Commit b4bdbe4e authored by wyykak's avatar wyykak

fix 74563015

parent 43f7162a
......@@ -57,13 +57,7 @@ function c74563015.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function c74563015.desfilter2(c,num)
if c:IsType(TYPE_LINK) then
return num>1200
elseif c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup() then
return num>1200
else
return c:IsDefenseBelow(num) and c:IsFaceup()
end
return c:IsFaceup() and c74563015.customdef(c)<=num
end
function c74563015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
......@@ -74,27 +68,39 @@ function c74563015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,1,nil,lp) and counter1-counter2<=0 end
Duel.RegisterFlagEffect(tp,74563015,RESET_PHASE+PHASE_END,0,1)
end
function c74563015.gselect(g,num)
local def=0
local tc=g:GetFirst()
while tc do
if tc:IsDefenseAbove(0) and tc:IsFaceup() then
def=def+tc:GetDefense()
else
def=def+1200
end
tc=g:GetNext()
end
return def<=num
function c74563015.customdef(c)
if c:IsType(TYPE_LINK|TYPE_SPELL|TYPE_TRAP) then
return 1200
else
return c:GetDefense()
end
end
function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=e:GetLabel()
local g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,num)
if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:SelectSubGroup(tp,c74563015.gselect,false,1,#g,num)
local tc=dg:GetFirst()
local dg=Group.CreateGroup()
while true do
g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,dg,num)
if #g==0 then
break
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sc=g:SelectUnselect(dg,tp,#dg>0,#dg>0,1,99)
if not sc then
break
elseif g:IsContains(sc) then
g:RemoveCard(sc)
dg:AddCard(sc)
num=num-c74563015.customdef(sc)
else
dg:RemoveCard(sc)
g:AddCard(sc)
num=num+c74563015.customdef(sc)
end
end
local tc=dg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
......
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