Commit e5ab1dcc authored by Grajade's avatar Grajade

Update c74563002.lua

parent b3dbb8b5
Pipeline #7814 passed with stage
in 1 minute and 9 seconds
--蛙符「操纵蛤蟆」 --蛙符「操纵蛤蟆」
function c74563002.initial_effect(c) function c74563002.initial_effect(c)
--act in set turn --act in set turn
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN) e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE) e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(c74563002.actcon) e2:SetCondition(c74563002.actcon)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c74563002.negcost) e1:SetCost(c74563002.negcost)
e1:SetTarget(c74563002.target) e1:SetTarget(c74563002.target)
e1:SetOperation(c74563002.activate) e1:SetOperation(c74563002.activate)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--destroy --destroy
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY) e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetTarget(c74563002.destg) e4:SetTarget(c74563002.destg)
e4:SetOperation(c74563002.desop) e4:SetOperation(c74563002.desop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
function c74563002.actcon(e) function c74563002.tfilter(c)
return Duel.IsExistingMatchingCard(Card.IsSetCard,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,0x497) return c:IsSetCard(0x497) and c:IsFaceup()
end end
function c74563002.negcost(e,tp,eg,ep,ev,re,r,rp,chk) function c74563002.actcon(e)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x128a,1,REASON_COST) end return Duel.IsExistingMatchingCard(c74563002.tfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
Duel.RemoveCounter(tp,1,1,0x128a,1,REASON_COST) end
end function c74563002.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
function c74563002.target(e,tp,eg,ep,ev,re,r,rp,chk) if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x128a,1,REASON_COST) end
if chk==0 then return true end Duel.RemoveCounter(tp,1,1,0x128a,1,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0) function c74563002.target(e,tp,eg,ep,ev,re,r,rp,chk)
end local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
function c74563002.activate(e,tp,eg,ep,ev,re,r,rp) local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 if chk==0 then return ft1>0 and ft2>0
or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 and Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER,POS_FACEUP_DEFENSE)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_MACHINE,ATTRIBUTE_DARK,POS_FACEUP_DEFENSE) and Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER,POS_FACEUP_DEFENSE,1-tp)
or not Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,0,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER,POS_FACEUP_DEFENSE,1-tp) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
local token1=Duel.CreateToken(tp,74563020) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
local token2=Duel.CreateToken(tp,74563020) end
Duel.SpecialSummonStep(token1,0,tp,tp,false,false,POS_FACEUP_DEFENSE) function c74563002.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummonStep(token2,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE) if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
Duel.SpecialSummonComplete() or Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0
end or not Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER,POS_FACEUP_DEFENSE)
function c74563002.destg(e,tp,eg,ep,ev,re,r,rp,chk) or not Duel.IsPlayerCanSpecialSummonMonster(tp,74563020,nil,TYPES_TOKEN_MONSTER,0,0,1,RACE_AQUA,ATTRIBUTE_WATER,POS_FACEUP_DEFENSE,1-tp)
if chk==0 then return true end or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
end local token1=Duel.CreateToken(tp,74563020)
function c74563002.desop(e,tp,eg,ep,ev,re,r,rp) local token2=Duel.CreateToken(tp,74563020)
local c=e:GetHandler() Duel.SpecialSummonStep(token1,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local sg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,nil,74563020) Duel.SpecialSummonStep(token2,0,tp,1-tp,false,false,POS_FACEUP_DEFENSE)
local tc=sg:GetFirst() Duel.SpecialSummonComplete()
local ag=Group.CreateGroup() end
while tc do function c74563002.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local seq=tc:GetSequence() if chk==0 then return true end
local acg=Duel.GetMatchingGroup(c74563002.seqfilter,tp,0,LOCATION_ONFIELD,tc,tp,seq) end
ag:Merge(acg) function c74563002.desop(e,tp,eg,ep,ev,re,r,rp)
tc=sg:GetNext() local c=e:GetHandler()
end local sg=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_MZONE,nil,74563020)
ag:Merge(sg) local tc=sg:GetFirst()
if ag:GetCount()~=0 then Duel.Destroy(ag,REASON_EFFECT) end local ag=Group.CreateGroup()
end while tc do
function c74563002.seqfilter(c,tp,seq) local seq=tc:GetSequence()
local loc=LOCATION_MZONE local acg=Duel.GetMatchingGroup(c74563002.seqfilter,tp,0,LOCATION_ONFIELD,tc,tp,seq)
if seq>8 then ag:Merge(acg)
loc=LOCATION_SZONE tc=sg:GetNext()
seq=seq-8 end
end ag:Merge(sg)
local cseq=c:GetSequence() if ag:GetCount()~=0 then Duel.Destroy(ag,REASON_EFFECT) end
-- if tp==c:GetControler() then cseq=cseq>>16 end end
if tp==c:GetControler() and (cseq==5 and seq==3 or cseq==6 and seq==1) then return true end function c74563002.seqfilter(c,tp,seq)
local cloc=c:GetLocation() local loc=LOCATION_MZONE
if cloc==LOCATION_SZONE and cseq>=5 then return false end if seq>8 then
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE and tp~=c:GetControler() loc=LOCATION_SZONE
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end seq=seq-8
return cseq==seq or cloc==loc and math.abs(cseq-seq)==1 and tp~=c:GetControler() end
local cseq=c:GetSequence()
-- if tp==c:GetControler() then cseq=cseq>>16 end
if tp==c:GetControler() and (cseq==5 and seq==3 or cseq==6 and seq==1) then return true end
local cloc=c:GetLocation()
if cloc==LOCATION_SZONE and cseq>=5 then return false end
if cloc==LOCATION_MZONE and cseq>=5 and loc==LOCATION_MZONE and tp~=c:GetControler()
and (seq==1 and cseq==5 or seq==3 and cseq==6) then return true end
return cseq==seq or cloc==loc and math.abs(cseq-seq)==1 and tp~=c:GetControler()
end end
\ No newline at end of file
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