Commit 5112841a authored by mercury233's avatar mercury233

fix

parent 2a9e1a15
...@@ -84,20 +84,38 @@ end ...@@ -84,20 +84,38 @@ end
function c100415029.tgfilter(c) function c100415029.tgfilter(c)
return c:IsFaceup() and c:IsAbleToGrave() return c:IsFaceup() and c:IsAbleToGrave()
end end
function c100415029.fselect(g,tp) function c100415029.fselect(g,chk1,chk2)
if Duel.IsExistingTarget(c100415029.tgfilter,tp,0,LOCATION_ONFIELD,2,nil) then local sum=g:GetSum(Card.GetAttack)
return g:CheckWithSumEqual(Card.GetAttack,2000,#g,#g) or g:CheckWithSumEqual(Card.GetAttack,4000,#g,#g) if chk2 then
elseif Duel.IsExistingTarget(c100415029.tgfilter,tp,0,LOCATION_ONFIELD,1,nil) then return sum==2000 or sum==4000
return g:CheckWithSumEqual(Card.GetAttack,2000,#g,#g) elseif chk1 then
return sum==2000
end end
return false return false
end end
function c100415029.gcheck(maxatk)
return function(g)
return g:GetSum(Card.GetAttack)<=maxatk
end
end
function c100415029.tgcost(e,tp,eg,ep,ev,re,r,rp,chk) function c100415029.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100,0) e:SetLabel(100,0)
local chk1=Duel.IsExistingTarget(c100415029.tgfilter,tp,0,LOCATION_ONFIELD,1,nil)
local chk2=Duel.IsExistingTarget(c100415029.tgfilter,tp,0,LOCATION_ONFIELD,2,nil)
local maxatk=2000
if chk2 then maxatk=4000 end
local g=Duel.GetMatchingGroup(c100415029.costfilter,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c100415029.costfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:CheckSubGroup(c100415029.fselect,1,#g,tp) end if chk==0 then
if not chk1 then return false end
aux.GCheckAdditional=c100415029.gcheck(maxatk)
local res=g:CheckSubGroup(c100415029.fselect,1,#g,chk1,chk2)
aux.GCheckAdditional=nil
return res
end
aux.GCheckAdditional=c100415029.gcheck(maxatk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:SelectSubGroup(tp,c100415029.fselect,false,1,#g,tp) local sg=g:SelectSubGroup(tp,c100415029.fselect,false,1,#g,chk1,chk2)
aux.GCheckAdditional=nil
if sg:GetSum(Card.GetAttack)==4000 then if sg:GetSum(Card.GetAttack)==4000 then
e:SetLabel(100,2) e:SetLabel(100,2)
else else
......
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