Commit c6e52ecd authored by wyykak's avatar wyykak

fix c74563015.lua

parent f6cf5c5a
Pipeline #7825 passed with stage
in 1 minute and 6 seconds
--圣拳月兔妖 --圣拳月兔妖
function c74563015.initial_effect(c) function c74563015.initial_effect(c)
--fusion material --fusion material
c:EnableReviveLimit() c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x258),c74563015.matfilter,true) aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x258),c74563015.matfilter,true)
--equip --equip
local e12=Effect.CreateEffect(c) local e12=Effect.CreateEffect(c)
e12:SetCategory(CATEGORY_DISABLE) e12:SetCategory(CATEGORY_DISABLE)
e12:SetType(EFFECT_TYPE_QUICK_O) e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetRange(LOCATION_MZONE) e12:SetRange(LOCATION_MZONE)
e12:SetCode(EVENT_FREE_CHAIN) e12:SetCode(EVENT_FREE_CHAIN)
e12:SetCost(c74563015.spcost) e12:SetCost(c74563015.spcost)
e12:SetTarget(c74563015.eqtg) e12:SetTarget(c74563015.eqtg)
e12:SetOperation(c74563015.eqop) e12:SetOperation(c74563015.eqop)
c:RegisterEffect(e12) c:RegisterEffect(e12)
--draw --draw
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_RECOVER) e2:SetCode(EVENT_RECOVER)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,74563015) e2:SetCountLimit(1,74563015)
e2:SetCondition(c74563015.drcon) e2:SetCondition(c74563015.drcon)
e2:SetTarget(c74563015.drtg) e2:SetTarget(c74563015.drtg)
e2:SetOperation(c74563015.drop) e2:SetOperation(c74563015.drop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
c74563015.DescSetName=0x258 c74563015.DescSetName=0x258
function c74563015.matfilter(c) function c74563015.matfilter(c)
return c:IsFusionAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_WATER) return c:IsFusionAttribute(ATTRIBUTE_LIGHT+ATTRIBUTE_WATER)
end end
function c74563015.drcon(e,tp,eg,ep,ev,re,r,rp) function c74563015.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp return ep==tp
end end
function c74563015.drtg(e,tp,eg,ep,ev,re,r,rp,chk) function c74563015.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
end end
function c74563015.drop(e,tp,eg,ep,ev,re,r,rp) function c74563015.drop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,74563011,RESET_PHASE+PHASE_END,0,1) Duel.RegisterFlagEffect(tp,74563011,RESET_PHASE+PHASE_END,0,1)
end end
function c74563015.thfilter(c) function c74563015.thfilter(c)
return c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() return c:IsSetCard(0x258) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end end
function c74563015.spcost(e,tp,eg,ep,ev,re,r,rp,chk) function c74563015.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) or Duel.IsExistingMatchingCard(c74563015.thfilter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) or Duel.IsExistingMatchingCard(c74563015.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and (not Duel.IsExistingMatchingCard(c74563015.thfilter,tp,LOCATION_GRAVE,0,1,nil) or not Duel.SelectYesNo(tp,aux.Stringid(74563015,0))) then if Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) and (not Duel.IsExistingMatchingCard(c74563015.thfilter,tp,LOCATION_GRAVE,0,1,nil) or not Duel.SelectYesNo(tp,aux.Stringid(74563015,0))) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD+REASON_COST,nil) Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_DISCARD+REASON_COST,nil)
else else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c74563015.thfilter,tp,LOCATION_GRAVE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,c74563015.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST) Duel.Remove(g,POS_FACEUP,REASON_COST)
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 end
elseif c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsFaceup() then function c74563015.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
return num>1200 local c=e:GetHandler()
else local lp=c:GetAttack()
return c:IsDefenseBelow(num) and c:IsFaceup() e:SetLabel(lp)
end local counter1=Duel.GetFlagEffect(tp,74563015)
end local counter2=Duel.GetFlagEffect(tp,74563011)
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
local c=e:GetHandler() Duel.RegisterFlagEffect(tp,74563015,RESET_PHASE+PHASE_END,0,1)
local lp=c:GetAttack() end
e:SetLabel(lp) function c74563015.gselect(g,num)
local counter1=Duel.GetFlagEffect(tp,74563015) local def=0
local counter2=Duel.GetFlagEffect(tp,74563011) local tc=g:GetFirst()
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 while tc do
Duel.RegisterFlagEffect(tp,74563015,RESET_PHASE+PHASE_END,0,1) if tc:IsDefenseAbove(0) and tc:IsFaceup() then
end def=def+tc:GetDefense()
function c74563015.gselect(g,num) else
local def=0 def=def+1200
local tc=g:GetFirst() end
while tc do tc=g:GetNext()
if tc:IsDefenseAbove(0) and tc:IsFaceup() then end
def=def+tc:GetDefense() return def<=num
else end
def=def+1200 function c74563015.customdef(c)
end if c:IsType(TYPE_LINK|TYPE_SPELL|TYPE_TRAP) and c:IsFaceup() then
tc=g:GetNext() return 1200
end else
return def<=num return c:GetDefense()
end end
function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp) end
local c=e:GetHandler() function c74563015.eqop(e,tp,eg,ep,ev,re,r,rp)
local num=e:GetLabel() local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,num) local num=e:GetLabel()
if g:GetCount()==0 then return end local g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,num)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) if g:GetCount()==0 then return end
local dg=g:SelectSubGroup(tp,c74563015.gselect,false,1,#g,num) local dg=Group.CreateGroup()
local tc=dg:GetFirst() while true do
while tc do g=Duel.GetMatchingGroup(c74563015.desfilter2,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,dg,num)
Duel.NegateRelatedChain(tc,RESET_TURN_SET) if #g==0 then
local e1=Effect.CreateEffect(c) break
e1:SetDescription(aux.Stringid(74563015,2)) end
e1:SetType(EFFECT_TYPE_SINGLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT) local sc=g:SelectUnselect(dg,tp,#dg>0,#dg>0,1,99)
e1:SetCode(EFFECT_DISABLE) if not sc then
e1:SetReset(RESET_EVENT+RESETS_STANDARD) break
tc:RegisterEffect(e1) elseif g:IsContains(sc) then
local e2=Effect.CreateEffect(c) g:RemoveCard(sc)
e2:SetDescription(aux.Stringid(74563015,2)) dg:AddCard(sc)
e2:SetType(EFFECT_TYPE_SINGLE) num=num-c74563015.customdef(sc)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) else
e2:SetCode(EFFECT_DISABLE_EFFECT) dg:RemoveCard(sc)
e2:SetValue(RESET_TURN_SET) g:AddCard(sc)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) num=num+c74563015.customdef(sc)
tc:RegisterEffect(e2) end
if tc:IsType(TYPE_TRAPMONSTER) then end
local e3=Effect.CreateEffect(c) local tc=dg:GetFirst()
e3:SetDescription(aux.Stringid(74563015,2)) while tc do
e3:SetType(EFFECT_TYPE_SINGLE) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) local e1=Effect.CreateEffect(c)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER) e1:SetDescription(aux.Stringid(74563015,2))
e3:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetType(EFFECT_TYPE_SINGLE)
tc:RegisterEffect(e3) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
end e1:SetCode(EFFECT_DISABLE)
tc=dg:GetNext() e1:SetReset(RESET_EVENT+RESETS_STANDARD)
end tc:RegisterEffect(e1)
end local e2=Effect.CreateEffect(c)
\ No newline at end of file e2:SetDescription(aux.Stringid(74563015,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(74563015,2))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
tc=dg:GetNext()
end
end
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