Commit a592bfe6 authored by Nemo Ma's avatar Nemo Ma

update

parent 19cc3ac0
No preview for this file type
--虚拟YouTuber 名取纱那
local m=33701403
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,5,2,cm.ovfilter,aux.Stringid(m,0),2)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetCondition(cm.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e3:SetCondition(cm.indcon)
e3:SetValue(1)
c:RegisterEffect(e3)
end
function cm.atkval(e,c)
return c:GetOverlayCount()*500
end
function cm.indcon(e)
return e:GetHandler():GetOverlayCount()==0
end
--虚拟主播 楠栞桜
local m=33701404
local cm=_G["c"..m]
function cm.initial_effect(c)--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.spcon)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BATTLE_CONFIRM)
e2:SetCondition(cm.tgcon)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetLabelObject(e2)
e3:SetCondition(cm.atcon)
e3:SetOperation(cm.atop)
c:RegisterEffect(e3)
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsCanAddCounter,tp,LOCATION_MZONE,0,1,nil,0x1440,1)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.GetMatchingGroupCount(Card.IsCanAddCounter,tp,LOCATION_MZONE,0,nil,0x1440,1)==0 then return end
local sg=Group.CreateGroup()
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg1=Duel.SelectMatchingCard(tp,Card.IsCanAddCounter,tp,LOCATION_MZONE,0,1,1,nil,0x1440,1)
local sc=sg1:GetFirst()
sc:AddCounter(0x1440,1)
--atk down
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(cm.atkval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
sc:RegisterEffect(e1)
if sc:IsAttackBelow(0) and not sg:IsContains(sc) then
sg:AddCard(sc)
end
end
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function cm.atkval(e,c)
return c:GetCounter(0x1440)*-1000
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetAttackTarget()
local c=e:GetHandler()
return Duel.GetAttacker()==c and t~=nil and t:GetAttack()<c:GetAttack() and
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetFirstTarget()
if t:IsRelateToBattle() then
Duel.SendtoGrave(t,REASON_EFFECT)
end
end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
return re==e:GetLabelObject() and e:GetHandler():IsChainAttackable()
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChainAttack()
end
--【背景音台】最终之所 ~The Farthest Ends~
local m=33701405
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_COUNTER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.sumlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetOperation(cm.regop)
c:RegisterEffect(e4)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local ct=math.floor(Duel.GetLP(tp)/100)
if chk==0 then return Duel.IsCanAddCounter(tp,0x1440,ct,c) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local ct=math.floor(Duel.GetLP(tp)/100)
c:AddCounter(0x1440,ct)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetAttacker()
return tp~=Duel.GetTurnPlayer() and tg:IsOnField() and tg:IsCanBeEffectTarget(e)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,true,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP_ATTACK) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_SET_ATTACK_FINAL)
e3:SetValue(0)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e4)
end
Duel.SpecialSummonComplete()
local at=Duel.GetAttacker()
if tc and at:IsAttackable() and not at:IsImmuneToEffect(e) then
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetTargetRange(1,0)
e4:SetReset(RESET_EVENT+EVENT_DAMAGE_STEP_END)
e4:SetValue(cm.damval)
Duel.RegisterEffect(e4,tp)
Duel.CalculateDamage(at,tc)
end
end
end
function cm.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_BATTLE)==0 then return val end
local c=e:GetOwner()
local ct=c:GetCounter(0x1440)
local ct1=math.ceil(val/100)
if ct<ct1 then ct1=ct end
c:RemoveCounter(c:GetControler(),0x1440,ct1,REASON_EFFECT+REASON_REPLACE)
if val>ct1 then val=val-ct1*100
else val=0 end
return val
end
function cm.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return bit.band(Duel.GetCurrentPhase(),PHASE_MAIN1+PHASE_MAIN2)~=0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetCounter(0x1)
if ct==0 then
Duel.SetLP(tp,0)
else
Duel.Recover(tp,math.max(ct*100,4000),REASON_EFFECT)
end
end
--物为群分
local m=33701406
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER)
end
function cm.fselect(g)
return (g:GetClassCount(Card.GetRace())==g:GetCount() and g:GetClassCount(Card.GetAttribute())==g:GetCount())
or (g:GetClassCount(Card.GetRace())==1)
or (g:GetClassCount(Card.GetAttribute())==1)
end
function cm.fselect1(g,op)
return (op==0 and g:GetClassCount(Card.GetRace())==g:GetCount() and g:GetClassCount(Card.GetAttribute())==g:GetCount())
or (op==1 and g:GetClassCount(Card.GetRace())==1)
or (op==2 and g:GetClassCount(Card.GetAttribute())==1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
return g:CheckSubGroup(cm.fselect,1,15)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local mg=g:SelectSubGroup(tp,cm.fselect,false,1,15)
local op=0
local ct=mg:GetCount()
if mg:GetClassCount(Card.GetRace())==mg:GetCount() and mg:GetClassCount(Card.GetAttribute())==mg:GetCount() then op=0
elseif mg:GetClassCount(Card.GetRace())==1 then op=1
elseif mg:GetClassCount(Card.GetAttribute())==1 then op=2 end
Duel.ConfirmCards(1-tp,mg)
local g1=Duel.GetMatchingGroup(cm.filter,1-tp,LOCATION_DECK,0,nil)
if g1:GetCount()>0 and g1:CheckSubGroup(cm.fselect1,ct,ct,op) and Duel.SelectYesNo(1-tp,aux.Stringid(m,0)) then
local mg1=g:SelectSubGroup(tp,cm.fselect,false,ct,ct)
Duel.ConfirmCards(tp,mg1)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Draw(1-tp,1,REASON_EFFECT)
Duel.SetLP(tp,Duel.GetLP(tp)-1000)
Duel.SetLP(1-tp,Duel.GetLP(1-tp)-1000)
else
Duel.Draw(tp,2,REASON_EFFECT)
end
end
--曲终的觉悟
local m=33701407
local cm=_G["c"..m]
function cm.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_RECOVER+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
c:RegisterEffect(e1)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=7-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(1-tp,ct) end
Duel.SetTargetPlayer(1-tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,1-tp,ct)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=7-Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
if ct>0 then
local ct1=Duel.Draw(p,ct,REASON_EFFECT)
if ct1~=0 then
local sp=p
if Duel.GetFieldGroupCount(1-p,LOCATION_HAND,0) and Duel.SelectYesNo(1-p,aux.Stringid(m,0)) then sp=1-p end
local t2=Duel.GetMatchingGroupCount(aux.TRUE,p,LOCATION_EXTRA,0,nil)
local t3=Duel.GetMatchingGroupCount(Card.IsFaceup,1-p,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
local op=0
local m={}
local n={}
local ct=1
m[ct]=aux.Stringid(m,1) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(m,2) n[ct]=2 ct=ct+1 end
if t3 then m[ct]=aux.Stringid(m,3) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(sp,table.unpack(m))
op=n[sp+1]
if op==1 then
Duel.Recover(1-p,ct1*4200)
elseif op==2 then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(p,aux.TRUE,tp,LOCATION_EXTRA,0,1,ct1*2,nil)
Duel.SendtoGrave(g,REASON_RULE)
elseif op==3 then
Duel.Hint(HINT_SELECTMSG,1-p,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(1-p,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,ct1,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_ONFIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
end
end
function cm.efilter(e,te)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
--来自死角的杀意
local m=33701408
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.discon)
e2:SetCost(cm.cost)
e2:SetTarget(cm.distg)
e2:SetOperation(cm.disop)
c:RegisterEffect(e2)
--disable spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_SUMMON)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetCondition(cm.dscon)
e3:SetCost(cm.cost)
e3:SetTarget(cm.dstg)
e3:SetOperation(cm.dsop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e4)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(cm.chlimit)
end
end
function cm.chlimit(e,ep,tp)
return tp==ep
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainNegatable(ev)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetDecktopGroup(tp,15)
if chk==0 then return g:FilterCount(Card.IsAbleToRemoveAsCost,nil,POS_FACEDOWN)==15 end
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_COST)
local tc=g:GetFirst()
while tc do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc=g:GetNext()
end
e:SetLabelObject(g)
g:KeepAlive()
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.Destroy(eg,REASON_EFFECT)~=0 then cm.dselect(e,tp,eg,ep,ev,re,r,rp) end
end
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
if Duel.Destroy(eg,REASON_EFFECT)~=0 then cm.dselect(e,tp,eg,ep,ev,re,r,rp) end
end
function cm.dselect(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(1-tp,aux.Stringid(m,2)) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cm.actlimit)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetLabelObject(e:GetLabelObject())
e2:SetOperation(cm.dselect1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
elseif e:GetLabelObject() then
e:GetLabelObject():DeleteGroup()
end
end
function cm.actlimit(e,re,tp)
return re==e:GetOwner()
end
function cm.tdfilter(c)
return c:GetFlagEffect(m)~=0
end
function cm.dselect1(e,tp,eg,ep,ev,re,r,rp)
local op=Duel.SelectOption(1-tp,aux.Stringid(m,3),aux.Stringid(m,4))
if op==0 and e:GetLabelObject() then
local rg=e:GetLabelObject():Filter(cm.tdfilter,nil)
if rg:GetCount()>0 then
Duel.SendtoDeck(rg,nil,2,REASON_RULE)
end
e:GetLabelObject():DeleteGroup()
else op=1 then
Duel.Recover(tp,5000,REASON_EFFECT)
end
end
--【背景音台】Morning Music
local m=33701410
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_PHASE+PHASE_STANDBY)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_SZONE)
e4:SetCondition(cm.thcon)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EVENT_PHASE+PHASE_END)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCost(cm.thcost1)
e6:SetTarget(cm.thtg1)
e6:SetOperation(cm.thop1)
c:RegisterEffect(e6)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,0,e:GetHandler())
if sg:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,sg,sg:GetCount(),0,0)
end
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,:GetHandler())
Duel.SendtoGrave(sg,REASON_EFFECT)
end
function cm.splimit(e,c)
return not c:IsSetCard(0x15) or not (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4))
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer()
end
function cm.thfilter(c)
return (c:IsSetCard(0x15) or (c:IsRace(RACE_MACHINE) and c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsLevel(4))) and c:IsAbleToHand()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.thcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.thtg1(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=4 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,4,tp,LOCATION_DECK)
end
function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local cg=g:SelectSubGroup(tp,aux.dncheck,false,4,4)
if cg:GetCount()>0 then
Duel.SendtoHand(cg,nil,REASON_EFFECT)
cg=Duel.GetOperatedGroup()
local tc=cg:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1)
end
cg:KeepAlive()
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetLabelObject(cg)
e2:SetTarget(cm.splimit1)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e3,tp)
end
end
function cm.filter(c)
return c:GetFlagEffect(m)~=0
end
function cm.splimit1(e,c)
local g=e:GetLabelObject()
if not g then
e:Reset()
return false
end
local cg=g:Filter(cm.filter,nil)
if cg:GetCount()==0 then
cg:DeleteGroup()
e:Reset()
return false
end
return not cg:IsContains(c)
end
--来自死角的震撼
local m=33701411
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_EQUIP)
e3:SetCode(EFFECT_CANNOT_TRIGGER)
c:RegisterEffect(e3)
--reequip
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DESTROYED)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCondition(cm.eqcon)
e4:SetTarget(cm.eqtg)
e4:SetOperation(cm.eqop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(423705,0))
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_EQUIP)
e5:SetTarget(cm.econ)
e5:SetOperation(cm.eop)
c:RegisterEffect(e5)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function cm.eqfilter(c,eqc)
return c:IsFaceup() and eqc:CheckEquipTarget(c)
end
function cm.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetPreviousEquipTarget()
return c:IsReason(REASON_LOST_TARGET) and ec
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,c) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,c,1,0,0)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.eqfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.Equip(tp,c,g:GetFirst())
end
end
function cm.econ(e,tp,eg,ep,ev,re,r,rp)
return eg:IsContains(e:GetHandler())
end
function cm.eop(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if not ec then return end
if ec:IsPosition(POS_FACEUP_ATTACK) and ec:IsCanChangePosition() then
Duel.ChangePosition(ec,POS_FACEUP_DEFENSE)
end
if Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
if Duel.Draw(tp,1,REASON_EFFECT)~=0 then
if not ec:IsControler(tp) then
local dc=Duel.GetOperatedGroup():GetFirst()
if dc:IsLocation(LOCATION_HAND) then
Duel.SendtoHand(dc,1-tp,REASON_RULE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
dc:RegisterEffect(e1)
end
end
Duel.BreakEffect()
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
end
--水晶魔法小妖精 寇思莫兹
local m=33701412
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PREDRAW)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1)
e2:SetCondition(cm.thcon)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_CONFIRM)
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.descon)
e3:SetCost(cm.descost)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)-Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)>=5
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetValue(cm.damval)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetTargetRange(1,0)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetCondition(cm.tdcon)
e2:SetOperation(cm.tdop)
Duel.RegisterEffect(e2,tp)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,0)
end
function cm.damval(e,re,val,r,rp,rc)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
local ct1=math.ceil(val/50)
if ct<ct1 then ct1=ct end
Duel.DiscardDeck(tp,ct1,REASON_EFFECT)
if val>ct1 then val=val-ct1*50
else val=0 end
return val
end
function cm.tdcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetOwner():GetFlagEffect(m)~=0
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(e:GetOwner(),tp,2,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e:GetHandler():RegisterEffect(e1)
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
and Duel.GetDrawCount(tp)>0 and Duel.GetDecktopGroup(tp,1):IsContains(c) and c:IsPublic()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
aux.DrawReplaceCount=aux.DrawReplaceCount+1
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_GRAVE,0,nil)
if aux.DrawReplaceCount<=aux.DrawReplaceMax and g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetDecktopGroup(tp,1):IsContains(c) and c:IsPublic()
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
if chk==0 then return a and d end
if a:IsControler(tp) then a=d end
Duel.SetTargetCard(a)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,a,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local t=Duel.GetFirstTarget()
if t:IsRelateToBattle() then
Duel.Destroy(t,REASON_EFFECT)
end
end
--Lily White,季节之外的春告精
local m=33701414
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableCounterPermit(0x234)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),aux.NonTuner(Card.IsAttribute,ATTRIBUTE_LIGHT),1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(cm.lpcon1)
e1:SetOperation(cm.lpop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e1:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e2)
--sp_summon effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_PZONE)
e3:SetCondition(cm.regcon)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_PZONE)
e5:SetCondition(cm.lpcon2)
e5:SetOperation(cm.lpop2)
e5:SetLabelObject(e2)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_CHAINING)
e6:SetRange(LOCATION_PZONE)
e6:SetCondition(cm.atcon)
e6:SetOperation(cm.atop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e7:SetProperty(EFFECT_FLAG_DELAY)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EVENT_DRAW)
e7:SetCondition(cm.ctcon)
e7:SetOperation(cm.ctop)
c:RegisterEffect(e7)
--spsummon
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetRange(LOCATION_MZONE)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(cm.ctop1)
c:RegisterEffect(e8)
--indes
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetRange(LOCATION_MZONE)
e9:SetCondition(cm.idcon)
e9:SetValue(1)
c:RegisterEffect(e9)
--atkchange
local e10=Effect.CreateEffect(c)
e10:SetCategory(CATEGORY_RECOVER)
e10:SetDescription(aux.Stringid(m,0))
e10:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e10:SetType(EFFECT_TYPE_QUICK_O)
e10:SetCode(EVENT_FREE_CHAIN)
e10:SetRange(LOCATION_MZONE)
e10:SetCost(cm.rccost)
e10:SetTarget(cm.rctg)
e10:SetOperation(cm.rcop)
c:RegisterEffect(e10)
--pendulum
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e11:SetCode(EVENT_LEAVE_FIELD)
e11:SetCondition(cm.pencon)
e11:SetOperation(cm.penop)
c:RegisterEffect(e11)
end
function cm.cfilter(c,sp)
return c:IsSummonPlayer(sp) and c:IsFaceup()
end
function cm.lpcon1(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return eg:IsExists(cm.cfilter,1,nil,1-tp)
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function cm.lpop1(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(cm.cfilter,nil,1-tp)
local rnum=lg:GetSum(Card.GetAttack)
if Duel.Recover(tp,rnum,REASON_EFFECT)<1 then return end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return eg:IsExists(cm.cfilter,1,nil,1-tp)
and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local lg=eg:Filter(cm.cfilter,nil,1-tp)
local g=e:GetLabelObject()
if g==nil or #g==0 then
lg:KeepAlive()
e:SetLabelObject(lg)
else
g:Merge(lg)
end
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
function cm.lpcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
end
function cm.lpop2(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,m)
local lg=e:GetLabelObject():GetLabelObject()
local rnum=lg:GetSum(Card.GetAttack)
local g=Group.CreateGroup()
g:KeepAlive()
e:GetLabelObject():SetLabelObject(g)
lg:DeleteGroup()
if Duel.Recover(tp,rnum,REASON_EFFECT)<1 then return end
end
function cm.atcon(e,tp,eg,ep,ev,re,r,rp)
if rp~=tp then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
if ex then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if not ex then return false end
if cp~=PLAYER_ALL then return Duel.IsPlayerAffectedByEffect(cp,EFFECT_REVERSE_DAMAGE)
else return Duel.IsPlayerAffectedByEffect(0,EFFECT_REVERSE_DAMAGE)
or Duel.IsPlayerAffectedByEffect(1,EFFECT_REVERSE_DAMAGE)
end
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp)
local v=0
local ex,cg,ct,cp,cv,tg1,ct1,tp1,ev1=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
if ex then v=v+ev1 end
ex,cg,ct,cp,cv,tg1,ct1,tp1,ev1=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if not ex then return end
if cp~=PLAYER_ALL then
if Duel.IsPlayerAffectedByEffect(cp,EFFECT_REVERSE_DAMAGE) then v=v+ev1 end
elseif Duel.IsPlayerAffectedByEffect(0,EFFECT_REVERSE_DAMAGE) or Duel.IsPlayerAffectedByEffect(1,EFFECT_REVERSE_DAMAGE) then v+ev1 end
end
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.atop1(v))
end
function cm.atop1(v)
return function(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetValue(v)
Duel.RegisterEffect(e1,tp)
end
end
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
e:GetHandler():AddCounter(0x234,1)
end
function cm.cfilter(c,tp)
return c:IsSummonPlayer(tp)
end
function cm.ctop1(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.cfilter,1,nil,1-tp) then
e:GetHandler():AddCounter(0x234,1)
end
end
function cm.idcon(e)
return e:GetHandler():GetCounter(0x234)>0
end
function cm.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=e:GetHandler():GetCounter(0x234)
if chk==0 then return ct>0 and e:GetHandler():IsCanRemoveCounter(tp,0x234,ct,REASON_COST) end
e:GetHandler():RemoveCounter(tp,0x234,ct,REASON_COST)
e:SetLabel(ct)
end
function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetLabel()
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct*2000)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*2000)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Recover(p,d,REASON_EFFECT)
end
function cm.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function cm.penop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.CheckLocation(tp,LOCATION_PZONE,0) and not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
--残存的思念
local m=33701415
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_DESTROY)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
if not cm.global_check then
cm.global_check=true
cm[0]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROY)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge2:SetOperation(cm.clear)
Duel.RegisterEffect(ge2,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 then
local destroyed=cm[0]
local destroyed=destroyed+1
cm[0]=destroyed
if cm[destroyed]==nil then table.insert(cm,tc:GetOriginalCode())
else cm[destroyed]=tc:GetOriginalCode() end
end
tc=eg:GetNext()
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
local i=0
local destroyed=cm[0]
while i<=destroyed do
cm[i]=0
i=i+1
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return cm[0]>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
Duel.SetTargetParam(ac)
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,0,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
local i=1
local destroyed=cm[0]
while i<=destroyed do
if cm[i]==ac then
e:SetLabel(ac)
c:SetHint(CHINT_CARD,ac)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetLabelObject(e1)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.drcon1)
e3:SetOperation(cm.drop1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e3)
break
end
i=i+1
end
end
function cm.thfilter(c,code)
return c:IsCode(code) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject() and e:GetLabelObject():GetLabel() and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e:GetLabelObject():GetLabel()) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
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,e:GetLabelObject():GetLabel())
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.cfilter(c,tp,code)
return c:IsControler(tp) and not c:IsCode(code) and
end
function cm.drcon1(e,tp,eg,ep,ev,re,r,rp)
local code=0
local ct=0
if e:GetLabelObject() and e:GetLabelObject():GetLabel() then
code=e:GetLabelObject():GetLabel()
end
if code~=0 then ct=eg:FilterCount(cm.cfilter,nil,tp,code)
else return false end
e:SetLabel(ct)
return ct>0
and (not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function cm.drop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.SetLP(tp,Duel.GetLP(tp)-2000*e:GetLabel())
end
--Falling Light
local m=33701416
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:GetLevel()>0 and c:IsAbleToRemove()
end
function cm.filter1(c)
return c:IsType(TYPE_TUNER)
end
function cm.filter2(c)
return not c:IsType(TYPE_TUNER)
end
function cm.exfilter(c,g,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsLevel(g:GetSum(Card.GetLevel())) and c:IsLevelAbove(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.exfilter1(c,lv,e,tp)
return c:IsType(TYPE_SYNCHRO) and c:IsLevel(lv) and c:IsLevelAbove(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.fselect(g,e,tp)
return g:IsExists(cm.filter1,1,nil) and g:IsExists(cm.filter2,1,nil) and Duel.IsExistingMatchingCard(cm.exfilter,tp,LOCATION_EXTRA,0,1,nil,g,e,tp)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_HAND,0,nil)
if chk==0 then return g:CheckSubGroup(cm.fselect,2,2,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and g:CheckSubGroup(cm.fselect,2,2,e,tp) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg=g:SelectSubGroup(tp,cm.fselect,false,2,2)
local lv=rg:GetSum(Card.GetLevel)
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,cm.exfilter1,tp,LOCATION_EXTRA,0,1,1,nil,lv,e,tp)
local sc=sg:GetFirst()
if sc and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)>0 then
local op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
if op=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_SKIP_TURN)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
Duel.RegisterEffect(e1,tp)
else
local dmg=sc:GetLevel()*800
if Duel.GetLP(tp)<dmg then
Duel.SetLP(tp,10)
else
Duel.Damage(tp,sc:GetLevel()*800,REASON_EFFECT)
end
end
end
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(e)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return se~=e:GetLabelObject()
end
--休憩
local m=33701417
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_HAND,0,1,nil,TYPE_MONSTER) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_HAND,0,1,ct,nil,TYPE_MONSTER)
if tg:GetCount()>0 then
Duel.SendtoGrave(tg,REASON_EFFECT)
local dg=Duel.GetOperatedGroup()
local tc=dg:GetFirst()
local atk=0
while tc do
local tatk=tc:GetTextAttack()
if tatk>0 then atk=atk+tatk end
tc=dg:GetNext()
end
Duel.BreakEffect()
Duel.Recover(tp,atk,REASON_EFFECT)
end
end
--虚拟YouTuber 夜乃空
local m=33701419
local cm=_G["c"..m]
function cm.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,3,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.atop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(cm.attarget1)
e3:SetValue(cm.atval1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_REMOVE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.rccon)
e4:SetTarget(cm.rctg)
e4:SetOperation(cm.rcop)
c:RegisterEffect(e4)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e11:SetValue(1)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e12:SetValue(cm.fuslimit)
c:RegisterEffect(e12)
local e13=e11:Clone()
e13:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e13)
local e14=e11:Clone()
e14:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e14)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_RECOVER)
ge2:SetOperation(cm.checkop1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
end
function cm.sprfilter(c)
return c:IsType(TYPE_XYZ) and c:GetOverlayCount()>0
end
function cm.fselect(g)
return g:GetClassCount(Card.GetAttribute)==g:GetCount()
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if not Duel.CheckRemoveOverlayCard(c:GetControler(),1,1,3,REASON_COST) then return false end
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local mg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
mg:Merge(tc:GetOverlayGroup())
tc:GetNext()
end
return g:CheckSubGroup(cm.fselect,3,3,tp,c)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local mg=g:SelectSubGroup(tp,cm.fselect,false,3,3,tp,c)
c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_MATERIAL)
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g=c:GetMaterial()
local atk=0
if g then
atk=g:GetCount()*800
else atk=0 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function cm.attarget1(e,c)
return c~=e:GetHandler()
end
function cm.atval1(e,c)
return e:GetHandler():GetAttack()
end
function cm.rccon(e,tp,eg,ep,ev,re,r,rp)
return tp==Duel.GetTurnPlayer() and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==1
end
function cm.rctg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,c:GetAttack())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,c,1,0,0)
end
function cm.rcop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsFaceup() then return end
Duel.Recover(tp,c:GetAttack(),REASON_EFFECT)
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local fid=c:GetFieldID()
c:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,0,1,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(c)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
e1:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnPlayer()~=tp then return false end
local tc=e:GetLabelObject()
if not tc:GetFlagEffectLabel(m)==e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.ReturnToField(tc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(cm[tp+2])
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
cm[ep]=cm[ep]+ev
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[2]=cm[0]
cm[3]=cm[1]
cm[0]=0
cm[1]=0
end
function cm.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
--VOICEROID 伊达子
local m=33701420
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,5,5)
c:EnableReviveLimit()
--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.linklimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetValue(SUMMON_TYPE_LINK)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e2:SetCondition(cm.sprcon)
e2:SetOperation(cm.sprop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.indtg)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e4:SetValue(cm.fuslimit)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e6)
--untargetable
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e7:SetRange(LOCATION_MZONE)
e7:SetValue(aux.imval1)
c:RegisterEffect(e7)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetRange(LOCATION_MZONE)
e11:SetCode(EFFECT_UNRELEASABLE_SUM)
e11:SetValue(1)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e12)
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE)
e13:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e13:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e13:SetValue(1)
c:RegisterEffect(e13)
local e14=e13:Clone()
e14:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e14:SetValue(cm.fuslimit)
c:RegisterEffect(e14)
local e15=e13:Clone()
e15:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e15)
local e16=e13:Clone()
e16:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e16)
end
function cm.spfilter(c,sc)
return c:IsCanBeLinkMaterial(sc) and c:IsAbleToRemoveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCountFromEx(tp,tp,nil,c)<=0 then return false end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_EXTRA,0,c)
return g:GetCount()>=5
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.spfilter,c:GetControler(),LOCATION_EXTRA,0,c,sc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=g:Select(tp,5,5,c)
c:SetMaterial(g)
Duel.Remove(sg,POS_FACEDOWN,REASON_MATERIAL+REASON_LINK)
end
function cm.indtg(e,c)
return e:GetHandler():GetLinkedGroup():IsContains(c)
end
function cm.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
--新晦空城
local m=33701421
local cm=_G["c"..m]
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE_START+PHASE_END)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetOperation(cm.condition)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_DESTROY_REPLACE)
e3:SetTarget(cm.reptg)
e3:SetOperation(cm.repop)
c:RegisterEffect(e3)
--tian shen dang
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(cm.descon)
e4:SetCost(cm.descost)
e4:SetTarget(cm.destg)
e4:SetOperation(cm.desop)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(m,ACTIVITY_CHAIN,cm.chainfilter)
end
function cm.chainfilter(re,tp,cid)
local attr=Duel.GetChainInfo(cid,CHAININFO_TRIGGERING_ATTRIBUTE)
return not (re:GetHandler():IsSetCard(0x144e))
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetActivityCount(tp,ACTIVITY_NORMALSUMMON)<=0 then
c:AddCounter(0x144e,5)
end
if Duel.GetActivityCount(tp,ACTIVITY_SPSUMMON)<=0 then
c:AddCounter(0x144e,10)
end
if Duel.GetActivityCount(tp,ACTIVITY_ATTACK)<=0 then
c:AddCounter(0x144e,8)
end
if Duel.GetCustomActivityCount(m,tp,ACTIVITY_CHAIN)<=0 then
c:AddCounter(0x144e,20)
end
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ct=math.ceil(c:GetCounter(0x144e)/2)
if chk==0 then return not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0x144e,ct,REASON_EFFECT) end
return true
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=math.ceil(c:GetCounter(0x144e)/2)
e:GetHandler():RemoveCounter(tp,0x144e,ct,REASON_EFFECT)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x144e)>=64
end
function cm.descost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_DECK+LOCATION_EXTRA,1,nil) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_DECK+LOCATION_EXTRA,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,sg,sg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,sg:GetCount()*100)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_DECK+LOCATION_EXTRA,nil)
local ct=Duel.Destroy(sg,REASON_EFFECT)
if ct>0 then
Duel.Damage(1-tp,ct*100,REASON_EFFECT)
end
end
--不相通的悲欣
local m=33701422
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--activate limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(0,1)
e2:SetCondition(cm.actcona)
e2:SetValue(cm.actlimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(1,0)
e3:SetCondition(cm.actconb)
e3:SetValue(cm.actlimit)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_CONTROL)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.ctcost)
e4:SetCondition(cm.ctcon)
e4:SetTarget(cm.cttg)
e4:SetOperation(cm.ctop)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROY)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetOperation(cm.checkop1)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.actcona(e)
return cm[tp]>0
end
function cm.actconb(e)
return cm[1-tp]<=0
end
function cm.actlimit(e,re,tp)
if re:GetHandler() then return re:GetHandler()~=e:GetHandler()
else return re:GetOwner()~=e:GetHandler()
end
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
return cm[2]>0 and cm[3]>0
end
function cm.ctcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,2000)
else Duel.PayLPCost(tp,2000) end
end
function cm.cttg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_SZONE,tp,LOCATION_REASON_CONTROL) end
Duel.SetOperationInfo(0,CATEGORY_CONTROL,e:GetHandler(),1,0,0)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.GetControl(c,1-tp)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
local p=tc:GetPreviousControler()
if tc:IsPreviousLocation(LOCATION_MZONE) and rp~=p then
cm[p]=cm[p]+1
end
tc=eg:GetNext()
end
end
function cm.checkop1(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_MZONE) then
cm[tc:GetPreviousControler()+2]=cm[tc:GetPreviousControler()+2]+1
end
tc=eg:GetNext()
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
cm[2]=0
cm[3]=0
end
--飘零之幻
local m=33701423
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(1,0)
e2:SetCondition(cm.cacon)
e2:SetValue(cm.caval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_MAIN1)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.damcon)
e3:SetTarget(cm.damtg)
e3:SetOperation(cm.damop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e4:SetRange(LOCATION_SZONE)
e4:SetLabelObject(e3)
e4:SetCondition(cm.damcon1)
e4:SetCost(cm.damcost1)
e4:SetOperation(cm.damop1)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EFFECT_DESTROY_REPLACE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_BOTH_SIDE)
e5:SetRange(LOCATION_SZONE)
e5:SetTarget(cm.reptg)
c:RegisterEffect(e5)
end
function cm.cacon(e)
return e:GetHandlerPlayer()~=Duel.GetTurnPlayer()
end
function cm.caval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
if Duel.GetFlagEffectLabel(tp,m)==0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_MAIN1+RESET_SELF_TURN,0,1,val)
else
local label=Duel.GetFlagEffectLabel(tp,m)
Duel.SetFlagEffectLabel(tp,m,label+val)
end
return 0
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local dam=Duel.GetFlagEffectLabel(tp,m)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(dam)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,0,tp,dam)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
end
end
function cm.damcon1(e,tp,eg,ep,ev,re,r,rp)
return re=e:GetLabelObject() and e:GetHandlerPlayer()~=tp
end
function cm.damcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
g:RemoveCard(e:GetHandler())
return g:GetCount()>0 and g:FilterCount(Card.IsDiscardable,nil)==g:GetCount()
end
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function cm.damop1(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetLabel(cid)
e1:SetValue(cm.damval)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
end
end
function cm.damval(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return val end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return val end
return DOUBLE_DAMAGE
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetControler()~=tp and rp==tp not c:IsReason(REASON_REPLACE)
and Duel.GetLocationCount(tp,LOCATION_SZONE,tp,LOCATION_REASON_CONTROL) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),96) then
Duel.GetControl(c,tp)
return true
else Duel.Recover(c:GetControler(),3000) return false end
end
--不可视之力
local m=33701424
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTarget(cm.damtg)
e1:SetOperation(cm.damop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTarget(cm.damtg1)
e2:SetOperation(cm.damop1)
c:RegisterEffect(e2)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Damage(p,d,REASON_EFFECT)
if c:IsRelateToEffect(e) and e:IsHasType(EFFECT_TYPE_ACTIVATE) then
c:CancelToGrave()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
function cm.damtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,2000)
end
function cm.damop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Damage(p,d,REASON_EFFECT)>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
if tc then
local toGrave=false
local flag=0
local seq=tc:GetSequence()
local p=tc:GetControler()
if tc:IsLocation(LOCATION_FZONE) then toGrave=true
elseif tc:IsLocation(LOCATION_MZONE) then
if seq<=4 then
if seq>0 and Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,seq-1)) end
if seq<4 and Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,seq+1)) end
if bit.band(tc:GetType(),TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK+TYPE_PENDULUM)>0 and tc:IsFaceup() then
if seq==1 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,5)) end
if seq==3 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,6)) end
end
else
if seq==5 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,1))
if seq==6 then flag=flag|(aux.SequenceToGlobal(p,LOCATION_MZONE,3))
else toGrave=true
end
elseif tc:IsLocation(LOCATION_SZONE) then
if seq<=4 then
if seq>0 and Duel.CheckLocation(p,LOCATION_SZONE,seq-1) then flag=flag|(aux.SequenceToGlobal(p,LOCATION_SZONE,seq-1)) end
if seq<4 and Duel.CheckLocation(p,LOCATION_SZONE,seq+1) then flag=flag|(aux.SequenceToGlobal(p,LOCATION_SZONE,seq+1)) end
else toGrave=true
end
else toGrave=true
end
if not toGrave then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(p,1,LOCATION_ONFIELD,0,~flag)
local nseq=math.log(s,2)
nseq=nesq-p*16
if tc:IsLocation(LOCATION_SZONE) then nseq=nseq-8
Duel.MoveSequence(c,nseq)
else
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 then
Duel.Draw(p,1,REASON_EFFECT)
end
end
end
end
end
--赤月礼赞·天泽郁末
local m=33701425
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--send to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DESTROY+CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(cm.reccon)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and cm[tp]>=3000
end
function cm.tgfilter(c)
return c:IsCode(33701424) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local ct=0
local ct1=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
ct=Duel.SendtoGrave(g,REASON_EFFECT)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
ct1=Duel.Destroy(g,REASON_EFFECT)
end
if ct>0 and ct1>0 then
Duel.Recover(tp,1000,REASON_EFFECT)
end
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT)
end
function cm.tdfilter(c)
return c:IsCode(33701424) and c:IsAbleToDeck()
end
function cm.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
local c=e:GetHandler()
if rp~=tp and g:GetCount()>0 and c:IsAbleToDeck() and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,1,nil)
g:AddCard(c)
Duel.SendtoDeck(g,tp,1,REASON_EFFECT)
Duel.Damage(1-tp,val,REASON_EFFECT)
end
return val
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
cm[ep]=cm[ep]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--赤月礼赞·鹿沼叶子
local m=33701425
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--send to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(cm.reccon)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and cm[tp]>=2000
end
function cm.tgfilter(c)
return c:IsCode(33701424) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.desfilter(c)
return c:IsFaceup() and not(c:IsAttackBelow(0) and c:IsDefenseBelow(0))
end
function cm.desfilter1(c)
return c:IsFaceup() and (c:IsAttack(0) or c:IsDefense(0))
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=0
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
ct=Duel.SendtoGrave(g,REASON_EFFECT)
end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1000)
c:RegisterEffect(e1)
local g=Duel.GetMatchingGroup(cm.desfilter,tp,0,LOCATION_MZONE,nil)
if c:IsRelateToEffect(e) and ct>0 and g:GetCount()>0 then
Duel.BreakEffect()
local sc=g:GetFirst()
while sc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-c:GetAttack())
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc:RegisterEffect(e2)
sc=g:GetNext()
end
g=Duel.GetMatchingGroup(cm.desfilter1,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
end
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev*2,REASON_EFFECT)
end
function cm.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
local sg=Duel.GetMatchingGroup(nil,tp,0,LOCATION_SZONE,nil)
local c=e:GetHandler()
if rp~=tp and g:GetCount()>0 and c:IsAbleToDeck() and sg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,1,nil)
g:AddCard(c)
Duel.SendtoDeck(g,tp,1,REASON_EFFECT)
local ct=Duel.Destroy(sg,REASON_EFFECT)
if ct>0 then
Duel.Recover(tp,ct*800,REASON_EFFECT)
end
end
return val
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
cm[ep]=cm[ep]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--赤月礼赞·名仓由依
local m=33701427
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--send to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(cm.reccon)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and cm[tp]>=1200
end
function cm.tgfilter(c)
return c:IsCode(33701424) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,2,nil) and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,2,tp,LOCATION_HAND+LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,2,2,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
local ct=Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_GRAVE,0,nil,33701424)
g=Duel.GetFieldGroup(tp,0,LOCATION_DECK+LOCATION_EXTRA)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_TOGRAVE)
local sg=g:Select(p,ct,ct,nil)
local ct1=Duel.SendtoGrave(sg,REASON_EFFECT)
Duel.ShuffleDeck(1-tp)
Duel.ShuffleExtra(1-tp)
if ct1>0 then
Duel.Damage(1-tp,ct1*800,REASON_EFFECT)
end
end
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,ev,REASON_EFFECT)
end
function cm.tdfilter(c)
return c:IsCode(33701424) and c:IsAbleToDeck()
end
function cm.tgfilter1(c,rc)
return c:GetReasonCard()==rc
end
function cm.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
local c=e:GetHandler()
if rp~=tp and g:GetCount()>0 and c:IsAbleToDeck() and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,2,nil)
g:AddCard(c)
local ct=Duel.SendtoDeck(g,tp,1,REASON_EFFECT)
if ct>0 then
local ct1=Duel.Draw(tp,ct,REASON_EFFECT)
if ct1>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local g1=Duel.GetOperatedGroup():Filter(cm.tgfilter1,nil,c)
local ct2=Duel.SendtoGrave(g1,REASON_EFFECT)
if ct2>0 then
Duel.Recover(tp,ct2*1200,REASON_EFFECT)
end
end
end
end
return val
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
cm[ep]=cm[ep]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--赤月礼赞·己间晴香
local m=33701428
local cm=_G["c"..m]
function cm.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCondition(cm.spcon)
c:RegisterEffect(e1)
--send to grave
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.tgtg)
e2:SetOperation(cm.tgop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_BATTLE_DAMAGE)
e3:SetCondition(cm.reccon)
e3:SetOperation(cm.recop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(1,0)
e4:SetValue(cm.damval)
c:RegisterEffect(e4)
if not cm.global_check then
cm.global_check=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DAMAGE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.spcon(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and cm[tp]>=800
end
function cm.tgfilter(c)
return c:IsCode(33701424) and c:IsAbleToGrave()
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,3,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,tp,LOCATION_HAND+LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_HAND+LOCATION_DECK,0,3,3,nil)
if g:GetCount()>0 then
ct=Duel.SendtoGrave(g,REASON_EFFECT)
end
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CARD_TARGET)
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_DAMAGE)
e2:SetCost(cm.tgcost1)
e2:SetCondition(cm.tgcon1)
e2:SetTarget(cm.tgtg1)
e2:SetOperation(cm.tgop1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
end
function cm.tgcon1(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and Duel.GetAttackTarget()==nil
end
function cm.cfilter(c)
return c:IsSetCard(33701424) c:IsAbleToDeckAsCost()
end
function cm.tgcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:IsOnField() and chkc:IsAbleToGrave() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToGrave,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function cm.tgop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT)
if c:IsRelateToBattle() and c:IsChainAttackable() then
Duel.ChainAttack()
end
end
end
function cm.reccon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,math.ceil(ev/2),REASON_EFFECT)
end
function cm.tdfilter(c)
return c:IsCode(33701424) and c:IsAbleToDeck()
end
function cm.disfilter(c)
return c:IsFaceup() and not c:IsDisabled()
end
function cm.damval(e,re,val,r,rp,rc)
local tp=e:GetHandlerPlayer()
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_GRAVE,0,nil)
local ct=Duel.GetMatchingGroupCount(cm.disfilter,tp,0,LOCATION_ONFIELD,nil)
local c=e:GetHandler()
if rp~=tp and g:GetCount()>0 and c:IsAbleToDeck() and ct>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
if ct>3 then ct=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
g=g:Select(tp,1,ct,nil)
g:AddCard(c)
ct=Duel.SendtoDeck(g,tp,1,REASON_EFFECT)
local sg=Duel.GetMatchingGroup(cm.disfilter,tp,0,LOCATION_ONFIELD,nil)
if ct>0 and sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
sg=sg:Select(tp,ct,ct,nil)
local tc=sg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
end
tc=sg:GetNext()
end
local ct1=sg:FilterCount(Card.IsDisabled,nil)
Duel.Recover(tp,ct1*1500,REASON_EFFECT)
end
end
return val
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if bit.band(r,REASON_EFFECT)~=0 then
cm[ep]=cm[ep]+ev
end
end
function cm.clear(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
--赤月之少年
local m=33701429
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,aux.FilterBoolFunction(Card.IsRace,RACE_PSYCHO),aux.TRUE,100)
c:EnableReviveLimit()
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetValue(SUMMON_TYPE_XYZ)
e1:SetCondition(cm.sprcon)
e1:SetOperation(cm.sprop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
c:RegisterEffect(e2)
--damage conversion
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_REVERSE_DAMAGE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetValue(cm.rev)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(cm.thcost)
e4:SetTarget(cm.thtg)
e4:SetOperation(cm.thop)
c:RegisterEffect(e4)
end
function cm.sprfilter(c)
return c:IsCanBeXyzMaterial(nil) and c:IsCode(33701424) and not c:IsPublic()
end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND,0,nil)
return g:GetCount()>0
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_HAND,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.SelectMatchingCard(tp,cm.sprfilter,tp,LOCATION_HAND,0,3,3,nil)
Duel.ConfirmCards(1-tp,mg)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
function cm.rev(e,re,r,rp,rc)
local c=e:GetHandler()
return bit.band(r,REASON_BATTLE)~=0
and (c==Duel.GetAttacker() or c==Duel.GetAttackTarget())
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cm.thfilter(c)
return c:IsSetCard(0x9449) 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)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local lp=Duel.GetLP(tp)
local m=math.floor(math.min(lp,8000)/2000)
local t={}
for i=1,m do
t[i]=i*2000
end
local ac=Duel.AnnounceNumber(tp,table.unpack(t))
local ct=math.floor(Duel.Damage(tp,ac,REASON_EFFECT)/2000)
if ct>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,ct,ct,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local tc=g:GetFirst()
while tc do
if tc:IsLocation(LOCATION_HAND) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,0)
e1:SetValue(cm.aclimit)
e1:SetLabel(tc:GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
tc=g:GetNext()
end
end
end
function cm.aclimit(e,re,tp)
return re:GetHandler():IsCode(e:GetLabel())
end
--ELPOD
local m=33701430
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,33701424)
--change code
aux.EnableChangeCode(c,33701424,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetRange(LOCATION_FZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(cm.damval)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e3:SetRange(LOCATION_FZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(cm.damtg)
e3:SetValue(DOUBLE_DAMAGE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.target)
e4:SetOperation(cm.operation)
c:RegisterEffect(e4)
end
function cm.damval(e,re,val,r,rp)
if r&REASON_EFFECT~=0 and re then
local rc=re:GetHandler()
if (rc:IsSetCard(0x9449) or rc:IsCode(33701424)) and rc~=e:GetHandler() then
return val*2
end
end
return val
end
function cm.damtg(e,c)
return (rc:IsSetCard(0x9449) or rc:IsCode(33701424)) and rc~=e:GetHandler()
end
function cm.filter(c)
return c:IsSetCard(0x9449) and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.Damage(tp,tc:GetDefense(),REASON_EFFECT)>0 then
local t1=tc:IsAbleToHand()
local t2=tc:IsAbleToGrave()
local op=0
if t1 or t2 then
local m={}
local n={}
local ct=1
if t1 then m[ct]=aux.Stringid(m,0) n[ct]=1 ct=ct+1 end
if t2 then m[ct]=aux.Stringid(m,1) n[ct]=2 ct=ct+1 end
m[ct]=aux.Stringid(m,2) n[ct]=3 ct=ct+1 end
local sp=Duel.SelectOption(tp,table.unpack(m))
op=n[sp+1]
end
if op==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
elseif op==2 then
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
--MINMES
local m=33701431
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,33701424)
--change code
aux.EnableChangeCode(c,33701424,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--damage conversion
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EVENT_DAMAGE)
e2:SetRange(LOCATION_FZONE)
e2:SetCondition(cm.reccon)
e2:SetOperation(cm.recop)
c:RegisterEffect(e2)
end
function cm.reccop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0 and rc~=e:GetHandler() and (rc:IsCode(33701424) or rc:IsSetCard(9449))
end
function cm.tgfilter(c)
return c:IsCode(33701424) and c:IsAbleToGrave()
end
function cm.recop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.tgfilter,tp,LOCATION_HAND,0,e:GetHandler())
if g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g1=g:Select(tp,1,1,nil)
Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.Recover(ep,ev*2,REASON_EFFECT)
else
Duel.Recover(ep,ev,REASON_EFFECT)
end
end
--赤月礼赞·TERRIBLE SIGHT
local m=33701432
local cm=_G["c"..m]
function cm.initial_effect(c)
--Atk Change
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetTarget(cm.target)
e1:SetValue(cm.value)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.tglimit)
c:RegisterEffect(e2)
--must attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_MUST_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_MUST_ATTACK_MONSTER)
e4:SetValue(cm.atklimit)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetCondition(cm.condition)
e5:SetTarget(cm.target)
e5:SetOperation(cm.activate)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE+CATEGORY_DAMAGE)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetCost(cm.damcost)
e6:SetTarget(cm.damtg)
e6:SetOperation(cm.damop)
c:RegisterEffect(e6)
end
function cm.target(e,c)
return c:IsSetCard(0x9449)
end
function cm.value(e,c)
return c:GetBaseAttack()*2
end
function cm.tglimit(e,c)
return c and c:IsSetCard(0x9449)
end
function cm.atlimit(e,c)
return c:IsFaceup() and c:IsSetCard(0x9449) and not c:IsImmuneToEffect(e)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.filter(c)
return c:IsSetCard(0x9449)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,0,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
local atk=0
while tc do
local tatk=tc:GetTextAttack()
if tatk>0 then atk=atk+tatk end
tc=g:GetNext()
end
local dam=Duel.Damage(tp,atk,REASON_EFFECT)
if Duel.GetLP(tp)>0 and dam>0 then
Duel.BreakEffect()
Duel.Damage(1-tp,math.floor(dam/2),REASON_EFFECT)
end
end
end
function cm.damcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function cm.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_MZONE,0,1,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
local tc=g:GetFirst()
Duel.HintSelection(tc)
if Duel.Destroy(tc,REASON_EFFECT)>0 then
local ct1=Duel.Damage(1-tp,tc:GetDefense(),REASON_EFFECT,true)
local ct2=Duel.Damage(tp,tc:GetDefense(),REASON_EFFECT,true)
Duel.RDComplete()
if ct1>0 or ct2>0 then
Duel.BreakEffect()
Duel.Draw(1-tp,math.floor(ct1/1000),REASON_EFFECT)
Duel.Draw(tp,math.floor(ct2/1000),REASON_EFFECT)
end
end
end
end
--赤月礼赞·SEEKER
local m=33701433
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,33701424)
--change code
aux.EnableChangeCode(c,33701424,LOCATION_GRAVE)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.filter(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x9449)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,0)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
Duel.Hint(HINT_CARD,0,m)
if Duel.Damage(tp,tc:GetAttack()+tc:GetDefense(),REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,0,1,fid)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE,0,0)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(cm.retcon)
e1:SetOperation(cm.retop)
Duel.RegisterEffect(e1,tp)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetRange(LOCATION_MZONE)
e11:SetCode(EFFECT_UNRELEASABLE_SUM)
e11:SetValue(1)
tc:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e12)
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_SINGLE)
e13:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e13:SetValue(1)
e13:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e13)
local e14=e13:Clone()
e14:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
tc:RegisterEffect(e14)
local e15=e13:Clone()
e15:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
tc:RegisterEffect(e15)
local e16=e13:Clone()
e16:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
tc:RegisterEffect(e16)
end
end
end
function cm.retcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(m)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function cm.retop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
--赤月礼赞·SHUDDER RUNNING
local m=33701434
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.discon)
e1:SetCost(cm.cost)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
--disable spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_SUMMON)
e2:SetCondition(cm.dscon)
e2:SetCost(cm.cost)
e2:SetTarget(cm.dstg)
e2:SetOperation(cm.dsop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e3)
end
function cm.costfilter(c)
return c:IsSetCard(0x9449) and c:IsType(TYPE_MONSTER) and not c:IsPublic()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_HAND,0,1,1,nil)
e:SetTargetCard(g:GetFirst())
e:SetLabelObject(g:GetFirst())
e:SetLabel(g:GetFirst():GetDefense())
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetLabel()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct)
if ct>0 and Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE) then
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not (tc and tc:IsRelateToEffect(e)) then return end
local ct=tc:GetDefense()
if Duel.Damage(tp,ct,REASON_EFFECT)>0 then
Duel.NegateSummon(eg)
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SendtoHand(eg,tp,REASON_EFFECT)
else
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
function cm.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=e:GetLabel()
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,ct)
if ct>0 and Duel.IsPlayerAffectedByEffect(tp,EFFECT_NO_EFFECT_DAMAGE) then
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
end
function cm.filter(c)
return c:IsSetCard(0x9449) and c:IsFaceup()
end
function cm.activate2(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if not (tc and tc:IsRelateToEffect(e)) then return end
local ct=tc:GetDefense()
if Duel.Damage(tp,ct,REASON_EFFECT)>0 then
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
if Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.SendtoHand(eg,tp,REASON_EFFECT)
else
Duel.Destroy(eg,REASON_EFFECT)
end
end
end
end
--艹!DIY卡的LUA又写错了!
local m=33701435
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(2,m+EFFECT_COUNT_CODE_DUEL)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CODE)
local ac=Duel.AnnounceCard(tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetLabel(ac)
e1:SetCondition(cm.discon)
e1:SetOperation(cm.disop)
Duel.RegisterEffect(e1,tp)
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local ac=e:GetLabel()
return re:GetHandler():IsCode(ac)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
end
--冥散华·消逝的太阳
local m=33701436
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,LOCATION_DECK,0,nil,POS_FACEDOWN)
local opt=0
if g:GetCount()==Duel.GetFieldGroupCount(tp,LOCATION_DECK,0) then
opt=Duel.SelectOption(tp,aux.Stringid(m,0))
else
opt=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
end
if opt==0 then Duel.SetLP(tp,Duel.GetLP(tp)-8000)
else
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
if Duel.GetLP(tp)>0 and Duel.GetActivityCount(1-tp,ACTIVITY_CHAIN)>=13 then
Duel.BreakEffect()
Duel.SetLP(1-tp,Duel.GetLP())
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)-Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)
if ct>0 and Duel.IsPlayerCanDiscardDeck(1-tp,ct) then
Duel.DiscardDeck(1-tp,ct,REASON_EFFECT)
end
end
end
......@@ -33,4 +33,8 @@
!setname 0x144d 残星倩影(Starspirit
!setname 0x144e 晦空士(Sepialife
\ No newline at end of file
!setname 0x144e 晦空士(Sepialife
!setname 0x8449 破天神狐(Kitsune.Sky.Breaker.)
!setname 0x9449 赤月礼赞(Bloodmoon.)
!counter 0x1440 集中力
!counter 0x144e 晦空之础
\ 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