Commit c6e52ecd authored by wyykak's avatar wyykak

fix c74563015.lua

parent f6cf5c5a
...@@ -51,13 +51,7 @@ function c74563015.spcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -51,13 +51,7 @@ function c74563015.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function c74563015.desfilter2(c,num) function c74563015.desfilter2(c,num)
if c:IsType(TYPE_LINK) then return c74563015.customdef(c)<=num
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
end end
function c74563015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk) function c74563015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler() local c=e:GetHandler()
...@@ -81,13 +75,38 @@ function c74563015.gselect(g,num) ...@@ -81,13 +75,38 @@ function c74563015.gselect(g,num)
end end
return def<=num return def<=num
end end
function c74563015.customdef(c)
if c:IsType(TYPE_LINK|TYPE_SPELL|TYPE_TRAP) and c:IsFaceup() then
return 1200
else
return c:GetDefense()
end
end
function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp) function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local num=e:GetLabel() local num=e:GetLabel()
local g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,num) local g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,num)
if g:GetCount()==0 then return end if g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) local dg=Group.CreateGroup()
local dg=g:SelectSubGroup(tp,c74563015.gselect,false,1,#g,num) 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() local tc=dg:GetFirst()
while tc do while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
......
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