Commit a0b2af0b authored by 花桃白音's avatar 花桃白音

update 12.12

parent 62607e77
...@@ -5,7 +5,7 @@ stages: ...@@ -5,7 +5,7 @@ stages:
variables: variables:
GIT_DEPTH: "1" GIT_DEPTH: "1"
LAST_UPDATE_DATE: "2023.11.19" LAST_UPDATE_DATE: "2023.11.19"
CURRENT_UPDATE_DATE: "2023.11.19" CURRENT_UPDATE_DATE: "2023.12.12"
redtext: redtext:
stage: prepare stage: prepare
......
--贪欲的大恶魔
local s,id=GetID()
function s.initial_effect(c)
--special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_DECK)
e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e0:SetCondition(s.spcon)
c:RegisterEffect(e0)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,id+10000)
e1:SetTarget(s.thtg2)
e1:SetOperation(s.thop2)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_DRAW+CATEGORY_HANDES)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DISCARD)
e3:SetCountLimit(1,id+20000)
e3:SetCost(s.spcost)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_HANDES)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_DISCARD)
e4:SetCountLimit(1,id+20000)
e4:SetCost(s.spcost)
e4:SetTarget(s.drtg)
e4:SetOperation(s.drop)
c:RegisterEffect(e4)
--search
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(id,3))
e5:SetCategory(CATEGORY_HANDES+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_DISCARD)
e5:SetCountLimit(1,id+20000)
e5:SetCost(s.spcost)
e5:SetTarget(s.destg)
e5:SetOperation(s.desop)
c:RegisterEffect(e5)
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(nil,tp,LOCATION_HAND,0,nil)==0
end
function s.thfilter2(c)
return c:IsSetCard(0x5540) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,400)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,400)
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,400,REASON_EFFECT,true)
Duel.Damage(1-tp,400,REASON_EFFECT,true)
Duel.RDComplete()
Duel.Draw(tp,1,REASON_EFFECT)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),tp,SEQ_DECKSHUFFLE,REASON_COST)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_DP)
e1:SetTargetRange(1,0)
if Duel.GetTurnPlayer()==tp and Duel.GetCurrentPhase()==PHASE_DRAW then
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_DRAW+RESET_SELF_TURN)
end
Duel.RegisterEffect(e1,tp)
end
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,1,1,REASON_EFFECT+REASON_DISCARD)==0 then return end
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(s.spcon2)
e1:SetOperation(s.spop2)
if Duel.GetCurrentPhase()<=PHASE_STANDBY then
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
else
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
end
Duel.RegisterEffect(e1,tp)
end
function s.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()~=e:GetLabel()
end
function s.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,id)
Duel.Draw(tp,2,REASON_EFFECT)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>2 and g:GetCount()>0 end
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
if Duel.DiscardHand(tp,nil,3,3,REASON_EFFECT+REASON_DISCARD)==0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
local m=15005200
local cm=_G["c"..m]
cm.name="坠镞为林-柯莱"
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_CUSTOM+15005200)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--on-summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,15005200)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.target)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,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
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function cm.thfilter(c)
return aux.IsCounterAdded(c,0x1f37) and c:IsAbleToHand() and not c:IsCode(15005200)
end
function cm.ctfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
if chk==0 then return b1 or b2 end
local op=aux.SelectFromOptions(tp,{b1,aux.Stringid(m,3)},{b2,aux.Stringid(m,4)})
if op==1 then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e:SetOperation(cm.search)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(CATEGORY_COUNTER)
e:SetOperation(cm.ctplace)
end
end
function cm.search(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~=0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.ctplace(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if #g~=0 then
g:GetFirst():AddCounter(0x1f37,1)
Duel.RaiseEvent(g:GetFirst(),EVENT_CUSTOM+15005201,e,0,tp,tp,1)
end
end
\ No newline at end of file
local m=15005201
local cm=_G["c"..m]
cm.name="提纳里-由片叶管窥枯荣"
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_CUSTOM+15005201)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.cttg)
e2:SetOperation(cm.ctop)
c:RegisterEffect(e2)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.ctfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:GetCounter(0)~=0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and cm.ctfilter(chkc) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsRelateToEffect(e) then
local count=tc:GetCounter(0x1f37)
local count1=tc:GetCounter(0x100e)
tc:RemoveCounter(tp,0,0,REASON_EFFECT)
if count1~=0 then Duel.RaiseEvent(e:GetHandler(),EVENT_REMOVE_COUNTER+0x100e,e,REASON_EFFECT,tp,tp,count) end
if count~=0 and tc:GetCounter(0x1f37)==0 and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function cm.actfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local cg=g:Select(tp,1,2,nil)
local tc=cg:GetFirst()
while tc do
tc:AddCounter(0x1f37,1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
tc=cg:GetNext()
end
end
end
\ No newline at end of file
local m=15005202
local cm=_G["c"..m]
cm.name="卡维-天园的理想"
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
--counter
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.ctcon)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(15005202)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph==PHASE_MAIN1 or ph==PHASE_MAIN2
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.rctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.ctfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.rctfilter(c)
return c:GetCounter(0x1f37)~=0
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCounter(tp,LOCATION_MZONE,LOCATION_MZONE,0x1f37)==0 then return end
local ct0=Duel.GetCounter(tp,LOCATION_MZONE,0,0x1f37)
local ct1=Duel.GetCounter(1-tp,LOCATION_MZONE,0,0x1f37)
local sg=Duel.GetMatchingGroup(cm.rctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=sg:GetFirst()
while tc do
tc:RemoveCounter(tp,0x1f37,tc:GetCounter(0x1f37),REASON_EFFECT)
tc=sg:GetNext()
end
local cg=Duel.GetMatchingGroup(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #cg~=0 then
local cc=cg:GetFirst()
while cc do
cc:AddCounter(0x1f37,1)
Duel.RaiseEvent(cc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
cc=cg:GetNext()
end
end
end
\ No newline at end of file
local m=15005203
local cm=_G["c"..m]
cm.name="艾尔海森-正理"
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,99,cm.lcheck)
c:EnableReviveLimit()
--
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetCondition(cm.tgcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--cannot target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCondition(cm.tgcon)
e2:SetValue(cm.atktg)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetCondition(cm.atkcon)
e3:SetValue(cm.atkval)
c:RegisterEffect(e3)
--place counter
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_COUNTER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetCost(cm.ctcost)
e4:SetTarget(cm.cttg)
e4:SetOperation(cm.ctop)
c:RegisterEffect(e4)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.lctfilter(c)
return aux.IsCounterAdded(c,0x1f37)
end
function cm.lcheck(g,lc)
return g:IsExists(cm.lctfilter,1,nil)
end
function cm.tgcon(e)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.atktg(e,c)
return c:IsFaceup() and aux.IsCounterAdded(c,0x1f37) and c~=e:GetHandler()
end
function cm.atkcon(e)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return Duel.GetCurrentPhase()==PHASE_DAMAGE_CAL and bc and bc:GetCounter(0x1f37)~=0
end
function cm.atkval(e)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc:GetCounter(0x1f37)*300
end
function cm.filter(c)
return c:GetCounter(0x1f37)>0
end
function cm.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function cm.ctfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(cm.ctfilter,tp,0,LOCATION_MZONE,1,nil)
end
local count=Duel.GetCounter(tp,LOCATION_MZONE,0,0x1f37)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.RemoveCounter(tp,LOCATION_MZONE,0,0x1f37,Duel.GetCounter(tp,LOCATION_MZONE,0,0x1f37),REASON_COST)
Duel.SetTargetParam(count)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local x=0
while x<ct do
local g=Duel.GetMatchingGroup(cm.ctfilter,tp,0,LOCATION_MZONE,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
local tc=g:Select(tp,1,1,nil):GetFirst()
tc:AddCounter(0x1f37,1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
x=x+1
end
end
\ No newline at end of file
local m=15005204
local cm=_G["c"..m]
cm.name="纳西妲-妙谛破愚之叶"
function cm.initial_effect(c)
--public
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,15005204)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
cm.public_effect=e1
--place
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,15005205)
e2:SetCondition(cm.regcon)
e2:SetTarget(cm.regtg)
e2:SetOperation(cm.regop)
c:RegisterEffect(e2)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.filter(c)
return c:GetCounter(0x1f37)>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
tc:RemoveCounter(tp,0x1f37,1,REASON_COST,e)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local fid=c:GetFieldID()
c:RegisterFlagEffect(15005204,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,EFFECT_FLAG_CLIENT_HINT,1,fid,66)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1)
--Damage
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(15005204)
e2:SetRange(LOCATION_HAND)
e2:SetTargetRange(0,1)
e2:SetLabel(fid)
e2:SetLabelObject(c)
e2:SetCondition(cm.indcon)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
e2:SetValue(300)
c:RegisterEffect(e2)
end
function cm.indcon(e)
local c=e:GetLabelObject()
return c:GetFlagEffectLabel(15005204)==e:GetLabel()
end
function cm.ctfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.rctfilter(c)
return c:GetCounter(0x1f37)==0
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ev>0 and eg and eg:IsExists(cm.rctfilter,1,nil) and ((e:GetHandler():IsFaceup() and e:GetHandler():IsLocation(LOCATION_MZONE)) or (e:GetHandler():IsPublic() and e:GetHandler():IsLocation(LOCATION_HAND))) and not e:GetHandler():IsStatus(STATUS_CHAINING) and ((not re) or re~=c.public_effect)
end
function cm.regtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(15005205)==0 end
c:RegisterFlagEffect(15005205,RESET_CHAIN,0,1)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local cg=eg:Filter(cm.rctfilter,nil):Filter(cm.ctfilter,nil)
if #cg~=0 then
local cc=cg:GetFirst()
while cc do
cc:AddCounter(0x1f37,1)
Duel.RaiseEvent(cc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
cc=cg:GetNext()
end
end
end
\ No newline at end of file
local m=15005206
local cm=_G["c"..m]
cm.name="瑶瑶-正思无邪"
function cm.initial_effect(c)
--place
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCountLimit(1,15005206)
e1:SetCondition(cm.pccon)
e1:SetCost(cm.pccost)
e1:SetOperation(cm.pcop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,15005207)
e2:SetCost(cm.cost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.pccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function cm.pccost(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.pcop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.ctop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function cm.ctfilter(c)
return c:IsFaceup() and c:IsCanAddCounter(0x1f37,1)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.ctfilter,1,nil) then
local g=eg:Filter(cm.ctfilter,nil)
local tc=g:GetFirst()
while tc do
tc:AddCounter(0x1f37,1,REASON_EFFECT)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
tc=g:GetNext()
end
end
end
function cm.filter(c)
return c:GetCounter(0x1f37)>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
tc:RemoveCounter(tp,0x1f37,1,REASON_COST)
end
function cm.thfilter(c)
return aux.IsCounterAdded(c,0x1f37) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and not c:IsCode(15005206)
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.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
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>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
local m=15005208
local cm=_G["c"..m]
cm.name="绮良良-沿途百景会心"
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,15005208)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
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+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BE_MATERIAL)
e3:SetProperty(EFFECT_FLAG_EVENT_PLAYER)
e3:SetCondition(cm.indcon)
e3:SetOperation(cm.indop)
c:RegisterEffect(e3)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.spfilter(c,e,tp)
return aux.IsCounterAdded(c,0x1f37) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and not c:IsCode(15005208)
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_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsCanAddCounter(0x1f37,1) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.ConfirmCards(1-tp,g)
if c:IsRelateToEffect(e) and c:IsCanAddCounter(0x1f37,1) then
c:AddCounter(0x1f37,1,REASON_EFFECT)
Duel.RaiseEvent(c,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
end
end
end
function cm.indcon(e,tp,eg,ep,ev,re,r,rp)
return r==REASON_LINK
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(cm.indval)
e1:SetOwnerPlayer(ep)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
function cm.indval(e,re,rp)
return rp==1-e:GetOwnerPlayer()
end
\ No newline at end of file
local m=15005209
local cm=_G["c"..m]
cm.name="白术-盈虚藏象"
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,15005209)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--destroy replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,15005210)
e3:SetTarget(cm.reptg)
e3:SetValue(cm.repval)
e3:SetOperation(cm.repop)
c:RegisterEffect(e3)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.ctfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanAddCounter(0x1f37,1)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and cm.ctfilter(chkc) end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 and tc:IsRelateToEffect(e) and cm.ctfilter(tc) then
tc:AddCounter(0x1f37,1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
end
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:GetCounter(0x1f37)>0 and c:IsControler(tp)
and c:IsReason(REASON_BATTLE+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 eg:IsExists(cm.repfilter,1,nil,tp)
and Duel.IsCanRemoveCounter(tp,1,0,0x1f37,1,REASON_EFFECT) 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_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
tc:RemoveCounter(tp,0x1f37,1,REASON_EFFECT)
end
\ No newline at end of file
local m=15005211
local cm=_G["c"..m]
cm.name="心景幻成-净善摄受明论"
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_FZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(cm.ct2filter))
e2:SetValue(300)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e3)
--SearchCard
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1,15005211)
e4:SetCost(cm.cost)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.ct1filter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.ct2filter(c)
return c:GetCounter(0x1f37)>0
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.ct1filter,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,cm.ct1filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if #g~=0 then
g:GetFirst():AddCounter(0x1f37,1)
Duel.RaiseEvent(g:GetFirst(),EVENT_CUSTOM+15005201,e,0,tp,tp,1)
end
end
end
function cm.filter(c)
return c:GetCounter(0x1f37)>0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil)
end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=g:Select(tp,1,1,nil):GetFirst()
tc:RemoveCounter(tp,0x1f37,1,REASON_COST)
end
function cm.thfilter(c)
return aux.IsCounterAdded(c,0x1f37) 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
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,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.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
\ No newline at end of file
local m=15005212
local cm=_G["c"..m]
cm.name="显象缚结-谜林道破"
function cm.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,15005212+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target1)
e1:SetOperation(cm.activate1)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,15005212+EFFECT_COUNT_CODE_OATH)
e2:SetTarget(cm.target2)
e2:SetOperation(cm.activate2)
c:RegisterEffect(e2)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.ctfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsFaceup() and c:IsCanAddCounter(0x1f37,1)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() and cm.ctfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and cm.ctfilter(tc) then
tc:AddCounter(0x1f37,1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
end
end
function cm.atkfilter(c)
return c:IsFaceup() and c:GetCounter(0x1f37)>0 and (c:GetAttack()>0 or c:GetDefense()>0 or aux.NegateMonsterFilter(c))
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SET_ATTACK_FINAL)
e0:SetValue(0)
e0:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e1)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
\ No newline at end of file
local m=15005213
local cm=_G["c"..m]
cm.name="繁绘隅穹-工艺家的奇想"
function cm.initial_effect(c)
--counter
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1,15005213+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.cttg)
e1:SetOperation(cm.ctop)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,15005214)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.rctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.ctfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.rctfilter(c)
return c:GetCounter(0x1f37)~=0
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetCounter(tp,LOCATION_MZONE,LOCATION_MZONE,0x1f37)==0 then return end
local ct0=Duel.GetCounter(tp,LOCATION_MZONE,0,0x1f37)
local ct1=Duel.GetCounter(1-tp,LOCATION_MZONE,0,0x1f37)
local sg=Duel.GetMatchingGroup(cm.rctfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
local tc=sg:GetFirst()
while tc do
tc:RemoveCounter(tp,0x1f37,tc:GetCounter(0x1f37),REASON_EFFECT)
tc=sg:GetNext()
end
local cg=Duel.GetMatchingGroup(cm.ctfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #cg~=0 then
local cc=cg:GetFirst()
while cc do
cc:AddCounter(0x1f37,1)
Duel.RaiseEvent(cc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
cc=cg:GetNext()
end
end
end
function cm.spfilter(c,e,tp)
return aux.IsCounterAdded(c,0x1f37) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and cm.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,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 tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
local m=15005215
local cm=_G["c"..m]
cm.name="造生缠藤箭-诸叶辨通"
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCountLimit(1,15005215+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--counter
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_COUNTER)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetCountLimit(1,15005216)
e3:SetCost(aux.bfgcost)
e3:SetTarget(cm.cttg)
e3:SetOperation(cm.ctop)
c:RegisterEffect(e3)
if not TddSkandhaGlobalCheck then
TddSkandhaGlobalCheck=true
_SkandhaCRemoveCounter=Card.RemoveCounter
function Card.RemoveCounter(tc,p,countertype,ct,r,re)
if countertype==0 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),count)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),count)
end
end
if countertype==0x1f37 then
local count=tc:GetCounter(0x1f37)
if count>0 and not re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,nil,r,p,tc:GetControler(),ct)
elseif count>0 and re then
Duel.RaiseEvent(tc,EVENT_REMOVE_COUNTER+0x1f37,re,r,p,tc:GetControler(),ct)
end
end
return _SkandhaCRemoveCounter(tc,p,countertype,ct,r)
end
_SkandhaDRemoveCounter=Duel.RemoveCounter
function Duel.RemoveCounter(p,s,o,countertype,ct,r)
if countertype~=0x1f37 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
if s~=0 and o~=0 then
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local f=function(c)
return c:GetCounter(0x1f37)>0
end
local rmg=Duel.GetMatchingGroup(f,p,s,o,nil)
local rmg0=rmg:Filter(Card.IsControler,nil,0)
local rmg1=rmg:Filter(Card.IsControler,nil,1)
if #rmg0~=0 then
Duel.RaiseEvent(rmg0,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,0,ct)
end
if #rmg1~=0 then
Duel.RaiseEvent(rmg1,EVENT_REMOVE_COUNTER+0x1f37,nil,r,7,1,ct)
end
return _SkandhaDRemoveCounter(p,s,o,countertype,ct,r)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_LEAVE_FIELD_P)
ge1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0=eg:Filter(Card.IsControler,nil,0):GetSum(Card.GetCounter,0x1f37)
local ct1=eg:Filter(Card.IsControler,nil,1):GetSum(Card.GetCounter,0x1f37)
e:SetLabel(ct0,ct1)
end)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD)
ge2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
return ct0~=0 or ct1~=0
end)
ge2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local ct0,ct1=e:GetLabelObject():GetLabel()
if ct0~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,0,ct0)
end
if ct1~=0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+15005200,re,r,rp,1,ct1)
end
end)
ge2:SetLabelObject(ge1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CUSTOM+15005200)
ge3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0
end)
ge3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge3,0)
local ge4=Effect.CreateEffect(c)
ge4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge4:SetCode(EVENT_REMOVE_COUNTER+0x1f37)
ge4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return ev>0 and (rp==0 or rp==1)
end)
ge4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local x=100
if Duel.IsPlayerAffectedByEffect(ep,15005204) then
x=Duel.IsPlayerAffectedByEffect(ep,15005204):GetValue()
end
if Duel.IsPlayerAffectedByEffect(ep,15005202) then
Duel.Recover(ep,ev*x,REASON_EFFECT)
else
Duel.Damage(ep,ev*x,REASON_EFFECT)
end
end)
Duel.RegisterEffect(ge4,0)
end
end
cm.counter_add_list={0x1f37}
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsChainNegatable(ev) then return false end
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():GetCounter(0x1f37)~=0
end
function cm.target(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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
local code=re:GetHandler():GetCode()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(code)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(cm.aclimit)
Duel.RegisterEffect(e1,tp)
end
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel()) and re:IsActiveType(TYPE_MONSTER)
end
function cm.actfilter(c)
return c:IsCanAddCounter(0x1f37,1)
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if #g~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local cg=g:Select(tp,1,2,nil)
local tc=cg:GetFirst()
while tc do
tc:AddCounter(0x1f37,1)
Duel.RaiseEvent(tc,EVENT_CUSTOM+15005201,e,0,tp,tp,1)
tc=cg:GetNext()
end
end
end
\ No newline at end of file
--N×M 露丝
local s,id=GetID()
function s.summon(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCost(s.sumcost)
e2:SetTarget(s.sumtg)
e2:SetOperation(s.sumop)
c:RegisterEffect(e2)
end
function s.cfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
end
function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.cfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,c,tp)
Duel.Release(g,REASON_COST)
end
function s.sumfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsSummonable(true,nil)
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Summon(tp,c,true,nil)
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(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return not c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47320020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.sccon)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.synfilter(c,tc,mg)
return c:IsSynchroSummonable(tc,mg)
end
function s.sfilter(c)
return c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function s.ontg(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function s.thfilter(c)
return c:IsSetCard(0x434) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.initial_effect(c)
s.summon(c)
s.tohand(c)
s.ontg(c)
end
--N×M 图莉普
local s,id=GetID()
function s.summon(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCost(s.sumcost)
e2:SetTarget(s.sumtg)
e2:SetOperation(s.sumop)
c:RegisterEffect(e2)
end
function s.cfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
end
function s.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,c,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.cfilter1,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,c,tp)
Duel.Release(g,REASON_COST)
end
function s.sumfilter(c)
return (c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)) and c:IsFaceup()
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Summon(tp,c,true,nil)
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(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return not c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47320020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.sccon)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.synfilter(c,tc,mg)
return c:IsSynchroSummonable(tc,mg)
end
function s.sfilter(c)
return c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function s.ontg(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function s.thfilter(c)
return c:IsSetCard(0x434) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.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 s.initial_effect(c)
s.summon(c)
s.tohand(c)
s.ontg(c)
end
--N×M 桑弗洛
local s,id=GetID()
function s.summon(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SUMMON)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id)
e2:SetCondition(s.sumcon)
e2:SetTarget(s.sumtg)
e2:SetOperation(s.sumop)
c:RegisterEffect(e2)
end
function s.cfilter1(c,tp)
return c:IsType(TYPE_MONSTER) and c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0
end
function s.spfilter(c,tp)
return c:IsSetCard(0x434) and c:IsSummonLocation(LOCATION_EXTRA) and c:IsControler(tp)
end
function s.sumcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.spfilter,1,nil,tp)
end
function s.sumfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsSummonable(true,nil)
end
function s.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSummonable(true,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,e:GetHandler(),1,0,0)
end
function s.sumop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Summon(tp,c,true,nil)
end
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47320020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.sccon)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.synfilter(c,tc,mg)
return c:IsSynchroSummonable(tc,mg)
end
function s.sfilter(c)
return c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil,mg)
end
end
function s.ontg(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function s.thfilter(c)
return c:IsSetCard(0x434) and c:IsAbleToHand() and not c:IsCode(47320003)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,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 s.initial_effect(c)
s.summon(c)
s.tohand(c)
s.ontg(c)
end
--N×M 康乃馨
local s,id=GetID()
function s.peff(c)
aux.EnablePendulumAttribute(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.scost)
e1:SetTarget(s.stg)
e1:SetOperation(s.sop)
c:RegisterEffect(e1)
end
function s.scost(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 s.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,0,0)
end
function s.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsSetCard(0x434)
end
function s.sop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
end
end
function s.search(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id-1000)
e1:SetTarget(s.thtg)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function s.filter(c,tp)
if not Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil,c:GetCode()) then return false end
return c:IsType(TYPE_SPIRIT) and c:IsLevel(4) and c:IsAbleToRemove()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_GRAVE,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_GRAVE,0,1,1,nil,tp)
e:SetLabel(g:GetFirst():GetCode())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 then
local code=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil,code)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER) then
local token=Duel.CreateToken(tp,47320021)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47320021,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetCondition(s.fscon)
e2:SetTarget(s.fstg)
e2:SetOperation(s.fsop)
c:RegisterEffect(e2)
end
function s.fscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.mfilter(c,e)
return c:IsReleasable() and not c:IsImmuneToEffect(e)
end
function s.sfilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FAIRY) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local sg1=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Release(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.onrelease(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_DECK)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id-2000)
e1:SetCondition(s.thcon)
e1:SetTarget(s.thtg2)
e1:SetOperation(s.thop2)
c:RegisterEffect(e1)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsReason(REASON_RELEASE) and c:IsLocation(LOCATION_EXTRA)
and c:IsFaceup()
end
function s.thtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToHand() end
end
function s.thop2(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
end
end
function s.initial_effect(c)
s.peff(c)
s.search(c)
s.tohand(c)
s.onrelease(c)
end
--N×M 艾莉丝
local s,id=GetID()
function s.sptoken(c)
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_FLIP)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return (c:IsSetCard(0x434) or (c:IsType(TYPE_SPIRIT) and c:IsType(TYPE_MONSTER))) and not c:IsPublic()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
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(s.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.splimit(e,c)
return not c:IsRace(RACE_FAIRY) and c:IsLocation(LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE)
end
function s.tohand(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_FLIP)
c:RegisterEffect(e2)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER) then
local token=Duel.CreateToken(tp,47320021)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47320021,1))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetCondition(s.fscon)
e2:SetTarget(s.fstg)
e2:SetOperation(s.fsop)
c:RegisterEffect(e2)
end
function s.fscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.mfilter(c,e)
return c:IsReleasable() and not c:IsImmuneToEffect(e)
end
function s.sfilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FAIRY) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local sg1=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Release(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.ontg(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.setcon)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsPreviousLocation(LOCATION_DECK)
end
function s.setfilter(c)
return c:IsSetCard(0x434) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsSSetable() end
if chk==0 then return Duel.IsExistingTarget(s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) and
Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,s.setfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc)
end
end
function s.initial_effect(c)
s.sptoken(c)
s.tohand(c)
s.ontg(c)
end
--N×M 佩图莉娅
local s,id=GetID()
function s.eff1(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_RECOVER+CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cfilter(c,lg)
return lg:IsContains(c)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(s.cfilter,1,nil,lg)
end
function s.lkfilter(c,att)
return c:IsFaceup() and c:IsAttribute(att)
end
function s.filter(c)
return (c:IsSetCard(0x434) or c:IsType(TYPE_SPIRIT)) and c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_FIRE)
local b2=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_WATER)
local b3=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_ALL-ATTRIBUTE_FIRE-ATTRIBUTE_WATER)
if chk==0 then return b1 or b2 or b3 end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local lg=e:GetHandler():GetLinkedGroup()
local b1=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_MZONE,0,1,nil) and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_FIRE)
local res=0
if b1 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,1,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(800)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
res=res+1
tc=g:GetNext()
end
Duel.BreakEffect()
Duel.Damage(1-tp,800,REASON_EFFECT)
end
lg=e:GetHandler():GetLinkedGroup()
local b2=Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_ONFIELD,0,1,nil) and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_WATER)
if b2 then
if res~=0 then Duel.BreakEffect() end
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,0,1,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
res=res+1
tc=g:GetNext()
end
Duel.BreakEffect()
Duel.Recover(tp,600,REASON_EFFECT)
end
lg=e:GetHandler():GetLinkedGroup()
local b3=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>1
and Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and lg:IsExists(s.lkfilter,1,nil,ATTRIBUTE_ALL-ATTRIBUTE_FIRE-ATTRIBUTE_WATER)
if b3 then
if res~=0 then Duel.BreakEffect() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND,0,nil)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tg=Duel.SelectMatchingCard(tp,s.setfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SSet(tp,tg)
end
end
function s.setfilter(c)
return c:IsSetCard(0x434) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function s.eff2(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.drcon)
e1:SetTarget(s.drtg)
e1:SetOperation(s.drop)
c:RegisterEffect(e1)
end
function s.drfilter(c,lg)
return c:IsType(TYPE_TOKEN) and lg:IsContains(c)
end
function s.drcon(e,tp,eg,ep,ev,re,r,rp)
local lg=e:GetHandler():GetLinkedGroup()
return eg:IsExists(s.drfilter,1,nil,lg)
end
function s.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 s.drop(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 s.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_SPIRIT),2,2)
s.eff1(c)
s.eff2(c)
end
--N×M 薇尔莉特
local s,id=GetID()
function s.peff(c)
aux.EnablePendulumAttribute(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_GRAVE_SPSUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKBOTTOM,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x434) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsCanBeSpecialSummoned(e,0,tp,true,false) end
if chk==0 then return Duel.GetMZoneCount(tp)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
end
function s.remove(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.regop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id-1000)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToRemove),tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function s.toextra(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoExtraP(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER) then
local token=Duel.CreateToken(tp,47320021)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(47320021,0))
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_MAIN_END)
e2:SetCountLimit(1)
e2:SetCondition(s.fscon)
e2:SetTarget(s.fstg)
e2:SetOperation(s.fsop)
c:RegisterEffect(e2)
end
function s.fscon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.mfilter(c,e)
return c:IsReleasable() and not c:IsImmuneToEffect(e)
end
function s.sfilter(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_FAIRY) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function s.fstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD)
end
function s.fsop(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(s.mfilter,nil,e)
local sg1=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.Release(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function s.onleave(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_EXTRA)
e1:SetCountLimit(1,id-2000)
e1:SetCondition(s.pcon)
e1:SetTarget(s.ptg)
e1:SetOperation(s.pop)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and bit.band(c:GetPreviousTypeOnField(),TYPE_TOKEN)~=0
end
function s.pcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(c) and c:IsFaceup()
end
function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function s.pop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end
end
function s.ffilter(c)
return c:IsFusionSetCard(0x434) or c:IsFusionType(TYPE_SPIRIT)
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,s.ffilter,2,true)
s.peff(c)
s.remove(c)
s.toextra(c)
s.onleave(c)
end
--N×M 普拉姆·布罗瑟
local s,id=GetID()
function s.peff(c)
aux.EnablePendulumAttribute(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.descost)
e1:SetTarget(s.destg)
e1:SetOperation(s.desop)
c:RegisterEffect(e1)
end
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtra() end
Duel.SendtoDeck(e:GetHandler(),nil,SEQ_DECKBOTTOM,REASON_COST)
end
function s.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.desfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,s.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function s.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 s.negate(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.regop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id-1000)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCondition(s.ngcon)
e2:SetTarget(s.ngtg)
e2:SetOperation(s.ngop)
c:RegisterEffect(e2)
end
function s.regop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(id)~=0
end
function s.ngtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,nil) end
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateEffectMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
function s.toextra(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE)
end
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() and Duel.SendtoExtraP(c,nil,REASON_EFFECT)~=0
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
s.give(token)
end
end
function s.give(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(47320020,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(s.sccon)
e1:SetTarget(s.sctg)
e1:SetOperation(s.scop)
c:RegisterEffect(e1)
end
function s.sccon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return not e:GetHandler():IsStatus(STATUS_CHAINING) and Duel.GetTurnPlayer()~=tp
and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function s.synfilter(c,tc,mg)
return c:IsSynchroSummonable(tc,mg)
end
function s.sfilter(c)
return (c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)) and c:IsFaceup()
end
function s.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(s.synfilter,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler(),mg) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(s.sfilter,tp,LOCATION_MZONE,0,nil)
if c:GetControler()~=tp or not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(s.synfilter,tp,LOCATION_EXTRA,0,nil,c,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c,mg)
end
end
function s.onleave(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_LEAVE_FIELD)
e1:SetRange(LOCATION_EXTRA)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id-2000)
e1:SetCondition(s.pcon)
e1:SetTarget(s.ptg)
e1:SetOperation(s.pop)
c:RegisterEffect(e1)
end
function s.cfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and bit.band(c:GetPreviousTypeOnField(),TYPE_TOKEN)~=0
end
function s.pcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(c) and c:IsFaceup()
end
function s.ptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function s.pop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end
end
function s.ffilter(c)
return c:IsFusionSetCard(0x434) or c:IsFusionType(TYPE_SPIRIT)
end
function s.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(Card.IsRace,RACE_FAIRY),1,99)
s.peff(c)
s.negate(c)
s.toextra(c)
s.onleave(c)
end
--N×M 达丽雅
local s,id=GetID()
function s.release(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetCost(s.rlcost)
e1:SetTarget(s.rltg)
e1:SetOperation(s.rlop)
c:RegisterEffect(e1)
end
function s.rlcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.rltg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsReleasableByEffect() end
if chk==0 then return Duel.IsExistingTarget(Card.IsReleasableByEffect,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,Card.IsReleasableByEffect,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,1,0,0)
if e:GetHandler():GetOverlayGroup():FilterCount(Card.IsSetCard,nil,0x434)~=0 then
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(600)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,600)
end
end
function s.sovfilter(c)
return c:IsSetCard(0x434) and c:GetOriginalType()&TYPE_MONSTER~=0
end
function s.rlop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Release(tc,REASON_EFFECT)
if e:GetHandler():GetOverlayGroup():FilterCount(s.sovfilter,nil)~=0 then
Duel.BreakEffect()
Duel.Recover(tp,600,REASON_EFFECT)
end
end
end
function s.toextra(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetOperation(s.retreg)
c:RegisterEffect(e1)
end
function s.retreg(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetDescription(1104)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetReset(RESET_EVENT+0x1ee0000+RESET_PHASE+PHASE_END)
e1:SetCondition(aux.SpiritReturnConditionForced)
e1:SetTarget(s.rettg)
e1:SetOperation(s.retop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCondition(aux.SpiritReturnConditionOptional)
c:RegisterEffect(e2)
end
function s.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:IsHasType(EFFECT_TYPE_TRIGGER_F) then
return true
else
return c:IsAbleToExtra()
end
end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,c,1,0,0)
if c:GetOverlayGroup():FilterCount(Card.IsAbleToHand,nil)~=0 then
local g=c:GetOverlayGroup():Filter(Card.IsAbleToHand,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,#g,0,0)
end
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=c:GetOverlayGroup():Filter(Card.IsAbleToHand,nil)
if #g>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
local cg=g:Filter(Card.IsLocation,nil,LOCATION_HAND)
if #cg>0 then
Duel.ConfirmCards(1-tp,cg)
end
end
Duel.SendtoDeck(c,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
end
end
function s.onrelease(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_RELEASE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.ovcon)
e1:SetTarget(s.ovtg)
e1:SetOperation(s.ovop)
c:RegisterEffect(e1)
end
function s.ovcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSetCard,1,nil,0x434)
end
function s.ovfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsCanOverlay()
end
function s.ovtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.ovfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
end
function s.ovop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,s.ovfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(e:GetHandler(),g)
end
end
function s.initial_effect(c)
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsType,TYPE_SPIRIT),4,2,nil,nil,99)
c:EnableReviveLimit()
s.release(c)
s.toextra(c)
s.onrelease(c)
end
--N×M 居所
local s,id=GetID()
function s.summon(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetRange(LOCATION_FZONE)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x434))
c:RegisterEffect(e1)
end
function s.indes(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_COUNT)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.indtg)
e1:SetValue(s.indct)
c:RegisterEffect(e1)
end
function s.indtg(e,c)
return c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)
end
function s.indct(e,re,r,rp)
if bit.band(r,REASON_BATTLE)~=0 then
return 1
else return 0 end
end
function s.recover(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_FZONE)
e1:SetCountLimit(1)
e1:SetCondition(s.rccon)
e1:SetTarget(s.rctg)
e1:SetOperation(s.rcop)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SUMMON_SUCCESS)
ge1:SetOperation(s.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function s.filter(c)
return c:IsType(TYPE_SPIRIT) and c:IsFaceup()
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(s.filter,nil)
if #g>0 then
local tc=g:GetFirst()
while tc do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),id,RESET_PHASE+PHASE_END,0,1)
tc=eg:GetNext()
end
end
end
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,id)~=0
end
function s.tdfilter(c)
return c:IsType(TYPE_SPIRIT) and c:IsAbleToDeck()
end
function s.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.tdfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
end
function s.fselect(g)
return g:IsExists(Card.IsType,1,nil,TYPE_SPIRIT)
end
function s.rcop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_HAND+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:SelectSubGroup(tp,s.fselect,false,1,3)
if #tg>0 then
local cg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
Duel.ConfirmCards(1-tp,cg)
local co=Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
if co>0 then
Duel.BreakEffect()
if Duel.Recover(tp,co*600,REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetOperation(s.drop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY)
Duel.RegisterEffect(e1,tp)
end
end
end
end
function s.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsPlayerCanDraw(tp,1) then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
s.summon(c)
s.indes(c)
s.recover(c)
end
--N×M 迎接
local s,id=GetID()
function s.active(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsSetCard(0x434) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.sfilter(c,code,e)
return not c:IsCode(code) and c:IsSummonable(true,nil) and c:IsLevel(4)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,tc:GetCode())
and Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(s.sfilter,tp,LOCATION_HAND,0,1,nil,tc:GetCode(),e)
and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local sg=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_HAND,0,1,1,nil,tc:GetCode(),e)
local sc=sg:GetFirst()
if sc then
Duel.Summon(tp,sc,true,nil)
end
end
end
end
function s.changelv(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,2))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_GRAVE)
e1:SetCost(aux.bfgcost)
e1:SetTarget(s.lvtg)
e1:SetOperation(s.lvop)
c:RegisterEffect(e1)
end
function s.lvfilter(c)
return (c:IsType(TYPE_SPIRIT) or c:IsType(TYPE_TOKEN)) and c:IsFaceup() and c:GetLevel()>0
end
function s.lvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and s.lvfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.lvfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,s.lvfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function s.lvop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local sel=0
local lvl=1
if tc:IsLevel(1) then
sel=Duel.SelectOption(tp,aux.Stringid(id,3))
else
sel=Duel.SelectOption(tp,aux.Stringid(id,3),aux.Stringid(id,4))
end
if sel==1 then
lvl=-1
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetValue(lvl)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
end
end
function s.initial_effect(c)
s.active(c)
s.changelv(c)
end
--N×M 休憩
local s,id=GetID()
function s.active(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SUMMON+CATEGORY_POSITION+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.filter(c)
return c:IsType(TYPE_TOKEN) and c:IsReleasable()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(s.sumfilter,tp,LOCATION_HAND,0,1,nil) end
local g=Duel.SelectTarget(tp,s.filter,tp,LOCATION_MZONE,0,1,nil)
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,0,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,g,0,0,0)
end
function s.sumfilter(c)
return c:IsSummonable(true,nil) and c:IsType(TYPE_SPIRIT) and c:IsLevel(4)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,s.sumfilter,tp,LOCATION_HAND,0,1,1,nil)
local tc=g:GetFirst()
if tc then
Duel.Summon(tp,tc,true,nil)
Duel.BreakEffect()
local tt=Duel.GetFirstTarget()
if tt and tt:IsRelateToEffect(e) then
Duel.Release(tt,REASON_EFFECT)
end
end
end
function s.recover(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1)
e1:SetCondition(s.rccon)
e1:SetCost(aux.bfgcost)
e1:SetOperation(s.rcop)
c:RegisterEffect(e1)
end
function s.rfilter(c)
return c:IsFaceup() and c:IsType(TYPE_SPIRIT)
end
function s.rccon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 and Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function s.rcop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT)
end
function s.initial_effect(c)
s.active(c)
s.recover(c)
end
--N×M 清扫
local s,id=GetID()
function s.active(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.rfilter(c)
return c:IsReleasable() and c:IsType(TYPE_MONSTER)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.rfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,s.rfilter,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil)
local tc=g:GetFirst()
if tc then
local att=tc:GetAttribute()
if Duel.Release(g,REASON_EFFECT)>0 and Duel.NegateEffect(ev) then
Duel.BreakEffect()
if att&ATTRIBUTE_FIRE~=0 and Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320020,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,47320020)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
end
if att&ATTRIBUTE_WATER~=0 and Duel.GetMZoneCount(tp)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,47320021,0x434,TYPES_TOKEN_MONSTER,1000,1000,4,RACE_FAIRY,ATTRIBUTE_WATER) then
local token=Duel.CreateToken(tp,47320021)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)
Duel.SpecialSummonComplete()
end
if att&(ATTRIBUTE_ALL-ATTRIBUTE_FIRE-ATTRIBUTE_WATER)~=0 and Duel.GetFieldGroupCount(tp,0,LOCATION_SZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local tg=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_SZONE,1,1,nil)
Duel.Destroy(tg,REASON_EFFECT)
end
end
end
end
function s.set(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_RECOVER)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id-1000)
e1:SetCondition(s.setcon)
e1:SetTarget(s.settg)
e1:SetOperation(s.setop)
c:RegisterEffect(e1)
end
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp
end
function s.settg(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 s.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SSet(tp,c)
end
end
function s.initial_effect(c)
s.active(c)
s.set(c)
end
...@@ -3,7 +3,7 @@ local s,id=GetID() ...@@ -3,7 +3,7 @@ local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--spsummon --spsummon
local e0=Effect.CreateEffect(c) local e0=Effect.CreateEffect(c)
e0:SetDescription(aux.Stringid(m,0)) e0:SetDescription(aux.Stringid(id,0))
e0:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP) e0:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_EQUIP)
e0:SetType(EFFECT_TYPE_IGNITION) e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetRange(LOCATION_HAND) e0:SetRange(LOCATION_HAND)
......
...@@ -3,7 +3,7 @@ local s,id=GetID() ...@@ -3,7 +3,7 @@ local s,id=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH) e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
......
...@@ -227,6 +227,9 @@ ...@@ -227,6 +227,9 @@
!setname 0x9540 西风教会 !setname 0x9540 西风教会
!setname 0xa540 璃月 !setname 0xa540 璃月
!setname 0xc540 契约 !setname 0xc540 契约
!setname 0xe540 须弥
!counter 0x410 棱镜指示物
!counter 0x1406 蕴种印指示物
#yuangeril 1404497238 118 0x310-0x31f #yuangeril 1404497238 118 0x310-0x31f
!setname 0x3310 创造物 !setname 0x3310 创造物
...@@ -460,6 +463,7 @@ ...@@ -460,6 +463,7 @@
!counter 0x1f30 红指示物 !counter 0x1f30 红指示物
!counter 0x1f31 岩指示物 !counter 0x1f31 岩指示物
!counter 0x1f33 理智 !counter 0x1f33 理智
!counter 0x1f37 蕴种指示物
!counter 0xf3c 幻象指示物 !counter 0xf3c 幻象指示物
!counter 0xf3f 隐痛指示物 !counter 0xf3f 隐痛指示物
......
# Delete List (Codepage is UTF-8, please use TAB to seperate entries, Use Relative Address.) # Delete List (Codepage is UTF-8, please use TAB to seperate entries, Use Relative Address.)
\ No newline at end of file \ No newline at end of file
This diff is collapsed.
2023/12/12 19:42:01 2023/12/14 8:39:06
\ No newline at end of file \ 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