Commit d610f7ef authored by Nemo Ma's avatar Nemo Ma

Sync Data 20181013

parent dd7600ce
No preview for this file type
expansions/pics/33700211.jpg

14.2 KB | W: | H:

expansions/pics/33700211.jpg

13.4 KB | W: | H:

expansions/pics/33700211.jpg
expansions/pics/33700211.jpg
expansions/pics/33700211.jpg
expansions/pics/33700211.jpg
  • 2-up
  • Swipe
  • Onion skin
...@@ -11,7 +11,7 @@ function c33700018.initial_effect(c) ...@@ -11,7 +11,7 @@ function c33700018.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c33700018.condition(e,tp,eg,ep,ev,re,r,rp) function c33700018.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE) return Duel.GetTurnPlayer()==1-tp and (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end end
function c33700018.filter(c,tp) function c33700018.filter(c,tp)
return c:GetSummonPlayer()==1-tp and c:IsControlerCanBeChanged() return c:GetSummonPlayer()==1-tp and c:IsControlerCanBeChanged()
......
...@@ -12,7 +12,7 @@ function c33700019.initial_effect(c) ...@@ -12,7 +12,7 @@ function c33700019.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c33700019.condition(e,tp,eg,ep,ev,re,r,rp) function c33700019.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and bit.band(r,REASON_DESTROY)~=0 and eg:IsExists(c33700019.filter,1,nil) return rp==1-tp and bit.band(r,REASON_DESTROY)~=0 and eg:IsExists(c33700019.filter,1,nil)
end end
function c33700019.filter(c) function c33700019.filter(c)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT) return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsReason(REASON_EFFECT)
......
...@@ -55,7 +55,7 @@ end ...@@ -55,7 +55,7 @@ end
function c33700043.spcon(e,tp,eg,ep,ev,re,r,rp) function c33700043.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct1=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0):FilterCount(Card.IsFacedown,nil) local ct1=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,0):FilterCount(Card.IsFacedown,nil)
local ct2=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD):FilterCount(Card.IsFacedown,nil) local ct2=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD):FilterCount(Card.IsFacedown,nil)
return Duel.GetTurnPlayer()~=tp and rp~=tp and ct1<ct2 return Duel.GetTurnPlayer()==1-tp and rp==1-tp and ct1<ct2
end end
function c33700043.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700043.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
......
...@@ -91,7 +91,7 @@ function c33700054.jfilter(c) ...@@ -91,7 +91,7 @@ function c33700054.jfilter(c)
end end
function c33700054.drcon(e,tp,eg,ep,ev,re,r,rp) function c33700054.drcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33700054.confiltert,tp,LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c33700054.confiltert,tp,LOCATION_GRAVE,0,nil)
return (g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090) and ep~=tp return (g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090) and ep==1-tp
end end
function c33700054.confilter(c) function c33700054.confilter(c)
return c:IsSetCard(0x442) and c:IsFaceup() and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x442) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
......
...@@ -50,7 +50,7 @@ function c33700058.con(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,7 +50,7 @@ function c33700058.con(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700058.spfilter(c,e,tp,tid) function c33700058.spfilter(c,e,tp,tid)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER)
and c:GetTurnID()==tid and (c:IsReason(REASON_BATTLE) or bit.band(c:GetReason(),0x41)==0x41 and c:GetReasonPlayer()~=tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetTurnID()==tid and (c:IsReason(REASON_BATTLE) or bit.band(c:GetReason(),0x41)==0x41 and c:GetReasonPlayer()==1-tp) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function c33700058.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700058.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tid=Duel.GetTurnCount() local tid=Duel.GetTurnCount()
......
...@@ -93,7 +93,7 @@ end ...@@ -93,7 +93,7 @@ end
end end
end end
function c33700061.damcon(e,tp,eg,ep,ev,re,r,rp) function c33700061.damcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function c33700061.damop(e,tp,eg,ep,ev,re,r,rp) function c33700061.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
......
...@@ -54,7 +54,7 @@ function c33700087.cost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -54,7 +54,7 @@ function c33700087.cost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.PayLPCost(tp,1000) Duel.PayLPCost(tp,1000)
end end
function c33700087.dcon(e,tp,eg,ep,ev,re,r,rp) function c33700087.dcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700087.tgfilter,1,nil,tp) and rp~=tp return eg:IsExists(c33700087.tgfilter,1,nil,tp) and rp==1-tp
end end
function c33700087.dtg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700087.dtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
...@@ -77,7 +77,7 @@ function c33700087.atop(e,tp,eg,ep,ev,re,r,rp) ...@@ -77,7 +77,7 @@ function c33700087.atop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700087.condition(e,tp,eg,ep,ev,re,r,rp) function c33700087.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker() local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil return at:GetControler()==1-tp and Duel.GetAttackTarget()==nil
end end
function c33700087.cost2(e,tp,eg,ep,ev,re,r,rp,chk) function c33700087.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33700087.filter,tp,LOCATION_GRAVE,0,1,nil) end if chk==0 then return Duel.IsExistingMatchingCard(c33700087.filter,tp,LOCATION_GRAVE,0,1,nil) end
......
...@@ -88,7 +88,7 @@ function c33700096.jfilter(c) ...@@ -88,7 +88,7 @@ function c33700096.jfilter(c)
end end
function c33700096.cbcon(e,tp,eg,ep,ev,re,r,rp) function c33700096.cbcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33700096.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil) local g=Duel.GetMatchingGroup(c33700096.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return Duel.GetTurnPlayer()~=tp and Duel.GetAttackTarget()~=e:GetHandler() and (g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090) return Duel.GetTurnPlayer()==1-tp and Duel.GetAttackTarget()~=e:GetHandler() and (g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090)
end end
function c33700096.cbop(e,tp,eg,ep,ev,re,r,rp) function c33700096.cbop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -60,7 +60,7 @@ function c33700122.cfilter(c) ...@@ -60,7 +60,7 @@ function c33700122.cfilter(c)
return c:IsSetCard(0x443) return c:IsSetCard(0x443)
end end
function c33700122.ctcon(e,tp,eg,ep,ev,re,r,rp) function c33700122.ctcon(e,tp,eg,ep,ev,re,r,rp)
return g:IsExists(c33700122.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep~=tp return g:IsExists(c33700122.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep==1-tp
end end
function c33700122.ctop(e,tp,eg,ep,ev,re,r,rp) function c33700122.ctop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():AddCounter(0x5,1) e:GetHandler():AddCounter(0x5,1)
......
...@@ -58,7 +58,7 @@ function c33700128.effop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +58,7 @@ function c33700128.effop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c33700128.hdcon(e,tp,eg,ep,ev,re,r,rp) function c33700128.hdcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetCurrentPhase()~=PHASE_DRAW return ep==1-tp and Duel.GetCurrentPhase()~=PHASE_DRAW
end end
function c33700128.hdtg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700128.hdtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -62,7 +62,7 @@ function c33700129.cfilter(c) ...@@ -62,7 +62,7 @@ function c33700129.cfilter(c)
return c:IsSetCard(0x443) return c:IsSetCard(0x443)
end end
function c33700129.con(e,tp,eg,ep,ev,re,r,rp) function c33700129.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700129.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep~=tp return eg:IsExists(c33700129.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep==1-tp
end end
function c33700129.rectg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700129.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -11,7 +11,7 @@ function c33700136.initial_effect(c) ...@@ -11,7 +11,7 @@ function c33700136.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c33700136.con(e,tp,eg,ep,ev,re,r,rp) function c33700136.con(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r==REASON_RULE return ep==1-tp and r==REASON_RULE
end end
function c33700136.tg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700136.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0 if chk==0 then return Duel.GetMZoneCount(tp)>0
......
...@@ -100,7 +100,7 @@ function c33700143.ntrcost(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -100,7 +100,7 @@ function c33700143.ntrcost(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
function c33700143.ntrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700143.ntrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()~=tp and chkc:IsControlerCanBeChanged() end if chkc then return chkc:GetLocation()==LOCATION_MZONE and chkc:GetControler()==1-tp and chkc:IsControlerCanBeChanged() end
if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end if chk==0 then return Duel.IsExistingTarget(Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONTROL)
local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil) local g=Duel.SelectTarget(tp,Card.IsControlerCanBeChanged,tp,0,LOCATION_MZONE,1,1,nil)
......
...@@ -14,7 +14,7 @@ function c33700153.initial_effect(c) ...@@ -14,7 +14,7 @@ function c33700153.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c33700153.condition(e,tp,eg,ep,ev,re,r,rp) function c33700153.condition(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and r~=REASON_RULE return ep==1-tp and r~=REASON_RULE
end end
function c33700153.target(e,tp,eg,ep,ev,re,r,rp,chk) function c33700153.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsAbleToRemove() end if chk==0 then return eg:IsAbleToRemove() end
......
...@@ -19,7 +19,7 @@ function c33700156.dircon(e) ...@@ -19,7 +19,7 @@ function c33700156.dircon(e)
end end
function c33700156.con(e,tp,eg,ep,ev,re,r,rp) function c33700156.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and Duel.GetAttackTarget()==nil and Duel.GetLP(e:GetHandlerPlayer())<Duel.GetLP(1-e:GetHandlerPlayer()) return ep==1-tp and Duel.GetAttackTarget()==nil and Duel.GetLP(e:GetHandlerPlayer())<Duel.GetLP(1-e:GetHandlerPlayer())
end end
function c33700156.op(e,tp,eg,ep,ev,re,r,rp) function c33700156.op(e,tp,eg,ep,ev,re,r,rp)
if ev>0 then if ev>0 then
......
...@@ -14,7 +14,7 @@ function c33700157.initial_effect(c) ...@@ -14,7 +14,7 @@ function c33700157.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function c33700157.con(e,tp,eg,ep,ev,re,r,rp) function c33700157.con(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp return ep==1-tp
end end
function c33700157.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c33700157.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end if chk==0 then return not e:GetHandler():IsPublic() end
......
...@@ -37,7 +37,7 @@ function c33700159.tg(e,c) ...@@ -37,7 +37,7 @@ function c33700159.tg(e,c)
end end
function c33700159.recon(e,tp,eg,ep,ev,re,r,rp) function c33700159.recon(e,tp,eg,ep,ev,re,r,rp)
local rc=eg:GetFirst() local rc=eg:GetFirst()
return ep~=tp and rc:IsControler(tp) and rc:IsRace(RACE_T) and Duel.GetAttackTarget()==nil and Duel.GetLP(tp)>=12000 return ep==1-tp and rc:IsControler(tp) and rc:IsRace(RACE_T) and Duel.GetAttackTarget()==nil and Duel.GetLP(tp)>=12000
end end
function c33700159.retg(e,tp,eg,ep,ev,re,r,rp,chk) function c33700159.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -64,7 +64,7 @@ function c33700164.damop(e,tp,eg,ep,ev,re,r,rp) ...@@ -64,7 +64,7 @@ function c33700164.damop(e,tp,eg,ep,ev,re,r,rp)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET) e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0) e1:SetTargetRange(1,0)
e1:SetValue(c33700164.damval) e1:SetValue(c33700164.damval)
if Duel.GetTurnPlayer()~=tp then if Duel.GetTurnPlayer()==1-tp then
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN) e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
......
...@@ -76,7 +76,7 @@ function c33700165.sdcon(e) ...@@ -76,7 +76,7 @@ function c33700165.sdcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0 return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_HAND,0)==0
end end
function c33700165.descon(e,tp,eg,ep,ev,re,r,rp) function c33700165.descon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsDestructable() and Duel.GetTurnPlayer()==1-tp return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsDestructable() and Duel.GetTurnPlayer()==1-tp
end end
function c33700165.desfilter(c) function c33700165.desfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsDiscardable() return c:IsType(TYPE_MONSTER) and c:IsDiscardable()
...@@ -97,7 +97,7 @@ function c33700165.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -97,7 +97,7 @@ function c33700165.desop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c33700165.discon(e,tp,eg,ep,ev,re,r,rp) function c33700165.discon(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev) and Duel.GetTurnPlayer()==1-tp return rp==1-tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev) and Duel.GetTurnPlayer()==1-tp
end end
function c33700165.disfilter(c) function c33700165.disfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable() return c:IsType(TYPE_SPELL) and c:IsDiscardable()
...@@ -118,7 +118,7 @@ function c33700165.disop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +118,7 @@ function c33700165.disop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
function c33700165.drcon(e,tp,eg,ep,ev,re,r,rp) function c33700165.drcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetCurrentPhase()~=PHASE_DRAW and Duel.GetTurnPlayer()==1-tp return ep==1-tp and Duel.GetCurrentPhase()~=PHASE_DRAW and Duel.GetTurnPlayer()==1-tp
end end
function c33700165.drfilter(c) function c33700165.drfilter(c)
return c:IsType(TYPE_TRAP) and c:IsDiscardable() return c:IsType(TYPE_TRAP) and c:IsDiscardable()
......
...@@ -51,7 +51,7 @@ function c33700168.cfilter(c) ...@@ -51,7 +51,7 @@ function c33700168.cfilter(c)
return c:IsSetCard(0x443) return c:IsSetCard(0x443)
end end
function c33700168.atkcon(e,tp,eg,ep,ev,re,r,rp) function c33700168.atkcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700168.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep~=tp return eg:IsExists(c33700168.cfilter,1,nil) and bit.band(r,REASON_EFFECT)~=0 and ep==1-tp
end end
function c33700168.atkop(e,tp,eg,ep,ev,re,r,rp) function c33700168.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
...@@ -54,7 +54,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -54,7 +54,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp) function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return c:GetReasonPlayer()~=tp and c:IsReason(REASON_EFFECT) return c:GetReasonPlayer()==1-tp and c:IsReason(REASON_EFFECT)
end end
function cm.filter1(c) function cm.filter1(c)
return c:IsSetCard(0x442) and c:IsAbleToHand() return c:IsSetCard(0x442) and c:IsAbleToHand()
......
...@@ -22,7 +22,7 @@ function cm.initial_effect(c) ...@@ -22,7 +22,7 @@ function cm.initial_effect(c)
e2:SetCode(EVENT_TO_GRAVE) e2:SetCode(EVENT_TO_GRAVE)
e2:SetProperty(0x14000) e2:SetProperty(0x14000)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp return rp==1-tp
end) end)
e2:SetTarget(cm.sptg) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop) e2:SetOperation(cm.spop)
......
...@@ -105,7 +105,7 @@ function c33700192.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,7 +105,7 @@ function c33700192.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -104,7 +104,7 @@ function c33700193.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,7 +104,7 @@ function c33700193.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -107,7 +107,7 @@ function c33700195.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -107,7 +107,7 @@ function c33700195.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -105,7 +105,7 @@ function c33700196.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -105,7 +105,7 @@ function c33700196.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -103,7 +103,7 @@ function c33700198.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +103,7 @@ function c33700198.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -104,7 +104,7 @@ function c33700201.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,7 +104,7 @@ function c33700201.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -104,7 +104,7 @@ function c33700202.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -104,7 +104,7 @@ function c33700202.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -92,7 +92,7 @@ function c33700207.drval(e,c) ...@@ -92,7 +92,7 @@ function c33700207.drval(e,c)
return false return false
end end
function c33700207.cfilter(c,tp) function c33700207.cfilter(c,tp)
return c:GetPreviousControler()~=tp and (c:IsLocation(LOCATION_GRAVE) or c:IsReason(REASON_DISCARD)) and c:IsPreviousLocation(LOCATION_HAND) return c:GetPreviousControler()==1-tp and (c:IsLocation(LOCATION_GRAVE) or c:IsReason(REASON_DISCARD)) and c:IsPreviousLocation(LOCATION_HAND)
end end
function c33700207.drcon1(e,tp,eg,ep,ev,re,r,rp) function c33700207.drcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c33700207.cfilter,1,nil,tp) return eg:IsExists(c33700207.cfilter,1,nil,tp)
......
...@@ -32,7 +32,7 @@ function c33700208.op(e,tp,eg,ep,ev,re,r,rp) ...@@ -32,7 +32,7 @@ function c33700208.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<3 or g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<3 then return end if Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<3 or g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<3 then return end
--if you do, Draw 1 card. If this card is activated in your opponent's turn, you can draw 1 more card. --if you do, Draw 1 card. If this card is activated in your opponent's turn, you can draw 1 more card.
local d=1 local d=1
if Duel.GetTurnPlayer()~=tp then d=d+1 end if Duel.GetTurnPlayer()==1-tp then d=d+1 end
Duel.Draw(tp,d,REASON_EFFECT) Duel.Draw(tp,d,REASON_EFFECT)
local dg=Duel.GetOperatedGroup():Filter(Card.IsLocation,tp,LOCATION_HAND) local dg=Duel.GetOperatedGroup():Filter(Card.IsLocation,tp,LOCATION_HAND)
--And if it's a "Heavenly Maid" monster, you can Special Summon it. --And if it's a "Heavenly Maid" monster, you can Special Summon it.
......
...@@ -118,7 +118,7 @@ function cm.ctop(e,tp,eg,ep,ev,re,r,rp) ...@@ -118,7 +118,7 @@ function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
e:Reset() e:Reset()
return return
end end
if Duel.GetTurnPlayer()~=tp then return end if Duel.GetTurnPlayer()==1-tp then return end
ct=ct+1 ct=ct+1
c:SetTurnCounter(ct) c:SetTurnCounter(ct)
end end
......
...@@ -43,7 +43,7 @@ function cm.con(e) ...@@ -43,7 +43,7 @@ function cm.con(e)
end end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp) function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return ep~=tp and (tc:IsSetCard(0x1449) or tc:IsSetCard(0x3449)) return ep==1-tp and (tc:IsSetCard(0x1449) or tc:IsSetCard(0x3449))
end end
function cm.damop(e,tp,eg,ep,ev,re,r,rp) function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
......
...@@ -28,7 +28,7 @@ function cm.initial_effect(c) ...@@ -28,7 +28,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.at(e,tp,eg,ep,ev,re,r,rp,chk) function cm.at(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetTurnPlayer()~=tp end if chk==0 then return Duel.GetTurnPlayer()==1-tp end
end end
function cm.ao(e,tp,eg,ep,ev,re,r,rp) function cm.ao(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget() local at=Duel.GetAttackTarget()
......
...@@ -31,5 +31,5 @@ function c33700326.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,5 +31,5 @@ function c33700326.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700326.descon(e,tp,eg,ep,ev,re,r,rp) function c33700326.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -35,5 +35,5 @@ function c33700327.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,5 +35,5 @@ function c33700327.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700327.descon(e,tp,eg,ep,ev,re,r,rp) function c33700327.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -43,5 +43,5 @@ function c33700328.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,5 +43,5 @@ function c33700328.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700328.descon(e,tp,eg,ep,ev,re,r,rp) function c33700328.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -37,5 +37,5 @@ function c33700329.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,5 +37,5 @@ function c33700329.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700329.descon(e,tp,eg,ep,ev,re,r,rp) function c33700329.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -41,7 +41,7 @@ function c33700330.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,7 +41,7 @@ function c33700330.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700330.descon(e,tp,eg,ep,ev,re,r,rp) function c33700330.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
function c33700330.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c33700330.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
......
...@@ -20,7 +20,7 @@ function c33700331.check(c,tp) ...@@ -20,7 +20,7 @@ function c33700331.check(c,tp)
local g1=Duel.GetMatchingGroup(c33700331.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c) local g1=Duel.GetMatchingGroup(c33700331.cfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local zone=0 local zone=0
for tc in aux.Next(g1) do for tc in aux.Next(g1) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp)) zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end end
return zone>0,zone return zone>0,zone
end end
...@@ -46,5 +46,5 @@ function c33700331.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,5 +46,5 @@ function c33700331.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700331.descon(e,tp,eg,ep,ev,re,r,rp) function c33700331.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -60,5 +60,5 @@ function c33700332.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,5 +60,5 @@ function c33700332.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700332.descon(e,tp,eg,ep,ev,re,r,rp) function c33700332.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -37,5 +37,5 @@ function c33700333.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -37,5 +37,5 @@ function c33700333.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700333.descon(e,tp,eg,ep,ev,re,r,rp) function c33700333.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
...@@ -50,7 +50,7 @@ function c33700334.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -50,7 +50,7 @@ function c33700334.desop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700334.descon(e,tp,eg,ep,ev,re,r,rp) function c33700334.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0 return ep==1-tp and c:GetBattleTarget()==nil and c:IsRelateToBattle() and c:GetColumnGroup():Filter(Card.IsControler,nil,tp):GetCount()==0
end end
function c33700334.tgtg2(e,c) function c33700334.tgtg2(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c) return e:GetHandler():GetLinkedGroup():IsContains(c)
......
...@@ -49,7 +49,7 @@ function c33700335.get_zone(c,tp) ...@@ -49,7 +49,7 @@ function c33700335.get_zone(c,tp)
local zone=0 local zone=0
local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD) local lg=Duel.GetFieldGroup(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)
for tc in aux.Next(lg) do for tc in aux.Next(lg) do
zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,0,0,tp)) zone=bit.bor(zone,tc:GetColumnZone(LOCATION_MZONE,tp))
end end
return zone return zone
end end
......
...@@ -51,7 +51,7 @@ function c33700336.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -51,7 +51,7 @@ function c33700336.spop(e,tp,eg,ep,ev,re,r,rp)
end end
function c33700336.damcon(e,tp,eg,ep,ev,re,r,rp) function c33700336.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst() local tc=eg:GetFirst()
return ep~=tp and tc:IsSetCard(0x5449) and tc:GetBattleTarget()==nil return ep==1-tp and tc:IsSetCard(0x5449) and tc:GetBattleTarget()==nil
end end
function c33700336.damop(e,tp,eg,ep,ev,re,r,rp) function c33700336.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2) Duel.ChangeBattleDamage(ep,ev*2)
......
...@@ -43,7 +43,7 @@ function c33700338.thcon(e,tp,eg,ep,ev,re,r,rp) ...@@ -43,7 +43,7 @@ function c33700338.thcon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp return (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2) and Duel.GetTurnPlayer()==tp
end end
function c33700338.reccon(e,tp,eg,ep,ev,re,r,rp) function c33700338.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst():IsControler(tp) and Duel.GetAttacker():IsSetCard(0x5449) and Duel.GetAttackTarget()==nil return ep==1-tp and eg:GetFirst():IsControler(tp) and Duel.GetAttacker():IsSetCard(0x5449) and Duel.GetAttackTarget()==nil
end end
function c33700338.recop(e,tp,eg,ep,ev,re,r,rp) function c33700338.recop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end if not e:GetHandler():IsRelateToEffect(e) then return end
......
...@@ -36,7 +36,7 @@ function c33700343.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,7 +36,7 @@ function c33700343.desop(e,tp,eg,ep,ev,re,r,rp)
if bt:IsControler(tp) then at,bt=bt,at end if bt:IsControler(tp) then at,bt=bt,at end
if not bt:IsRelateToBattle() then return end if not bt:IsRelateToBattle() then return end
Duel.Hint(HINT_CARD,0,33700343) Duel.Hint(HINT_CARD,0,33700343)
if Duel.Destroy(bt,REASON_EFFECT)~=0 and Duel.GetTurnPlayer()~=tp then if Duel.Destroy(bt,REASON_EFFECT)~=0 and Duel.GetTurnPlayer()==1-tp then
Duel.SendtoHand(at,nil,REASON_EFFECT) Duel.SendtoHand(at,nil,REASON_EFFECT)
end end
end end
......
--吸猫
--Script by Nemoma
local m=33700399
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
c:RegisterEffect(e1)
end
--Target 1 Beast Type Monster on the field
function cm.filter(c)
return c:IsRace(RACE_BEAST) and c:IsFaceup()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
local tc=g:GetFirst()
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,tc:GetAttack()+tc:GetDefense())
end
--Gain LP equal of its ATK and DEF
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()+tc:GetDefense()>0 then
Duel.Recover(tp,tc:GetAttack()+tc:GetDefense(),REASON_EFFECT)
end
end
\ No newline at end of file
--Ego-Doxxing
--AlphaKretin
--For Nemoma
local card = c33700404
local code = 33700404
function card.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(card.cost)
e1:SetTarget(card.target)
e1:SetOperation(card.activate)
c:RegisterEffect(e1)
if not AshBlossomTable then AshBlossomTable = {} end
table.insert(AshBlossomTable, e1)
end
function card.cost(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.IsExistingMatchingCard(aux.NOT(Card.IsPublic), tp, LOCATION_HAND, 0, 1, nil) end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetOwner() == tp then
e:GetHandler():CancelToGrave()
end
local tc = Duel.SelectMatchingCard(tp, aux.NOT(Card.IsPublic), tp, LOCATION_HAND, 0, 1, 1, nil):GetFirst()
Duel.ConfirmCards(1 - tp, tc)
e:SetLabelObject(tc)
end
function card.target(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then return Duel.GetFieldGroupCount(1 - tp, LOCATION_DECK, 0) > 0 end
end
function card.activate(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
if not e:GetLabelObject() then return end
if Duel.IsChainDisablable(0) and Duel.SelectYesNo(1 - tp, aux.Stringid(code, 0)) then
Duel.Recover(tp, 4000, REASON_EFFECT)
Duel.NegateEffect(0)
return
end
local dg = Duel.GetFieldGroup(tp, 0, LOCATION_DECK)
Duel.ConfirmCards(tp, dg)
local mg = dg:Filter(Card.IsCode, nil, e:GetLabelObject():GetCode())
local ct = mg:GetCount()
if ct == 0 then
Duel.Damage(tp, 2000, REASON_EFFECT)
elseif ct == 1 then
Duel.SendtoGrave(mg, REASON_EFFECT)
elseif ct == 2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local rc = mg:Select(tp, 1, 1, nil):GetFirst()
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp, LOCATION_MZONE) > 0 and rc:IsCanBeSpecialSummoned(e, 0, tp, false, false, POS_FACEDOWN_DEFENSE) then
Duel.SpecialSummon(rc, 0, tp, tp, false, false, POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1 - tp, rc)
elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp, LOCATION_SZONE) > 0) and rc:IsSSetable() then
Duel.SSet(tp, rc)
Duel.ConfirmCards(1 - tp, rc)
end
elseif ct >= 3 then
Duel.Draw(tp, 2, REASON_EFFECT)
end
if not c:IsRelateToEffect(e) or c:IsStatus(STATUS_LEAVE_CONFIRMED) then return end
if c:IsCanTurnSet() and e:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.GetLocationCount(1 - tp, LOCATION_SZONE, tp) > 0 then
Duel.BreakEffect()
Duel.MoveToField(c, tp, 1 - tp, LOCATION_SZONE, POS_FACEDOWN, true)
Duel.RaiseEvent(c, EVENT_SSET, e, REASON_EFFECT, tp, tp, 0)
else
c:CancelToGrave(false)
end
end
\ No newline at end of file
--Destiny Cut
--AlphaKretin
--For Nemoma
local card = c33700405
local code = 33700405
function card.initial_effect(c)
--activate
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE + CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(card.target)
e1:SetOperation(card.activate)
c:RegisterEffect(e1)
end
function card.target(e, tp, eg, ep, ev, re, r, rp, chk)
local hg = Duel.GetFieldGroup(tp, LOCATION_HAND, 0)
if chk == 0 then
return #hg > 0 and #hg == #hg:Filter(Card.IsAbleToRemove,nil,tp) and Duel.IsPlayerCanDraw(tp, 5)
end
Duel.SetOperationInfo(0, CATEGORY_REMOVE, hg, hg:GetCount(), tp, LOCATION_HAND)
end
function card.activate(e, tp, eg, ep, ev, re, r, rp, chk)
local hg = Duel.GetFieldGroup(tp, LOCATION_HAND, 0)
if #hg > 0 and Duel.Remove(hg, POS_FACEDOWN, REASON_EFFECT) == #hg and Duel.Draw(tp, 5, REASON_EFFECT) == 5 then
Duel.Hint(HINT_SELECTMSG, tp, aux.Stringid(code, 0)) --Select a phase to skip
local opt = Duel.SelectOption(tp, 20, 24, 22) --Draw Phase, Battle Phase, Main Phase, from strings.conf
local e1 = Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(1,0)
if opt == 0 then
e1:SetCode(EFFECT_SKIP_DP)
elseif opt == 1 then
e1:SetCode(EFFECT_SKIP_BP)
else --if opt == 2 is the only other option
e1:SetCode(EFFECT_SKIP_M1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_SKIP_M2)
Duel.RegisterEffect(e2, tp)
end
Duel.RegisterEffect(e1, tp)
end
if Duel.GetFieldGroupCount(tp, LOCATION_MZONE + LOCATION_SZONE, 0) > 1 then --1 card is itself
--become EP
Duel.SkipPhase(tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
\ No newline at end of file
--Seyanaa
--AlphaKretin
--For Nemoma
local card = c33700406
local code = 33700406
function card.initial_effect(c)
--battle indestructable
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
c:RegisterEffect(e1)
--control
local e2 = Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(code, 0))
e2:SetCategory(CATEGORY_CONTROL)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(card.ctlcon)
e2:SetTarget(card.ctltg)
e2:SetOperation(card.ctlop)
c:RegisterEffect(e2)
--lose ATK
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE, 0)
e3:SetValue(card.atkval)
c:RegisterEffect(e3)
--cannot NS
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SUMMON)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1, 0)
e4:SetCondition(card.nscon)
c:RegisterEffect(e4)
local e5 = e4:Clone()
e5:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e5)
--cannot SS
local e6 = Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(card.sscon)
e6:SetTargetRange(1, 0)
c:RegisterEffect(e6)
--negate
local e7 = Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(LOCATION_ONFIELD, 0)
e7:SetCondition(card.negcon)
e7:SetTarget(card.negtg)
e7:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e7)
end
--helper function
function card.mcount(tp)
return Duel.GetFieldGroupCount(tp, LOCATION_MZONE, 0) - 1
end
--control
function card.ctlcon(e, tp, eg, ep, ev, re, r, rp)
return card.mcount(tp) == 0
end
function card.ctltg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return e:GetHandler():IsControlerCanBeChanged()
end
Duel.SetOperationInfo(0, CATEGORY_CONTROL, e:GetHandler(), 1, 0, 0)
end
function card.ctlop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Hint(HINT_SELECTMSG, tp, HINTMSG_TOZONE)
local zone = Duel.SelectDisableField(tp, 1, 0, LOCATION_MZONE, 0) >> 16
if Duel.GetControl(c, 1 - tp, 0, 0, zone) then
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE + PHASE_END)
e1:SetTargetRange(1, 0)
Duel.RegisterEffect(e1, tp)
end
end
end
--lose ATK
function card.atkval(e, c)
if card.mcount(e:GetHandlerPlayer()) > 0 then
return -800
else
return 0
end
end
--cannot NS
function card.nscon(e)
return card.mcount(e:GetHandlerPlayer()) > 2
end
--cannot SS
function card.sscon(e)
return card.mcount(e:GetHandlerPlayer()) > 3
end
--negate
function card.negcon(e)
return card.mcount(e:GetHandlerPlayer()) > 4
end
function card.negtg(e, c)
return c:IsFaceup() and c ~= e:GetHandler()
end
--Destiny Mend
--AlphaKretin
--For Nemoma
local card = c33700407
local code = 33700407
function card.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(card.target)
e1:SetOperation(card.activate)
c:RegisterEffect(e1)
end
function card.target(e, tp, eg, ep, ev, re, r, rp, chk)
local c = e:GetHandler()
local rg = Duel.GetFieldGroup(tp, LOCATION_ONFIELD, 0)
rg:AddCard(c) --add self to banish check in case in hand
if chk == 0 then
return Duel.IsExistingMatchingCard(Card.IsDiscardable, tp, LOCATION_HAND, 0, 5, c, REASON_EFFECT) and
rg:IsExists(Card.IsAbleToRemove, 1, nil)
end
Duel.SetOperationInfo(0, CATEGORY_HANDES, nil, 5, tp, 1)
Duel.SetOperationInfo(0, CATEGORY_REMOVE, rg, #rg, tp, 1)
end
function card.activate(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local dct = Duel.DiscardHand(tp, Card.IsDiscardable, 5, 5, REASON_EFFECT + REASON_DISCARD)
local rg = Duel.GetFieldGroup(tp, LOCATION_ONFIELD, 0)
local rct = Duel.Remove(rg, POS_FACEDOWN, REASON_EFFECT)
if dct > 0 and rct > 0 and rct == #rg then
local opt = Duel.SelectOption(tp, aux.Stringid(code, 0), aux.Stringid(code, 1), aux.Stringid(code, 2))
if opt == 0 then
--double draw
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1, 0)
e1:SetValue(2)
Duel.RegisterEffect(e1, tp)
elseif opt == 1 then
--double summon
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SET_SUMMON_COUNT_LIMIT)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1, 0)
e1:SetValue(2)
Duel.RegisterEffect(e1, tp)
else
--double battle
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_BP_TWICE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1, 0)
Duel.RegisterEffect(e1, tp)
end
if rct == 1 and rg:GetFirst() == c then
local turnp = Duel.GetTurnPlayer()
Duel.SkipPhase(tp, PHASE_DRAW, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(tp, PHASE_STANDBY, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(tp, PHASE_MAIN1, RESET_PHASE + PHASE_END, 1)
Duel.SkipPhase(tp, PHASE_BATTLE, RESET_PHASE + PHASE_END, 1, 1)
Duel.SkipPhase(tp, PHASE_MAIN2, RESET_PHASE + PHASE_END, 1)
local e1 = Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(1, 0)
e1:SetReset(RESET_PHASE + PHASE_END)
Duel.RegisterEffect(e1, turnp)
end
end
end
--Sweety Dreamy Fluffy Fairy
--AlphaKretin
--For Nemoma
local card = c33700408
local code = 33700408
function card.initial_effect(c)
--unaffected
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_ONFIELD, 0)
e1:SetTarget(card.imtg)
e1:SetValue(card.imval)
c:RegisterEffect(e1)
--effect gain
local e2 = Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetType(EFFECT_TYPE_SINGLE + EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_MATERIAL)
e2:SetCondition(card.effcon)
e2:SetOperation(card.effop)
c:RegisterEffect(e2)
end
function card.imtg(e, tc)
local c = e:GetHandler()
return c:GetColumnGroup(1, 1):IsContains(tc) or c == tc
end
function card.imval(e, te)
return te:GetOwnerPlayer() ~= e:GetHandlerPlayer()
end
function card.effcon(e, tp, eg, ep, ev, re, r, rp)
local rc = e:GetHandler():GetReasonCard()
return rc and rc:GetSummonLocation()==LOCATION_EXTRA
end
function card.effop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local rc = c:GetReasonCard()
--take out some resets to allow recursion
rc:ReplaceEffect(code, RESET_EVENT + RESETS_STANDARD - RESET_LEAVE - RESET_TOGRAVE)
--magic hack so it does reset in grave after recu
local a, b = e:GetReset()
if a~=0 or b~=0 then e:Reset() end
end
--AKARI Has Arrived!
--AlphaKretin
--For Nemoma
local scard = c33700409
local id = 33700409
function scard.initial_effect(c)
--Activate
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(scard.regtg)
e1:SetCost(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(33700409,6))
end)
c:RegisterEffect(e1)
--indes
local e2 = Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(1)
c:RegisterEffect(e2)
--Cannot activate
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET + EFFECT_FLAG_CANNOT_DISABLE + EFFECT_FLAG_CANNOT_NEGATE)
e3:SetTargetRange(1, 0)
e3:SetValue(scard.efilter)
c:RegisterEffect(e3)
--Special Summon token
local e4 = Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON + CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e4:SetTarget(scard.tktg)
e4:SetOperation(scard.tkop)
c:RegisterEffect(e4)
--cannot special summon
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_FZONE)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1, 0)
e5:SetTarget(scard.splimit)
c:RegisterEffect(e5)
--cannot link material
local e6 = Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e6:SetTargetRange(LOCATION_MZONE, LOCATION_MZONE)
e6:SetTarget(aux.TargetBoolFunction(Card.IsCode, id + 1))
e6:SetValue(1)
c:RegisterEffect(e6)
--release all
local e7 = Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_RECOVER)
e7:SetType(EFFECT_TYPE_TRIGGER_F + EFFECT_TYPE_SINGLE)
e7:SetCode(EVENT_LEAVE_FIELD)
e7:SetTarget(scard.reltg)
e7:SetOperation(scard.relop)
c:RegisterEffect(e7)
if not scard.global_check then
scard.global_check = true
scard[0] = 0
scard[1] = 0
scard.release_check = false
scard.summon_check = false
end
end
function scard.efilter(e, re, tp)
return re:GetHandler():IsType(TYPE_FIELD) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function scard.regtg(e, tp, eg, ep, ev, re, r, rp, chk)
if chk == 0 then
return true
end
local c = e:GetHandler()
--to grave
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD + EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE + PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_FZONE)
e1:SetCondition(scard.gycon)
e1:SetOperation(scard.gyop)
e1:SetReset(RESET_EVENT + RESETS_STANDARD + RESET_PHASE + PHASE_END + RESET_SELF_TURN, 5)
c:SetTurnCounter(0)
c:RegisterEffect(e1)
end
function scard.gycon(e, tp, eg, ep, ev, re, r, rp)
return Duel.GetTurnPlayer() == tp
end
function scard.gyop(e, tp, eg, ep, ev, re, r, rp)
local c = e:GetHandler()
local ct = c:GetTurnCounter()
ct = ct + 1
c:SetTurnCounter(ct)
if ct == 5 then
Duel.SendtoGrave(c, REASON_EFFECT)
end
end
function scard.IsCanSummonAkariToken(tp)
return Duel.IsPlayerCanSpecialSummonMonster(
tp,
id + 1,
0,
TYPE_MONSTER + TYPE_NORMAL + TYPE_TOKEN,
1000,
1000,
1,
RACE_CYBERSE,
ATTRIBUTE_LIGHT,
POS_FACEUP
)
end
function scard.tktg(e, tp, eg, ep, ev, re, r, rp, chk)
scard.summon_check = true
if chk == 0 then
return ((scard[tp] & 0x1) == 0 or (scard[tp] & 0x2) == 0 or (scard[tp] & 0x4) == 0 or (scard[tp] & 0x8) == 0 or
(scard[tp] & 0x10) == 0) and
scard.IsCanSummonAkariToken(tp) and
Duel.GetLocationCount(tp, LOCATION_MZONE) > 0
end
Duel.SetOperationInfo(0, CATEGORY_TOKEN, nil, 1, 0, 0)
Duel.SetOperationInfo(0, CATEGORY_SPECIAL_SUMMON, nil, 1, tp, 0)
scard.summon_check = false
end
function scard.tkop(e, tp, eg, ep, ev, re, r, rp)
scard.summon_check = true
local c = e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.GetLocationCount(tp, LOCATION_MZONE) < 1 or not scard.IsCanSummonAkariToken(tp) then
return
end
local token = Duel.CreateToken(tp, id + 1)
local flag = 0
Duel.SpecialSummonStep(token, 0, tp, tp, false, false, POS_FACEUP)
if (scard[tp] & 0x1) == 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 0)) then
--atk
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1500)
e1:SetReset(RESET_EVENT + RESETS_STANDARD)
token:RegisterEffect(e1)
local e2 = e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
token:RegisterEffect(e2)
flag = flag | 0x1
token:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 0))
end
if (scard[tp] & 0x2) == 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 1)) then
--indes
local e3 = Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
e3:SetReset(RESET_EVENT + RESETS_STANDARD)
token:RegisterEffect(e3)
flag = flag | 0x2
token:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 1))
end
if (scard[tp] & 0x4) == 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 2)) then
--indes
local e4 = Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetValue(1)
e4:SetReset(RESET_EVENT + RESETS_STANDARD)
token:RegisterEffect(e4)
flag = flag | 0x4
token:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 2))
end
if (scard[tp] & 0x8) == 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 3)) then
--cannot be target
local e5 = Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(1)
e5:SetReset(RESET_EVENT + RESETS_STANDARD)
token:RegisterEffect(e5)
local e6 = e5:Clone()
e6:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
c:RegisterEffect(e6)
flag = flag | 0x8
token:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 3))
end
if flag == 0 or (scard[tp] & 0x10) == 0 and Duel.SelectYesNo(tp, aux.Stringid(id, 4)) then
--cannot release
local e7 = Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_UNRELEASABLE_SUM)
e7:SetValue(1)
e7:SetReset(RESET_EVENT + RESETS_STANDARD)
token:RegisterEffect(e7)
local e8 = Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_CANNOT_RELEASE)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e8:SetRange(LOCATION_MZONE)
e8:SetTargetRange(1, 1)
e8:SetTarget(scard.relval)
e8:SetValue(1)
token:RegisterEffect(e8)
flag = flag | 0x10
token:RegisterFlagEffect(0, RESET_EVENT + RESETS_STANDARD, EFFECT_FLAG_CLIENT_HINT, 1, 0, aux.Stringid(id, 4))
end
--reset effects
local e9 = Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_CONTINUOUS + EFFECT_TYPE_SINGLE)
e9:SetCode(EVENT_LEAVE_FIELD)
e9:SetOperation(scard.resetop)
e9:SetLabel(flag)
token:RegisterEffect(e9)
scard[tp] = scard[tp] | flag
Duel.SpecialSummonComplete()
scard.summon_check = false
end
function scard.relval(e, c)
return c == e:GetHandler() and not scard.release_check
end
function scard.resetop(e, tp, eg, ep, ev, re, r, rp)
local p = e:GetHandler():GetPreviousControler()
scard[p] = scard[p] - e:GetLabel()
end
function scard.splimit(e, c)
return not scard.summon_check
end
function scard.relfilter(c)
return c:IsCode(id + 1) and c:IsReleasableByEffect()
end
function scard.reltg(e, tp, eg, ep, ev, re, r, rp, chk)
scard.release_check = true
if chk == 0 then
return not e:GetHandler():IsLocation(LOCATION_DECK) and not (c:IsLocation(LOCATION_REMOVED) and c:IsFacedown())
end
local g = Duel.GetMatchingGroup(scard.relfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
Duel.SetOperationInfo(0, CATEGORY_RELEASE, g, #g, 0, 0)
Duel.SetOperationInfo(0, CATEGORY_RECOVER, nil, 0, tp, 0)
scard.release_check = false
end
function scard.relop(e, tp, eg, ep, ev, re, r, rp)
scard.release_check = true
local g = Duel.GetMatchingGroup(scard.relfilter, tp, LOCATION_MZONE, LOCATION_MZONE, nil)
Duel.Release(g, REASON_EFFECT)
local og = Duel.GetOperatedGroup()
if #og > 0 then
atk = og:GetSum(Card.GetPreviousAttackOnField)
Duel.Recover(tp, atk, REASON_EFFECT)
Duel.Recover(1 - tp, atk, REASON_EFFECT)
end
scard.release_check = false
end
--朱雀的净化
function c33700175.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SOUND,0,aux.Stringid(33700175,1))
end)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(c33700175.cost)
e2:SetTarget(c33700175.tg)
e2:SetOperation(c33700175.op)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33700175,0))
e3:SetCategory(CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1)
e3:SetCondition(c33700175.thcon)
e3:SetTarget(c33700175.thtg)
e3:SetOperation(c33700175.thop)
c:RegisterEffect(e3)
end
function c33700175.filter(c)
return c:IsCode(33700083) and c:IsAbleToRemoveAsCost()
end
function c33700175.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33700175.filter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c33700175.filter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c33700175.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c33700175.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
function c33700175.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c33700175.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_HAND,nil)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,ct,tp,0)
end
function c33700175.thop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct1=Duel.GetFieldGroupCount(p,0,LOCATION_HAND)
local ct2=ct1-Duel.GetFieldGroupCount(p,LOCATION_HAND,0)
if ct2>0 then
Duel.Draw(tp,ct2,REASON_EFFECT)
end
local sg=Duel.GetOperatedGroup()
Duel.ConfirmCards(1-p,sg)
if sg:GetClassCount(Card.GetCode)==sg:GetCount() then
local gt=sg:FilterSelect(p,Card.IsDiscardable,1,sg:GetCount(),nil)
Duel.SendtoGrave(gt,REASON_EFFECT+REASON_DISCARD)
local ct3=gt:GetCount()
local tg=Duel.GetMatchingGroup(Card.IsAbleToHand,p,LOCATION_GRAVE,0,nil)
if ct3>0 and tg:GetCount()>=ct3 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_ATOHAND)
local sel=tg:Select(p,ct3,ct3,nil)
Duel.SendtoHand(sel,nil,REASON_EFFECT)
Duel.ConfirmCards(1-p,sel)
end
else
Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
\ No newline at end of file
...@@ -79,7 +79,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp) ...@@ -79,7 +79,7 @@ function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
if not g then return false end if not g then return false end
local c=e:GetHandler() local c=e:GetHandler()
return ep~=tp and g:IsExists(cm.nfilter,1,nil,tp) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) return ep==1-tp and g:IsExists(cm.nfilter,1,nil,tp) and not c:IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
--动物朋友 蓝鲸
local m=33700740
local cm=_G["c"..m]
function cm.initial_effect(c)
cm[c]={}
local effect_list=cm[c]
--zone
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetCondition(cm.indcon)
e3:SetValue(1)
c:RegisterEffect(e3)
--and Anifriends indes
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(cm.nocodecon)
e4:SetTarget(cm.nocodetg)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
--Destroy
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,1))
e6:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e6:SetCode(EVENT_TO_GRAVE)
e6:SetLabel(22)
effect_list[22]=e6
e6:SetTarget(cm.destg)
e6:SetOperation(cm.desop)
c:RegisterEffect(e6)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,tp,nil)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>2 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_DISABLE_FIELD)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
else
Duel.SendtoGrave(c,REASON_EFFECT)
end
end
function cm.disop(e,tp)
local c=Duel.GetLocationCount(tp,LOCATION_MZONE,PLAYER_NONE,0)
if c==0 then return end
local dis1=Duel.SelectDisableField(tp,3,LOCATION_MZONE,0,0)
return dis1
end
function cm.indcon(e)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetCount()==0 or cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.nocodefilter(c)
return not c:IsSetCard(0x442)
end
function cm.nocodecon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_GRAVE,0)>=1 and not Duel.IsExistingMatchingCard(cm.nocodefilter,e:GetHandler():GetControler(),LOCATION_GRAVE,0,1,nil)
end
function cm.nocodetg(e,c)
return c:IsSetCard(0x442) and c~=e:GetHandler()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,1-tp,g:GetCount()*500)
end
function cm.confilter(c)
return c:IsSetCard(0x442) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.confilter,tp,LOCATION_GRAVE,0,nil)
if g:GetClassCount(Card.GetCode)<e:GetLabel() then return end
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if g:GetCount()>0 then
local ct=Duel.Destroy(g,REASON_EFFECT)
if ct>0 then
Duel.Damage(1-tp,ct*500,REASON_EFFECT)
end
end
end
\ No newline at end of file
--动物朋友 真海豚
local m=33700741
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-inds
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetTarget(cm.indtg)
e2:SetOperation(cm.indop)
c:RegisterEffect(e2)
--grave effect-atk up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.atkcon)
e3:SetCost(cm.atkcost)
e3:SetTarget(cm.atktg)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.indfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.indfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1500)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--动物朋友 海豚
local m=33700742
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-inds
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetTarget(cm.indtg)
e2:SetOperation(cm.indop)
c:RegisterEffect(e2)
--grave effect-atk down
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.atkcon)
e3:SetCost(cm.atkcost)
e3:SetTarget(cm.atktg)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.indfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.indfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(-(tc:GetDefense()))
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--动物朋友 中华白海豚
local m=33700743
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-inds
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetTarget(cm.indtg)
e2:SetOperation(cm.indop)
c:RegisterEffect(e2)
--grave effect-inds
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.gycon)
e3:SetCost(cm.gycost)
e3:SetTarget(cm.indtg)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.indfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.indfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function cm.gycon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.gycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
\ No newline at end of file
--动物朋友 一角鲸
local m=33700744
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-Honest
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.atkcon)
e2:SetCost(cm.cost)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
--grave effect-inds
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.indcon)
e3:SetCost(cm.indcost)
e3:SetTarget(cm.indtg)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
if phase~=PHASE_DAMAGE or Duel.IsDamageCalculated() then return false end
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return d~=nil and d:IsFaceup() and ((a:GetControler()==tp and a:IsSetCard(0x442) and a:IsRelateToBattle())
or (d:GetControler()==tp and d:IsSetCard(0x442) and d:IsRelateToBattle()))
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if not a:IsRelateToBattle() or not d:IsRelateToBattle() then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetOwnerPlayer(tp)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(2000)
if a:GetControler()==tp then
a:RegisterEffect(e1)
else
d:RegisterEffect(e1)
end
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.indcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.indfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.indfilter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.efilter)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--动物朋友 林斑小鸮
local m=33700745
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-inds
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetTarget(cm.indtg)
e2:SetOperation(cm.indop)
c:RegisterEffect(e2)
--grave effect-replace draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PREDRAW)
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(cm.recon)
e3:SetTarget(cm.retg)
e3:SetOperation(cm.reop)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.indfilter(c)
return c:IsFaceup() and c:IsSetCard(0x442)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.indfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.indfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.indfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(1)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(cm.efilter)
tc:RegisterEffect(e2)
end
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.recon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount() and tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function cm.retg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.reop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
_replace_count=_replace_count+1
if _replace_count<=_replace_max and c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--动物朋友 白头鹰&苍鹰&游隼
local m=33700746
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_SPECIAL_SUMMON)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_TO_HAND)
e0:SetCondition(cm.con)
e0:SetOperation(cm.op)
c:RegisterEffect(e0)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_PZONE)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
c:RegisterEffect(e1)
--replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_PZONE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
--Solemn Strike
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(3,m)
e3:SetCondition(cm.negcon1)
e3:SetCost(cm.negcost)
e3:SetTarget(cm.negtg1)
e3:SetOperation(cm.negop1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_SPSUMMON)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(3,m)
e4:SetCondition(cm.negcon1)
e4:SetCost(cm.negcost)
e4:SetTarget(cm.negtg1)
e4:SetOperation(cm.negop1)
c:RegisterEffect(e4)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=re and re:GetHandler()
return c:IsReason(REASON_EFFECT) and c:IsPreviousLocation(LOCATION_DECK) and c:GetPreviousControler()==tp and rc and rc:IsSetCard(0x442) and Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetTurnCount()>0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and
Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x442) and c:IsLocation(LOCATION_ONFIELD) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) and not c:IsReason(REASON_REPLACE)
end
function cm.tgfilter(c,e,tp)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and eg:IsExists(cm.repfilter,1,nil,tp) and e:GetHandler():GetFlagEffect(m)==0 end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
end
function cm.negcon1(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
end
function cm.costfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.costfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function cm.negtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.negop1(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.negcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL) and Duel.GetCurrentChain()==0
end
function cm.negtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.negop2(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
end
\ No newline at end of file
--动物朋友 黑背胡狼
local m=33700747
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--hand effect-Kuriphoton
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_HAND)
e3:SetCost(cm.cost)
e3:SetOperation(cm.damop)
c:RegisterEffect(e3)
--onfield effect-to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_ONFIELD)
e4:SetCost(cm.thcost)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount() and Duel.GetAttacker():GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
e2:SetValue(cm.efilter)
c:RegisterEffect(e2)
end
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetActivityCount(tp,ACTIVITY_SUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
\ No newline at end of file
--动物朋友 驯鹿
local m=33700750
local cm=_G["c"..m]
function cm.initial_effect(c)
cm[c]={}
local effect_list=cm[c]
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect-count
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
effect_list[5]=e2
e2:SetCountLimit(1,m)
e2:SetTarget(cm.coutg)
e2:SetOperation(cm.couop)
c:RegisterEffect(e2)
--sent to GY
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
effect_list[5]=e3
e3:SetCountLimit(1,m)
e3:SetCondition(cm.tgcon)
e3:SetTarget(cm.coutg)
e3:SetOperation(cm.couop)
c:RegisterEffect(e3)
end
cm.card_code_list={33700756}
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.pufilter(c)
return not c:IsPublic()
end
function cm.coutg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0)
local ct=g:GetClassCount(Card.GetCode)
if ct>=5 then ct5=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) else ct5=true end
if ct>=10 then ct10=Duel.IsPlayerCanDraw(tp,1) end
if ct>=20 then ct20=Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.pufilter,tp,LOCATION_HAND,0,1,nil) and (ct5 or ct10 or ct20 or e:GetHandler():IsHasEffect(33700090)) end
if ct>=5 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HANDE)
end
if ct>=10 then
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
if ct>=20 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
end
function cm.couop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_GRAVE,0)
local ct=g:GetClassCount(Card.GetCode)
if Duel.IsExistingMatchingCard(cm.pufilter,tp,LOCATION_HAND,0,1,nil) then
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.ConfirmCards(1-tp,g1)
Duel.ShuffleHand(tp)
end
if ct<5 then return end
local c=e:GetHandler()
if ct>=5 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
if ct>=10 or e:GetLabel()==33700090 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
if ct>=20 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY)
end
\ No newline at end of file
--动物朋友 狸
local m=33700751
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--hand effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DISCARD)
e2:SetRange(LOCATION_HAND)
e2:SetCost(cm.cost)
e2:SetTarget(cm.thtg1)
e2:SetOperation(cm.thop1)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(cm.con)
e3:SetTarget(cm.thtg2)
e3:SetOperation(cm.thop2)
c:RegisterEffect(e3)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local tc=g:GetFirst()
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
function cm.aclimit(e,re,tp)
local tc=e:GetLabelObject()
return re:GetHandler():IsCode(tc:GetCode()) and not re:GetHandler():IsImmuneToEffect(e)
end
function cm.repfilter1(c,tp)
return c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND) and c:IsReason(REASON_DISCARD) and c:IsAbleToHand()
end
function cm.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter1,1,e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,eg:Filter(cm.repfilter1,e:GetHandler()):GetCount(),tp,LOCATION_GRAVE)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(cm.repfilter1,e:GetHandler())
local ct=sg:GetCount()
if ct>0 then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(function(e) return e:GetHandler():IsPublic() end)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=sg:GetNext()
end
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()~=0
end
function cm.repfilter2(c,tp)
return c:IsControler(1-tp) and c:IsLocation(LOCATION_GRAVE) and c:IsPreviousLocation(LOCATION_HAND) and c:IsReason(REASON_COST) and c:IsAbleToHand() and bit.band(c:GetReason(),REASON_MATERIAL)==0
end
function cm.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.repfilter2,1,e:GetHandler(),tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,eg:Filter(cm.repfilter2,e:GetHandler(),tp):GetCount(),tp,LOCATION_GRAVE)
end
function cm.thop2(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(cm.repfilter2,e:GetHandler(),tp)
local ct=sg:GetCount()
if ct>0 then
Duel.SendtoHand(sg,tp,REASON_EFFECT)
local tc=sg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetOwner())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCondition(function(e) return e:GetHandler():IsPublic() end)
e2:SetValue(LOCATION_REMOVED)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
tc=sg:GetNext()
end
end
end
\ No newline at end of file
--LUCKY BEAST 三型
local m=33700752
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(1)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.tkcon)
e2:SetTarget(cm.tktg)
e2:SetOperation(cm.tkop)
c:RegisterEffect(e2)
--level change
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCondition(cm.lvcon)
e3:SetOperation(cm.lvop)
e3:SetLabelObject(e1)
c:RegisterEffect(e3)
end
function cm.spcfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount() and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_HAND,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
local lv=tc:GetLevel()
e:SetLabel(lv)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
--local e1=Effect.CreateEffect(c)
--e1:SetType(EFFECT_TYPE_SINGLE)
--e1:SetCode(EFFECT_UPDATE_LEVEL)
--e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
--e1:SetValue(-lv)
--c:RegisterEffect(e1)
end
function cm.lvcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SPECIAL+1
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(-e:GetLabelObject():GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
end
function cm.tkcon(e,tp,eg,ep,ev,re,r,rp)
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
return cg:GetClassCount(Card.GetCode)==cg:GetCount()
end
function cm.tgfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
if tc:IsFacedown() then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,33700753,0,0x4011,tc:GetAttack(),tc:GetDefense(),tc:GetLevel(),tc:GetRace(),tc:GetAttribute()) then return end
local token=Duel.CreateToken(tp,33700753)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(tc:GetAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
e2:SetValue(tc:GetDefense())
token:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_LEVEL)
e3:SetValue(tc:GetLevel())
token:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_CHANGE_RACE)
e4:SetValue(tc:GetRace())
token:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e5:SetValue(tc:GetAttribute())
token:RegisterEffect(e5)
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_UNRELEASABLE_SUM)
e6:SetValue(function(e,c) return not c:IsSetCard(0x442) end)
e6:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e7)
local e8=Effect.CreateEffect(e:GetHandler())
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e8:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e8:SetValue(function(e,c) if c==nil then return true end return not c:IsSetCard(0x442) end)
e8:SetReset(RESET_EVENT+RESETS_STANDARD)
token:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
token:RegisterEffect(e9)
local ea=e8:Clone()
ea:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
token:RegisterEffect(ea)
Duel.SpecialSummonComplete()
end
\ No newline at end of file
--动物朋友 海生家族之绊
local m=33700754
local cm=_G["c"..m]
function cm.initial_effect(c)
--maintain
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EVENT_PHASE+PHASE_END)
e0:SetRange(LOCATION_SZONE)
e0:SetCountLimit(1)
e0:SetCondition(cm.mtcon)
e0:SetOperation(cm.mtop)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetOperation(aux.chainreg)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_CHAIN_SOLVED)
e3:SetRange(LOCATION_SZONE)
e3:SetOperation(cm.acop)
c:RegisterEffect(e3)
--Light Wing Shield
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetRange(LOCATION_SZONE)
e4:SetCode(EVENT_ATTACK_ANNOUNCE)
e4:SetCountLimit(1,33710754)
e4:SetCost(cm.atkcost)
e4:SetOperation(cm.atkop)
c:RegisterEffect(e4)
--replace
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EFFECT_DESTROY_REPLACE)
e5:SetRange(LOCATION_SZONE)
e5:SetTarget(cm.reptg)
e5:SetValue(cm.repval)
e5:SetOperation(cm.repop)
c:RegisterEffect(e5)
--to hand
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,3))
e6:SetProperty(EFFECT_FLAG_CARD_TARGET)
e6:SetCategory(CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1,m)
e6:SetCost(cm.thcost)
e6:SetTarget(cm.thtg)
e6:SetOperation(cm.thop)
c:RegisterEffect(e6)
end
function cm.mtcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=1
if e:GetHandler():IsCanRemoveCounter(tp,0x1442,2,REASON_COST) then
sel=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
else
sel=Duel.SelectOption(tp,aux.Stringid(m,1))+1
end
if sel==0 then
e:GetHandler():RemoveCounter(tp,0x1442,2,REASON_COST)
else
Duel.SendtoGrave(c,REASON_COST)
end
end
function cm.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x442) and re:GetHandler():IsRace(RACE_AQUA) and c:GetFlagEffect(1)>0 then
c:AddCounter(0x1442,1)
end
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1442,2,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1442,2,REASON_COST)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.NegateAttack()
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0x442) and c:IsLocation(LOCATION_ONFIELD) and (c:IsReason(REASON_BATTLE) or c:IsReason(REASON_EFFECT)) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1442,2,REASON_COST) and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RemoveCounter(tp,0x1442,2,REASON_EFFECT)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanRemoveCounter(tp,0x1442,4,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x1442,4,REASON_COST)
end
function cm.thfilter(c,tid)
return c:IsSetCard(0x442) and c:GetTurnID()==tid and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil,Duel.GetTurnCount()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,Duel.GetTurnCount())
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
end
\ No newline at end of file
--动物朋友的大团圆
local m=33700755
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Rekindling
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ADJUST)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.confilter,tp,LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)<20
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
end)
c:RegisterEffect(e3)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x442) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_GRAVE,0,nil,e,tp)
if ft<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=nil
if tg:GetCount()>ft then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
g=tg:Select(tp,ft,ft,nil)
else
g=tg
end
if g:GetCount()>0 then
local fid=e:GetHandler():GetFieldID()
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
tc:RegisterEffect(e4,true)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
g:KeepAlive()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(g)
e1:SetCondition(cm.thcon)
e1:SetOperation(cm.thop)
Duel.RegisterEffect(e1,tp)
end
end
function cm.thfilter(c,fid)
return c:GetFlagEffectLabel(m)==fid
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
if not g:IsExists(cm.thfilter,1,nil,e:GetLabel()) then
g:DeleteGroup()
e:Reset()
return false
else return true end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local tg=g:Filter(cm.thfilter,nil,e:GetLabel())
g:DeleteGroup()
Duel.SendtoHand(tg,tp,REASON_EFFECT)
end
function cm.confilter(c)
return c:IsSetCard(0x442) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.confilter,tp,LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)<20
end
\ No newline at end of file
--动物朋友 达纪监督
local m=33700756
local cm=_G["c"..m]
function cm.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetCondition(cm.con)
e2:SetCost(cm.cost)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.thfilter(c)
return (c:IsCode(33700053,33700054,33700055,33700060,33700061,33700068,33700070,33700071,33700075,33700076,33700077,33700078,33700079,33700080,33700081,33700088,33700089,33700091,33700092,33700095,33700096,33700104) or aux.IsCodeListed(c,14000260)) and c:IsSetCard(0x442) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,g:GetCount(),tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.cfilter(c)
return c:IsSetCard(0x442) and c:IsAbleToDeckAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_HAND_LIMIT)
e1:SetTargetRange(1,0)
e1:SetValue(100)
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
\ No newline at end of file
--动物朋友 土狼和她的朋友们
local m=33700757
local cm=_G["c"..m]
function cm.initial_effect(c)
cm[c]={}
local effect_list=cm[c]
--spsummon self
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spscon)
e1:SetTarget(cm.spstg)
e1:SetOperation(cm.spsop)
c:RegisterEffect(e1)
--halve damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetLabel(3)
effect_list[3]=e2
e2:SetTargetRange(1,0)
e2:SetCondition(cm.hlcon)
e2:SetValue(cm.val)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_HAND+LOCATION_ONFIELD)
e3:SetLabel(7)
effect_list[7]=e3
e3:SetCondition(cm.con)
e3:SetCost(cm.cost)
e3:SetTarget(cm.target)
e3:SetOperation(cm.operation)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_HANDES)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetLabel(13)
effect_list[13]=e4
e4:SetCondition(cm.thcon)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.spscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_MZONE,0,e:GetHandler())==0
end
function cm.spstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,tp,LOCATION_HAND)
end
function cm.spsop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsSetCard(0x442)
end
function cm.confilter(c)
return c:IsSetCard(0x442) and c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function cm.hlcon(e)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090
end
function cm.val(e,re,dam,r,rp,rc)
return dam/2
end
function cm.con(e)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.thfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.thcon(e)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetClassCount(Card.GetCode)>=e:GetLabel() or e:GetLabel()==33700090
end
function cm.thfilter1(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,3,nil)
if g:GetCount()>0 then
local ct=Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if ct>0 then
Duel.ShuffleHand(tp)
Duel.DiscardHand(tp,aux.TRUE,ct,ct,REASON_EFFECT+REASON_DISCARD)
end
end
end
\ No newline at end of file
--动物朋友 浣熊 ~琉球~
local m=33700758
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetTargetRange(POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE,1)
e1:SetCondition(cm.spscon)
e1:SetOperation(cm.spsop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e2:SetTargetRange(POS_FACEUP_ATTACK+POS_FACEUP_DEFENSE,0)
e2:SetCondition(cm.spscon1)
e2:SetOperation(cm.spsop1)
c:RegisterEffect(e2)
--todeck and toGY
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tdtg)
e3:SetOperation(cm.tdop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,3))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,33710758)
e4:SetCost(cm.spcost)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.spsfilter(c,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and c:IsReleasable() and Duel.GetMZoneCount(1-tp,c,tp)>0
end
function cm.spscon(e,c)
if c==nil then return true end
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
local tp=c:GetControler()
return cg:GetClassCount(Card.GetCode)==cg:GetCount() and Duel.IsExistingMatchingCard(cm.spsfilter,tp,0,LOCATION_MZONE,1,nil,tp)
end
function cm.spsop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.spsfilter,tp,0,LOCATION_MZONE,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.spsfilter1(c,tp)
return c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) and c:IsReleasable() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spscon1(e,c)
if c==nil then return true end
local cg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_GRAVE,0,nil)
local tp=c:GetControler()
return cg:GetClassCount(Card.GetCode)==cg:GetCount() and Duel.IsExistingMatchingCard(cm.spsfilter1,tp,LOCATION_MZONE,0,1,nil,tp)
end
function cm.spsop1(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.spsfilter1,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function cm.tdfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.tgfilter(c)
return c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x442) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(m)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--圣山之楔 天蓝薮猫
local m=33700759
local cm=_G["c"..m]
function cm.initial_effect(c)
--GY effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_REMOVE)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetCondition(cm.rmcon)
e1:SetTarget(cm.rmlimit)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x442))
e2:SetCondition(cm.indcon)
e2:SetValue(cm.indes)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetTargetRange(LOCATION_ONFIELD,0)
e3:SetCondition(cm.con)
e3:SetTarget(cm.filter)
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SUMMON_SUCCESS)
e4:SetCondition(cm.sumcon)
e4:SetOperation(cm.sumop)
c:RegisterEffect(e4)
end
function cm.confilter(c)
return c:IsCode(m)
end
function cm.rmcon(e,c)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetCount()>=1
end
function cm.rmlimit(e,c,tp)
return not c:IsSetCard(0x442)
end
function cm.indcon(e,c)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetCount()>=2
end
function cm.indes(e,c)
return c:IsDefenseBelow(e:GetHandler():GetDefense())
end
function cm.con(e,c)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return g:GetCount()>=3
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.filter(e,c)
return c:IsFaceup() and c:IsSetCard(0x442) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsSetCard(0x442) and c:IsType(TYPE_MONSTER)
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.confilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil)
return eg:IsExists(cm.cfilter,1,nil,tp) and g:GetCount()>=3
end
function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.cfilter,nil,e)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--妖幻战姬 长枪兵
local m=33700760
local cm=_G["c"..m]
if not RSTFVal then
RSTFVal=RSTFVal or {}
tfrsv=RSTFVal
function tfrsv.SSLimitEffect(c)
c:EnableUnsummonable()
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(tfrsv.splimit)
c:RegisterEffect(e1)
end
function tfrsv.splimit(e,se,sp,st)
return se:GetHandler():IsSetCard(0x344a)
end
function tfrsv.columntg(e,c)
--local g=e:GetHandler():GetColumnGroup(e:GetHandlerPlayer(),1,1)
--return g:IsContains(c) and c~=e:GetHandler() and c:GetSequence()<5
return c~=e:GetHandler() and c:GetSequence()<5 and math.abs(e:GetHandler():GetSequence()-c:GetSequence())<=1
end
function tfrsv.columntg2(e,c)
return tfrsv.columntg(e,c) and c:IsSetCard(0x344a)
end
function tfrsv.ToGraveEffect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCondition(tfrsv.thcon)
e1:SetTarget(tfrsv.thtg)
e1:SetOperation(tfrsv.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(tfrsv.lvop)
c:RegisterEffect(e2)
e1:SetLabelObject(e2)
end
function tfrsv.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(c:GetOriginalCode())==0 then
e:SetLabel(1)
else e:SetLabel(0) end
end
function tfrsv.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_SZONE) and e:GetLabelObject():GetLabel()==0
end
function tfrsv.thfilter(c,code)
return c:IsSetCard(0x344a) and not c:IsCode(code) and c:IsAbleToHand()
end
function tfrsv.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(tfrsv.thfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil,e:GetHandler():GetOriginalCode()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function tfrsv.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(tfrsv.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e:GetHandler():GetOriginalCode())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleDeck(tp)
end
end
function tfrsv.ActivateEffect(c,operation)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetTarget(tfrsv.settg)
e1:SetOperation(tfrsv.setop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(tfrsv.spcon)
e2:SetTarget(tfrsv.sptg)
e2:SetOperation(tfrsv.spop)
c:RegisterEffect(e2)
operation(c)
end
function tfrsv.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function tfrsv.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsLocation(LOCATION_HAND) or not Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then return end
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
c:RegisterFlagEffect(c:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
function tfrsv.ccon(e,tp,eg,ep,ev,re,r,rp,chk)
return e:GetHandler():GetFlagEffect(e:GetHandler():GetOriginalCode())>0
end
function tfrsv.spcon(e,tp,eg,ep,ev,re,r,rp,chk)
return e:GetHandler():GetTurnID()~=Duel.GetTurnCount()
end
function tfrsv.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function tfrsv.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,true,POS_FACEUP)
end
-------------------
end
-------------------
if cm then
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ToGraveEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--Atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg)
e1:SetValue(1000)
c:RegisterEffect(e1)
end
function cm.operation(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PREDRAW)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(aux.AND(tfrsv.ccon,cm.thcon))
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0
end
function cm.thfilter(c)
return c:IsSetCard(0x344a) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
local dt=Duel.GetDrawCount(tp)
if dt~=0 then
_replace_count=0
_replace_max=dt
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_DRAW_COUNT)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_DRAW)
e1:SetValue(0)
Duel.RegisterEffect(e1,tp)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
_replace_count=_replace_count+1
if _replace_count>_replace_max or not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
-------------------
end
\ No newline at end of file
--妖幻战姬 弓箭手
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700761
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ToGraveEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--Atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg)
e1:SetValue(1000)
c:RegisterEffect(e1)
end
function cm.operation(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(tfrsv.ccon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsSetCard(0x344a) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--妖幻战姬 盗贼
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700762
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ToGraveEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--de
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function cm.operation(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(tfrsv.ccon)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp,chk)
return e:GetHandler():GetTurnID()~=Duel.GetTurnCount()
end
function cm.filter(c)
return c:IsSetCard(0x344a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--妖幻战姬 武僧
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700763
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ToGraveEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--de
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg)
e1:SetValue(1)
c:RegisterEffect(e1)
end
function cm.operation(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(tfrsv.ccon)
e1:SetCost(cm.drcost)
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
c:RegisterEffect(e1)
end
function cm.drcfilter(c)
return c:IsSetCard(0x344a) and c:IsType(TYPE_MONSTER) and c:IsDiscardable()
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.drcfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,cm.drcfilter,1,1,REASON_DISCARD+REASON_COST)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--妖幻战姬 圣骑士
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700764
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--de
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg2)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(tfrsv.columntg2)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
end
function cm.operation(c)
--damage reduce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e1:SetCondition(aux.AND(tfrsv.ccon,cm.rdcon))
e1:SetOperation(cm.rdop)
c:RegisterEffect(e1)
end
function cm.rdcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function cm.rdop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(tp,ev/2)
end
--妖幻战姬 浪人
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700765
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(tfrsv.columntg2)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.operation(c)
--atk & def
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.valfilter)
e2:SetValue(800)
e2:SetCondition(tfrsv.ccon)
c:RegisterEffect(e2)
local e1=e2:Clone()
e1:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e1)
end
function cm.valfilter(e,c)
return c:IsSetCard(0x644a) or c:IsSetCard(0x344a)
end
\ No newline at end of file
--妖幻战姬 狂战士
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700766
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--atkup
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.atcon)
e1:SetCost(cm.atcost)
e1:SetOperation(cm.atop)
c:RegisterEffect(e1)
end
function cm.operation(c)
--tog
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(tfrsv.ccon)
e1:SetCost(cm.tgcost)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
end
function cm.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,1-tp,LOCATION_ONFIELD)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(1-tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DAMAGE or not Duel.IsDamageCalculated()
end
function cm.rfilter(c,e)
return tfrsv.columntg2(e,c)
end
function cm.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.rfilter,1,e:GetHandler(),e) end
local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,e:GetHandler(),e)
local atk=g:GetFirst():GetTextAttack()
if atk<0 then atk=0 end
local def=g:GetFirst():GetTextDefense()
if def<0 then def=0 end
e:SetLabel(atk)
e:SetValue(def)
Duel.Release(g,REASON_COST)
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(e:GetValue())
c:RegisterEffect(e2)
end
end
--妖幻战姬 巫女
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700767
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--sp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.operation(c)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_SZONE,0)
e1:SetCondition(tfrsv.ccon)
e1:SetTarget(cm.cbtg)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
end
function cm.cbtg(e,c)
return c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL) and c:IsSetCard(0x344a) and c~=e:GetHandler()
end
function cm.rfilter(c,e)
local tp=e:GetHandlerPlayer()
return tfrsv.columntg2(e,c) and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.rfilter,1,e:GetHandler(),e) end
local g=Duel.SelectReleaseGroup(tp,cm.rfilter,1,1,e:GetHandler(),e)
Duel.Release(g,REASON_COST)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x344a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--妖幻战姬 炼金术师
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700768
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.setcon)
e1:SetTarget(cm.settg)
e1:SetOperation(cm.setop)
c:RegisterEffect(e1)
end
function cm.operation(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(tfrsv.ccon)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
end
function cm.tgfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and cm.tgfilter(chkc) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,1000)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
Duel.Recover(1-tp,1000,REASON_EFFECT)
end
end
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_MZONE,0,1,nil,e)
end
function cm.rfilter(c,e)
local tp=e:GetHandlerPlayer()
return tfrsv.columntg2(e,c)
end
function cm.setfilter(c,tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable(true) and (c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.setfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.setfilter,tp,0,LOCATION_GRAVE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,cm.setfilter,tp,0,LOCATION_GRAVE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) then
Duel.SSet(tp,tc)
Duel.ConfirmCards(1-tp,tc)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1,true)
end
end
\ No newline at end of file
--妖幻战姬 傀儡师
if not pcall(function() require("expansions/script/c33700760") end) then require("script/c33700760") end
local m=33700769
local cm=_G["c"..m]
function cm.initial_effect(c)
tfrsv.SSLimitEffect(c)
tfrsv.ActivateEffect(c,cm.operation)
--sp
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
function cm.operation(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1)
e1:SetCondition(tfrsv.ccon)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
end
function cm.tgfilter(c)
return c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.tgfilter(chkc) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,cm.tgfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,1-tp,1000)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
Duel.Recover(1-tp,1000,REASON_EFFECT)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_MZONE,0,1,nil,e)
end
function cm.rfilter(c,e)
return tfrsv.columntg2(e,c)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local seq=c:GetSequence()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) and seq>0 and seq<4 and (Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) or Duel.CheckLocation(tp,LOCATION_MZONE,seq+1)) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local seq=c:GetSequence()
local zone2=0
if seq==0 then zone2=0x2
elseif seq==4 then zone2=0x8
else zone2=2^(seq-1)+2^(seq+1)
end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,zone2)
end
end
\ No newline at end of file
--妖幻幼精 繆恩
local m=33700770
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x344a),2,true,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_SZONE,0)
e3:SetTarget(aux.TargetEqualFunction(Card.GetType,TYPE_CONTINUOUS+TYPE_SPELL))
e3:SetValue(cm.efilter)
c:RegisterEffect(e3)
end
function cm.spfilter(c,fc)
return c:IsFusionSetCard(0x344a) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function cm.spfilter1(c,tp,g)
return g:IsExists(cm.spfilter2,1,c,tp,c)
end
function cm.spfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil,c)
return g:IsExists(cm.spfilter1,1,nil,tp,g)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:FilterSelect(tp,cm.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=g:FilterSelect(tp,cm.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.thfilter(c)
return c:IsCode(33700778) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--妖幻幼精 西美
local m=33700771
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x344a),1,1)
c:EnableReviveLimit()
--mat
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(cm.limit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--dis
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.negcon)
e3:SetCost(cm.negcost)
e3:SetTarget(cm.negtg)
e3:SetOperation(cm.negop)
c:RegisterEffect(e3)
end
function cm.limit(e,c)
if not c then return false end
return not c:IsRace(RACE_FAIRY)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsCode(33700779) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and rp~=tp and Duel.IsChainDisablable(ev)
end
function cm.negfilter(c)
return c:IsFaceup() and c:IsSetCard(0x344a) and c:IsAbleToGraveAsCost()
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.negfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.negfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
--妖幻幼精 西亚
local m=33700772
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x344a),1,1)
c:EnableReviveLimit()
--mat
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(cm.limit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.valtg)
e3:SetValue(cm.val)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetRange(LOCATION_MZONE)
e6:SetTargetRange(0,LOCATION_MZONE)
e6:SetValue(cm.val2)
e6:SetCondition(cm.adcon)
e6:SetTarget(cm.adtg)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e7)
end
function cm.limit(e,c)
if not c then return false end
return not c:IsRace(RACE_FAIRY)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsCode(33700780) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.valtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsType(TYPE_CONTINUOUS) and c:IsType(TYPE_SPELL)
end
function cm.val(e,c)
return Duel.GetMatchingGroupCount(cm.atkfilter,c:GetControler(),LOCATION_ONFIELD,0,nil)*500
end
function cm.val2(e,c)
return Duel.GetMatchingGroupCount(cm.atkfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,nil)*-500
end
function cm.adcon(e)
local c=e:GetHandler()
local g=c:GetLinkedGroup()
return Duel.GetAttackTarget() and (g:IsContains(Duel.GetAttacker()) or g:IsContains(Duel.GetAttackTarget())) and (Duel.GetCurrentPhase()==PHASE_DAMAGE or Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL)
end
function cm.adtg(e,c)
local g=e:GetHandler():GetLinkedGroup()
if g:IsContains(Duel.GetAttackTarget()) then return Duel.GetAttacker()
else return Duel.GetAttackTarget()
end
end
\ No newline at end of file
--妖幻幼精 特瑞兹
local m=33700773
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x344a),2,2,cm.lcheck)
c:EnableReviveLimit()
--mat
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(cm.limit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--seq
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(cm.seqtg)
e3:SetOperation(cm.seqop)
c:RegisterEffect(e3)
--immune
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetTarget(cm.valtg)
e4:SetValue(cm.efilter)
c:RegisterEffect(e4)
--direct attack
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DIRECT_ATTACK)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(cm.valtg)
c:RegisterEffect(e5)
end
function cm.limit(e,c)
if not c then return false end
return not c:IsRace(RACE_FAIRY)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsCode(33700783) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.lcheck(g,lc)
return g:GetClassCount(Card.GetLevel)==g:GetCount()
end
function cm.rfilter(c)
local seq=c:GetSequence()
if not c:IsSetCard(0x344a) then return false end
if c:IsFacedown() then return false end
if seq>4 then return false end
if seq==0 then return Duel.CheckLocation(tp,LOCATION_MZONE,1)
elseif seq==4 then return Duel.CheckLocation(tp,LOCATION_MZONE,3)
else return Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) or Duel.CheckLocation(tp,LOCATION_MZONE,seq-1)
end
end
function cm.seqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local seq=c:GetSequence()
if chk==0 then return seq>4 and Duel.IsExistingMatchingCard(cm.rfilter,tp,LOCATION_MZONE,0,1,nil) end
end
function cm.seqop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:GetSequence()<5 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tc=Duel.SelectMatchingCard(tp,cm.rfilter,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if not tc then return end
local seq=tc:GetSequence()
local flag=0
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then
flag=bit.replace(flag,0x1,seq+1)
end
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then
flag=bit.replace(flag,0x1,seq-1)
end
flag=bit.bxor(flag,0xff)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=0
if s==1 then nseq=0
elseif s==2 then nseq=1
elseif s==4 then nseq=2
elseif s==8 then nseq=3
else nseq=4
end
Duel.MoveSequence(c,nseq)
end
function cm.valtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
\ No newline at end of file
--妖幻幼精 空无
local m=33700774
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x344a),2,true,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCost(cm.spcost2)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
end
function cm.spcfilter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x344a) and c:IsAbleToDeckAsCost() and (Duel.GetMZoneCount(tp,c,tp)>0 or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
end
function cm.cfilter(c)
return Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spfilter2(c,e,tp)
return c:IsSetCard(0x344a) and (c:IsCanBeSpecialSummoned(e,0,tp,true,false) or not c:IsForbidden())
end
function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetMatchingGroup(cm.spcfilter2,tp,LOCATION_MZONE,0,nil,e,tp)
local g2=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
if chk==0 then return g1:GetCount()>0 and g2:GetCount()>0 end
local ct=g2:GetClassCount(Card.GetCode)
local g3=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=g1:Select(tp,1,1,nil):GetFirst()
g1:RemoveCard(tc)
g3:AddCard(tc)
if ((Duel.GetMZoneCount(tp,tc,tp)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0) or (Duel.GetLocationCount(tp,LOCATION_SZONE)>1) or g1:IsExists(cm.cfilter,1,nil)) and ct>1 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g4=g1:Select(tp,1,1,nil)
g3:Merge(g4)
end
Duel.ConfirmCards(1-tp,g3)
Duel.SendtoDeck(g3,nil,2,REASON_COST)
e:SetLabel(g3:GetCount())
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=e:GetLabel()
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft1+ft2<ct then return end
local g=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()<ct then return end
for i=1,ct do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil):GetFirst()
g:RemoveCard(tc)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and (Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or not Duel.SelectYesNo(tp,aux.Stringid(m,3))) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.sprfilter(c,fc)
return c:IsFusionSetCard(0x344a) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function cm.sprfilter1(c,tp,g)
return g:IsExists(cm.sprfilter2,1,c,tp,c)
end
function cm.sprfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,0,nil,c)
return g:IsExists(cm.sprfilter1,1,nil,tp,g)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:FilterSelect(tp,cm.sprfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=g:FilterSelect(tp,cm.sprfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.thfilter(c)
return aux.IsCodeListed(c,33700760) and c:IsType(TYPE_FIELD) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--妖幻幼精 御卫
local m=33700775
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x344a),2,true,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
e1:SetValue(SUMMON_TYPE_FUSION)
c:RegisterEffect(e1)
--dis
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.discon)
e2:SetCost(cm.discost)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackAbove(1) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(0)
c:RegisterEffect(e1,true)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD,1,nil) end
local sg=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,sg,sg:GetCount(),0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local sg,c=Duel.GetMatchingGroup(aux.disfilter1,tp,0,LOCATION_ONFIELD,nil),e:GetHandler()
if sg:GetCount()<=0 then return end
for tc in aux.Next(sg) do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_EFFECT)
e3:SetValue(RESET_TURN_SET)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetOperation(cm.adop)
e4:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e4:SetCountLimit(1)
tc:RegisterEffect(e4)
end
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetOwner())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.sprfilter(c,fc)
return c:IsFusionSetCard(0x344a) and c:IsCanBeFusionMaterial(fc) and c:IsAbleToGraveAsCost()
end
function cm.sprfilter1(c,tp,g)
return g:IsExists(cm.sprfilter2,1,c,tp,c)
end
function cm.sprfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,0,nil,c)
return g:IsExists(cm.sprfilter1,1,nil,tp,g)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:FilterSelect(tp,cm.sprfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=g:FilterSelect(tp,cm.sprfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
\ No newline at end of file
--妖幻幼精 库悠
local m=33700776
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,cm.ffilter1,cm.ffilter2,true)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(SUMMON_TYPE_FUSION)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--sp
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--d damage
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,1)
e3:SetValue(cm.val)
c:RegisterEffect(e3)
end
function cm.val(e,re,dam,r,rp,rc)
return dam*2
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x344a) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.setfilter(c)
return c:IsSetCard(0x344a) and not c:IsForbidden() and c:IsType(TYPE_MONSTER)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local mt=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local ct=math.min(ft,mt)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
if g:GetCount()<=0 or Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)<=0 then return end
ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
mt=Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)
ct=math.min(ft,mt)
if Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,ct,nil)
for tc in aux.Next(tg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function cm.ffilter1(c)
return c:IsLevel(4) and c:IsFusionSetCard(0x344a)
end
function cm.ffilter2(c)
return (c:IsLevel(6) and c:IsFusionSetCard(0x344a)) or c:IsSetCard(0x644a)
end
function cm.matfilter(c)
return (cm.ffilter1(c) or cm.ffilter2(c))
and c:IsAbleToGraveAsCost() and c:IsCanBeFusionMaterial()
end
function cm.spfilter1(c,tp,g)
return g:IsExists(cm.spfilter2,1,c,tp,c)
end
function cm.spfilter2(c,tp,mc)
return ((cm.ffilter1(c) and cm.ffilter2(mc))
or (cm.ffilter1(mc) and cm.ffilter2(c)))
and Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil)
return g:IsExists(cm.spfilter1,1,nil,tp,g)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:FilterSelect(tp,cm.spfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=g:FilterSelect(tp,cm.spfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_COST)
end
--妖幻幼精 美梦
local m=33700777
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x644a),2)
c:EnableReviveLimit()
--avoid damage
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetRange(LOCATION_PZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(0)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,0x1e0)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
--remove
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e4:SetTarget(cm.rmtg)
e4:SetOperation(cm.rmop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e5)
end
function cm.rmfilter(c,e,tp)
return c:GetSummonPlayer()==1-tp and c:IsAbleToRemove() and (not e or c:IsRelateToEffect(e))
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.rmfilter,1,nil,nil,tp) end
local g=eg:Filter(cm.rmfilter,nil,nil,tp)
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.rmfilter,nil,e,tp)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function cm.thfilter(c)
return (aux.IsCodeListed(c,33700760) or c:IsSetCard(0x344a) or c:IsSetCard(0x644a)) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--注目!缪恩的大魔法!
local m=33700778
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
cm.card_code_list={33700760}
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(33700770)
end
function cm.setfilter(c)
return c:IsSetCard(0x344a) and not c:IsForbidden()
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x344a) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if c:IsLocation(LOCATION_HAND) then ft=ft-1 end
local b1=Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_MZONE,0,1,nil) and ft>0
local b2=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_SZONE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b3=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if chk==0 then return b1 or b2 or b3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local ops={}
local opval={}
local off=1
if b1 then
ops[off]=aux.Stringid(m,1)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(m,2)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(m,3)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
e:SetCategory(0)
elseif sel==2 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_SZONE)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
else
e:SetProperty(0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
if sel==1 then
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_MZONE,0,1,ft,nil)
if g:GetCount()<=0 then return end
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
elseif sel==2 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_SZONE,0,1,ft,nil,e,tp)
if g:GetCount()<=0 then return end
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
else
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,math.min(ft,2),nil,e,tp)
if g:GetCount()<=0 then return end
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--感受!妖精的编年史!
local m=33700779
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
cm.card_code_list={33700760}
function cm.ctfilter(c)
return c:IsSetCard(0x344a) and c:IsFaceup() and c:GetType()==TYPE_SPELL+TYPE_CONTINUOUS
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(33700771)
end
function cm.thfilter(c)
return c:IsSetCard(0x344a) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.rmfilter(c)
return c:IsSetCard(0x344a) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(cm.ctfilter,tp,LOCATION_SZONE,0,nil)
if chk==0 then
if ct<=3 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,ct+1,nil)
else return
Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_GRAVE,0,1,nil)
end
end
if ct<=3 then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,ct+1,tp,LOCATION_GRAVE+LOCATION_DECK)
else
e:SetCategory(CATEGORY_REMOVE+CATEGORY_RECOVER+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
else
e:SetProperty(0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(cm.ctfilter,tp,LOCATION_SZONE,0,nil)
if ct<=3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if tg:GetCount()>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)~=0 then
Duel.ConfirmCards(1-tp,tg)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,ct,ct,nil)
if tg2:GetCount()>0 then
Duel.SendtoHand(tg2,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg2)
end
end
elseif ct==4 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_GRAVE,0,1,5,nil)
if rg:GetCount()<=0 then return end
Duel.HintSelection(rg)
local ct=Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
if ct<=0 then return end
local og=Duel.GetOperatedGroup()
local rec=og:Filter(Card.IsLevelAbove,nil,1):GetSum(Card.GetLevel)*300
if Duel.Recover(tp,rec,REASON_EFFECT)~=0 and ct==5 then
Duel.BreakEffect()
Duel.Draw(tp,3,REASON_EFFECT)
end
end
end
\ No newline at end of file
--祈愿!妖幻之翼降诞!
local m=33700780
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.gb then
cm.gb=true
--exmater
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTarget(cm.mattg)
e2:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e2:SetTargetRange(0,0)
e2:SetValue(cm.matval)
Duel.RegisterEffect(e2,0)
cm[0]=e2
cm[1]=0
end
end
cm.card_code_list={33700760}
function cm.cfilter(c)
return c:IsFaceup() and c:IsCode(33700772)
end
function cm.tgfilter(c,tp)
return c:IsSetCard(0x344a) and c:IsAbleToGrave() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.fufilter(c,e,tp)
return c:IsSetCard(0x644a) and c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial()
end
function cm.matval(e,c,mg)
return c:IsSetCard(0x644a)
end
function cm.mattg(e,c)
return c:IsSetCard(0x344a) and c:IsControler(cm[1])
end
function cm.lkfilter(c)
return c:IsSpecialSummonable(SUMMON_TYPE_LINK) and c:IsSetCard(0x644a)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp)
and Duel.IsExistingMatchingCard(cm.fufilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
cm[0]:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
cm[1]=tp
local b2=Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil)
cm[0]:SetTargetRange(0,0)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,0))
else
op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_TOGRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
e:SetLabel(op)
if Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,1,nil) then
e:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
else
e:SetProperty(0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_ONFIELD+LOCATION_HAND,0,2,nil,tp)
and Duel.IsExistingMatchingCard(cm.fufilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
cm[0]:SetTargetRange(LOCATION_HAND,LOCATION_HAND)
cm[1]=tp
local b2=Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil)
if not b1 and not b2 then return end
local op=e:GetLabel()
if op==0 and b1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,2,2,nil,tp)
if Duel.SendtoGrave(tg,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.fufilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
Duel.SpecialSummon(sg,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
sg:GetFirst():CompleteProcedure()
end
end
if op==1 and b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_LINK)
end
cm[0]:SetTargetRange(0,0)
end
\ No newline at end of file
--欢迎!妖精的避难所!
local m=33700781
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--rec
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetOperation(cm.recop)
c:RegisterEffect(e2)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_FZONE)
e3:SetTarget(cm.destg)
e3:SetValue(cm.value)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(cm.setcon)
e4:SetTarget(cm.settg)
e4:SetOperation(cm.setop)
c:RegisterEffect(e4)
end
cm.card_code_list={33700760}
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
end
function cm.setfilter(c)
return c:IsSetCard(0x344a) and not c:IsForbidden() and c:IsType(TYPE_MONSTER)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.value(e,c)
return cm.dfilter(c,e:GetHandlerPlayer())
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local g=e:GetLabelObject()
Duel.SendtoHand(g,nil,REASON_EFFECT)
g:DeleteGroup()
end
function cm.dfilter(c,tp)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x344a)
and not c:IsReason(REASON_REPLACE) and c:IsControler(tp) and c:IsAbleToHand()
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not eg:IsContains(e:GetHandler())
and eg:IsExists(cm.dfilter,1,nil,tp) end
local g=eg:Filter(cm.dfilter,nil,tp)
g:KeepAlive()
e:SetLabelObject(g)
return true
end
function cm.cfilter(c,tp)
return c:IsSetCard(0x344a) and c:GetSummonLocation()==LOCATION_SZONE and c:GetPreviousControler()==tp and c:IsLevelAbove(1)
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.cfilter,1,nil,tp) then
local sum=eg:Filter(cm.cfilter,nil,tp):GetSum(Card.GetLevel)
Duel.Hint(HINT_CARD,0,m)
Duel.Recover(tp,sum*500,REASON_EFFECT)
end
end
\ No newline at end of file
--欢迎!妖精的夜岗哨!
local m=33700782
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_FZONE)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--des
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--set
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(cm.setcon)
e4:SetTarget(cm.settg)
e4:SetOperation(cm.setop)
c:RegisterEffect(e4)
end
cm.card_code_list={33700760}
function cm.setcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil) end
end
function cm.setfilter(c)
return c:IsSetCard(0x344a) and not c:IsForbidden() and c:IsType(TYPE_MONSTER)
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil):GetFirst()
if tc and Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD,0,1)
end
end
function cm.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp and c:IsPreviousLocation(LOCATION_MZONE)
and c:IsPreviousSetCard(0x344a)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function cm.rcfilter(c,tp)
return c:IsSetCard(0x344a) and c:GetSummonLocation()==LOCATION_SZONE and c:GetPreviousControler()==tp and c:IsLevelAbove(1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.rcfilter,1,nil,tp) and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(g)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
--歌唱!妖精的时之诗!
local m=33700783
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--immune
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.econ)
e1:SetValue(cm.efilter)
c:RegisterEffect(e1)
--cannot set
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,1)
e2:SetTarget(aux.TRUE)
e2:SetCondition(aux.AND(cm.m1con,cm.effcon))
e2:SetLabel(5)
c:RegisterEffect(e2)
--cannot set
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_MSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,1)
e4:SetTarget(aux.TRUE)
e4:SetCondition(aux.AND(cm.m2con,cm.effcon))
e4:SetLabel(3)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_SSET)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_TURN_SET)
c:RegisterEffect(e6)
local e7=e4:Clone()
e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e7:SetTarget(cm.sumlimit)
c:RegisterEffect(e7)
--activate cost
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_ACTIVATE_COST)
e8:SetRange(LOCATION_SZONE)
e8:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e8:SetTargetRange(0,1)
e8:SetCondition(aux.AND(cm.m1con,cm.effcon))
e8:SetCost(cm.costchk)
e8:SetLabel(7)
e8:SetOperation(cm.costop)
c:RegisterEffect(e8)
--accumulate
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(0x10000000+m)
e9:SetRange(LOCATION_SZONE)
e9:SetCondition(aux.AND(cm.m1con,cm.effcon))
e9:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e9:SetTargetRange(0,1)
e9:SetLabel(7)
c:RegisterEffect(e9)
--skip turn
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(m,0))
e10:SetType(EFFECT_TYPE_IGNITION)
e10:SetRange(LOCATION_SZONE)
e10:SetCondition(cm.effcon)
e10:SetLabel(10)
e10:SetCost(cm.skipcost)
e10:SetTarget(cm.skiptg)
e10:SetOperation(cm.skipop)
c:RegisterEffect(e10)
end
cm.card_code_list={33700760}
function cm.skipcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.skiptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(1-tp,EFFECT_SKIP_TURN) end
end
function cm.skipop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
Duel.RegisterEffect(e1,tp)
end
function cm.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,23851033)
return Duel.CheckLPCost(tp,ct*800)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.PayLPCost(tp,800)
end
function cm.m1con(e)
return Duel.GetCurrentPhase()==PHASE_MAIN1
end
function cm.m2con(e)
return Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp)
return bit.band(sumpos,POS_FACEDOWN)>0
end
function cm.effcon(e)
return Duel.IsExistingMatchingCard(cm.effilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,e:GetLabel(),nil)
end
function cm.effilter(c)
return c:IsFaceup() and (c:IsSetCard(0x344a) or c:IsSetCard(0x644a))
end
function cm.econ(e)
return Duel.IsExistingMatchingCard(cm.ecfilter,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,nil)
end
function cm.ecfilter(c)
return c:IsFaceup() and c:IsCode(33700773)
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetOwnerPlayer()
end
\ No newline at end of file
Senya=Senya or {}
local cm=Senya
--7CG universal scripts
--test parts
aux.BeginPuzzle=aux.TRUE
cm.delay=0x14000
cm.fix=0x40400
cm.m=37564765
json=nil
--json lib
xpcall(function() json=require("expansions/script/json") end,function() json=require("script/json") end)
function cm.DescriptionInNanahira(id)
id=id or 0
return 37564765*16+id
end
cm.loaded_metatable_list=cm.loaded_metatable_list or {}
function cm.LoadMetatable(code)
local m1=_G["c"..code]
if m1 then return m1 end
local m2=cm.loaded_metatable_list[code]
if m2 then return m2 end
_G["c"..code]={}
if pcall(function() dofile("expansions/script/c"..code..".lua") end) or pcall(function() dofile("script/c"..code..".lua") end) then
local mt=_G["c"..code]
_G["c"..code]=nil
if mt then
cm.loaded_metatable_list[code]=mt
return mt
end
else
_G["c"..code]=nil
end
end
function cm.check_set(c,setcode,v,f,...)
local codet=nil
if type(c)=="number" then
codet={c}
elseif type(c)=="table" then
codet=c
elseif type(c)=="userdata" then
local f=f or Card.GetCode
codet={f(c)}
end
local ncodet={...}
for i,code in pairs(codet) do
for i,ncode in pairs(ncodet) do
if code==ncode then return true end
end
local mt=cm.LoadMetatable(code)
if mt and mt["Senya_name_with_"..setcode] and (not v or mt["Senya_name_with_"..setcode]==v) then return true end
end
return false
end
function cm.check_set_elem(c)
return cm.check_set(c,"elem")
end
function cm.check_fusion_set_elem(c)
if c:IsHasEffect(6205579) then return false end
return cm.check_set(c,"elem",nil,Card.GetFusionCode)
end
function cm.check_set_rose(c)
return cm.check_set(c,"rose")
end
function cm.check_set_sawawa(c)
return cm.check_set(c,"sawawa")
end
function cm.check_set_prism(c)
return cm.check_set(c,"prism")
end
function cm.check_fusion_set_prism(c)
if c:IsHasEffect(6205579) then return false end
return cm.check_set(c,"prism",nil,Card.GetFusionCode)
end
function cm.check_set_prim(c)
return cm.check_set(c,"prim")
end
function cm.check_set_sayuri(c)
return cm.check_set(c,"sayuri") or c:IsHasEffect(37564900)
end
function cm.check_link_set_sayuri(c)
return cm.check_set(c,"sayuri",nil,Card.GetLinkCode) or c:IsHasEffect(37564900)
end
function cm.check_set_remix(c)
return cm.check_set(c,"remix")
end
function cm.check_set_3L(c)
if c:IsHasEffect(37564800) then return true end
local codet={c:GetCode()}
for j,code in pairs(codet) do
local mt=cm.LoadMetatable(code)
if mt then
for str,v in pairs(mt) do
if type(str)=="string" and str:find("_3L") and v then return true end
end
end
end
return false
end
function cm.check_link_set_3L(c)
if c:IsHasEffect(37564800) then return true end
local codet={c:GetLinkCode()}
for j,code in pairs(codet) do
local mt=cm.LoadMetatable(code)
if mt then
for str,v in pairs(mt) do
if type(str)=="string" and str:find("_3L") and v then return true end
end
end
end
return false
end
function cm.check_fusion_set_3L(c)
if c:IsHasEffect(6205579) then return false end
if c:IsHasEffect(37564800) then return true end
local codet={c:GetFusionCode()}
for j,code in pairs(codet) do
local mt=cm.LoadMetatable(code)
if mt then
for str,v in pairs(mt) do
if type(str)=="string" and str:find("_3L") and v then return true end
end
end
end
return false
end
function cm.RegisterSingleEffect(c,setcd)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(setcd)
c:RegisterEffect(e1)
return e1
end
function cm.GetValueType(v)
local t=type(v)
if t=="userdata" then
local mt=getmetatable(v)
if mt==Group then return "Group"
elseif mt==Effect then return "Effect"
else return "Card" end
else return t end
end
function cm.CheckGroupRecursive(c,sg,g,f,min,max,ext_params)
sg:AddCard(c)
local res=(#sg>=min and #sg<=max and f(sg,table.unpack(ext_params)))
or (#sg<max and g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params))
sg:RemoveCard(c)
return res
end
function cm.CheckGroup(g,f,cg,min,max,...)
local min=min or 1
local max=max or #g
if min>max then return false end
local ext_params={...}
local sg=Group.CreateGroup()
if cg then sg:Merge(cg) end
if #sg>=min and #sg<=max and f(sg,...) then return true end
return g:IsExists(cm.CheckGroupRecursive,1,sg,sg,g,f,min,max,ext_params)
end
function cm.SelectGroupNew(tp,desc,cancelable,g,f,cg,min,max,...)
local min=min or 1
local max=max or #g
local ext_params={...}
local sg=Group.CreateGroup()
local cg=cg or Group.CreateGroup()
sg:Merge(cg)
local ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
while #sg<max and #ag>0 do
local seg=sg:Clone()
seg:Sub(cg)
local finish=(#sg>=min and #sg<=max and f(sg,...))
local cancel=cancelable and not finish
local dmin=#sg
local dmax=math.min(max,#g)
local tc=nil
repeat
Duel.Hint(HINT_SELECTMSG,tp,desc)
tc=ag:SelectUnselect(sg,tp,finish,cancel,dmin,dmax)
until not tc or ag:IsContains(tc) or seg:IsContains(tc)
if not tc then
if not finish then return end
break
end
if sg:IsContains(tc) then
sg:RemoveCard(tc)
else
sg:AddCard(tc)
end
ag=g:Filter(cm.CheckGroupRecursive,sg,sg,g,f,min,max,ext_params)
end
return sg
end
function cm.SelectGroup(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroupNew(tp,desc,false,g,f,cg,min,max,...)
end
function cm.SelectGroupWithCancel(tp,desc,g,f,cg,min,max,...)
return cm.SelectGroupNew(tp,desc,true,g,f,cg,min,max,...)
end
--updated overlay
function cm.OverlayCard(c,tc,xm,nchk)
if not nchk and (not c:IsLocation(LOCATION_MZONE) or c:IsFacedown() or not c:IsType(TYPE_XYZ) or tc:IsType(TYPE_TOKEN)) then return end
if tc:IsStatus(STATUS_LEAVE_CONFIRMED) then
tc:CancelToGrave()
end
if tc:GetOverlayCount()>0 then
local og=tc:GetOverlayGroup()
if xm then
Duel.Overlay(c,og)
else
Duel.SendtoGrave(og,REASON_RULE)
end
end
Duel.Overlay(c,tc)
end
function cm.OverlayFilter(c,nchk)
return nchk or not c:IsType(TYPE_TOKEN)
end
function cm.OverlayGroup(c,g,xm,nchk)
if not nchk and (not c:IsLocation(LOCATION_MZONE) or c:IsFacedown() or #g<=0 or not c:IsType(TYPE_XYZ)) then return end
local tg=g:Filter(cm.OverlayFilter,nil,nchk)
if #tg==0 then return end
local og=Group.CreateGroup()
for tc in aux.Next(tg) do
if tc:IsStatus(STATUS_LEAVE_CONFIRMED) then
tc:CancelToGrave()
end
og:Merge(tc:GetOverlayGroup())
end
if #og>0 then
if xm then
Duel.Overlay(c,og)
else
Duel.SendtoGrave(og,REASON_RULE)
end
end
Duel.Overlay(c,tg)
end
function cm.CheckFieldFilter(g,tp,c,f,...)
if c:IsLocation(LOCATION_EXTRA) then
return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 and (not f or f(g,...))
else
return Duel.GetMZoneCount(tp,g,tp)>0 and (not f or f(g,...))
end
end
function cm.MustMaterialCheck(v,tp,code)
return aux.MustMaterialCheck(v,tp,code)
end
--xyz summon of prim
function cm.AddXyzProcedureRank(c,rk,f,minct,maxct,xm,exop,...)
local ext_params={...}
return cm.AddXyzProcedureCustom(c,cm.XyzProcedureRankFilter(rk,f,ext_params),cm.XyzProcedureRankCheck,minct,maxct,xm,exop)
end
function cm.XyzProcedureRankFilter(rk,f,ext_params)
return function(c,xyzc)
return c:IsXyzType(TYPE_XYZ) and (not rk or c:GetRank()==rk) and (not f or f(c,xyzc,table.unpack(ext_params)))
end
end
function cm.XyzProcedureRankCheck(g,xyzc)
return g:GetClassCount(Card.GetRank)==1
end
function cm.XyzProcedureCustomCheck(g,xyzc,tp,gf)
if g:IsExists(aux.TuneMagicianCheckX,nil,g,EFFECT_TUNE_MAGICIAN_X) then return false end
return not gf or gf(g,xyzc,tp)
end
function cm.AddXyzProcedureCustom(c,func,gf,minc,maxc,xm,exop,...)
local ext_params={...}
c:EnableReviveLimit()
local maxc=maxc or minc
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.XyzProcedureCustomCondition(func,gf,minc,maxc,ext_params))
e1:SetTarget(cm.XyzProcedureCustomTarget(func,gf,minc,maxc,ext_params))
e1:SetOperation(cm.XyzProcedureCustomOperation(xm,exop))
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
return e1
end
function cm.XyzProcedureCustomFilter(c,xyzcard,func,ext_params)
if c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED) and c:IsFacedown() then return false end
return c:IsCanBeXyzMaterial(xyzcard) and (not func or func(c,xyzcard,table.unpack(ext_params)))
end
function cm.XyzProcedureCustomCondition(func,gf,minct,maxct,ext_params)
return function(e,c,og,min,max)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local minc=minct or 2
local maxc=maxct or minct or 63
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
local mg=nil
if og then
mg=og:Filter(cm.XyzProcedureCustomFilter,nil,c,func,ext_params)
else
mg=Duel.GetMatchingGroup(cm.XyzProcedureCustomFilter,tp,LOCATION_MZONE,0,nil,c,func,ext_params)
end
local sg=Group.CreateGroup()
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
if not mg:IsContains(tc) then return false end
sg:AddCard(tc)
end
return maxc>=minc and cm.CheckGroup(mg,cm.CheckFieldFilter,sg,minc,maxc,tp,c,cm.XyzProcedureCustomCheck,c,tp,gf)
end
end
function cm.XyzProcedureCustomTarget(func,gf,minct,maxct,ext_params)
return function(e,tp,eg,ep,ev,re,r,rp,chk,c,og,min,max)
local g=nil
if og and not min then
g=og
else
local mg=nil
if og then
mg=og:Filter(cm.XyzProcedureCustomFilter,nil,c,func,ext_params)
else
mg=Duel.GetMatchingGroup(cm.XyzProcedureCustomFilter,tp,LOCATION_MZONE,0,nil,c,func,ext_params)
end
local minc=minct or 2
local maxc=maxct or minct or 63
if min then
minc=math.max(minc,min)
maxc=math.min(maxc,max)
end
local sg=Group.CreateGroup()
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
sg:AddCard(tc)
end
g=cm.SelectGroupWithCancel(tp,HINTMSG_XMATERIAL,mg,cm.CheckFieldFilter,sg,minc,maxc,tp,c,cm.XyzProcedureCustomCheck,c,tp,gf)
end
if g then
g:KeepAlive()
e:SetLabelObject(g)
return true
else return false end
end
end
function cm.XyzProcedureCustomOperation(xm,exop)
return function(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
local g=e:GetLabelObject()
if exop then exop(e,tp,g,c) end
c:SetMaterial(g)
cm.OverlayGroup(c,g,xm,true)
g:DeleteGroup()
end
end
cm.proc_check_list={
[Duel.Destroy]=Card.IsDestructable,
[Duel.SendtoDeck]=Card.IsAbleToDeckOrExtraAsCost,
[Duel.SendtoExtraP]=Card.IsAbleToDeckOrExtraAsCost,
[Duel.SendtoHand]=Card.IsAbleToHandAsCost,
[Duel.SendtoGrave]=Card.IsAbleToGraveAsCost,
[Duel.Remove]=Card.IsAbleToRemoveAsCost,
[Duel.Release]=Card.IsReleasable,
}
cm.proc_param_list={
[Duel.Destroy]={REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.SendtoDeck]={nil,2,REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.SendtoExtraP]={nil,REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.SendtoHand]={nil,REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.SendtoGrave]={REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.Remove]={POS_FACEUP,REASON_COST+REASON_FUSION+REASON_MATERIAL},
[Duel.Release]={REASON_COST+REASON_FUSION+REASON_MATERIAL},
}
--touch fusion proc using fusion material
function cm.AddSelfFusionProcedure(c,loc,opf,fonly,sonly)
local loc=loc or LOCATION_MZONE
c:EnableReviveLimit()
local e2=Effect.CreateEffect(c)
e2:SetDescription(cm.DescriptionInNanahira(0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(cm.SelfFusionProcedureCondition(loc,opf))
e2:SetOperation(cm.SelfFusionProcedureOperation(loc,opf))
c:RegisterEffect(e2)
if sonly then
local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_SINGLE)
e22:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e22:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e22)
elseif fonly then
local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_SINGLE)
e22:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e22:SetCode(EFFECT_SPSUMMON_CONDITION)
e22:SetValue(aux.fuslimit)
c:RegisterEffect(e22)
end
return e2
end
function cm.SelfFusionProcedureFilter(c,fc,opf)
local f=cm.proc_check_list[opf]
return c:IsCanBeFusionMaterial(fc) and (not f or f(c))
end
function cm.SelfFusionProcedureCondition(loc,opf)
return function(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.SelfFusionProcedureFilter,tp,loc,0,c,c,opf)
return c:CheckFusionMaterial(mg,nil,chkf)
end
end
function cm.SelfFusionProcedureOperation(loc,opf)
return function(e,tp,eg,ep,ev,re,r,rp,c)
local chkf=tp
local mg=Duel.GetMatchingGroup(cm.SelfFusionProcedureFilter,tp,loc,0,c,c,opf)
local g=Duel.SelectFusionMaterial(tp,c,mg,nil,chkf)
c:SetMaterial(g)
local params=cm.proc_param_list[opf]
opf(g,table.unpack(params))
end
end
--mokou reborn
function cm.MokouReborn(c,ct,cd,eff,con,exop,excon,comp)
local comp=comp or false
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(ct,cd)
e2:SetCondition(cm.MokouRebornCondition(eff,con))
e2:SetTarget(cm.MokouRebornTarget(comp))
e2:SetOperation(cm.MokouRebornOperation(exop,excon,comp))
c:RegisterEffect(e2)
return e2
end
function cm.MokouRebornCondition(eff,con)
if eff then
return function(e,tp,eg,ep,ev,re,r,rp)
return (e:GetHandler():GetReason() & 0x41)==0x41 and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
else
return function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_DESTROY) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
end
end
function cm.MokouRebornTarget(comp)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,comp,comp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
end
function cm.MokouRebornOperation(exop,excon,comp)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetMZoneCount(tp)<=0 then return end
if not c:IsRelateToEffect(e) or not c:IsCanBeSpecialSummoned(e,0,tp,comp,comp) then return end
if Duel.SpecialSummon(c,0,tp,tp,comp,comp,POS_FACEUP)>0 and exop and (not excon or excon(e,tp,eg,ep,ev,re,r,rp)) then
exop(e,tp,eg,ep,ev,re,r,rp)
end
if comp then c:CompleteProcedure() end
end
end
--code lists
cm.csetlist={
"elem",
"sawawa",
"prism",
"prim",
"3L",
"sayuri",
}
function cm.cgcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cgfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,1,nil)
end
function cm.cgfilter(c)
return cm.unifilter(c) and c:IsFaceup()
end
function cm.unifilter(c)
if not c:IsType(TYPE_MONSTER) then return false end
if c:IsCode(37564765) then return true end
for i,v in pairs(cm.csetlist) do
local chkf=cm["check_set_"..v]
if chkf(c) then return true end
end
return false
end
--rm mat cost
function cm.RemoveOverlayCost(ct)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST)
end
end
--discard hand cost
function cm.DiscardHandCost(ct,f,...)
local ext_params={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.DiscardHandCostFilter,tp,LOCATION_HAND,0,ct,e:GetHandler(),f,ext_params) end
Duel.DiscardHand(tp,cm.DiscardHandCostFilter,ct,ct,REASON_COST+REASON_DISCARD,e:GetHandler(),f,ext_params)
end
end
function cm.DiscardHandCostFilter(c,f,ext_params)
return c:IsDiscardable() and (not f or f(c,table.unpack(ext_params)))
end
--release cost
function cm.SelfReleaseCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.SelfRemoveCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.SelfToDeckCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckOrExtraAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function cm.SelfToGraveCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.SelfToHandCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHandAsCost() end
Duel.SendtoHand(e:GetHandler(),nil,REASON_COST)
end
function cm.SelfDiscardCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
--arrival condition
function cm.ArrivalCondition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,0,1,nil)
end
---check date dt="Mon" "Tue" etc
function cm.DateCheck(dt,excon)
return function(e,tp,eg,ep,ev,re,r,rp)
return dt==os.date("%a") and (not excon or excon(e,tp,eg,ep,ev,re,r,rp))
end
end
--copy effect c=getcard(nil=orcard) tc=sourcecard ht=showcard(bool) res=reset event(nil=no reset)
--ctlm=extra count limit
function cm.CopyStatusAndEffect(e,c,tc,ht,res,resct,ctlm)
local c=c or e:GetHandler()
local res=res or RESET_EVENT+0x1fe0000
local resct=resct or 1
local cid=nil
if tc and c:IsFaceup() and c:IsRelateToEffect(e) then
local code=tc:GetOriginalCode()
local atk=tc:GetBaseAttack()
local def=tc:GetBaseDefense()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(res,resct)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(res,resct)
e3:SetCode(EFFECT_SET_BASE_ATTACK)
e3:SetValue(atk)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetReset(res,resct)
e4:SetCode(EFFECT_SET_BASE_DEFENSE)
e4:SetValue(def)
c:RegisterEffect(e4)
if not tc:IsType(TYPE_TRAPMONSTER) then
if ctlm then
cm.CopyEffectExtraCount(c,ctlm,code,res,resct)
else
c:CopyEffect(code,res,resct)
end
end
if ht then
Duel.Hint(HINT_CARD,0,code)
end
end
return cid
end
--copyeffect with extra count limit
function cm.CopyEffectExtraCount(c,ctlm,code,res,resct)
if not ctlm then return c:CopyEffect(code,res,resct) end
local et={}
local ef=Effect.SetCountLimit
local rf=Card.RegisterEffect
Effect.SetCountLimit=cm.replace_set_count_limit(et)
Card.RegisterEffect=cm.replace_register_effect(et,ctlm,ef,rf)
c:RegisterFlagEffect(37564768,res,0,resct,ctlm)
local cid=c:CopyEffect(code,res,resct)
Effect.SetCountLimit=ef
Card.RegisterEffect=rf
c:ResetFlagEffect(37564768)
return cid
end
function cm.replace_set_count_limit(et)
return function(e,ct,cd)
et[e]={ct,cd}
end
end
function cm.replace_register_effect(et,ctlm,ef,rf)
return function(c,e,forced)
local t=et[e]
if t then
if e:IsHasType(0x7e0) then
t[1]=math.max(t[1],ctlm)
end
ef(e,table.unpack(t))
end
rf(c,e,forced)
end
end
--universals for sww
--swwss(ct=discount exf=extra function)
function cm.SawawaCommonEffect(c,ct,ctxm,ctsm,exf)
--cm.setreg(c,nil,37564299)
if ctxm then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
end
if ctsm then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetValue(1)
c:RegisterEffect(e3)
end
--ss
local e4=Effect.CreateEffect(c)
e4:SetDescription(37564765,0)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e4:SetCost(cm.SawawaSpsummonCost(ct,exf))
e4:SetTarget(cm.SelfSpsummonTarget)
e4:SetOperation(cm.SelfSpsummonOperation)
c:RegisterEffect(e4)
return e4
end
function cm.SawawaSpsummonCost(ct,exf)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if e:GetHandler():IsLocation(LOCATION_HAND) and Duel.IsPlayerAffectedByEffect(tp,37564218) then return true end
if chk==0 then return Duel.IsExistingMatchingCard(cm.SawawaSpsummonCostFilter,tp,LOCATION_HAND,0,ct,e:GetHandler(),e,exf) end
Duel.DiscardHand(tp,cm.SawawaSpsummonCostFilter,ct,ct,REASON_COST,e:GetHandler(),e,exf)
end
end
function cm.SelfSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.SelfSpsummonOperation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.SawawaSpsummonCostFilter(c,e,exf)
return (cm.check_set_sawawa(c) or (exf and exf(c))) and not c:IsCode(e:GetHandler():GetOriginalCode()) and c:IsAbleToGraveAsCost()
end
--for judge blank extra
function cm.CheckNoExtra(e,tp)
tp=tp or e:GetHandlerPlayer()
return Duel.GetFieldGroupCount(tp,LOCATION_EXTRA,0)==0
end
--for sww rm grave
function cm.SawawaRemoveCostFilter(c)
return cm.check_set_sawawa(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function cm.SawawaRemoveCost(ct)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.SawawaRemoveCostFilter,tp,LOCATION_GRAVE,0,ct,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.SawawaRemoveCostFilter,tp,LOCATION_GRAVE,0,ct,ct,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
end
--universals for bm
--bmss ctg=category istg=is-target-effect
function cm.PrismCommonEffect(c,tg,op,istg,ctg)
--cm.setreg(c,nil,37564573)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(37564765,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOHAND)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_HAND)
e4:SetCost(cm.PrismSpsummonCost(c:GetOriginalCode()))
e4:SetTarget(cm.PrismSpsummonTarget)
e4:SetOperation(cm.PrismSpsummonOperation)
c:RegisterEffect(e4)
local e1=nil
if op then
e1=Effect.CreateEffect(c)
if ctg then e1:SetCategory(ctg) end
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
if istg then
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+cm.delay)
else
e1:SetProperty(cm.delay)
end
e1:SetCondition(cm.PrismSpsummonCheck)
if tg then e1:SetTarget(tg) end
e1:SetOperation(op)
c:RegisterEffect(e1)
end
return e1
end
function cm.PrismSpsummonFilter(c,tp)
return c:IsAbleToHand() and cm.CheckPrism(c) and c:IsFaceup() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.PrismSpsummonCost(cd)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if not cd then return false end
if chk==0 then return Duel.GetFlagEffect(tp,cd)==0 end
Duel.RegisterFlagEffect(tp,cd,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.PrismSpsummonTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.PrismSpsummonFilter(chkc,tp) end
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingTarget(cm.PrismSpsummonFilter,tp,LOCATION_MZONE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,cm.PrismSpsummonFilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.PrismSpsummonOperation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)>0 then
Duel.BreakEffect()
if Duel.SpecialSummonStep(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP) then
e:GetHandler():RegisterFlagEffect(37564499,RESET_EVENT+0x1fe0000,0,1)
Duel.SpecialSummonComplete()
end
end
end
end
function cm.PrismSpsummonCheck(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(37564499)>0
end
--check if is bm
function cm.CheckPrism(c)
return cm.check_set_prism(c) and c:IsType(TYPE_MONSTER)
end
--for condition of damchk
function cm.PrismDamageCheckCondition(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattleTarget()~=nil and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
end
--damage chk for bm
--1=remove 2=extraattack 3=atk3000 4=draw
function cm.PrismDamageCheckOperation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)==0 then return end
local ct=e:GetLabel()
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if ct==0 then return end
if c:IsRelateToEffect(e) and c:IsFaceup() then
local exte={c:IsHasEffect(37564427)}
for _,te in ipairs(exte) do
if Duel.SelectEffectYesNo(tp,te:GetHandler()) then
Duel.Hint(HINT_CARD,0,te:GetHandler():GetOriginalCode())
ct=ct+1
end
end
Duel.ConfirmDecktop(tp,ct)
local g=Duel.GetDecktopGroup(tp,ct)
local ag=g:Filter(cm.CheckPrism,nil)
if #ag>0 then
local val={0}
for tc in aux.Next(ag) do
val[1]=val[1]+tc:GetTextAttack()
if tc.bm_check_operation and (not tc.bm_check_condition or tc.bm_check_condition(e,tp,eg,ep,ev,re,r,rp)) then
Duel.Hint(HINT_CARD,0,tc:GetOriginalCode())
tc.bm_check_operation(e,tp,eg,ep,ev,re,r,rp,val)
end
end
if val[1]>0 and c:IsRelateToBattle() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(0x1fe1000+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(val[1])
c:RegisterEffect(e1)
end
if Duel.SelectYesNo(tp,aux.Stringid(37564765,2)) then
local thg=ag:Filter(cm.PrismCheckAddHand,nil)
if #thg>0 then
local thc=thg:Select(tp,1,1,nil)
Duel.SendtoHand(thc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thc)
end
end
end
Duel.ShuffleDeck(tp)
end
end
function cm.PrismCheckAddHand(c)
return c:IsAbleToHand() and c:IsLocation(LOCATION_DECK)
end
--bm attack oppolimit
function cm.PrismDamageCheckRegister(c,lm)
local e2=nil
if lm then
e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(cm.PrismActivateLimit)
e2:SetCondition(cm.PrismAttackCondition)
c:RegisterEffect(e2)
end
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_EXTRA_ATTACK)
e4:SetValue(cm.PrismExtraAttackCount)
c:RegisterEffect(e4)
return e4,e2
end
function cm.PrismActivateLimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function cm.PrismAttackCondition(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function cm.PrismExtraAttackCount(e,c)
return c:GetFlagEffect(37564498)
end
--for cost of rmex
function cm.PrismRemoveExtraCostFilter(c)
return cm.CheckPrism(c) and c:IsAbleToRemoveAsCost()
end
function cm.PrismRemoveExtraCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.PrismRemoveExtraCostfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.PrismRemoveExtraCostfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
--for release bm L5
--fr=must be ssed
function cm.PrismAdvanceCommonEffect(c,fr)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37564765,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.PrismProcCondition)
e1:SetOperation(cm.PrismProcOperation)
c:RegisterEffect(e1)
if fr then
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
end
return e1
end
function cm.PrismProcFilter(c,tp)
return cm.CheckPrism(c) and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.PrismProcCondition(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.CheckReleaseGroup(tp,cm.PrismProcFilter,1,nil,tp)
end
function cm.PrismProcOperation(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectReleaseGroup(tp,cm.PrismProcFilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
--prism xyz multi-count xyz proc
function cm.PrismXyzProcedure(c,min,max)
cm.AddXyzProcedureCustom(c,cm.PrismXyzFilter,cm.PrismXyzCheck(min,max),1,max)
end
function cm.PrismXyzFilter(c,xyzc)
return c:IsXyzLevel(xyzc,3) and cm.check_set_prism(c)
end
function cm.PrismXyzCheck(min,max)
return function(g)
for i=min,math.min(max,#g*2) do
if g:CheckWithSumEqual(cm.PrismXyzValue,i,#g,#g) then return true end
end
return false
end
end
function cm.PrismXyzValue(c)
local v=1
if c:IsHasEffect(37564499) then v=(v | 0x20000) end
return v
end
--xyz monster atk drain effect
--con(usual)=condition tg(battledcard,card)=filter
--cost=cost
--xm=drain mat
function cm.AttackOverlayDrainEffect(c,con,tg,cost,ctlm,ctlmid,xm)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_BATTLE_START)
if ctlm then e5:SetCountLimit(ctlm,ctlmid) end
e5:SetCondition(cm.AttackOverlayDrainCondition(con,tg))
if cost then e5:SetCost(cost) end
e5:SetTarget(cm.AttackOverlayDrainTarget)
e5:SetOperation(cm.AttackOverlayDrainOperation(xm))
c:RegisterEffect(e5)
end
function cm.AttackOverlayDrainCondition(con,tg)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return (not con or con(e,tp,eg,ep,ev,re,r,rp)) and bc and (not tg or tg(bc,c)) and not bc:IsType(TYPE_TOKEN) and bc:IsAbleToChangeControler()
end
end
function cm.AttackOverlayDrainTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) end
end
function cm.AttackOverlayDrainOperation(xm)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToBattle() and not tc:IsImmuneToEffect(e) then
cm.OverlayCard(c,tc,xm)
end
end
end
--nanahira parts
function cm.Nanahira(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetRange(LOCATION_ONFIELD+LOCATION_GRAVE)
e2:SetValue(37564765)
c:RegisterEffect(e2)
end
function cm.NanahiraPendulum(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetRange(LOCATION_ONFIELD+LOCATION_GRAVE)
e2:SetValue(37564765)
c:RegisterEffect(e2)
local e6=e2:Clone()
e6:SetRange(LOCATION_PZONE)
c:RegisterEffect(e6)
local e1=Effect.CreateEffect(c)
e1:SetDescription(cm.DescriptionInNanahira(8))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,10000000)
e1:SetCondition(cm.PendConditionNanahira())
e1:SetOperation(cm.PendOperationNanahira())
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--register by default
local e2=Effect.CreateEffect(c)
e2:SetDescription(1160)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
c:RegisterEffect(e2)
end
function cm.NanahiraExtraPendulum(c,scon)
cm.NanahiraPendulum(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNSUMMONABLE_CARD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(1)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_REVIVE_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCondition(function(e)
if e:GetHandler():IsLocation(LOCATION_EXTRA) and e:GetHandler():IsFaceup() then return false end
return true
end)
e2:SetValue(1)
c:RegisterEffect(e2)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetValue(function(e,se,sp,st)
if scon and not scon(e,se,sp,st) then return false end
local c=e:GetHandler()
if c:IsFaceup() and c:IsLocation(LOCATION_EXTRA) and c:IsType(TYPE_FUSION) and (st & SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION then return false end
return c:IsHasEffect(EFFECT_REVIVE_LIMIT) or c:IsStatus(STATUS_PROC_COMPLETE) or (st & SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end)
c:RegisterEffect(e2)
end
function cm.PConditionFilterNanahira(c,e,tp,lscale,rscale,f,tc)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=aux.PendulumSummonableBool(c)
return lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden() and (not f or f(c,tc))
end
function cm.PendConditionNanahira()
return function(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local rpz=cm.GetPendulumCard(tp,1)
if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp)
if ft<=0 then return false end
local mft=Duel.GetMZoneCount(tp)
local eft=Duel.GetLocationCountFromEx(tp)
local g=nil
if og then
g=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale)
else
g=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale)
end
local ext1={c:IsHasEffect(37564541)}
local ext2={rpz:IsHasEffect(37564541)}
for i,te in pairs(ext1) do
local t=cm.order_table[te:GetValue()]
if (t.location==LOCATION_EXTRA and eft>0) or (t.location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterNanahira,tp,t.location,0,nil,e,tp,lscale,rscale,t.filter,te:GetHandler())
g:Merge(exg)
end
end
for i,te in pairs(ext2) do
local t=cm.order_table[te:GetValue()]
if (t.location==LOCATION_EXTRA and eft>0) or (t.location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterNanahira,tp,t.location,0,nil,e,tp,lscale,rscale,t.filter,te:GetHandler())
g:Merge(exg)
end
end
if mft<=0 then g=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then g:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
return #g>0
end
end
function cm.PendCheckNanahira(g,mft,maxlist)
if mft>0 and g:IsExists(Card.IsLocation,mft+1,nil,0xbf) then return false end
for loc,lct in pairs(maxlist) do
if lct>0 and g:IsExists(Card.IsLocation,lct+1,nil,loc) then return false end
end
return true
end
function cm.PendOperationNanahira()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local rpz=cm.GetPendulumCard(tp,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetUsableMZoneCount(tp)
local mft=Duel.GetMZoneCount(tp)
local eft=Duel.GetLocationCountFromEx(tp)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
mft=math.min(1,mft)
mft=math.min(1,eft)
ft=1
end
local tg=nil
local maxlist={}
if og then
tg=og:Filter(aux.PConditionFilter,1,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale)
end
local ext1={c:IsHasEffect(37564541)}
local ext2={rpz:IsHasEffect(37564541)}
for i,te in pairs(ext1) do
local t=cm.order_table[te:GetValue()]
if (t.location==LOCATION_EXTRA and eft>0) or (t.location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterNanahira,tp,t.location,0,nil,e,tp,lscale,rscale,t.filter,te:GetHandler())
tg:Merge(exg)
local mct=t.max_count
if mct and mct>0 and mct<ft then
maxlist[t.location]=mct
end
end
end
for i,te in pairs(ext2) do
local t=cm.order_table[te:GetValue()]
if (t.location==LOCATION_EXTRA and eft>0) or (t.location~=LOCATION_EXTRA and mft>0) then
local exg=Duel.GetMatchingGroup(cm.PConditionFilterNanahira,tp,t.location,0,nil,e,tp,lscale,rscale,t.filter,te:GetHandler())
tg:Merge(exg)
local mct=t.max_count
if mct and mct>0 and mct<ft then
maxlist[t.location]=mct
end
end
end
if mft<=0 then tg=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA) end
if eft<=0 then tg:Remove(Card.IsLocation,nil,LOCATION_EXTRA) end
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and math.min(c29724053[tp],eft) or eft
local left=maxlist[LOCATION_EXTRA]
if left then
maxlist[LOCATION_EXTRA]=math.min(left,ect)
else
maxlist[LOCATION_EXTRA]=ect
end
local g=cm.SelectGroup(tp,HINTMSG_SPSUMMON,tg,cm.PendCheckNanahira,nil,1,ft,mft,maxlist)
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
end
function cm.NanahiraPCardFilter(c)
return c.Senya_desc_with_nanahira
end
function cm.NanahiraPCardCheck(e)
return Duel.IsExistingMatchingCard(cm.NanahiraPCardFilter,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler())
end
function cm.NanahiraExistingCondition(og)
return function(e,tp)
tp=tp or e:GetHandlerPlayer()
return Duel.IsExistingMatchingCard(cm.NanahiraFilter,tp,LOCATION_ONFIELD,0,1,nil,og)
end
end
function cm.NanahiraFilter(c,og)
if not c:IsFaceup() then return false end
return c:GetOriginalCode()==37564765 or (c:IsCode(37564765) and not og)
end
function cm.NanahiraTrap(c,...)
local t={...}
for i,te in pairs(t) do
local e1=te:Clone()
if te:GetDescription()==0 then
e1:SetDescription(37564553*16)
end
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
if te:GetCode()==EVENT_FREE_CHAIN then
e1:SetHintTiming(0x1e0)
end
e1:SetCost(cm.SelfReleaseCost)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return e:GetHandler():IsSummonType(0x553)
end)
local op=te:GetOperation()
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():ReleaseEffectRelation(e)
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end)
c:RegisterEffect(e1)
end
end
--for infinity negate effect
function cm.NegateEffectModule(c,lmct,lmcd,cost,excon,exop,loc,force)
local e3=Effect.CreateEffect(c)
local loc=loc or LOCATION_MZONE
e3:SetDescription(aux.Stringid(37564765,5))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
if force then
e3:SetType(EFFECT_TYPE_QUICK_F)
else
e3:SetType(EFFECT_TYPE_QUICK_O)
end
e3:SetCode(EVENT_CHAINING)
if lmct then e3:SetCountLimit(lmct,lmcd) end
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(loc)
e3:SetCondition(cm.NegateEffectCondition(excon))
if cost then e3:SetCost(cost) end
e3:SetTarget(cm.NegateEffectTarget)
e3:SetOperation(cm.NegateEffectOperation(exop))
c:RegisterEffect(e3)
return e3
end
function cm.NegateEffectCondition(excon)
return function(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and (not excon or excon(e,tp,eg,ep,ev,re,r,rp))
end
end
function cm.NegateEffectTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.NegateEffectOperation(exop)
return function(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
if exop then
exop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
end
function cm.NegateEffectTrap(c,lmct,lmcd,cost,excon,exop)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(lmct,lmcd)
e1:SetCondition(cm.NegateEffectCondition(excon))
if cost then e1:SetCost(cost) end
e1:SetTarget(cm.NegateEffectTarget)
e1:SetOperation(cm.NegateEffectOperation(exop))
c:RegisterEffect(e1)
return e1
end
function cm.DrawTarget(ct)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
end
function cm.DrawOperation(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.PrimSynchroFilter(c)
return cm.check_set_prim(c) and c:IsSynchroType(TYPE_SYNCHRO)
end
function cm.PrimLv4CommonEffect(c,cd)
aux.AddSynchroProcedure(c,nil,cm.check_set_prim,1)
c:EnableReviveLimit()
end
function cm.XMaterialCountCondition(ct,excon)
return function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>=ct and (not excon or excon(e,tp,eg,ep,ev,re,r,rp))
end
end
--counter summon effect universals
--n=normal f=flip s=special o=opponent only
function cm.NegateSummonModule(c,tpcode,ctlm,ctlmid,con,cost)
if not tpcode or (tpcode & 7)==0 then return end
ctlmid=ctlmid or 1
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37564765,4))
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_SPSUMMON)
if ctlm then e3:SetCountLimit(ctlm,ctlmid) end
if (tpcode & 8)==8 then
e3:SetLabel(2)
else
e3:SetLabel(1)
end
e3:SetCondition(cm.NegateSummonCondition(con))
if cost then e3:SetCost(cost) end
e3:SetTarget(cm.NegateSummonTarget)
e3:SetOperation(cm.NegateSummonOperation)
local e2=e3:Clone()
e2:SetCode(EVENT_FLIP_SUMMON)
local e1=e3:Clone()
e1:SetCode(EVENT_SUMMON)
local t={}
if (tpcode & 1)==1 then
c:RegisterEffect(e1)
table.insert(t,e1)
end
if (tpcode & 2)==2 then
c:RegisterEffect(e2)
table.insert(t,e2)
end
if (tpcode & 4)==4 then
c:RegisterEffect(e3)
table.insert(t,e3)
end
return table.unpack(t)
end
function cm.NegateSummonFilter(c,tp,e)
return c:GetSummonPlayer()==tp or e:GetLabel()==1
end
function cm.NegateSummonCondition(con)
return function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0 and eg:IsExists(cm.NegateSummonFilter,1,nil,e,1-tp) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
end
function cm.NegateSummonTarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(cm.filter,nil,e,1-tp)
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function cm.NegateSummonOperation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.NegateSummonFilter,nil,e,1-tp)
Duel.NegateSummon(g)
Duel.Destroy(g,REASON_EFFECT)
end
--for copying spell
function cm.CopySpellModule(c,loc1,loc2,f,con,cost,ctlm,ctlmid,eloc,x)
local e2=Effect.CreateEffect(c)
eloc=eloc or LOCATION_MZONE
ctlmid=ctlmid or 1
e2:SetDescription(aux.Stringid(37564765,6))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(eloc)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0x3c0)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
if ctlm then e2:SetCountLimit(ctlm,ctlmid) end
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.CheckEvent(EVENT_CHAINING) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end)
e2:SetCost(cm.ForbiddenCost(cost))
e2:SetTarget(cm.CopySpellNormalTarget(loc1,loc2,f,x))
e2:SetOperation(cm.CopyOperation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(37564765,6))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
if ctlm then e3:SetCountLimit(ctlm,ctlmid) end
e3:SetCost(cm.ForbiddenCost(cost))
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not con or con(e,tp,eg,ep,ev,re,r,rp)
end)
e3:SetTarget(cm.CopySpellChainingTarget(loc1,loc2,f,x))
e3:SetOperation(cm.CopyOperation)
c:RegisterEffect(e3)
return e2,e3
end
function cm.ProtectedRun(f,...)
if not f then return true end
local params={...}
local ret={}
local res_test=pcall(function()
ret={f(table.unpack(params))}
end)
if not res_test then return false end
return table.unpack(ret)
end
function cm.ForbiddenCost(costf)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if not costf then return true end
return costf(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.CopySpellNormalFilter(c,f,e,tp)
return (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_SPELL+TYPE_QUICKPLAY
or c:GetType()==TYPE_TRAP or c:GetType()==TYPE_TRAP+TYPE_COUNTER)
and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false) and (not f or f(c,e,tp))
end
function cm.CopySpellNormalTarget(loc1,loc2,f,x)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
local og=Duel.GetFieldGroup(tp,loc1,loc2)
if x then og:Merge(e:GetHandler():GetOverlayGroup()) end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return og:IsExists(cm.CopySpellNormalFilter,1,nil,f,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=og:FilterSelect(tp,cm.CopySpellNormalFilter,1,1,nil,f,e,tp)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(true,true,true)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
e:SetLabel(te:GetLabel())
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_CHAIN_END)
ex:SetLabelObject(e)
ex:SetOperation(function(e)
e:GetLabelObject():SetLabel(0)
ex:Reset()
end)
Duel.RegisterEffect(ex,tp)
end
end
function cm.CopyOperation(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if te:IsHasType(EFFECT_TYPE_ACTIVATE) then
e:GetHandler():ReleaseEffectRelation(e)
end
cm.ProtectedRun(op,e,tp,eg,ep,ev,re,r,rp)
end
function cm.CopySpellChainingFilter(c,e,tp,eg,ep,ev,re,r,rp,f)
if (c:GetType()==TYPE_SPELL or c:GetType()==TYPE_SPELL+TYPE_QUICKPLAY
or c:GetType()==TYPE_TRAP or c:GetType()==TYPE_TRAP+TYPE_COUNTER) and c:IsAbleToRemoveAsCost() and (not f or f(c,e,tp,eg,ep,ev,re,r,rp)) then
if c:CheckActivateEffect(true,true,false) then return true end
local te=c:GetActivateEffect()
if te:GetCode()~=EVENT_CHAINING then return false end
local tg=te:GetTarget()
if not cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0) then return false end
return true
else return false end
end
function cm.CopySpellChainingTarget(loc1,loc2,f,x)
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and (not tg or tg(e,tp,eg,ep,ev,re,r,rp,0,chkc))
end
local og=Duel.GetFieldGroup(tp,loc1,loc2)
if x then og:Merge(e:GetHandler():GetOverlayGroup()) end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return og:IsExists(cm.CopySpellChainingFilter,1,nil,e,tp,eg,ep,ev,re,r,rp,f)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=og:FilterSelect(tp,cm.CopySpellChainingFilter,1,1,nil,e,tp,eg,ep,ev,re,r,rp,f)
local tc=g:GetFirst()
local te,ceg,cep,cev,cre,cr,crp
local fchain=cm.CopySpellNormalFilter(tc)
if fchain then
te,ceg,cep,cev,cre,cr,crp=tc:CheckActivateEffect(true,true,true)
else
te=tc:GetActivateEffect()
end
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(te:GetLabel())
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then
if fchain then
cm.ProtectedRun(tg,e,tp,ceg,cep,cev,cre,cr,crp,1)
else
cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,1)
end
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_CHAIN_END)
ex:SetLabelObject(e)
ex:SetOperation(function(e)
e:GetLabelObject():SetLabel(0)
ex:Reset()
end)
Duel.RegisterEffect(ex,tp)
end
end
function cm.InstantCopyModule(c,lmct,lmcd,cost,excon,loc)
local e3=Effect.CreateEffect(c)
loc=loc or LOCATION_MZONE
e3:SetDescription(aux.Stringid(37564765,7))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
if lmct then e3:SetCountLimit(lmct,lmcd) end
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(loc)
e3:SetCondition(cm.InstantCopyCondition(excon))
e3:SetCost(cm.ForbiddenCost(cost))
e3:SetTarget(cm.InstantCopyTarget)
e3:SetOperation(cm.CopyOperation)
c:RegisterEffect(e3)
return e3
end
function cm.InstantCopyCondition(excon)
return function(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and (not excon or excon(e,tp,eg,ep,ev,re,r,rp))
end
end
function cm.InstantCopyTarget(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return te:IsHasProperty(EFFECT_FLAG_CARD_TARGET) and cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
local te=re:Clone()
local tg=te:GetTarget()
local code=te:GetCode()
local tres,teg,tep,tev,tre,tr,trp
if code>0 and code~=EVENT_FREE_CHAIN and code~=EVENT_CHAINING and Duel.CheckEvent(code) then
tres,teg,tep,tev,tre,tr,trp=Duel.CheckEvent(code,true)
end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
local res=false
if not tg then return true end
if tres then return cm.ProtectedRun(tg,e,tp,teg,tep,tev,tre,tr,trp,0)
else return cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,0) end
end
e:SetLabel(te:GetLabel())
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
if tg then
if tres then
cm.ProtectedRun(tg,e,tp,teg,tep,tev,tre,tr,trp,1)
else
cm.ProtectedRun(tg,e,tp,eg,ep,ev,re,r,rp,1)
end
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_CHAIN_END)
ex:SetLabelObject(e)
ex:SetOperation(function(e)
e:GetLabelObject():SetLabel(0)
ex:Reset()
end)
Duel.RegisterEffect(ex,tp)
end
function cm.NegateEffectWithoutChainingModule(c,con,cost,exop,desc,des,loc)
local e3=Effect.CreateEffect(c)
loc=loc or LOCATION_MZONE
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_CHAIN_SOLVING)
e3:SetRange(loc)
e3:SetCondition(cm.NegateEffectWithoutChainingCondition(con))
e3:SetOperation(cm.NegateEffectWithoutChainingOperation(cost,exop,desc,des))
c:RegisterEffect(e3)
return e3
end
function cm.NegateEffectWithoutChainingCondition(con)
return function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainDisablable(ev) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
end
function cm.NegateEffectWithoutChainingOperation(cost,exop,desc,des)
return function(e,tp,eg,ep,ev,re,r,rp)
if not Duel.SelectYesNo(tp,desc) then return end
Duel.Hint(HINT_CARD,0,e:GetHandler():GetOriginalCode())
if cost then cost(e,tp,eg,ep,ev,re,r,rp) end
local chk=Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) and des then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
end
if chk and exop then
exop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
--for aux.FCheckAdditional in izayoi
function cm.CheckFusionMaterialExact(c,g,chkf)
aux.FCheckAdditional=cm.HoldGroup(g)
local res=c:CheckFusionMaterial(g,nil,chkf)
aux.FCheckAdditional=nil
return res
end
function cm.HoldGroup(mg)
return function(tp,g,fc)
return mg:Equal(g)
end
end
--3L fusion monster, c=card, m=code
--exf=extra function
function cm.Fusion_3L(c,mf,f,min,max,myon,sub)
cm.enable_kaguya_check_3L()
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_FUSION_MATERIAL)
e1:SetCondition(cm.FusionCondition_3L(mf,f,min,max,myon,sub))
e1:SetOperation(cm.FusionOperation_3L(mf,f,min,max,myon,sub))
c:RegisterEffect(e1)
end
function cm.MyonCheckFilter(c,ec,myon)
return (c:IsHasEffect(37564841) or myon) and c:IsFaceup() and c:IsCanBeFusionMaterial(ec)
end
function cm.FusionFilter_3L(c,fc,mf,sub)
return c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579) and ((not mf or mf(c,fc,sub)) or c:IsHasEffect(37564914))
end
function cm.FusionCheck_3L(g,min,tp,fc,f,chkf,sub)
--check sayuri_3L
if g:IsExists(aux.TuneMagicianCheckX,nil,g,EFFECT_TUNE_MAGICIAN_F) then return false end
if chkf~=PLAYER_NONE and Duel.GetLocationCountFromEx(chkf,tp,g,fc)<=0 then return false end
if aux.FCheckAdditional and not aux.FCheckAdditional(tp,g,fc) then return false end
if #g==1 and fc:GetLevel()==7 and g:GetFirst():IsHasEffect(37564914) then return true end
return #g>=min and (not f or f(g,fc,sub))
end
function cm.FusionCondition_3L(mf,f,min,max,myon,sub)
return function(e,g,gc,chkfnf)
if g==nil then return true end
local c=e:GetHandler()
local chkf=(chkfnf & 0xff)
local mg=g:Filter(cm.FusionFilter_3L,nil,e:GetHandler(),mf,sub)
local tp=e:GetHandlerPlayer()
local exg=Duel.GetMatchingGroup(cm.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c,myon)
mg:Merge(exg)
local sg=Group.CreateGroup()
if gc then
if not cm.FusionFilter_3L(gc,fc,mf,sub) then return false end
sg:AddCard(gc)
end
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_FMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
if not mg:IsContains(tc) then return false end
sg:AddCard(tc)
end
return cm.CheckGroup(mg,cm.FusionCheck_3L,sg,1,max,min,tp,c,f,chkfnf,sub)
end
end
function cm.FusionOperation_3L(mf,f,min,max,myon,sub)
return function(e,tp,eg,ep,ev,re,r,rp,gc,chkfnf)
local c=e:GetHandler()
local chkf=(chkfnf & 0xff)
local mg=eg:Filter(cm.FusionFilter_3L,nil,e:GetHandler(),mf,sub)
local exg=Duel.GetMatchingGroup(cm.MyonCheckFilter,tp,0,LOCATION_MZONE,nil,c,myon)
mg:Merge(exg)
local sg=Group.CreateGroup()
if gc then
sg:AddCard(gc)
end
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_FMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
sg:AddCard(tc)
end
local g=cm.SelectGroup(tp,HINTMSG_FMATERIAL,mg,cm.FusionCheck_3L,sg,1,max,min,tp,c,f,chkf,sub)
Duel.SetFusionMaterial(g)
end
end
function cm.GroupFilterMultiCheck(c,g,list,ct,fc,sub)
local f=list[ct]
if not f(c,fc,sub) then return false end
if ct==#list then return true end
local res=false
g:RemoveCard(c)
if sub and f(c,fc,false) then
res=g:IsExists(cm.GroupFilterMultiCheck,1,nil,g,list,ct+1,fc,true)
else
res=g:IsExists(cm.GroupFilterMultiCheck,1,nil,g,list,ct+1,fc,false)
end
g:AddCard(c)
return res
end
function cm.GroupFilterMulti(...)
local list={...}
return function(g,fc,sub)
return g:IsExists(cm.GroupFilterMultiCheck,1,nil,g,list,1,fc,sub)
end
end
function cm.AttributeReplace_3L(att)
return function(c)
return c:IsFusionAttribute(att) or c:IsHasEffect(37564828)
end
end
function cm.Fusion_3L_Attribute(c,mt)
local f1=cm.check_fusion_set_3L
local f2=cm.AttributeReplace_3L(mt.fusion_att_3L)
return cm.Fusion_3L(c,cm.OR(f1,f2),cm.GroupFilterMulti(f1,f2),2,2)
end
function cm.GainEffectFilter(c,fc)
if not c.effect_operation_3L then return false end
local con=c.effect_condition_3L
if con and not con(c,fc) then return false end
return true
end
function cm.FusionGainFilter(c)
local t=cm.gain_effect_list_3L[c]
return c:IsSummonType(SUMMON_TYPE_FUSION) and t and c:GetFlagEffect(37564848)==0
end
function cm.enable_kaguya_check_3L()
if cm.kaguya_check_3L then return end
cm.kaguya_check_3L={}
cm.previous_chain_info={}
cm.kaguya_check_3L[0]=0
cm.kaguya_check_3L[1]=0
cm.gain_effect_list_3L={}
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
cm.kaguya_check_3L[ep]=cm.kaguya_check_3L[ep]+1
if cm.kaguya_check_3L[ep]==7 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+37564829,re,r,rp,ep,ev)
end
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local ceg=eg:Clone()
ceg:KeepAlive()
cm.previous_chain_info[cid]={ceg,ep,ev,re,r,rp}
end)
Duel.RegisterEffect(e1,0)
local e2=Effect.GlobalEffect()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e2:SetOperation(function()
cm.kaguya_check_3L[0]=0
cm.kaguya_check_3L[1]=0
end)
Duel.RegisterEffect(e2,0)
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.FusionGainFilter,1,nil)
end)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.FusionGainFilter,nil)
for tc in aux.Next(g) do
local t=cm.gain_effect_list_3L[tc]
for code,v in pairs(t) do
cm.GainEffect_3L(tc,code)
end
end
end)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.GlobalEffect()
ge3:SetType(EFFECT_TYPE_FIELD)
ge3:SetCode(EFFECT_MATERIAL_CHECK)
ge3:SetProperty(EFFECT_FLAG_IGNORE_RANGE)
ge3:SetTargetRange(0xff,0xff)
ge3:SetValue(function(e,c)
if c:IsType(TYPE_FUSION) and cm.check_set_3L(c) then
local g=c:GetMaterial():Filter(cm.GainEffectFilter,nil,c)
local t={}
for tc in aux.Next(g) do
t[tc:GetOriginalCode()]=true
end
cm.gain_effect_list_3L[c]=t
end
end)
Duel.RegisterEffect(ge3,0)
end
function cm.CheckKoishiCount(c)
local t={c:IsHasEffect(37564826)}
local res=1
for i,te in pairs(t) do
res=math.max(res,te:GetValue())
end
return res
end
--filter for effect gaining
--chkc=card to check if it can gain c's effect, nil for not checking
function cm.EffectSourceFilter_3L(c,chkc)
local cd=c:GetOriginalCode()
local mt=cm.LoadMetatable(cd)
return cm.check_set_3L(c) and c:IsType(TYPE_MONSTER) and mt and mt.effect_operation_3L and (not chkc or chkc:GetFlagEffect(cd-4000)==0)
end
--3L get effect by other cards
--c=target_card, tc=source_card/code, pres=reset on the next turn, pctlm=count_limit(before custom_ctlm_3L)
function cm.GainEffect_3L(c,tc,pres,pctlm)
local cd=0
if type(tc)=="number" then
cd=tc
else
cd=tc:GetOriginalCode()
end
local mt=cm.LoadMetatable(cd)
if not mt or c:GetFlagEffect(cd-4000)>0 or not mt.effect_operation_3L then return end
local ctlm=pctlm or cm.CheckKoishiCount(c)
local efft={mt.effect_operation_3L(c,ctlm)}
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ADD_TYPE)
e2:SetValue(TYPE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e2,true)
table.insert(efft,e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_REMOVE_TYPE)
e3:SetValue(EFFECT_NORMAL)
c:RegisterEffect(e3,true)
table.insert(efft,e3)
c:RegisterFlagEffect(cd-4000,RESET_EVENT+0x1fe0000,EFFECT_FLAG_CLIENT_HINT,1,cm.order_table_new(efft),cd*16+1)
if pres then
local info_list={
elist=efft,
code=cd,
}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(pres)
e1:SetCondition(function(e)
local tc=e:GetOwner()
local effm=tc:GetFlagEffectLabel(info_list.code-4000)
if not effm then e:Reset() return false end
local efft=cm.order_table[effm]
if efft~=info_list.elist then e:Reset() return false end
return true
end)
e1:SetOperation(function(e)
local tct=e:GetLabel()-1
if tct>0 then
e:SetLabel(tct)
else
cm.RemoveCertainEffect_3L(e:GetOwner(),info_list.code)
e:Reset()
end
end)
Duel.RegisterEffect(e1,c:GetControler())
end
return efft
end
--create the codelist for checking effects
if not cm.codelist_3L then
cm.codelist_3L={37564519,37564914}
for i=37564800,37564899 do
table.insert(cm.codelist_3L,i)
end
end
--returns a table, which shows all the codes the effect c gets
function cm.GetGainedList_3L(c)
local t={}
for i,code in pairs(cm.codelist_3L) do
if c:GetFlagEffect(code-4000)>0 then
table.insert(t,code)
end
end
return t
end
--returns the effect_count of the effect tc gets
function cm.GetGainedCount_3L(c)
local t=cm.GetGainedList_3L(c)
local v=0
for i,cd in pairs(t) do
local mt=cm.LoadMetatable(cd)
local mct=mt.custom_effect_count_3L or 1
v=v+mct
end
return v
end
--reset gained effect from 3L
function cm.RemoveCertainEffect_3L(tc,code)
local effm=tc:GetFlagEffectLabel(code-4000)
if not effm then return false end
local mt=cm.LoadMetatable(code)
Duel.Hint(tc:GetControler(),HINT_OPSELECTED,cm.DescriptionInNanahira(10))
local efft=cm.order_table[effm]
for i,te in pairs(efft) do
if mt and mt.reset_operation_3L and mt.reset_operation_3L[i] then
mt.reset_operation_3L[i](te,tc)
end
te:Reset()
end
tc:ResetFlagEffect(code-4000)
return true
end
--remove ct~maxct of the effect(s) from 3L
--[...]shows the code omitted
function cm.RemoveEffect_3L(tp,tc,ct,maxct,chk,...)
local maxct=maxct or ct
local effect_list=cm.GetGainedList_3L(tc)
local avaliable_list={}
local omit_list={...}
local oet={tc:IsHasEffect(37564827)}
for i,oe in pairs(oet) do
local of=cm.order_table[oe:GetValue()]
local og=of(tc)
for oc in aux.Next(og) do
table.insert(omit_list,oc:GetOriginalCode())
end
end
for i,code in pairs(effect_list) do
local res=true
for j,ocode in pairs(omit_list) do
if code==ocode then res=false end
end
if res then table.insert(avaliable_list,i) end
end
if chk then return #avaliable_list>=ct end
local result_count=0
while #avaliable_list>0 and result_count<maxct and not (result_count>=ct and not Duel.SelectYesNo(tp,210)) do
local option_list={}
for i,v in pairs(avaliable_list) do
local descid=1
local ccode=effect_list[v]
local mt=cm.LoadMetatable(ccode)
local effct=mt.custom_effect_count_3L
if effct and effct>1 then descid=effct+1 end
table.insert(option_list,aux.Stringid(ccode,descid))
end
Duel.Hint(HINT_SELECTMSG,tp,cm.DescriptionInNanahira(9))
local option=table.remove(avaliable_list,Duel.SelectOption(tp,table.unpack(option_list))+1)
cm.RemoveCertainEffect_3L(tc,effect_list[option])
result_count=result_count+1
end
return result_count
end
--cost for self removing effect
--... stands for omit codes
function cm.RemoveEffectCost_3L(ct,...)
local omit_list={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetHandler():IsHasEffect(37564827) then return false end
return cm.RemoveEffect_3L(tp,e:GetHandler(),ct,ct,true,table.unpack(omit_list))
end
cm.RemoveEffect_3L(tp,e:GetHandler(),ct,ct,false,table.unpack(omit_list))
end
end
function cm.MergeCost(...)
local list={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
for _,f in pairs(list) do
if f and not f(e,tp,eg,ep,ev,re,r,rp,0) then return false end
end
return true
end
for _,f in pairs(list) do
if f then f(e,tp,eg,ep,ev,re,r,rp,1) end
end
end
end
--registers an effect which gains 3L's effect continuously
--function f stands for the function which returns a group to be gained
--excost is a function which has a card for param and returns an extra cost for gaining effects which are activatable. For ordinary costs, use DirectReturn.
function cm.ContinuousEffectGainModule_3L(c,f,excost)
local excost=excost or aux.NULL
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.ContinuousEffectCondition_3L(f))
e2:SetOperation(cm.ContinuousEffectOperation_3L(f,excost))
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(37564827)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetValue(cm.order_table_new(f))
c:RegisterEffect(e3)
end
function cm.ContinuousEffectCondition_3L(f)
return function(e)
local c=e:GetHandler()
return c:IsHasEffect(37564827) and f(c):IsExists(cm.EffectSourceFilter_3L,1,nil,c)
end
end
function cm.ContinuousEffectOperation_3L(f,excost)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local og=f(c):Filter(cm.EffectSourceFilter_3L,nil,c)
for tc in aux.Next(og) do
local t=cm.GainEffect_3L(c,tc,false,63)
if t then
for i,te in pairs(t) do
te:SetCondition(cm.ContinuousEffectReplaceCondition_3L(f,te:GetCondition(),tc:GetOriginalCode()))
if te:IsHasType(0x7e0) then
te:SetCost(cm.MergeCost(cm.CountCost_3L(tc:GetOriginalCode(),tc.single_effect_3L),te:GetCost(),excost(tc)))
end
end
end
end
end
end
function cm.ContinuousEffectReplaceCondition_3L(f,con,cd)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (f(c):IsExists(aux.FilterEqualFunction(Card.GetOriginalCode,cd),1,nil) and c:IsHasEffect(37564827)) then
return (not con or con(e,tp,eg,ep,ev,re,r,rp))
else
cm.RemoveCertainEffect_3L(e:GetHandler(),cd)
return false
end
end
end
function cm.CountCost_3L(cd,chks)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chks then return true end
local c=e:GetHandler()
local ctlm=cm.CheckKoishiCount(c)
if chk==0 then return c:GetFlagEffect(cd-3000)<ctlm end
c:RegisterFlagEffect(cd-3000,0x1fe1000+RESET_PHASE+PHASE_END,0,1)
end
end
function cm.PreExile(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1,true)
local t={EFFECT_CANNOT_TO_DECK,EFFECT_CANNOT_REMOVE,EFFECT_CANNOT_TO_GRAVE}
for i,code in pairs(t) do
local ex=e1:Clone()
ex:SetCode(code)
c:RegisterEffect(ex,true)
end
Duel.SendtoGrave(c:GetOverlayGroup(),REASON_RULE)
end
function cm.ExileCard(c)
cm.PreExile(c)
Duel.Exile(c,REASON_RULE)
c:ResetEffect(0xfff0000,RESET_EVENT)
end
function cm.ExileGroup(g)
for c in aux.Next(g) do
cm.PreExile(c)
end
Duel.Exile(g,REASON_RULE)
for c in aux.Next(g) do
c:ResetEffect(0xfff0000,RESET_EVENT)
end
end
function cm.DescriptionCost(costf)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (not costf or costf(e,tp,eg,ep,ev,re,r,rp,0)) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
if costf then costf(e,tp,eg,ep,ev,re,r,rp,1) end
end
end
function cm.splimit(c,v,rlimit)
if rlimit then
c:EnableReviveLimit()
end
v=v or 0
local e22=Effect.CreateEffect(c)
e22:SetType(EFFECT_TYPE_SINGLE)
e22:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e22:SetCode(EFFECT_SPSUMMON_CONDITION)
e22:SetValue(v)
c:RegisterEffect(e22)
return e22
end
function cm.splimitcost(f,m,cost,...)
local ext_params={...}
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,aux.FilterBoolFunction(f,...))
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 and (not cost or cost(e,tp,eg,ep,ev,re,r,rp,0)) end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit_filter(f,ext_params))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
if cost then cost(e,tp,eg,ep,ev,re,r,rp,1) end
end
end
function cm.splimit_filter(f,ext_params)
return function(e,c)
return not f(c,table.unpack(ext_params))
end
end
function cm.multi_choice_target(m,...)
local function_list={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local pr=e:GetProperty()
return (pr & EFFECT_FLAG_CARD_TARGET)~=0 and function_list[e:GetLabel()](e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
local avaliable_list={}
for i,tg in pairs(function_list) do
if tg(e,tp,eg,ep,ev,re,r,rp,0) then
table.insert(avaliable_list,i)
end
end
if chk==0 then return #avaliable_list>0 end
local option_list={}
for i,v in pairs(avaliable_list) do
table.insert(option_list,aux.Stringid(m,v-1))
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
local option=avaliable_list[Duel.SelectOption(tp,table.unpack(option_list))+1]
e:SetLabel(option)
function_list[option](e,tp,eg,ep,ev,re,r,rp,1)
end
end
function cm.multi_choice_operation(...)
local function_list={...}
return function(e,tp,eg,ep,ev,re,r,rp)
local op=function_list[e:GetLabel()]
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
end
--order_table system
--allows storing value of any type by Label or FlagEffectLabel
--cm.order_table_new will create a new space in cm.order_table and returns the address
--usually stores the address in Label and uses them by using the Label as the key to cm.order_table
cm.order_table=cm.order_table or {}
cm.order_count=cm.order_count or 0
function cm.order_table_new(v)
cm.order_count=cm.order_count+1
cm.order_table[cm.order_count]=v
return cm.order_count
end
function cm.enable_get_all_cards()
if not cm.get_all_cards then
cm.get_all_cards=Group.CreateGroup()
cm.get_all_cards:KeepAlive()
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetOperation(function()
local g=Duel.GetFieldGroup(0,0xff,0xff)
local g1=g:Clone()
g:ForEach(function(tc)
g1:Merge(tc:GetOverlayGroup())
end)
cm.get_all_cards:Merge(g1)
end)
Duel.RegisterEffect(e1,0)
return true
end
return false
end
function cm.SummonTypeCondition(t,con)
return function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(t) and (not con or con(e,tp,eg,ep,ev,re,r,rp))
end
end
function cm.NonImmuneFilter(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.FusionMaterialFilter(c,oppo)
if oppo and c:IsLocation(LOCATION_ONFIELD+LOCATION_REMOVED) and c:IsFacedown() then return false end
return c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER)
end
function cm.GetFusionMaterial(tp,loc,oloc,f,gc,e,...)
local g1=Duel.GetFusionMaterial(tp)
if loc then
local floc=(loc & LOCATION_ONFIELD+LOCATION_HAND)
if floc~=0 then
g1=g1:Filter(Card.IsLocation,nil,floc)
else
g1:Clear()
end
local eloc=loc-floc
if eloc~=0 then
local g2=Duel.GetMatchingGroup(cm.FusionMaterialFilter,tp,eloc,0,nil)
g1:Merge(g2)
end
end
if oloc and oloc~=0 then
local g3=Duel.GetMatchingGroup(cm.FusionMaterialFilter,tp,0,oloc,nil,true)
g1:Merge(g3)
end
if f then g1=g1:Filter(f,nil,...) end
if gc then g1:RemoveCard(gc) end
if e then g1=g1:Filter(cm.NonImmuneFilter,nil,e) end
return g1
end
function cm.GetReleaseGroup(tp,loc,oloc,f,gc,...)
local g1=Duel.GetReleaseGroup(tp)
if loc then
local floc=(loc & LOCATION_MZONE)
if floc~=0 then
g1=g1:Filter(Card.IsLocation,nil,floc)
else
g1:Clear()
end
local eloc=loc-floc
if eloc~=0 then
local g2=Duel.GetMatchingGroup(Card.IsReleasable,tp,eloc,0,nil)
g1:Merge(g2)
end
end
if oloc and oloc~=0 then
local g3=Duel.GetMatchingGroup(Card.IsReleasable,tp,0,oloc,nil)
g1:Merge(g3)
end
if f then g1=g1:Filter(f,nil,...) end
if gc then g1:RemoveCard(gc) end
return g1
end
function cm.ReleaseCost(loc,oloc,f,self,...)
local ext_params={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=self and e:GetHandler()
local mg=cm.GetReleaseGroup(tp,loc,oloc,f,ec,table.unpack(ext_params))
if chk==0 then return #mg>0 and (not ec or ec:IsReleasable()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=mg:Select(tp,1,1,nil)
if ec then g:AddCard(ec) end
Duel.Release(g,REASON_COST)
end
end
function cm.ChainLimitCost(original_cost)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local effect_code=e:GetHandler():GetFlagEffectLabel(37564766)
if chk==0 then
if original_cost and not original_cost(e,tp,eg,ep,ev,re,r,rp,0) then return false end
if not effect_code then return true end
local effect_list=cm.order_table[effect_code]
for i,te in pairs(effect_list) do
if e==te then return false end
end
return true
end
if original_cost then original_cost(e,tp,eg,ep,ev,re,r,rp,1) end
if effect_code then
local effect_list=cm.order_table[effect_code]
table.insert(effect_list,e)
else
e:GetHandler():RegisterFlagEffect(37564766,RESET_EVENT+0x1fe0000+RESET_CHAIN,0,1,cm.order_table_new({e}))
end
end
end
function cm.RemainFilter(ct,ignorefaceup)
if not cm.RemainCheck then
cm.RemainCheck=true
local ex=Effect.GlobalEffect()
ex:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ex:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ex:SetOperation(cm.RemainCheckOperation)
Duel.RegisterEffect(ex,0)
end
return function(c)
return c:GetFlagEffect(37564767)>=ct and (ignorefaceup or c:IsFaceup())
end
end
function cm.RemainCheckFilter(c)
return not c:IsType(TYPE_TOKEN)
end
function cm.RemainCheckOperation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.RemainCheckFilter,0,LOCATION_MZONE,LOCATION_MZONE,nil)
g:ForEach(function(tc)
tc:RegisterFlagEffect(37564767,RESET_EVENT+0x1fc0000,0,1)
end)
end
--for sayuri
cm.sayuri_fit_monster=cm.sayuri_fit_monster or {}
cm.sayuri_activate_effect=cm.sayuri_activate_effect or {}
function cm.SayuriRitualPreload(m)
local mt=cm.LoadMetatable(m)
mt.Senya_name_with_sayuri=true
table.insert(cm.sayuri_fit_monster,m)
return m,mt
end
function cm.SayuriSpellPreload(m)
local mt=cm.LoadMetatable(m)
mt.Senya_name_with_sayuri=true
mt.fit_monster=cm.sayuri_fit_monster
return m,mt
end
function cm.SayuriSelfReturnCommonEffect(c,m)
local e2=Effect.CreateEffect(c)
e2:SetDescription(cm.DescriptionInNanahira(11))
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(aux.exccon)
e2:SetCountLimit(1,37564900)
e2:SetCost(cm.SayuriSelfReturnCost)
e2:SetTarget(cm.DrawTarget(1))
e2:SetOperation(cm.DrawOperation)
c:RegisterEffect(e2)
return e2
end
function cm.SayuriSelfReturnFilter(c)
return cm.check_set_sayuri(c) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeckOrExtraAsCost()
end
function cm.SayuriSelfReturnCost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckOrExtraAsCost()
and Duel.IsExistingMatchingCard(cm.SayuriSelfReturnFilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.SayuriSelfReturnFilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:AddCard(e:GetHandler())
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.SayuriCheckTrigger(c,e,tp,eg,ep,ev,re,r,rp)
if not e:IsActiveType(TYPE_RITUAL) then return end
if not c.sayuri_trigger_operation then return end
if c.sayuri_trigger_condition and not c:sayuri_trigger_condition(e,tp,eg,ep,ev,re,r,rp) then return end
if not (c.sayuri_trigger_forced or Duel.SelectEffectYesNo(tp,c)) then return end
Duel.Hint(HINT_CARD,0,c:GetOriginalCode())
Duel.BreakEffect()
c:sayuri_trigger_operation(e,tp,eg,ep,ev,re,r,rp)
end
function cm.SayuriDefaultMaterialFilterLevel8(c)
if c:GetLevel()==8 and c:IsLocation(LOCATION_GRAVE) then return false end
return true
end
function cm.SayuriDefaultMaterialFilterLevel12(c)
return cm.check_set_sayuri(c) and c:GetLevel()==4
end
function cm.CloneTable(t)
local rt={}
for i,v in pairs(t) do
rt[i]=v
end
return rt
end
function cm.GetPendulumCard(tp,seq)
return Duel.GetFieldCard(tp,LOCATION_PZONE,seq)
end
function cm.CheckPendulum(c)
local tp=c:GetControler()
return cm.GetPendulumCard(tp,0)==c or cm.GetPendulumCard(tp,1)==c
end
function cm.CheckSummonLocation(c,tp,g)
local g=g or Group.CreateGroup()
if c:IsLocation(LOCATION_EXTRA) then return Duel.GetLocationCountFromEx(tp,tp,g,c)>0 end
return Duel.GetMZoneCount(tp,g,tp)>0
end
function cm.AND(...)
return aux.AND(...)
end
function cm.OR(...)
return aux.OR(...)
end
function cm.NOT(f)
return aux.NOT(f)
end
function cm.DirectReturn(...)
local t={...}
return function()
return table.unpack(t)
end
end
function cm.GetEffectValue(e,...)
local v=e:GetValue()
if type(v)=="function" then
return v(e,...)
else
return v
end
end
--custom ocgcore needed
function cm.CheckEffect(c,code,...)
local eset={c:IsHasEffect(code)}
for _,te in ipairs(eset) do
local res=cm.GetEffectValue(te,...)
if res and res~=0 then return res end
end
return false
end
function cm.CheckPlayerEffect(p,code,...)
local eset={Duel.IsPlayerAffectedByEffect(p,code)}
for _,te in ipairs(eset) do
local res=cm.GetEffectValue(te,...)
if res and res~=0 then return res end
end
return false
end
function cm.AddSummonMusic(c,desc,stype)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
if stype then
e1:SetCondition(cm.SummonTypeCondition(stype))
end
e1:SetOperation(function()
Duel.Hint(HINT_MUSIC,0,desc)
end)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.IgnoreActionCheck(f,...)
Duel.DisableActionCheck(true)
local cr=coroutine.create(f)
local ret={}
while coroutine.status(cr)~="dead" do
local sret={coroutine.resume(cr,...)}
for i=2,#sret do
table.insert(ret,sret[i])
end
end
Duel.DisableActionCheck(false)
return table.unpack(ret)
end
--no front side common effects
function cm.IsDFCTransformable(c)
return c.dfc_front_side
end
function cm.GetDFCBackSideCard(c)
if not cm.IsDFCTransformable(c) then return end
return cm.IgnoreActionCheck(Duel.CreateToken,c:GetControler(),c.dfc_front_side)
end
function cm.TransformDFCCard(c)
if not cm.IsDFCTransformable(c) then return false end
local tcode=c.dfc_front_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
--Duel.Hint(HINT_CARD,0,tcode)
--Duel.ConfirmCards(c:GetControler(),Group.FromCards(c))
--if c:IsLocation(LOCATION_DECK) then
-- Duel.ConfirmCards(1-c:GetControler(),Group.FromCards(c))
--end
return true
end
function cm.DFCBackSideCommonEffect(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c.dfc_back_side
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tcode=c.dfc_back_side
if not tcode then return end
c:SetEntityCode(tcode)
-- Duel.ConfirmCards(tp,Group.FromCards(c))
-- if c:IsLocation(LOCATION_DECK) then
-- Duel.ConfirmCards(1-tp,Group.FromCards(c))
-- end
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetRange(0)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCode(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
c:RegisterEffect(e3)
end
--for ritual update
function cm.CheckRitualMaterialGoal(g,c,tp,lv,f,gt)
return cm.CheckSummonLocation(c,tp,g) and (g:CheckWithSumEqual(f,lv,#g,#g,c) or (gt and cm.CheckGreaterExact(g,f,lv,c)))
end
function cm.DivideValueMax(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=(v & 0xffff)
local v2=(v >> 16)
return math.max(v1,v2)
end
end
function cm.DivideValueMin(f,...)
local ext_params={...}
return function(c)
local v=f(c,table.unpack(ext_params))
local v1=(v & 0xffff)
local v2=(v >> 16)
if v1<=0 then
return v2
elseif v2<=0 then
return v1
else
return math.min(v1,v2)
end
end
end
function cm.CheckGreaterExactCounterCheck(c,g,f,lv,...)
g:RemoveCard(c)
local res=g:GetSum(cm.DivideValueMin(f,...))>=lv
g:AddCard(c)
return res
end
function cm.CheckGreaterExact(g,f,lv,...)
return g:GetSum(cm.DivideValueMax(f,...))>=lv and not g:IsExists(cm.CheckGreaterExactCounterCheck,1,nil,g,f,lv,...)
end
function cm.CheckRitualMaterial(c,g,tp,lv,f,gt)
local f=f or Card.GetRitualLevel
return cm.CheckGroup(g,cm.CheckRitualMaterialGoal,nil,1,lv,c,tp,lv,f,gt)
end
function cm.SelectRitualMaterial(c,g,tp,lv,f,gt)
local f=f or Card.GetRitualLevel
return cm.SelectGroup(tp,HINTMSG_RELEASE,g,cm.CheckRitualMaterialGoal,nil,1,lv,c,tp,lv,f,gt)
end
--for anifriends sound effects
function cm.AddSummonSE(c,desc)
if c:IsStatus(STATUS_COPYING_EFFECT) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(function()
Duel.Hint(HINT_SOUND,0,desc)
end)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.AddAttackSE(c,desc)
if not cm.AttackSEList then
cm.AttackSEList={}
local e1=Effect.GlobalEffect()
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCondition(function()
return cm.AttackSEList[Duel.GetAttacker()]
end)
e1:SetOperation(function()
Duel.Hint(HINT_SOUND,0,cm.AttackSEList[Duel.GetAttacker()])
end)
Duel.RegisterEffect(e1,0)
end
cm.AttackSEList[c]=desc
end
function cm.GetPZoneCount(tp,g)
local res=0
for i=0,1 do
if Duel.CheckLocation(tp,LOCATION_PZONE,i) or (g and g:IsExists(function(c) return c==Duel.GetFieldCard(tp,LOCATION_PZONE,i) or (c:IsLocation(LOCATION_SZONE) and c:GetSequence()==i*4) end,1,nil)) then res=res+1 end
end
return res
end
...@@ -18,4 +18,14 @@ ...@@ -18,4 +18,14 @@
#??? #???
!setname 0x444 天降妹抖 (Heavenly Maid !setname 0x444 天降妹抖 (Heavenly Maid
#??? #???
!setname 0x5449 阻抗 (Resistor !setname 0x5449 阻抗 (Resistor
\ No newline at end of file #???
!setname 0x344a 妖幻战姬(T.Fairies
!setname 0x644a 妖幻幼精(Tzermellend Fairy
#???
!setname 0x144b 虚毒(Voison
!setname 0x144c VOICEROIDVOICEROID
!setname 0x344c 虚拟主播(VLiver
!setname 0x44f 【背景音台】(【Sound Stage】)
!counter 0x144b 虚空指示物
\ 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