Commit f9a87df7 authored by Tachibana's avatar Tachibana

ndyd

parent fe424883
......@@ -45,7 +45,7 @@ function cm.filter1(c)
return rk.check(c,"BOW")
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or not sg:IsExists(cm.filter1,1,nil)
return not sg or sg:IsExists(cm.filter1,1,nil)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCode(m-2) and c:IsAbleToExtraAsCost()
......
......@@ -34,13 +34,34 @@ end
function c16160003.rgcheck(g)
return g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=99
end
function c16160003.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk)) or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
Auxiliary.GCheckAdditional=Auxiliary.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(c16160003.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
Auxiliary.GCheckAdditional=nil
return res
end
function c16160003.RitualCheck(g,tp,c,lv,greater_or_equal)
return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 and Auxiliary["RitualCheck"..greater_or_equal](g,c,lv) and Duel.GetMZoneCount(tp,g,tp)>0 and (not c.mat_group_check or c.mat_group_check(g,tp))
and (not Auxiliary.RCheckAdditional or Auxiliary.RCheckAdditional(tp,g,c))
end
function c16160003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local dg=Duel.GetMatchingGroup(c16160003.dfilter,tp,LOCATION_EXTRA,0,nil)
aux.RCheckAdditional=c16160003.rcheck
aux.RGCheckAdditional=c16160003.rgcheck
local res=Duel.IsExistingMatchingCard(aux.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,c16160003.filter,e,tp,mg,dg,Card.GetLevel,"Equal")
local res=Duel.IsExistingMatchingCard(c16160003.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,nil,c16160003.filter,e,tp,mg,dg,Card.GetLevel,"Equal")
aux.RCheckAdditional=nil
aux.RGCheckAdditional=nil
return res
......@@ -53,7 +74,7 @@ function c16160003.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.RCheckAdditional=c16160003.rcheck
aux.RGCheckAdditional=c16160003.rgcheck
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,c16160003.filter,e,tp,m,dg,Card.GetLevel,"Equal")
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16160003.RitualUltimateFilter),tp,LOCATION_HAND+LOCATION_EXTRA,0,1,1,nil,c16160003.filter,e,tp,m,dg,Card.GetLevel,"Equal")
local tc=tg:GetFirst()
if tc then
local mg=m:Filter(Card.IsCanBeRitualMaterial,tc,tc)
......@@ -65,7 +86,7 @@ function c16160003.activate(e,tp,eg,ep,ev,re,r,rp)
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16160003,1))
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
local mat=mg:SelectSubGroup(tp,c16160003.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Equal")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then
aux.RCheckAdditional=nil
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment