Commit 019f5db9 authored by tsubaki's avatar tsubaki

1.999zy更新

parent 2f814b62
Pipeline #10266 passed with stage
in 51 seconds
No preview for this file type
TET=TET or {}
Pyro = 50219
Hydro = 50216
Electro=50213
Cryo = 50210
Anemo= 50240
Geo= 50234
if not TET.ELCounter then
local class = {}
class._e = {}
class._n = {
[0] = {0, 0},
[1] = {0, 0},
}
function class.Add(e, tp, code, num, te, ze)
Mystery=Duel.GetFlagEffect(tp,50500)
local eh=Duel.GetFlagEffect(tp,50429)
if Mystery==0 then return end
local ze = Effect.GlobalEffect()
Duel.RegisterEffect(ze, tp)
local eg=class._e[tp]
if eg then
local e = eg:GetLabelObject()
e:Reset()
eg:Reset()
end
--无
if (not class._n[tp]) or (class._n[tp][1] == 0) then
if code==Anemo then return end
count = num
genso = code
class._n[tp] = {genso, count}
else
genso, count = table.unpack(class._n[tp])
--Nef.LogFormat("a=%s,b=%s", tostring(genso), tostring(count))
--同色
if genso == code then
count = count + num
if count>5 then count=5 end
if genso == Geo and count>3 then count=3 end
--火为底
elseif genso == Pyro then
--蒸发
if code == Hydro then
Duel.Hint(HINT_CARD,0,50701)
count = count-num-2
if Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE then
local tc=te:GetHandler()
if tc and te:IsActivated() then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack())
tc:RegisterEffect(e1)
end
end
end
--超载
if code == Electro then
Duel.Hint(HINT_CARD,0,50702)
count = count-num
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local sg=g:RandomSelect(tp,1)
if Duel.Destroy(sg,REASON_EFFECT)>0 then
Duel.Damage(tp,Mystery*500,REASON_EFFECT)
end
end
--融化
if code == Cryo then
Duel.Hint(HINT_CARD,0,50703)
count = count-num
if Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE then
local tc=te:GetHandler()
if tc and te:IsActivated() then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()/2)
tc:RegisterEffect(e1)
end
end
end
--扩散
if code == Anemo then
count = count + num
if count>5 then count=5 end
TET.spread(ze,tp,Mystery)
end
--结晶
if code == Geo then
count = count-num
TET.crystal(ze,tp,Mystery)
end
--水为底
elseif genso == Hydro then
--蒸发
if code == Pyro then
Duel.Hint(HINT_CARD,0,50701)
count = count-num
if Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE then
local tc=te:GetHandler()
if tc and te:IsActivated() then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack()/2)
tc:RegisterEffect(e1)
end
end
end
--感电
if code == Electro then
Duel.Hint(HINT_CARD,0,50704)
count = count-num
local gh=Duel.GetFieldGroup(tp,LOCATION_HAND,0):RandomSelect(tp,1)
local gd=Duel.GetFieldGroup(tp,LOCATION_DECK,0):RandomSelect(tp,1)
if eh>=2 then
gd:Merge(gh)
end
Duel.RegisterFlagEffect(tp,50429,RESET_PHASE+PHASE_END,0,1)
if Duel.SendtoGrave(gd,REASON_EFFECT)>0 then
Duel.Damage(tp,Mystery*300,REASON_EFFECT)
end
end
--冻结
if code == Cryo then
Duel.Hint(HINT_CARD,0,50705)
count = count-num
local cc=te:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
local gm=Mystery
while gm>0 and g:GetCount()>0 do
local tc=g:RandomSelect(tp,1):GetFirst()
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(cc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(cc)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
gm=gm-1
g:RemoveCard(tc)
end
end
--扩散
if code == Anemo then
count = count + num
if count>5 then count=5 end
TET.spread(ze,tp,Mystery)
end
--结晶
if code == Geo then
count = count-num
TET.crystal(ze,tp,Mystery)
end
--雷为底
elseif genso == Electro then
--超载
if code == Pyro then
Duel.Hint(HINT_CARD,0,50702)
count = count-num
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,0,nil)
local sg=g:RandomSelect(tp,1)
if Duel.Destroy(sg,REASON_EFFECT)>0 then
Duel.Damage(tp,Mystery*500,REASON_EFFECT)
end
end
--感电
if code == Hydro then
Duel.Hint(HINT_CARD,0,50704)
count = count-num
local gh=Duel.GetFieldGroup(tp,LOCATION_HAND,0):RandomSelect(tp,1)
local gd=Duel.GetFieldGroup(tp,LOCATION_DECK,0):RandomSelect(tp,1)
if eh>=2 then
gd:Merge(gh)
end
Duel.RegisterFlagEffect(tp,50429,RESET_PHASE+PHASE_END,0,1)
if Duel.SendtoGrave(gd,REASON_EFFECT)>0 then
Duel.Damage(tp,Mystery*300,REASON_EFFECT)
end
end
--超导
if code == Cryo then
Duel.Hint(HINT_CARD,0,50706)
count = count-num
Duel.Damage(tp,Mystery*100,REASON_EFFECT)
local cc=te:GetHandler()
local g=Duel.GetMatchingGroup(TET.chaodao,tp,LOCATION_MZONE,0,nil)
while g:GetCount()>0 do
local tc=g:GetFirst()
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(0)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--扩散
if code == Anemo then
count = count + num
if count>5 then count=5 end
TET.spread(ze,tp,Mystery)
end
--结晶
if code == Geo then
count = count-num
TET.crystal(ze,tp,Mystery)
end
--冰为底
elseif genso == Cryo then
--融化
if code == Pyro then
Duel.Hint(HINT_CARD,0,50703)
count = count-num-2
if Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE then
local tc=te:GetHandler()
if tc and te:IsActivated() then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(tc:GetAttack())
tc:RegisterEffect(e1)
end
end
end
--冻结
if code == Hydro then
Duel.Hint(HINT_CARD,0,50705)
count = count-num
local cc=te:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)
local gm=Mystery
while gm>0 and g:GetCount()>0 do
local tc=g:RandomSelect(tp,1):GetFirst()
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(cc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(cc)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
gm=gm-1
g:RemoveCard(tc)
end
end
--超导
if code == Electro then
Duel.Hint(HINT_CARD,0,50706)
count = count-num
Duel.Damage(tp,Mystery*100,REASON_EFFECT)
local cc=te:GetHandler()
local g=Duel.GetMatchingGroup(TET.chaodao,tp,LOCATION_MZONE,0,nil)
while g:GetCount()>0 do
local tc=g:GetFirst()
local e1=Effect.CreateEffect(cc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_DEFENSE_FINAL)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(0)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
--扩散
if code == Anemo then
count = count + num
if count>5 then count=5 end
TET.spread(ze,tp,Mystery)
end
--结晶
if code == Geo then
count = count-num
TET.crystal(ze,tp,Mystery)
end
--岩为底
elseif genso == Geo then
--结晶
if code ~= Anemo then
count = count-num
TET.crystal(ze,tp,Mystery)
end
end
--透支转化
if count < 0 then
genso = code
count = math.abs(count)
end
end
local eg1 = Effect.GlobalEffect()
eg1:SetType(EFFECT_TYPE_FIELD)
eg1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CLIENT_HINT)
eg1:SetTargetRange(1, 0)
eg1:SetTarget(aux.TRUE)
class._e[tp] = eg1
if count <= 0 then
eg1:SetDescription(aux.Stringid(50500, 0))
else
eg1:SetDescription(aux.Stringid(genso, count))
end
eg1:SetLabelObject(eg1)
Duel.RegisterEffect(eg1, tp)
class._n[tp] = {genso, count}
--Nef.LogFormat("a=%s,b=%s", tostring(genso), tostring(count))
end
function class.Get(tp)
local vo = class._n[tp]
return vo[1] or 0, vo[2] or 0
end
TET.ELCounter=class
end
function TET.spread(e,tp,Mystery)
Duel.Hint(HINT_CARD,0,50707)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,TET.spfilter,1-tp,LOCATION_HAND,0,1,1,nil,e,tp,Mystery)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,1-tp,1-tp,false,false,POS_FACEUP)
end
end
end
function TET.spfilter(c,e,tp,Mystery)
local Mystery=Duel.GetFlagEffect(tp,50500)
return c:IsLevelBelow(Mystery*4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function TET.crystal(e,tp,Mystery)
Duel.Hint(HINT_CARD,0,50708)
local g=Duel.GetMatchingGroup(TET.jjfilter,1-tp,LOCATION_MZONE,0,nil)
local gm=Mystery
while gm>0 and g:GetCount()>0 do
local tc=g:RandomSelect(tp,1):GetFirst()
tc:AddCounter(0x500d,1)
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetTarget(TET.reptg)
e1:SetOperation(TET.repop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
gm=gm-1
g:RemoveCard(tc)
end
end
function TET.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return not c:IsReason(REASON_REPLACE)
and c:IsCanRemoveCounter(tp,0x500d,1,REASON_EFFECT) end
return true
end
function TET.repop(e,tp,eg,ep,ev,re,r,rp,chk)
e:GetHandler():RemoveCounter(tp,0x500d,1,REASON_EFFECT)
end
function TET.jjfilter(c)
return c:GetCounter(0x500d)==0 and c:IsFaceup()
end
function TET.chaodao(c)
return c:IsFaceup() and c:GetDefense()>0
end
......@@ -1366,6 +1366,8 @@ if not Nef.PLCounter then
function class.Add(tp, code, num)
local eg = class._e[tp][code]
if eg then
--local e = eg:GetLabelObject()
--e:Reset()
eg:Reset()
end
......@@ -1375,12 +1377,18 @@ if not Nef.PLCounter then
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CLIENT_HINT+EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
--local eg1 = Effect.GlobalEffect()
--eg1:SetType(EFFECT_TYPE_FIELD|EFFECT_TYPE_GRANT)
--eg1:SetTargetRange(0xff, 0)
--eg1:SetTarget(aux.TRUE)
local count = (class._n[tp][code] or 0) + num
class._e[tp][code] = e1
class._n[tp][code] = count
e1:SetDescription(aux.Stringid(code, count))
--eg1:SetLabelObject(e1)
Duel.RegisterEffect(e1, tp)
end
......
......@@ -163,6 +163,7 @@
!setname 0x317 幽曲
!setname 0x334 谢库丽特
!setname 0x338 幽幽子
!setname 0x371 虹之花
!setname 0x372 遗存
!setname 0x379 嫦娥
!setname 0x381
......
No preview for this file type
#[1.999赞颂我的降临吧! HCG][2015.10][2015.4.1][2015.4.1 TCG][2015.1.1][2015.1.1 TCG][2014.10.1][2014.10.1 TCG][2014.7.1][2014.7.14 TCG][2014世界赛][2014.4.1][2014.4.1 TCG][2014.2.1][2014.1.1 TCG][2013.9.1][2013.10.11 TCG][2013.9.1 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1][2011.3.1][2010.9.1][2010.3.1][2009.9.1][2009.3.1][2008.9.1][2008.3.1][2007.9.1][2007.3.1][2006.9.1][2006.3.1][2005.9.1][2005.3.1][2004.9.1][2004.3.1][2003.10.15][2003.7.1][2003.4.10][2003.1.1][2002.10.1][2002.1.1][2000.12.1][2000.4.1][1999.8.26]
#[1.999zy HCG][2015.10][2015.4.1][2015.4.1 TCG][2015.1.1][2015.1.1 TCG][2014.10.1][2014.10.1 TCG][2014.7.1][2014.7.14 TCG][2014世界赛][2014.4.1][2014.4.1 TCG][2014.2.1][2014.1.1 TCG][2013.9.1][2013.10.11 TCG][2013.9.1 TCG][2013.3.1][2012.9.1][2012.3.1][2011.9.1][2011.3.1][2010.9.1][2010.3.1][2009.9.1][2009.3.1][2008.9.1][2008.3.1][2007.9.1][2007.3.1][2006.9.1][2006.3.1][2005.9.1][2005.3.1][2004.9.1][2004.3.1][2003.10.15][2003.7.1][2003.4.10][2003.1.1][2002.10.1][2002.1.1][2000.12.1][2000.4.1][1999.8.26]
!1.999赞颂我的降临吧! HCG
!1.999zy HCG
#limit
23252 0 --暴力取材
14028 2 --BAD APPLE!!
......@@ -66,6 +66,7 @@
86379864 1 --羽衣若水✿永江衣玖
86379758 1 --嫉妒『看不见的绿眼怪物』
86379752 0 --花咲爷『对华丽的仁者之嫉妒』
86379692 0 --隙间妖怪✿八云紫
--花草卡?
99677001 0 --茨歌仙✿
--k
......
--闲暇✿片断
function c1135101.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(c1135101.target)
e1:SetOperation(c1135101.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c1135101.handcon)
c:RegisterEffect(e2)
if not c1135101.global_check then
c1135101.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c1135101.checkop)
Duel.RegisterEffect(ge1,0)
end
--
end
--
function c1135101.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
Duel.RegisterFlagEffect(tc:GetSummonPlayer(),1135101,RESET_PHASE+PHASE_END,0,1)
end
end
function c1135101.handcon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandlerPlayer()
return Duel.GetFlagEffect(1-tp,1135101)>=5 and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
--
function c1135101.tfilter(c,e)
return c:IsFaceup() and c:IsCanBeEffectTarget(e)
end
function c1135101.mfilter(mg,tp)
return Duel.GetLocationCountFromEx(tp,tp,mg,TYPE_LINK)>0
end
function c1135101.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c1135101.tfilter,tp,0,LOCATION_MZONE,nil,e)
if chk==0 then return mg:GetCount()>0 and mg:CheckSubGroup(c1135101.mfilter,2,2,1-tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local tg=mg:SelectSubGroup(tp,c1135101.mfilter,false,2,2,1-tp)
Duel.SetTargetCard(tg)
end
function c1135101.ofilter(c,e)
return c:IsRelateToEffect(e) and c:IsFaceup()
end
function c1135101.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if tg:FilterCount(c1135101.ofilter,nil,e)>1 then
local sg=Duel.GetMatchingGroup(Card.IsLinkSummonable,tp,0,LOCATION_EXTRA,nil,tg,nil,2,2)
if sg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local lg=sg:Select(1-tp,1,1,nil)
Duel.LinkSummon(1-tp,lg:GetFirst(),tg,nil,2,2)
else
Duel.Draw(tp,1,REASON_EFFECT)
end
else
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--
\ No newline at end of file
--声缘兽 紫薯缘
local m=13000500
local cm=_G["c"..m]
function cm.initial_effect(c)
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(cm.rmtg)
e1:SetOperation(cm.rmop)
c:RegisterEffect(e1)
end
function cm.rmft(c)
return c:IsFaceup() and c:IsSetCard(0x1ec2) and c:IsAbleToRemove()
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsAbleToRemove() end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cm.rmft,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--声缘兽 潮来狐
local m=13000509
local cm=_G["c"..m]
function cm.initial_effect(c)
--equip
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetTarget(cm.eqtg)
e1:SetOperation(cm.eqop)
c:RegisterEffect(e1)
end
function cm.eqft(c)
return c:IsLocation(LOCATION_GRAVE) and c:IsSetCard(0xec4) and c:IsType(TYPE_MONSTER) and not c:IsForbidden()
end
function cm.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingMatchingCard(cm.eqft,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceUp,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,nil,1,tp,LOCATION_GRAVE)
end
function cm.eqop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectMatchingCard(tp,cm.eqft,tp,LOCATION_GRAVE,0,1,1,nil)
local eqc=g:GetFirst()
if not eqc or not Duel.Equip(tp,eqc,tc) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(cm.eqlimit)
e1:SetLabelObject(tc)
eqc:RegisterEffect(e1)
end
end
function cm.eqlimit(e,c)
return e:GetLabelObject()==c
end
--声缘 弦卷真纪
local m=13002000
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon when no monster
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cm.sphcon)
c:RegisterEffect(e1)
--spsummon when summon success
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function cm.sphcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)>0
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xec1) and c:GetSummonPlayer()==tp
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--声缘 弦卷真纪M
local m=13002003
local cm=_G["c"..m]
function cm.initial_effect(c)
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(cm.ntcon)
e1:SetOperation(cm.ntop)
c:RegisterEffect(e1)
--indes
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetTarget(cm.indtg)
e2:SetOperation(cm.indop)
c:RegisterEffect(e2)
end
function cm.ntcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cm.ntop(e,tp,eg,ep,ev,re,r,rp,c)
--change base attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(0)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0xec3) and c:IsType(TYPE_MONSTER)
end
function cm.indtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.indop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--声缘+ 弦卷真纪
local m=13002006
local cm=_G["c"..m]
function cm.initial_effect(c)
--linksummon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,1,1)
--add magic card to hand
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.shtg)
e1:SetOperation(cm.shop)
c:RegisterEffect(e1)
--add monster to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.adcon)
e2:SetTarget(cm.adtg)
e2:SetOperation(cm.adop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_REMOVE)
c:RegisterEffect(e3)
--splimit
local e4=Effect.CreateEffect(c)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(cm.regcon)
e4:SetOperation(cm.regop)
c:RegisterEffect(e4)
end
function cm.matfilter(c)
return c:IsLinkSetCard(0xec3) and c:GetLevel()>0
end
function cm.shft(c)
return c:IsCode(13000015) and c:IsAbleToHand()
end
function cm.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.shft,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.shft,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.adcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function cm.adfilter(c,e,tp)
return c:IsLinkSetCard(0xec3) and c:GetLevel()>0 and c:IsAbleToHand()
end
function cm.adtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.adfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.adop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.adfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(e:GetHandler():GetSummonType(),SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsCode(m) and bit.band(sumtype,SUMMON_TYPE_LINK)==SUMMON_TYPE_LINK
end
\ No newline at end of file
--声缘 弦卷真纪AI ψ
local m=13002009
local cm=_G["c"..m]
--thanks for xhe for part of the script
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.raceft,2,2,cm.linkfilter)
--set unique on field
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0x1ec3),LOCATION_MZONE)
--add atk
local e1 = Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetValue(cm.atkval)
c:RegisterEffect(e1)
--to deck
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_MZONE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.raceft(c)
return c:IsLinkRace(RACE_CYBERSE)
end
function cm.linkfilter(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xec3)
end
function cm.atkval(c)
return Duel.GetMatchingGroupCount(Card.IsSetCard,c:GetHandlerPlayer(),LOCATION_GRAVE,0,nil,0xec1) * 100
end
function cm.tdfilter(c)
return c:IsSetCard(0xec3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATODECK)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,LOCATION_GRAVE,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local tcl=tc:GetLevel()
if tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,tp,2,REASON_EFFECT)
Duel.ShuffleDeck(tp)
if tcl>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(tcl)
c:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--声缘 弦卷真纪AI Ξ
local m=13002012
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.raceft,2,2,cm.linkfilter)
--set unique on field
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0x1ec3),LOCATION_MZONE)
--decrease atk and des
local e1 = Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_BATTLE_PHASE+TIMING_DAMAGE_STEP)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.atkcon)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--to hand
local e2 = Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_MZONE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.raceft(c)
return c:IsLinkRace(RACE_CYBERSE)
end
function cm.linkfilter(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0xec3)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.cfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.cfilter,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.cfilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(-2100)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
if tc:GetAttack()<=0 then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function cm.tdfilter(c)
return c:IsSetCard(0xec3) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:GetLevel()>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.tdfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.tdfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(CATEGORY_TOHAND,LOCATION_REMOVED,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local tcl=tc:GetLevel()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
if tcl>0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetValue(tcl)
c:RegisterEffect(e1)
end
end
end
\ No newline at end of file
--声缘 弦卷真纪J
local m=13002015
local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_CYBERSE),5,2)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--atkup and draw
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_DAMAGE_STEP)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(aux.dscon)
e2:SetCost(cm.atkcost)
--e2:SetTarget(cm.atktarget)
e2:SetOperation(cm.atkop)
c:RegisterEffect(e2)
--spsummon2
--not fixed(20210426)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.cost(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.filter(c,e,tp)
return c:IsSetCard(0xec3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(cm.filter,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.atkfilter(c)
return c:IsSetCard(0xec1) and c:IsAbleToRemoveAsCost() and (c:IsLocation(LOCATION_HAND) or c:IsFaceup()) and c:IsType(TYPE_MONSTER)
end
function cm.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.atkfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousControler(tp)
end
function cm.spfilter(c,e,tp)
return c:IsType(TYPE_LINK) and c:IsSetCard(0xec1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLinkBelow(1)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc = g:GetFirst()
if g:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED)
tc:RegisterEffect(e1)
end
--Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--弦卷咖啡厅
local m=13002018
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
c:SetCounterLimit(0x1ec1,9)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--counter
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.ctcon)
e2:SetOperation(cm.ctop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(cm.spcon)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.ctfilter(c)
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousLevelOnField()>=5
end
function cm.ctcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.ctfilter,1,nil)
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)--wait to change
e:GetHandler():AddCounter(0x1ec1,1)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetCounter(0x1ec1)==9
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_CYBERSE) and c:IsType(TYPE_LINK) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,PLAYER_ALL,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
local atk = g:GetFirst():GetTextAttack()
Duel.Recover(tp,atk*2+900,REASON_EFFECT)
Duel.Recover(1-tp,atk*2+900,REASON_EFFECT)
end
end
--弦卷电震大火
local m=13002021
local cm=_G["c"..m]
function cm.initial_effect(c)
--attack twice
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.atkcon)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsAbleToEnterBP()
end
function cm.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xec3) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.atkfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.atkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_PIERCE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
\ No newline at end of file
--声缘 东北伊达子
local m=13003000
local cm=_G["c"..m]
function cm.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetTarget(cm.shtg)
e1:SetOperation(cm.shop)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.shft(c)
return (c:IsSetCard(0x1ec1) or c:IsSetCard(0xec4)) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.shft,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.shft,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
if Duel.IsPlayerCanSummon(tp) and Duel.IsPlayerCanAdditionalSummon(tp) and Duel.GetFlagEffect(tp,m)==0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetDescription(aux.Stringid(m,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e1:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xec1))
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xec4) and c:IsLocation(LOCATION_GRAVE) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local c = e:GetHandler()
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if not tc then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_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:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
--声缘 东北俊子
local m=13003003
local cm=_G["c"..m]
function cm.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.dscon)
e1:SetTarget(cm.dstg)
e1:SetOperation(cm.dsop)
c:RegisterEffect(e1)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.thtg)
e3:SetOperation(cm.thop)
c:RegisterEffect(e3)
end
function cm.dsft(c)
return c:IsFaceup() and not c:IsCode(m) and c:IsRace(RACE_CYBERSE)
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.dsft,tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
if chk==0 then return Duel.IsExistingMatchingCard(cm.dsft,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.disfilter1,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
if tc:IsType(TYPE_SPELL) and tc:IsDestructable() then
Duel.Destroy(tc,REASON_EFFECT)
end
end
end
function cm.thft(c)
return c:IsSetCard(0xec1) and c:IsType(TYPE_SPELL) and c:GetType()~=TYPE_SPELL
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thft,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--东北的神弓-东北俊子
local m=13003021
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--link summon
aux.AddLinkProcedure(c,cm.mfilter,3,99)
c:EnableReviveLimit()
--disable
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.dscon)
e2:SetTarget(cm.dstg)
e2:SetOperation(cm.dsop)
c:RegisterEffect(e2)
--place
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_RELEASE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.pltg)
e3:SetOperation(cm.plop)
c:RegisterEffect(e3)
end
function cm.mfilter(c)
return c:IsLinkType(TYPE_LINK)
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return ep==1-tp and re:IsActiveType(TYPE_SPELL)
and Duel.IsChainNegatable(ev)
and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAttackAbove(800) and c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsFaceup() or not c:IsRelateToEffect(e) or c:GetAttack()<800
or Duel.GetCurrentChain()~=ev+1 or c:IsStatus(STATUS_BATTLE_DESTROYED) then
return
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(-800)
c:RegisterEffect(e1)
if not c:IsHasEffect(EFFECT_REVERSE_UPDATE) then
Duel.NegateActivation(ev)
end
end
function cm.pltg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function cm.plop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
--Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true) then
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_REDIRECT)
e3:SetValue(LOCATION_REMOVED)
c:RegisterEffect(e3)
end
--set link magic(not working properly)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(LINK_MARKER_TOP+LINK_MARKER_TOP_LEFT+LINK_MARKER_BOTTOM+LINK_MARKER_BOTTOM_RIGHT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e2)
end
\ No newline at end of file
--切蒲英稻米棒
local m=13003039
local cm=_G["c"..m]
function cm.initial_effect(c)
--release
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.mstft(c)
return c:IsType(TYPE_MONSTER) and c:IsReleasableByEffect()
end
function cm.filter(c,tp)
return
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.mstft,tp,LOCATION_HAND+LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.mstft,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil)
if g:GetCount()<=0 then return 0 end
Duel.HintSelection(g)
if Duel.Release(g,REASON_EFFECT)~=0 then
Duel.Recover(tp,1000,REASON_EFFECT)
if g:GetFirst():IsSetCard(0xec4) and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
local dg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsAbleToDeck),tp,LOCATION_GRAVE,0,3,3,nil)
if dg:GetCount()>0 then
Duel.HintSelection(dg)
Duel.SendtoDeck(dg,tp,2,REASON_EFFECT)
end
end
end
end
\ No newline at end of file
--Lost✿离爱红泪
function c16000007.initial_effect(c)
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.FALSE)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16000007,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,160000070)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c16000007.sptg)
e2:SetOperation(c16000007.spop)
c:RegisterEffect(e2)
--tograve
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16000007,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCost(c16000007.tgcost)
e3:SetTarget(c16000007.tgtg)
e3:SetOperation(c16000007.tgop)
c:RegisterEffect(e3)
--Flag
if not c16000007.global_check then
c16000007.global_check=true
c16000007[0]=0
c16000007[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(c16000007.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(c16000007.clear)
Duel.RegisterEffect(ge2,0)
end
end
function c16000007.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:FilterCount(Card.IsSetCard,nil,0x104e)>0 then
c16000007[rp]=true
end
end
function c16000007.clear(e,tp,eg,ep,ev,re,r,rp)
c16000007[0]=false
c16000007[1]=false
end
function c16000007.spfilter(c,e,tp)
return c:IsType(TYPE_SPELL) and Duel.IsPlayerCanSpecialSummonMonster(tp,c:GetCode(),nil,0x11,0,0,1,RACE_PLANT,ATTRIBUTE_DARK)
end
function c16000007.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetMZoneCount(tp)>0
and Duel.IsExistingMatchingCard(c16000007.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c16000007.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16000007.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,tp):GetFirst()
if not tc then return end
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_NORMAL+TYPE_MONSTER)
e1:SetReset(RESET_EVENT+0x47c0000)
tc:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RACE)
e2:SetValue(RACE_PLANT)
tc:RegisterEffect(e2,true)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e3:SetValue(ATTRIBUTE_DARK)
tc:RegisterEffect(e3,true)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK)
e4:SetValue(0)
tc:RegisterEffect(e4,true)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE)
e5:SetValue(0)
tc:RegisterEffect(e5,true)
local e6=e1:Clone()
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(1)
tc:RegisterEffect(e6,true)
if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x47e0000)
e1:SetValue(LOCATION_HAND)
tc:RegisterEffect(e1,true)
end
end
function c16000007.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c16000007.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c16000007.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c16000007.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c16000007.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c16000007.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
--时椿之景 晓春红曦
function c16030001.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16030001,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,160300010)
e1:SetTarget(c16030001.thtg)
e1:SetOperation(c16030001.thop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16030001,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,160300011)
e3:SetCost(c16030001.tkcost)
e3:SetTarget(c16030001.tktg)
e3:SetOperation(c16030001.tkop)
c:RegisterEffect(e3)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030001.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030001.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030001.thfilter(c)
return c:IsLevelBelow(3) and c:IsRace(RACE_PLANT)
end
function c16030001.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16030001.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16030001.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16030001.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--
function c16030001.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c16030001.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c16030001.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,16039999)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c16030001.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c16030001.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_PLANT
end
\ No newline at end of file
--时椿之景 倦夏静流
function c16030002.initial_effect(c)
--pos
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16030002,0))
e1:SetCategory(CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,160300020)
e1:SetCost(c16030002.poscost)
e1:SetTarget(c16030002.postg)
e1:SetOperation(c16030002.posop)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16030002,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,160300021)
e2:SetCost(c16030002.tkcost)
e2:SetTarget(c16030002.tktg)
e2:SetOperation(c16030002.tkop)
c:RegisterEffect(e2)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030002.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030002.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030002.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function c16030002.setfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c16030002.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c16030002.setfilter(chkc) and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(c16030002.setfilter,tp,LOCATION_MZONE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local g=Duel.SelectTarget(tp,c16030002.setfilter,tp,LOCATION_MZONE,0,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c16030002.posop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
end
end
--
function c16030002.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c16030002.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c16030002.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,16039999)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c16030002.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c16030002.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_PLANT
end
\ No newline at end of file
--时椿之景 冷秋心雨
function c16030003.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16030003,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,160300030)
e1:SetTarget(c16030003.target)
e1:SetOperation(c16030003.operation)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16030003,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,160300031)
e2:SetCost(c16030003.tkcost)
e2:SetTarget(c16030003.tktg)
e2:SetOperation(c16030003.tkop)
c:RegisterEffect(e2)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030003.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030003.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030003.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c16030003.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c16030003.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c16030003.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c16030003.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,16039999)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c16030003.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c16030003.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_PLANT
end
\ No newline at end of file
--时椿之景 谧冬祈愿
function c16030004.initial_effect(c)
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,160300040)
e1:SetCondition(c16030004.con)
e1:SetOperation(c16030004.op)
c:RegisterEffect(e1)
--token
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16030004,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,160300041)
e2:SetCost(c16030004.tkcost)
e2:SetTarget(c16030004.tktg)
e2:SetOperation(c16030004.tkop)
c:RegisterEffect(e2)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030004.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030004.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030004.con(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasCategory(CATEGORY_NEGATE) or re:IsHasCategory(CATEGORY_DISABLE) or re:IsHasCategory(CATEGORY_DISABLE_SUMMON)
end
function c16030004.filter(c,rtype)
return c:IsType(rtype) and c:IsAbleToGrave()
end
function c16030004.op(e,tp,eg,ep,ev,re,r,rp)
local rtype=bit.band(re:GetActiveType(),0x7)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c16030004.repop)
if Duel.IsExistingMatchingCard(c16030004.filter,tp,LOCATION_DECK,0,1,nil,rtype) and Duel.SelectYesNo(tp,aux.Stringid(16030004,0)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,c16030004.filter,tp,LOCATION_DECK,0,1,1,nil,rtype)
if sg:GetCount()>0 then Duel.SendtoGrave(sg,REASON_EFFECT) end
end
end
function c16030004.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsType(TYPE_SPELL+TYPE_TRAP) then
c:CancelToGrave(false)
end
Duel.SendtoGrave(c,REASON_EFFECT)
end
--
function c16030004.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c16030004.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c16030004.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,16039999)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c16030004.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c16030004.splimit(e,c,tp,sumtp,sumpos)
return c:GetRace()~=RACE_PLANT
end
--时椿之景 冬结
function c16030101.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c16030101.ffilter,2,false)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE,0,Duel.Release,REASON_COST+REASON_MATERIAL)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c16030101.spcond)
c:RegisterEffect(e0)
--token
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16030101,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCost(c16030101.tkcost)
e1:SetTarget(c16030101.tktg)
e1:SetOperation(c16030101.tkop)
c:RegisterEffect(e1)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030101.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030101.spcond(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
--
function c16030101.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030101.ffilter(c,fc,sub,mg,sg)
return c:IsRace(RACE_PLANT)
end
--
function c16030101.tkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeckAsCost(tp,1) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardDeck(tp,1,REASON_COST)
end
function c16030101.tktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c16030101.tkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,16039999,nil,0x4011,0,0,1,RACE_PLANT,ATTRIBUTE_EARTH) then
local token=Duel.CreateToken(tp,16039999)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c16030101.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c16030101.splimit(e,c,tp,sumtp,sumpos)
return not c:IsRace(RACE_PLANT)
end
\ No newline at end of file
--时椿之景 春归
function c16030102.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c16030102.ffilter,2,false)
aux.AddContactFusionProcedure(c,Card.IsReleasable,LOCATION_MZONE,0,Duel.Release,REASON_COST+REASON_MATERIAL)
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c16030102.splimit)
c:RegisterEffect(e0)
--indes
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_GRAVE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c16030102.indtg)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e2)
--xyzlimit
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_SINGLE)
e10:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e10:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e10:SetValue(c16030102.mlimit)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e11)
local e12=e10:Clone()
e12:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e12)
local e13=e10:Clone()
e13:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e13)
end
--
function c16030102.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
--
function c16030102.mlimit(e,c)
if not c then return false end
return c:GetRace()~=RACE_PLANT
end
--
function c16030102.ffilter(c,fc,sub,mg,sg)
return c:IsRace(RACE_PLANT)
end
--
function c16030102.indtg(e,c)
return c:IsType(TYPE_TOKEN) and c:IsRace(RACE_PLANT)
end
--时椿之景 他时黑椿
function c16031201.initial_effect(c)
c:SetUniqueOnField(1,0,16031201)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--effect gain
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16031201,0))
e2:SetCategory(CATEGORY_DECKDES)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c16031201.tgtg)
e2:SetOperation(c16031201.tgop)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(c16031201.eftg)
e3:SetLabelObject(e2)
c:RegisterEffect(e3)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16031201,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCondition(c16031201.drcon)
e4:SetTarget(c16031201.drtg)
e4:SetOperation(c16031201.drop)
c:RegisterEffect(e4)
end
--
function c16031201.eftg(e,c)
return c:IsSetCard(0xcaa)
end
function c16031201.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,5)
end
function c16031201.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.DiscardDeck(tp,5,REASON_EFFECT)
end
--
function c16031201.drcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c16031201.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c16031201.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--时椿之景 寂默久远
function c16032001.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16032001,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c16032001.spcost1)
e1:SetTarget(c16032001.sptg1)
e1:SetOperation(c16032001.spop1)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c16032001.handcon)
c:RegisterEffect(e2)
--to grave
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetOperation(c16032001.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16032001,1))
e4:SetCategory(CATEGORY_)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_GRAVE)
e4:SetCondition(c16032001.damcon)
e4:SetOperation(c16032001.damop)
c:RegisterEffect(e4)
end
--
function c16032001.handfilter(c)
return c:IsFaceup() and c:GetRace()~=RACE_PLANT
end
function c16032001.handcon(e)
return not Duel.IsExistingMatchingCard(c16032001.handfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
--
function c16032001.cfilter1(c,tp)
return c:IsRace(RACE_PLANT) and c:IsType(TYPE_TOKEN) and Duel.GetMZoneCount(tp,c)>0
end
function c16032001.spcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c16032001.cfilter1,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c16032001.cfilter1,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c16032001.spfilter1(c,e,tp)
return c:IsLevelBelow(4) and c:IsRace(RACE_PLANT)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c16032001.sptg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16032001.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c16032001.spop1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16032001.spfilter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c16032001.regop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(16032001,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function c16032001.damcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(16032001)>0
end
function c16032001.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,1)
end
\ No newline at end of file
--一根呆毛
function c19114519.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(c19114519.condition)
e1:SetCost(c19114519.cost)
e1:SetTarget(c19114519.target)
e1:SetOperation(c19114519.activate)
c:RegisterEffect(e1)
--special summon
-- local e2=Effect.CreateEffect(c)
-- e2:SetDescription(aux.Stringid(19114519,0))
-- e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
-- e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
-- e2:SetProperty(EFFECT_FLAG_DELAY)
-- e2:SetCode(EVENT_TO_GRAVE)
-- e2:SetCountLimit(1,19114519)
-- e2:SetCondition(c19114519.con)
-- e2:SetOperation(c19114519.op)
-- c:RegisterEffect(e2)
--synchro
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19114519,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetCost(c19114519.syncost)
e3:SetTarget(c19114519.syntg)
e3:SetOperation(c19114519.synop)
c:RegisterEffect(e3)
end
--function c19114519.con(e,tp,eg,ep,ev,re,r,rp)
-- local c=e:GetHandler()
-- return c:GetPreviousControler()==tp
-- and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN) and c:IsReason(REASON_DESTROY)
--end
--function c19114519.op(e,tp,eg,ep,ev,re,r,rp)
--immune effect
-- local e4=Effect.CreateEffect(c)
-- e4:SetType(EFFECT_TYPE_FIELD)
-- e4:SetCode(EFFECT_IMMUNE_EFFECT)
-- e4:SetTargetRange(LOCATION_SZONE,0)
-- e4:SetTarget(c19114519.etarget)
-- e4:SetValue(c19114519.efilter)
-- c:RegisterEffect(e4)
--end
--function c19114519.etarget(e,c)
-- return c:IsType(TYPE_SPELL)
--end
--function c19114519.efilter(e,re)
-- return re:GetOwnerPlayer()~=e:GetHandlerPlayer()
--end
function c19114519.cfilter(c)
return c:IsLocation(LOCATION_MZONE) and (c:IsSetCard(0x300) or c:IsSetCard(0x150) or c:IsSetCard(0x299))
end
function c19114519.condition(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(c19114519.cfilter,1,nil) and Duel.IsChainNegatable(ev)
end
function c19114519.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:GetHandler():IsStatus(STATUS_ACT_FROM_HAND) then
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD,nil)
end
end
function c19114519.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function c19114519.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function c19114519.syncost(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 c19114519.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c19114519.synop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
end
\ No newline at end of file
--人形的扫除时间
function c19114524.initial_effect(c)
--Destroy
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,19114524)
e1:SetTarget(c19114524.target)
e1:SetOperation(c19114524.operation)
c:RegisterEffect(e1)
--to deck
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TODECK)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,19114524)
e3:SetTarget(c19114524.tdtg)
e3:SetOperation(c19114524.tdop)
c:RegisterEffect(e3)
end
function c19114524.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsAbleToDeck()
and Duel.IsExistingTarget(Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c19114524.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
local g=Group.FromCards(c,tc)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
function c19114524.remfilter(c,tp)
return c:IsLocation(LOCATION_SZONE) and c:IsControler(tp)
end
function c19114524.gfilter(c,tp)
local g=c:GetColumnGroup()
g:Remove(c19114524.remfilter,nil,tp)
g:RemoveCard(c)
return c:IsSetCard(0x186) and g:GetCount()>0 and c:IsFaceup()
end
function c19114524.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c19114524.gfilter(chkc,tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(c19114524.gfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
local tg=Duel.SelectTarget(tp,c19114524.gfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
local tc=tg:GetFirst()
local g=tc:GetColumnGroup()
g:Remove(c19114524.remfilter,nil,tp)
g:RemoveCard(tc)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function c19114524.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local g=tc:GetColumnGroup()
g:Remove(c19114524.remfilter,nil,tp)
g:RemoveCard(tc)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
end
end
\ No newline at end of file
--魔彩光✿上海人形
function c19214522.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_MACHINE),1,2,c19214522.ovfilter,aux.Stringid(19214522,3),13,c19214522.xyzop)
c:EnableReviveLimit()
--deck
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19214522,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19214522)
e1:SetCost(c19214522.cost)
e1:SetTarget(c19214522.target1)
e1:SetOperation(c19214522.operation1)
c:RegisterEffect(e1)
--grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19214522,1))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19214522)
e1:SetCost(c19214522.cost)
e1:SetTarget(c19214522.target2)
e1:SetOperation(c19214522.operation2)
c:RegisterEffect(e1)
--to deck top
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19214522,2))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19214522)
e1:SetCost(c19214522.cost)
e1:SetTarget(c19214522.target3)
e1:SetOperation(c19214522.operation3)
c:RegisterEffect(e1)
end
--
function c19214522.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE) and c:IsSummonType(SUMMON_TYPE_NORMAL)
end
--
function c19214522.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,19214522)==0 end
Duel.RegisterFlagEffect(tp,19214522,RESET_PHASE+PHASE_END,0,1)
end
--
function c19214522.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
--
function c19214522.filter1(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsLevelBelow(4) and c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214522.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214522.filter1,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c19214522.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19214522.filter1,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c19214522.filter2(c,e,tp)
return c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214522.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214522.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c19214522.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19214522.filter2,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c19214522.filter3(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c19214522.target3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214522.filter3,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND+CATEGORY_SEARCH,nil,1,tp,LOCATION_DECK)
end
function c19214522.operation3(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c19214522.filter3,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x186) and Duel.SelectYesNo(tp,aux.Stringid(19214522,4)) then
Duel.BreakEffect()
local g2=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x186)
local tc=g2:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
end
end
--四季花开✿蓬莱人形
function c19214526.initial_effect(c)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,19214526)
e1:SetCost(c19214526.cost)
e1:SetTarget(c19214526.target)
e1:SetOperation(c19214526.operation)
c:RegisterEffect(e1)
--grave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,19214527)
e2:SetCost(c19214526.spcost)
e2:SetTarget(c19214526.sptg)
e2:SetOperation(c19214526.spop)
c:RegisterEffect(e2)
end
--
function c19214526.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c19214526.filter(c,e,tp)
return c:IsRace(RACE_MACHINE) and c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214526.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214526.filter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c19214526.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19214526.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
--
function c19214526.spfilter(c,e,tp)
return c:IsCode(19214528) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c19214526.spcostfilter(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and c:IsRace(RACE_MACHINE)
end
function c19214526.attfilter1(c,att1)
return c:GetAttribute()==att1
end
function c19214526.attfilter2(c,att2)
return c:GetAttribute()==att2
end
function c19214526.attfilter3(c,att3)
return c:GetAttribute()==att3
end
function c19214526.attfilter4(c,att4)
return c:GetAttribute()==att4
end
function c19214526.attfilter5(c,att5)
return c:GetAttribute()==att5
end
function c19214526.attfilter6(c,att6)
return c:GetAttribute()==att6
end
function c19214526.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c19214526.spcostfilter,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetCount()>=6 and g:GetClassCount(Card.GetAttribute)>=6 end
local tg=Group.CreateGroup()
local att1=c:GetAttribute()
g:Remove(c19214526.attfilter1,nil,att1)
tg:AddCard(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg2=g:Select(tp,1,1,nil)
local att2=tg2:GetFirst():GetAttribute()
g:Remove(c19214526.attfilter2,nil,att2)
tg:Merge(tg2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg3=g:Select(tp,1,1,nil)
local att3=tg3:GetFirst():GetAttribute()
g:Remove(c19214526.attfilter3,nil,att3)
tg:Merge(tg3)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg4=g:Select(tp,1,1,nil)
local att4=tg4:GetFirst():GetAttribute()
g:Remove(c19214526.attfilter4,nil,att4)
tg:Merge(tg4)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg5=g:Select(tp,1,1,nil)
local att5=tg5:GetFirst():GetAttribute()
g:Remove(c19214526.attfilter5,nil,att5)
tg:Merge(tg5)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tg6=g:Select(tp,1,1,nil)
local att6=tg6:GetFirst():GetAttribute()
g:Remove(c19214526.attfilter6,nil,att6)
tg:Merge(tg6)
if tg:GetCount()>=6 then
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
end
function c19214526.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214526.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c19214526.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.GetFirstMatchingCard(c19214526.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if g then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--花开幻想✿爱丽丝
function c19214528.initial_effect(c)
--synchro summon
c:EnableReviveLimit()
aux.AddSynchroMixProcedure(c,aux.FilterBoolFunction(Card.IsSynchroType,TYPE_TUNER),aux.FilterBoolFunction(Card.IsSetCard,0x300),nil,aux.NonTuner(nil),1,99)
--seven
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(19214528,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,19214528)
e1:SetCost(c19214528.cost)
e1:SetTarget(c19214528.target)
e1:SetOperation(c19214528.operation)
c:RegisterEffect(e1)
end
--
function c19214528.costfilter(c)
return c:IsSetCard(0x186) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost() and c:IsRace(RACE_MACHINE)
end
function c19214528.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c19214528.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c19214528.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
local att=g:GetFirst():GetAttribute()
e:SetLabel(att)
end
function c19214528.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local att=e:GetLabel()
if bit.band(att,ATTRIBUTE_WIND)~=0 then
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),1,0,0)
end
if bit.band(att,ATTRIBUTE_EARTH)~=0 then
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_ONFIELD)
end
if bit.band(att,ATTRIBUTE_DARK)~=0 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
if bit.band(att,ATTRIBUTE_LIGHT)~=0 then
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
end
function c19214528.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local att=e:GetLabel()
if bit.band(att,ATTRIBUTE_WIND)~=0 then
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(700)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
e2:SetValue(c19214528.efilter)
c:RegisterEffect(e2)
end
if bit.band(att,ATTRIBUTE_FIRE)~=0 then
if Duel.GetFlagEffect(tp,19214528)==0 then
Duel.RegisterFlagEffect(tp,19214528,0,0,1)
end
--Negate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c19214528.discon)
e1:SetOperation(c19214528.disop)
Duel.RegisterEffect(e1,tp)
end
if bit.band(att,ATTRIBUTE_WATER)~=0 then
if Duel.GetFlagEffect(tp,19214529)==0 then
Duel.RegisterFlagEffect(tp,19214529,0,0,1)
end
--damage reflect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e1:SetTargetRange(1,0)
e1:SetValue(c19214528.damval)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_REFLECT_DAMAGE)
Duel.RegisterEffect(e2,tp)
end
if bit.band(att,ATTRIBUTE_EARTH)~=0 then
if Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(19214528,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
if bit.band(att,ATTRIBUTE_LIGHT)~=0 then
if Duel.IsExistingMatchingCard(c19214528.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(19214528,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19214528.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if bit.band(att,ATTRIBUTE_DARK)~=0 then
if Duel.IsExistingMatchingCard(c19214528.thfilter,tp,LOCATION_GRAVE,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(19214528,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectMatchingCard(tp,c19214528.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,nil,0x186) and Duel.SelectYesNo(tp,aux.Stringid(19214528,4)) then
local g2=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,nil,0x186)
local tc=g2:GetFirst()
if tc then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(tc,0)
Duel.ConfirmDecktop(tp,1)
end
end
end
end
end
function c19214528.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function c19214528.discon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsChainNegatable(ev) and rp==1-tp and re:IsActiveType(TYPE_MONSTER) and Duel.GetFlagEffect(tp,19214528)>0
end
function c19214528.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.ResetFlagEffect(tp,19214528)
Duel.NegateEffect(ev)
end
function c19214528.damval(e,tp)
if Duel.GetFlagEffect(tp,19214529)>0 then
Duel.ResetFlagEffect(tp,19214529)
return true
else
return false
end
end
function c19214528.spfilter(c,e,tp)
return c:IsSetCard(0x186) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214528.thfilter(c)
return c:IsSetCard(0x186) and c:IsAbleToHand()
end
--人形舞台剧团
function c19214532.initial_effect(c)
c:SetUniqueOnField(1,0,19214532)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,19214532)
e1:SetOperation(c19214532.activate)
c:RegisterEffect(e1)
--add counter
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(19214532,1))
e2:SetCategory(CATEGORY_COUNTER)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,19214533)
e2:SetTarget(c19214532.actg)
e2:SetOperation(c19214532.acop)
c:RegisterEffect(e2)
--remove counter
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(19214532,6))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCost(c19214532.cost3)
e3:SetTarget(c19214532.tg3)
e3:SetOperation(c19214532.op3)
c:RegisterEffect(e3)
end
--
function c19214532.filter(c)
return c:IsAbleToHand() and c:IsSetCard(0x186) and c:IsType(TYPE_SPELL) and (c:IsType(TYPE_FIELD) or c:IsType(TYPE_CONTINUOUS))
end
function c19214532.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c19214532.filter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(19214532,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--
function c19214532.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_COUNTER,nil,1,0,0x128d)
end
function c19214532.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
tc:AddCounter(0x128d,1)
end
end
--
function c19214532.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local off=1
local ops={}
local opval={}
local a1=Duel.IsCanRemoveCounter(tp,1,1,0x128d,1,REASON_COST) and Duel.IsExistingMatchingCard(c19214532.filter1,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,nil)
local a3=Duel.IsCanRemoveCounter(tp,1,1,0x128d,3,REASON_COST) and Duel.IsExistingMatchingCard(c19214532.filter3,tp,LOCATION_REMOVED,LOCATION_REMOVED,3,nil) and Duel.IsPlayerCanDraw(tp,1)
local a5=Duel.IsCanRemoveCounter(tp,1,1,0x128d,5,REASON_COST) and Duel.IsExistingMatchingCard(c19214532.filter5,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local a7=Duel.IsCanRemoveCounter(tp,1,1,0x128d,7,REASON_COST) and Duel.IsExistingMatchingCard(c19214532.filter7,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) and (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0)
if chk==0 then return a1 or a3 or a5 or a7 end
if a1 then
ops[off]=aux.Stringid(19214532,2)
opval[off-1]=1
off=off+1
end
if a3 then
ops[off]=aux.Stringid(19214532,3)
opval[off-1]=3
off=off+1
end
if a5 then
ops[off]=aux.Stringid(19214532,4)
opval[off-1]=5
off=off+1
end
if a7 then
ops[off]=aux.Stringid(19214532,5)
opval[off-1]=7
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
Duel.RemoveCounter(tp,1,1,0x128d,sel,REASON_COST)
end
function c19214532.filter1(c)
return (c:IsAbleToDeck() or c:IsLocation(LOCATION_DECK)) and c:IsSetCard(0x186)
end
function c19214532.filter3(c)
return c:IsAbleToGrave()
end
function c19214532.filter5(c,e,tp)
return c:IsSetCard(0x300) and c:IsLevelBelow(5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214532.filter7(c,e,tp)
return c:IsSetCard(0x186) and c:IsRace(RACE_MACHINE) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c19214532.tg3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local sel=e:GetLabel()
if sel==3 then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,3,0,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
elseif sel==5 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
elseif sel==7 then
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND)
end
end
function c19214532.op3(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local sel=e:GetLabel()
if sel==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectMatchingCard(tp,c19214532.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
if g:GetFirst():IsLocation(LOCATION_DECK) then
Duel.ShuffleDeck(tp)
Duel.MoveSequence(g:GetFirst(),0)
Duel.ConfirmDecktop(tp,1)
elseif g:GetFirst():IsLocation(LOCATION_GRAVE) then
Duel.SendtoDeck(g:GetFirst(),nil,0,REASON_EFFECT)
end
end
end
if sel==3 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c19214532.filter3,tp,LOCATION_REMOVED,LOCATION_REMOVED,3,3,nil)
if g:GetCount()==3 then
Duel.SendtoGrave(g,REASON_EFFECT+REASON_RETURN)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
if sel==5 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c19214532.filter5,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
if sel==7 then
local ct1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
local ft=ct1+ct2
if ft<=0 then return end
local g=Duel.GetMatchingGroup(c19214532.filter7,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()<=0 then return end
local op=0
while g:GetCount()>0 and ft>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=g:Select(tp,1,1,nil)
if ct1>0 and ct2>0 then op=Duel.SelectOption(tp,aux.Stringid(19214532,7),aux.Stringid(19214532,8))
elseif ct1>0 then op=Duel.SelectOption(tp,aux.Stringid(19214532,7))
elseif ct2>0 then op=Duel.SelectOption(tp,aux.Stringid(19214532,8))+1
else op=2 end
if op==0 then
Duel.SpecialSummonStep(sc:GetFirst(),0,tp,tp,false,false,POS_FACEUP)
elseif op==1 then
Duel.SpecialSummonStep(sc:GetFirst(),0,tp,1-tp,false,false,POS_FACEUP)
end
ft=ft-1
g:RemoveCard(sc:GetFirst())
end
Duel.SpecialSummonComplete()
end
end
--凶兆的黑猫
function c20004.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20004,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(c20004.spcon)
e1:SetTarget(c20004.sptg)
e1:SetOperation(c20004.spop)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c20004.atkcon)
e2:SetValue(1000)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(20004,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetCode(EVENT_REMOVE)
e3:SetCondition(c20004.condition)
e3:SetTarget(c20004.target)
e3:SetOperation(c20004.operation)
c:RegisterEffect(e3)
end
function c20004.cfilter(c)
return c:IsFaceup() and c:IsLevelBelow(2)
end
function c20004.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c20004.cfilter,1,nil)
end
function c20004.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c20004.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c20004.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc225)
end
function c20004.atkcon(e)
local c=e:GetHandler()
return Duel.IsExistingMatchingCard(c20004.atkfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c20004.filter(c,e,tp)
return c:IsLevelBelow(3) and c:IsSetCard(0x208) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c20004.condition(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetFlagEffect(tp,20003)==0) then Duel.RegisterFlagEffect(tp,20003,0,0,0)
else return false end
return Duel.GetFlagEffect(tp,20003)==1
end
function c20004.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c20004.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c20004.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c20004.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--[[
⢰⠟⠉⠁ ⠉⠐⠳⣶⣾⣿⣿⣷⣦ Welcome, my friends!
⠃⠶⡈ ⢠ ⣆ ⠈⢿⣿⣿⣿⠏⠒ This is Cirn9, a common creater in the 222DIY & THC group who is very pigeon. XD
⠠⠎ ⣞⡿⡶ ⡼⣽⣤⣠ ⣿⡿⠁⠉ This is my personal function library.
⢠⠐⢰⠱⠇⣰⣿⣿⣿⠶⣿⣿⣿⣿⠋ ⣾⣿⣿⣿⣷⣦ You could notify me in the group chat,
⢀⡋⠤⠻⠿⣧ ⢓⣶⣯⣶⢿⡠⠛⢏⣭⠻⠁ if you have any question or just report bugs.
⠈⠖ ⠻⠙⠖⢄⣤⠤⠒ ⠛ ⠘ ⠸⠠
⣴⠊⠁⠣⢔⡀ ⠐⡔⢀ ⣀⣰⣾⣿⣆⣈⣾ ⠠ ⠈
⠑⢊ ⡤⠦⠊ ⣾⡷⠂⢿⡿⢛⣤⣿⣿⣀⣀⡤
⠙⣆⠉ ⢀⣴⣿⣿⢻⣿⣿⣾⣾⣿⣿⣿⠟⠉
⠊ ⠈⠙⡀ ⠘⣄⠙⣿⣿⣿⣿⣿⣿⣿⣰⣿⣿⡿⠁
⢿ ⢻⡀⣤⣿⣿⣿⣿⣿⣿⣿⣿⠁
⢸⣧ ⠈⣿ ⠈⢻⣿⣿⣿⣿⣿⣿⣷⡀
相关链接:
http://www.orz6.com/lattice.aspx
https://ferryyoungfan.github.io/projects/HelloWorld_Image2Braille/index.html
--]]
C9=C9 or {}
-------------------------------------------
C9.para={"e","tp","eg","ep","ev","re","r","rp","chk","chkc"} --No use
C9.ReLiveHensinCount=0
-------------------------------------------
--Toji no miko
function C9.TojiMonster(c)
--Equip Okatana
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(C9.Eqcon1)
e1:SetOperation(C9.Eqop1)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SUMMON_SUCCESS)
e3:SetCondition(C9.Eqcon2)
e3:SetOperation(C9.Eqop2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetCondition(C9.Eqcon3)
e5:SetOperation(C9.Eqop1)
e5:SetRange(LOCATION_MZONE)
c:RegisterEffect(e5)
--Chain Attack
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(20100000,0))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_BATTLE_START)
e6:SetTarget(C9.TojiChainAttackTg)
e6:SetRange(LOCATION_MZONE)
e6:SetCategory(CATEGORY_ATKCHANGE)
e6:SetOperation(C9.TojiChainAttackOp)
e6:SetCountLimit(1)
c:RegisterEffect(e6)
if not C9.battle_check then
C9.battle_check=true
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_BATTLE_START)
ge1:SetOperation(C9.BattleCheckOp)
Duel.RegisterEffect(ge1,0)
end
end
function C9.BattleCheckOp(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetTurnPlayer()
Duel.RegisterFlagEffect(p,20100000,RESET_PHASE+PHASE_BATTLE,0,1)
end
function C9.Eqcon1(e,tp,eg,ep,ev,re,r,rp)
if not re then return true end
return not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function C9.Eqcon2(e,tp,eg,ep,ev,re,r,rp)
if not re then return false end
return re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function C9.Eqcon3(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFlagEffect(20100000)~=0
end
function C9.TojiEquipLimit(c)
local e1_2=Effect.CreateEffect(c)
e1_2:SetType(EFFECT_TYPE_SINGLE)
e1_2:SetCode(EFFECT_EQUIP_LIMIT)
e1_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1_2:SetValue(1)
c:RegisterEffect(e1_2)
end
function C9.TojiEquip(ec,code,e,tp,eg,ep,ev,re,r,rp)
local token=Duel.CreateToken(tp,code)
Duel.MoveToField(token,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
--[[
token:CancelToGrave()
local e1_1=Effect.CreateEffect(token)
e1_1:SetType(EFFECT_TYPE_SINGLE)
e1_1:SetCode(EFFECT_CHANGE_TYPE)
e1_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1_1:SetValue(TYPE_EQUIP+TYPE_SPELL)
e1_1:SetReset(RESET_EVENT+0x1fc0000)
token:RegisterEffect(e1_1,true)
local e1_2=Effect.CreateEffect(token)
e1_2:SetType(EFFECT_TYPE_SINGLE)
e1_2:SetCode(EFFECT_EQUIP_LIMIT)
e1_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1_2:SetValue(1)
token:RegisterEffect(e1_2,true)
token:CancelToGrave()
--]]
if Duel.Equip(tp,token,ec,false) then
--[[
if code==20100201 then --御 刀 加 州 清 光
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
--extra summon
local e2_2=Effect.CreateEffect(ec)
e2_2:SetDescription(aux.Stringid(20100201,0))
e2_2:SetType(EFFECT_TYPE_FIELD)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetTargetRange(LOCATION_HAND+LOCATION_MZONE,0)
e2_2:SetCode(EFFECT_EXTRA_SUMMON_COUNT)
e2_2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc90))
token:RegisterEffect(e2_2)
elseif code==20100203 then --御 刀 莲 华 不 动 辉 广
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(200)
token:RegisterEffect(e2_1)
--tograve
local e2_2=Effect.CreateEffect(ec)
e2_2:SetDescription(aux.Stringid(20100203,0))
e2_2:SetCategory(CATEGORY_TOGRAVE)
e2_2:SetType(EFFECT_TYPE_IGNITION)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetCountLimit(1)
e2_2:SetTarget(C9.MusumiKiyokaTg)
e2_2:SetOperation(C9.MusumiKiyokaOp)
token:RegisterEffect(e2_2)
elseif code==20100205 then --御 刀 北 谷 菜 切 二 王 清 纲
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
--Destroy
local e2_2=Effect.CreateEffect(ec)
e2_2:SetDescription(aux.Stringid(20100205,0))
e2_2:SetCategory(CATEGORY_DESTROY)
e2_2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e2_2:SetCode(EVENT_BATTLE_DAMAGE)
e2_2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetCountLimit(1)
e2_2:SetCondition(C9.ShichinosatoKofukiCon)
e2_2:SetTarget(C9.ShichinosatoKofukiTg)
e2_2:SetOperation(C9.ShichinosatoKofukiOp)
token:RegisterEffect(e2_2)
elseif code==20100207 then --御 刀 骚 速 剑
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_DEFENSE)
e2_1:SetValue(400)
token:RegisterEffect(e2_1)
--special summon
local e2_2=Effect.CreateEffect(ec)
e2_2:SetDescription(aux.Stringid(20100207,0))
e2_2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2_2:SetType(EFFECT_TYPE_IGNITION)
e2_2:SetCountLimit(1,20100207)
e2_2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetTarget(C9.SetouchiChieTg)
e2_2:SetOperation(C9.SetouchiChieOp)
token:RegisterEffect(e2_2)
elseif code==20100209 then --御 刀 实 休 光 忠
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(200)
token:RegisterEffect(e2_1)
--to hand
local e2_2=Effect.CreateEffect(ec)
e2_2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2_2:SetType(EFFECT_TYPE_IGNITION)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetCountLimit(1)
e2_2:SetTarget(C9.KitoraMirjaTg)
e2_2:SetOperation(C9.KitoraMirjaOp)
token:RegisterEffect(e2_2)
elseif code==20100211 then --御 刀 千 鸟
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(400)
token:RegisterEffect(e2_1)
--to deck
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_EQUIP)
e2_2:SetCode(EFFECT_BATTLE_DESTROY_REDIRECT)
e2_2:SetValue(LOCATION_DECKSHF)
token:RegisterEffect(e2_2)
elseif code==20100213 then --御 刀 小 乌 丸
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(400)
token:RegisterEffect(e2_1)
--direct attack
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_EQUIP)
e2_2:SetCode(EFFECT_DIRECT_ATTACK)
e2_2:SetCondition(C9.JujoHiyoriCon)
token:RegisterEffect(e2_2)
elseif code==20100215 then --御 刀 孙 六 兼 元
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_FIELD)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetRange(LOCATION_SZONE)
e2_1:SetTargetRange(LOCATION_MZONE,0)
e2_1:SetCondition(C9.YanaseMaiCon)
e2_1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc90))
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
elseif code==20100217 then --御 刀 妙 法 村 正
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
--immune
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_EQUIP)
e2_2:SetCode(EFFECT_IMMUNE_EFFECT)
e2_2:SetCondition(C9.YanaseMaiCon)
e2_2:SetValue(C9.ItomiSayakaVal)
token:RegisterEffect(e2_2)
--must attack
local e2_3=Effect.CreateEffect(ec)
e2_3:SetType(EFFECT_TYPE_EQUIP)
e2_3:SetCode(EFFECT_MUST_ATTACK)
token:RegisterEffect(e2_3)
elseif code==20100219 then --御 刀 弥 弥 切 丸
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(800)
token:RegisterEffect(e2_1)
--Pierce
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_EQUIP)
e2_2:SetCode(EFFECT_PIERCE)
token:RegisterEffect(e2_2)
elseif code==20100222 then --御 刀 越 前 康 继
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_EQUIP)
e2_2:SetCode(EFFECT_UPDATE_DEFENSE)
e2_2:SetValue(300)
token:RegisterEffect(e2_2)
--atk limit
local e2_3=Effect.CreateEffect(ec)
e2_3:SetType(EFFECT_TYPE_FIELD)
e2_3:SetRange(LOCATION_SZONE)
e2_3:SetTargetRange(0,LOCATION_MZONE)
e2_3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2_3:SetValue(C9.KohaguraErenVal)
token:RegisterEffect(e2_3)
--target
local e2_4=Effect.CreateEffect(ec)
e2_4:SetType(EFFECT_TYPE_FIELD)
e2_4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2_4:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e2_4:SetRange(LOCATION_SZONE)
e2_4:SetTargetRange(LOCATION_MZONE,0)
e2_4:SetTarget(C9.KohaguraErenVal)
e2_4:SetValue(aux.tgoval)
token:RegisterEffect(e2_4)
elseif code==20100224 then --御 刀 薄 绿
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(400)
token:RegisterEffect(e2_1)
--actlimit
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_FIELD)
e2_2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2_2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetTargetRange(0,1)
e2_2:SetValue(aux.TRUE)
e2_2:SetCondition(C9.ShidouMakiCon)
token:RegisterEffect(e2_2)
elseif code==20100226 then --御 刀 九 字 兼 定
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(300)
token:RegisterEffect(e2_1)
--act limit
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2_2:SetCode(EVENT_CHAINING)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetCondition(C9.YanaseMaiCon)
e2_2:SetOperation(C9.KonohanaSuzukaOp)
token:RegisterEffect(e2_2)
elseif code==20100228 then --御 刀 水 神 切 兼 光
--atk
local e2_1=Effect.CreateEffect(ec)
e2_1:SetCategory(CATEGORY_ATKCHANGE)
e2_1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2_1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2_1:SetRange(LOCATION_SZONE)
e2_1:SetCondition(C9.SatsukiYumiCon)
e2_1:SetCost(C9.SatsukiYumiCost)
e2_1:SetOperation(C9.SatsukiYumiOp)
token:RegisterEffect(e2_1)
elseif code==20100230 then --御 刀 笑 面 青 江
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(400)
token:RegisterEffect(e2_1)
local e2_2=Effect.CreateEffect(ec)
e2_2:SetCategory(CATEGORY_ATKCHANGE)
e2_2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2_2:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetCondition(C9.TsubakuroYumeCon)
e2_2:SetOperation(C9.TsubakuroYumeOp)
token:RegisterEffect(e2_2)
elseif code==20100232 then --御 刀 童 子 切 安 纲
local e2_1=Effect.CreateEffect(ec)
e2_1:SetType(EFFECT_TYPE_EQUIP)
e2_1:SetCode(EFFECT_UPDATE_ATTACK)
e2_1:SetValue(500)
token:RegisterEffect(e2_1)
local e2_2=Effect.CreateEffect(ec)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetRange(LOCATION_SZONE)
e2_2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2_2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2_2:SetValue(LINK_MARKER_TOP)
token:RegisterEffect(e2_2)
end
--]]
return true
else Duel.SendtoGrave(token,REASON_RULE) return false
end
end
function C9.Eqop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local m=c:GetOriginalCode()
c:ResetFlagEffect(20100000)
if c:IsLocation(LOCATION_MZONE) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
C9.TojiEquip(c,m+1,e,tp,eg,ep,ev,re,r,rp)
end
end
function C9.Eqop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(20100000,RESET_CHAIN,0,1)
end
function C9.TojiChainAttackTg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
if chk==0 then return ac:IsControler(tp) and ac:IsSetCard(0xc90) and ac~=c
and c:GetAttackAnnouncedCount()==0 and c:IsAttackable() end
Duel.SetTargetCard(c)
end
function C9.TojiChainAttackOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ac=Duel.GetAttacker()
local atk=c:GetAttack()
if atk<1 then return end
if ac:IsFaceup() and ac:IsRelateToBattle() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(C9.TojiChainAttackCon)
e2:SetValue(atk)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE)
ac:RegisterEffect(e2)
end
end
function C9.TojiChainAttackCon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL) and c:IsRelateToBattle()
end
--Okatana Effect Function
-----------------------------------------------------------------------------------------------------------
function C9.MusumiKiyokaFilter(c)
return c:IsSetCard(0xc90) and c:IsAbleToGrave()
end
function C9.MusumiKiyokaTg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(C9.MusumiKiyokaFilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function C9.WarriorSpLimit(e,c)
return not c:IsRace(RACE_WARRIOR) and c:IsLocation(LOCATION_EXTRA)
end
function C9.MusumiKiyokaOp(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,C9.MusumiKiyokaFilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(C9.WarriorSpLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function C9.ShichinosatoKofukiCon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and eg:GetFirst()==e:GetHandler():GetEquipTarget()
end
function C9.ShichinosatoKofukiFilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function C9.ShichinosatoKofukiTg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and C9.ShichinosatoKofukiFilter(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,C9.ShichinosatoKofukiFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function C9.ShichinosatoKofukiOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
if Duel.Destroy(tc,REASON_EFFECT) then
Duel.BreakEffect()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(200)
ec:RegisterEffect(e1)
end
end
end
function C9.SetouchiChieFilter(c,e,tp)
return c:IsSetCard(0xc90) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function C9.SetouchiChieTg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and C9.SetouchiChieFilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(C9.SetouchiChieFilter,tp,LOCATION_GRAVE,0,1,nil,e,tp)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,C9.SetouchiChieFilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function C9.SetouchiChieOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(C9.WarriorSpLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function C9.KitoraMirjaFilter(c)
return c:IsSetCard(0xc91) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function C9.KitoraMirjaTg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(C9.KitoraMirjaFilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function C9.KitoraMirjaOp(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,C9.KitoraMirjaFilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(C9.WarriorSpLimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function C9.JujoHiyoriCon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ec=c:GetEquipTarget()
local ecc=ec:GetControler()
local cg=ec:GetColumnGroup()
return cg:FilterCount(Card.IsControler,nil,1-ecc)==0
end
function C9.YanaseMaiCon(e)
local p=e:GetHandler():GetControler()
local fec1=Duel.GetFlagEffect(p,20100000)
local fec2=Duel.GetFlagEffect(1-p,20100000)
return fec1>0 or fec2>0
end
function C9.ItomiSayakaVal(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
function C9.KohaguraErenVal(e,c)
return c~=e:GetHandler():GetEquipTarget()
end
function C9.ShidouMakiCon(e)
local tc=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==tc or Duel.GetAttackTarget()==tc
end
function C9.KonohanaSuzukaOp(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsSetCard(0xc90) then
Duel.SetChainLimit(C9.KonohanaSuzukaChainLim)
end
end
function C9.KonohanaSuzukaChainLim(e,rp,tp)
return tp==rp
end
function C9.SatsukiYumiCon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
if ec~=Duel.GetAttacker() and ec~=Duel.GetAttackTarget() then return false end
local tc=ec:GetBattleTarget()
return tc and tc:IsFaceup() and (tc:GetAttack())>(ec:GetAttack())
end
function C9.SatsukiYumiCost(e,tp,eg,ep,ev,re,r,rp,chk)
local ec=e:GetHandler():GetEquipTarget()
local atk1=ec:GetAttack()
local atk2=ec:GetBattleTarget():GetAttack()
local dif=atk2-atk1
local a1=math.ceil(dif/1000)
if (dif%1000)==0 then a1=a1+1 end
if chk==0 then return Duel.CheckLPCost(tp,a1*1000) end
Duel.PayLPCost(tp,a1*1000)
e:SetLabel(a1*1000)
end
function C9.SatsukiYumiOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local ec=c:GetEquipTarget()
local atk=e:GetLabel()
if ec and ec:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
ec:RegisterEffect(e1)
end
end
function C9.TsubakuroYumeCon(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
local ec=e:GetHandler():GetEquipTarget()
local tc=ec:GetBattleTarget()
return ec==Duel.GetAttacker() and tc and tc:IsFaceup() and tc:IsControler(1-tp) and tc:GetAttack()>0
end
function C9.TsubakuroYumeOp(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not e:GetHandler():IsRelateToEffect(e) then return end
local ec=c:GetEquipTarget()
local tc=ec:GetBattleTarget()
if ec:IsRelateToBattle() and ec:IsFaceup() and tc:IsRelateToBattle() and tc:IsFaceup() and tc:GetAttack()>0 then
for i=1,3 do
local op1=Duel.SelectOption(tp,aux.Stringid(20100229,1),aux.Stringid(20100229,2))
local op2=Duel.SelectOption(1-tp,aux.Stringid(20100229,1),aux.Stringid(20100229,2))
Duel.Hint(HINT_OPSELECTED,tp,aux.Stringid(20100229,op2+1))
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(20100229,op1+1))
if op1~=op2 then
local e1=Effect.CreateEffect(ec)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
end
end
end
end
--constant
-----------------------------------------------------------------------------------------------------------
C9.SE_Reset=RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END
C9.E_Reset=RESET_PHASE+PHASE_END
C9.S_Reset=RESET_EVENT+RESETS_STANDARD
C9.D_Reset=RESET_DISABLE
-----------------------------------------------------------------------------------------------------------
--通用函数
function C9.a(...) --花里胡哨的玩意,没啥卵用
local t={...}
local r={}
for i,v in ipairs(C9.para) do
r[v]=t[i]
end
return r
end
function C9.IsBetween(a,b,c) --检查a是否介于b和c之间
if b>c then b,c=c,b end
if a>=b and a<=c then return true end
return false
end
function C9.ContinuousAct(c,dam) --永续魔陷的发动动作,存在dam时则可在伤害步骤发动
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
if dam then e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP) end
c:RegisterEffect(e1)
end
function C9.SelfSpSummonCheck(tp,e) --特招自身效果的基础通用检测
local c=e:GetHandler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function C9.IsLinkedEach(c,ec) --检查c和ec之间是否处于连接状态
return c:GetLinkedGroup():IsContains(ec) or ec:GetLinkedGroup():IsContains(c)
end
function C9.SetCardCheck(c,...) --带字段且表侧表示的通用检测函数
return c:IsFaceup() and c:IsSetCard(table.unpack({...}))
end
function C9.OverlayCost(ct) --取除ct个超量素材的通用cost函数
return function (e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,ct,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,ct,ct,REASON_COST)
end
end
function C9.SpiritDragonCheck(tp) --检查玩家tp是否受青眼精灵龙效果影响
return Duel.IsPlayerAffectedByEffect(tp,59822133)
end
function C9.CreateSingleEffect(c,code) --为卡片c注册单体效果
local forced=false
if c:IsType(TYPE_TOKEN) then
forced=true
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(code)
c:RegisterEffect(e1,forced)
end
function C9.GetCoordinate(c,tp) --获取以tp来看的卡片c的坐标值,例如左下角的魔陷区域为(0,0),左EX区为(2,3)
if not c:IsLocation(LOCATION_ONFIELD) or c:IsLocation(LOCATION_FZONE) then return false end
local x=aux.GetColumn(c,tp)
local y=0
if c:IsControler(tp) then
y=c:IsLocation(LOCATION_SZONE) and 0 or 1
else
y=c:IsLocation(LOCATION_MZONE) and 3 or 4
end
if c:GetSequence()>4 then y=2 end
return x,y
end
function C9.RegisterEffect_Batch(c,...) --为卡片c批量注册效果
local t={...}
local forced=c:IsType(TYPE_NORMAL) and true or false
for _,v in ipairs(t) do
c:RegisterEffect(v,forced)
end
end
function C9.RE_Check(c,e) --单体取对象及永续卡适用的关联性检测
if not c:IsRelateToEffect(e) then return end
end
-----------------------------------------------------------------------------------------------------------
--ReLive
--Flag 20100001 玩家舞台展开次数
--Flag 20100002 本回合舞台展开次数
--Flag 20100003 舞台展开次数增加标识(神乐光用)
--Flag 20100004 舞台展开自肃效果避免重复注册检查用
--Flag 20100356 ReLive超量怪兽叠叠乐计数
--Flag 20100417 舞台展开主动使用次数(艾露用)
function C9.ReLive(c,m) --ReLive怪兽通用变身效果
local flag=Effect.CreateEffect(c)
flag:SetLabel(m)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(LOCATION_HAND+LOCATION_ONFIELD)
e0:SetCondition(C9.ReLiveLvCheck)
e0:SetLabel(0) --Current Level
e0:SetLabelObject(flag)
e0:SetOperation(C9.LvupReg)
c:RegisterEffect(e0)
end
function C9.GetPlayerLevel(tp) --获取玩家当前的舞台展开等级
local PlayerLv=math.floor(Duel.GetFlagEffect(tp,20100001)/3)
if PlayerLv>3 then PlayerLv=3 end
return PlayerLv
end
function C9.IsPlayerLevel(tp,lv) --判断玩家当前的舞台展开等级是否≥lv
return C9.GetPlayerLevel(tp)>=lv
end
function C9.ReLiveLvCheck(e,tp,eg,ep,ev,re,r,rp) --变身检测
local m=e:GetLabel()
local PlayerLv=C9.GetPlayerLevel(tp)
return PlayerLv~=m
end
function C9.LvupReg(e,tp,eg,ep,ev,re,r,rp) --舞台少女天天进化中~
local m=e:GetLabel()
local c=e:GetHandler()
if c:IsLocation(LOCATION_ONFIELD) and c:IsPosition(POS_FACEUP) then --为变身效果增加选中特效,增强演出效果
Duel.HintSelection(Group.FromCards(c))
end
local code=e:GetLabelObject():GetLabel()
local PlayerLv=C9.GetPlayerLevel(tp)
e:SetLabel(PlayerLv)
c:SetCardData(1,code+PlayerLv)
if c:IsLocation(LOCATION_HAND) then
C9.ReLiveHensinCount=C9.ReLiveHensinCount+1
local hct=Duel.GetMatchingGroupCount(Card.IsSetCard,tp,LOCATION_HAND,0,nil,0xc99)
if hct==C9.ReLiveHensinCount then
Duel.ShuffleHand(tp)
C9.ReLiveHensinCount=0
end
end
end
function C9.StageFilter(c,tp) --字面上的意思
return c:GetActivateEffect():IsActivatable(tp,true,true)
end
function C9.StageFilter2(c,num)
local code=c:GetOriginalCode()
return code~=num
end
function C9.GetStageList(tp) --获取玩家tp当前可进行舞台展开的列表
local NewGroup=Group.CreateGroup()
for i=20100417,20100431,2 do
local TokenStage=Duel.CreateToken(tp,i)
NewGroup:AddCard(TokenStage)
end
local StageList=NewGroup:Filter(C9.StageFilter,nil,tp)
if #StageList<1 then return StageList end
local TestCard=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,nil):GetFirst()
local fet={TestCard:IsHasEffect(EFFECT_FORBIDDEN)} --禁止令检测
if #fet>0 then
for _,v in ipairs(fet) do
local v1=v:GetLabel()
local v2=0
if e:GetLabelObject() then v2=e:GetLabelObject():GetLabel() end
if C9.IsBetween(v1,20100417,20100432) or C9.IsBetween(v2,20100417,20100432) then
StageList:Remove(Card.IsCode,nil,v1,v2,v1-1,v2-1)
end
end
end
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
local fccode=fc:GetCode()-1
local StageList1=StageList:Filter(C9.StageFilter2,nil,fccode)
return StageList1
end
Duel.DisableActionCheck(false)
return StageList
end
function C9.StageCheck(tp,no_inquiry) --检测并询问玩家是否进行舞台展开,传入no_inquiry参数时将不再询问
local StageList=C9.GetStageList(tp)
local num=Duel.GetFlagEffect(tp,20100002)-Duel.GetFlagEffect(tp,20100003)
if num<4 and #StageList>0 and (no_inquiry or Duel.SelectYesNo(tp,aux.Stringid(20100300,0))) then return true end
return false
end
function C9.ReLiveSplimit(e,c,sump,sumtype,sumpos,targetp,se)
if c:IsRace(RACE_SPELLCASTER) then return false end
return targetp and targetp==e:GetHandlerPlayer()
end
function C9.StageHatsudou(tp,e,num) --进行舞台展开
local StageList=C9.GetStageList(tp)
local sc=nil
if not num then
sc=StageList:Select(tp,1,1,nil):GetFirst()
end
if sc or num then
local oricode=0
if num then oricode=num+1 else oricode=sc:GetOriginalCode()+1 end
local token=Duel.CreateToken(tp,oricode)
Duel.Hint(8,1-tp,token:GetOriginalCode())
token:SetCardData(CARDDATA_TYPE,TYPE_FIELD+TYPE_SPELL+TYPE_TOKEN+TYPE_NORMAL)
local fc=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(token,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
token:CancelToGrave()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(TYPE_FIELD+TYPE_SPELL)
e1:SetReset(RESET_EVENT+0x1fc0000)
token:RegisterEffect(e1,true)
token:CancelToGrave()
token:CopyEffect(oricode-1,C9.S_Reset,1)
if not num then
Duel.RegisterFlagEffect(tp,20100001,0,0,0)
Duel.RegisterFlagEffect(tp,20100002,C9.E_Reset,0,1)
end
Duel.RegisterFlagEffect(tp,20100004,C9.E_Reset,0,1)
if Duel.GetFlagEffect(tp,20100004)<2 then
local function spcheck(e,c,sump,sumtype,sumpos,targetp,se)
if c:IsRace(RACE_SPELLCASTER) then return false end
return targetp and targetp==e:GetLabel()
end
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,1)
e6:SetLabel(e:GetHandlerPlayer())
e6:SetTarget(spcheck)
e6:SetReset(C9.E_Reset)
Duel.RegisterEffect(e6,tp)
end
Duel.RaiseEvent(token,4179255,e,0,tp,tp,Duel.GetCurrentChain())
if not num then Duel.RaiseEvent(token,EVENT_CUSTOM+20100425,e,0,tp,tp,Duel.GetCurrentChain()) end
if not C9.ReLiveCheck then
C9.ReLiveCheck=true
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetDescription(aux.Stringid(20100398,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED)
e2:SetCondition(C9.MenuCon)
e2:SetOperation(C9.MenuOp)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetTargetRange(LOCATION_EXTRA+LOCATION_GRAVE+LOCATION_REMOVED,0)
e3:SetTarget(C9.MenuTg)
e3:SetLabelObject(e2)
Duel.RegisterEffect(e3,tp)
end
return true
end
return false
end
function C9.StageFix(tp,e) --检查是否可进行舞台展开,若可则发动
if C9.StageCheck(tp) then
Duel.BreakEffect()
if C9.StageHatsudou(tp,e) then return true end
end
return false
end
function C9.CurtainCon(e,tp,eg,ep,ev,re,r,rp) --谢幕通用Con函数
local l=e:GetLabel()
local tid=e:GetHandler():GetTurnID()
local t=Duel.GetTurnCount()
if l==0 then return (t-tid)>0
elseif l==1 then return Duel.GetFlagEffect(tp,20100417)<1 and Duel.IsPlayerAffectedByEffect(tp,20100396) end
return false
end
function C9.CurtainCost(e,tp,eg,ep,ev,re,r,rp,chk) --谢幕通用Cost函数
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
if (e:GetLabel()==1) then Duel.RegisterFlagEffect(tp,20100417,C9.E_Reset,0,1) end
end
function C9.CurtainEffect(c,category,target,operation)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(20100417,0))
e1:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_FZONE)
e1:SetLabel(0)
e1:SetCondition(C9.CurtainCon)
e1:SetCost(C9.CurtainCost)
if category then e1:SetCategory(category) end
if target then e1:SetTarget(target) end
e1:SetOperation(operation)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(0)
e2:SetLabel(1)
c:RegisterEffect(e1)
c:RegisterEffect(e2)
local function tempop(e,tp,eg,ep,ev,re,r,rp)
local function spcheck(e,c,sump,sumtype,sumpos,targetp,se)
if c:IsRace(RACE_SPELLCASTER) then return false end
return targetp and targetp==e:GetLabel()
end
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(1,1)
e6:SetTarget(spcheck)
e6:SetLabel(e:GetHandlerPlayer())
Duel.RegisterEffect(e6,tp)
Duel.RegisterFlagEffect(tp,20100004,C9.E_Reset,0,1)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_FZONE+LOCATION_SZONE)
e3:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e3:SetCountLimit(1)
e3:SetOperation(tempop)
c:RegisterEffect(e3)
end
--Menu功能↓
function C9.MenuTg(e,c)
local tp=e:GetOwnerPlayer()
--local dtc=Duel.GetDecktopGroup(tp,1):GetFirst()
local dtc=Duel.GetFieldGroup(tp,LOCATION_EXTRA,0):GetFirst()
if dtc then return c==dtc end
local gc=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0):GetFirst()
if gc then return c==gc end
local rmc=Duel.GetFieldGroup(tp,LOCATION_REMOVED,0):GetFirst()
if rmc then return c==rmc end
return false
end
function C9.MenuCon(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetAttacker() then return false end
return Duel.GetCurrentChain()<1 and Duel.GetTurnPlayer()==tp
end
function C9.MenuOp(e,tp,eg,ep,ev,re,r,rp)
local OPT=Duel.SelectOption(tp,aux.Stringid(20100301,0),aux.Stringid(20100301,1),aux.Stringid(20100301,2))
if OPT==0 then
local ct=Duel.GetFlagEffect(tp,20100001)
if ct>9 then ct=9 end
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(20100396,ct))
elseif OPT==1 then
Duel.ShuffleHand(tp)
elseif OPT==2 then
local num=Duel.GetFlagEffect(tp,20100002)-Duel.GetFlagEffect(tp,20100003)
local ct=4-num
Duel.Hint(HINT_MESSAGE,tp,aux.Stringid(20100302,ct))
end
end
function C9.EnablePendulumAttribute(c,reg)
if not Auxiliary.PendulumChecklist then
Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(Auxiliary.PendulumReset)
Duel.RegisterEffect(ge1,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(1163)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(C9.PendCondition())
e1:SetOperation(C9.PendOperation())
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--register by default
if reg==nil or reg then
local e2=Effect.CreateEffect(c)
e2:SetDescription(1160)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
c:RegisterEffect(e2)
end
end
function C9.ExToMainFilter(c)
return c:IsHasEffect(EFFECT_EXTRA_TOMAIN_KOISHI)
end
function C9.PendCondition()
return function(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 or Duel.IsExistingMatchingCard(C9.ExToMainFilter,tp,LOCATION_EXTRA,0,1,nil)
then loc=loc+LOCATION_EXTRA
end
if loc==0 then return false end
local g=nil
if og then
g=og:Filter(Card.IsLocation,nil,loc)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
return g:IsExists(Auxiliary.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
end
end
function C9.PendOperationCheckFilter(c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsHasEffect(EFFECT_EXTRA_TOMAIN_KOISHI)
end
function C9.PendOperationCheck(ft1,ft2,ft)
return function(g)
local exg=g:Filter(C9.PendOperationCheckFilter,nil)
local mg=g-exg
return #g<=ft and #exg<=ft2 and #mg<=ft1
end
end
function C9.PendOperation()
return function(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local tg=nil
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 or Duel.IsExistingMatchingCard(C9.ExToMainFilter,tp,LOCATION_EXTRA,0,1,nil) then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(Auxiliary.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
if ce then
tg=tg:Filter(Auxiliary.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Auxiliary.GCheckAdditional=C9.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,math.min(#tg,ft))
Auxiliary.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
else
Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
end
-----------------------------------------------------------------------------------------------------------
--Komachi
function C9.KomachiMonster(c,num)
--special summon
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_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,num)
e1:SetCondition(C9.Komachi_Sp_Con)
e1:SetOperation(C9.Komachi_Sp_Op)
c:RegisterEffect(e1)
if num==20100501 then return end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CHANGE_TYPE)
e3:SetValue(TYPE_MONSTER+TYPE_EFFECT)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetTarget(function(e,c) return c:IsCode(20100500) end)
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
local m=_G["c"..c:GetCode()]
local he=m.huyuurei_effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetTarget(function(e,c) return c:IsCode(20100500) end)
e2:SetLabelObject(he)
c:RegisterEffect(e2)
if c:GetOriginalCode()==20100508 then
local he1=he:Clone()
he1:SetCode(EFFECT_UPDATE_DEFENSE)
local e9=e2:Clone()
e9:SetLabelObject(he1)
c:RegisterEffect(e9)
end
if c:GetOriginalCode()==20100512 then --傻逼写法,懒得写循环了
local he1=he:Clone()
he1:SetCode(EFFECT_UNRELEASABLE_NONSUM)
local he2=he:Clone()
he2:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
he2:SetValue(function (e,c,sumtype) return sumtype==SUMMON_TYPE_FUSION end)
local he3=he:Clone()
he3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
local he4=he:Clone()
he4:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
local he5=he:Clone()
he5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
local ge1=e2:Clone()
ge1:SetLabelObject(he1)
local ge2=e2:Clone()
ge2:SetLabelObject(he2)
local ge3=e2:Clone()
ge3:SetLabelObject(he3)
local ge4=e2:Clone()
ge4:SetLabelObject(he4)
local ge5=e2:Clone()
ge5:SetLabelObject(he5)
C9.RegisterEffect_Batch(c,ge1,ge2,ge3,ge4,ge5)
end
--splimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetTargetRange(0,1)
e5:SetTarget(function(e,c) return not c:IsRace(RACE_PSYCHO) end)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_SUMMON)
local e7=e2:Clone()
e7:SetLabelObject(e5)
c:RegisterEffect(e7)
local e8=e2:Clone()
e8:SetLabelObject(e6)
c:RegisterEffect(e8)
end
function C9.Komachi_Sp_Con(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_EXTRA,0)~=0 then return false end
if c:IsLocation(LOCATION_GRAVE) and not Duel.IsPlayerAffectedByEffect(tp,20100514) then return false end
local dec=Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500)
if dec then
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
else
return not C9.SpiritDragonCheck(tp) and Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonCount(tp,2)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,20100500,0,0x4011,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_DARK,POS_FACEUP_ATTACK,1-tp)
end
end
function C9.Komachi_Sp_Op(e,tp,eg,ep,ev,re,r,rp,c)
if not Duel.IsExistingMatchingCard(Card.IsCode,tp,0,LOCATION_MZONE,1,nil,20100500) then
local token=Duel.CreateToken(tp,20100500)
Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP_ATTACK)
C9.CreateSingleEffect(token,EFFECT_CANNOT_ATTACK)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(1)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
token:RegisterEffect(e2,true)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(function (e,c,sumtype) return sumtype==SUMMON_TYPE_FUSION end)
token:RegisterEffect(e3,true)
local e4=e3:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e4:SetValue(1)
token:RegisterEffect(e4,true)
local e5=e4:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
token:RegisterEffect(e5,true)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
token:RegisterEffect(e6,true)
end
end
\ No newline at end of file
--七日速成的圣子
local m=21210000
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,aux.FilterBoolFunction(Card.IsSetCard,0xa12),LOCATION_MZONE)
--spsummon from deck/hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)--can be disabled
e1:SetRange(LOCATION_DECK+LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.spcon1)
c:RegisterEffect(e1)
--unable be released as higher summon mat.
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UNRELEASABLE_SUM)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(1)
c:RegisterEffect(e2)
--spsummon from grave
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(cm.spcon2)
e3:SetTarget(cm.sptg2)
e3:SetOperation(cm.spop2)
c:RegisterEffect(e3)
end
function cm.spcon1(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.GetFieldGroupCount(c:GetControler(),LOCATION_ONFIELD,0)==0
end
function cm.spcfilter(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsPreviousSetCard(0xa12) and c:IsType(TYPE_XYZ)
and (c:IsReason(REASON_BATTLE) or (rp==1-tp and c:IsReason(REASON_EFFECT)))
end
function cm.spcon2(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spcfilter,1,nil,tp,rp)
end
function cm.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.spop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--守护的骑士 卬月
local m=21210003
local cm=_G["c"..m]
function cm.initial_effect(c)
end
--守护骑士的断刃
local m=21210021
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_BE_BATTLE_TARGET)
e1:SetRange(LOCATION_SZONE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(cm.atkcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.tgcon)
e2:SetTarget(cm.target)
e2:SetOperation(cm.activation)
c:RegisterEffect(e2)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttackTarget()
e:SetLabel(1)
return at:IsControler(tp) and at:IsFaceup() and at:IsSetCard(0xa12)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xa12) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
e:SetLabel(2)
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g and g:IsExists(cm.cfilter,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return c:IsCode(21210003) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==0 then return false end
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function cm.activation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) then--spsummon
--change target
if e:GetLabel()==1 then --atk target
local a=Duel.GetAttacker()
local ag=a:GetAttackableTarget()
if a:IsAttackable() and not a:IsImmuneToEffect(e) and ag:IsContains(tc) then
Duel.BreakEffect()
Duel.ChangeAttackTarget(tc)
end
elseif e:GetLabel() ==2 then --effect target
if Duel.CheckChainTarget(ev,tc) then
Duel.ChangeTargetCard(ev,Group.FromCards(tc))
end
end
--register effect
--destroy by battle
local e1=Effect.CreateEffect(tc)
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_BATTLE_DESTROYED)
e1:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e1:SetTarget(cm.rgatktg)
e1:SetOperation(cm.rgatkop)
tc:RegisterEffect(e1,true)
--destroy by effect
local e2 = Effect.Clone(e1)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(cm.rgefcon)
e2:SetTarget(cm.rgeftg)
e2:SetOperation(cm.rgefop)
tc:RegisterEffect(e2,true)
tc:CompleteProcedure()
end
end
function cm.rgatktg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetHandler():GetBattleTarget()
if chk==0 then return bc:IsRelateToBattle() end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,bc,1,0,0)
end
function cm.rgatkop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.Destroy(bc,REASON_EFFECT)
end
end
function cm.rgefcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return not c:IsReason(REASON_BATTLE) and c:IsPreviousLocation(LOCATION_MZONE)
end
function cm.rgeftg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,re:GetHandler(),1,0,0)
end
function cm.rgefop(e,tp,eg,ep,ev,re,r,rp)
--local de = e:GetHandler():GetReasonEffect()
--local dc = de:GetHandler()
--if dc:IsRelateToEffect(de) then
Duel.Destroy(re:GetHandler(),REASON_EFFECT)
--end
end
--红魔-十六夜咲夜
function c22021.initial_effect(c)
--summon with no tribute
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(22021,0))
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_SUMMON_PROC)
e4:SetCondition(c22021.ntcon)
e4:SetOperation(c22021.ntop)
c:RegisterEffect(e4)
--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)
e1:SetCondition(c22021.spcon)
c:RegisterEffect(e1)
--control
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
c:RegisterEffect(e2)
--skip BP
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCondition(c22021.skipcon)
e3:SetOperation(c22021.skipop)
c:RegisterEffect(e3)
end
function c22021.ntfilter(c)
return c:IsSetCard(0xa999) and c:IsAbleToRemoveAsCost()
end
function c22021.ntcon(e,c)
if c==nil then return true end
return c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22021.ntfilter,c:GetControler(),LOCATION_GRAVE,0,1,nil)
end
function c22021.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.SelectMatchingCard(tp,c22021.ntfilter,c:GetControler(),LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c22021.spfilter(c)
return c:IsSetCard(0x810)
end
function c22021.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(c22021.spfilter,c:GetControler(),LOCATION_GRAVE,0,1,nil)
end
function c22021.skipcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_COST) and re:IsHasType(0x7e0) and (re:GetHandler():IsCode(22024) or re:GetHandler():IsCode(22120))
end
function c22021.skipop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SKIP_BP)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
if Duel.GetTurnPlayer()~=tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(c22021.bpcon)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end
function c22021.bpcon(e)
return Duel.GetTurnCount()~=e:GetLabel()
end
--丰收之神 秋瓤子
function c23002.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23002,0))
e1:SetCategory(CATEGORY_SEARCH)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_DECK)
e1:SetCost(c23002.cost)
e1:SetTarget(c23002.tg)
e1:SetOperation(c23002.op)
c:RegisterEffect(e1)
end
function c23002.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23002)==0 end
Duel.RegisterFlagEffect(tp,23002,RESET_PHASE+PHASE_END,0,1)
end
function c23002.filter(c)
return (c:IsCode(23008) or c:IsCode(23001)) and c:IsAbleToHand()
end
function c23002.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c23002.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c23002.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c23002.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--哨戒天狗-犬走 椛
function c23006.initial_effect(c)
--def atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DEFENSE_ATTACK)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23006,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_DECK)
e2:SetCondition(c23006.spcon)
e2:SetCost(c23006.cost)
e2:SetTarget(c23006.sptg)
e2:SetOperation(c23006.spop)
c:RegisterEffect(e2)
end
function c23006.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND) or e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c23006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23006)==0 end
Duel.RegisterFlagEffect(tp,23006,RESET_PHASE+PHASE_END,0,1)
end
function c23006.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c23006.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--当代的念写记者 姬海棠极
function c23012.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23012,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_TO_DECK)
e1:SetCondition(c23012.spcon)
e1:SetCost(c23012.cost)
e1:SetTarget(c23012.sptg)
e1:SetOperation(c23012.spop)
c:RegisterEffect(e1)
--to deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(23012,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_TO_DECK)
e2:SetCondition(c23012.con)
e2:SetTarget(c23012.tg)
e2:SetOperation(c23012.op)
c:RegisterEffect(e2)
end
function c23012.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
end
function c23012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,23012)==0 end
Duel.RegisterFlagEffect(tp,23012,RESET_PHASE+PHASE_END,0,1)
end
function c23012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c23012.spop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c23012.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_HAND)
end
function c23012.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(1-tp) and chkc:GetLocation()==LOCATION_SZONE and chkc:IsAbleToDeck() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToDeck,tp,0,LOCATION_SZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,Card.IsAbleToDeck,tp,0,LOCATION_SZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function c23012.op(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,1,REASON_EFFECT)
end
end
\ No newline at end of file
......@@ -50,6 +50,7 @@ function c24088.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainNegatable(ev)
and re:GetHandler():GetLevel()>0 and re:GetHandler():GetLevel()<=e:GetHandler():GetLevel()
and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
function c24088.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsLevelAbove(3) end
......
--星莲-水难念缚灵 村纱水蜜
function c26005.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26005,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c26005.ntcon)
e1:SetOperation(c26005.ntop)
c:RegisterEffect(e1)
--level up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26005,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c26005.target)
e2:SetOperation(c26005.operation)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26005,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c26005.condition)
e3:SetTarget(c26005.sptg)
e3:SetOperation(c26005.spop)
c:RegisterEffect(e3)
end
function c26005.ntcon(e,c)
if c==nil then return true end
return c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c26005.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function c26005.filter1(c)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsLevelBelow(7)
end
function c26005.filter2(c)
return c:IsFaceup() and not c:IsType(TYPE_XYZ) and c:IsSetCard(0x251)
end
function c26005.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c26005.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26005.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c26005.filter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c26005.filter1,tp,LOCATION_MZONE,0,1,1,nil)
end
function c26005.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(c26005.filter2,tp,LOCATION_MZONE,0,nil)
local lc=g:GetFirst()
local lv=tc:GetLevel()
while lc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
lc:RegisterEffect(e1)
lc=g:GetNext()
end
end
end
function c26005.condition(e,tp,eg,ep,ev,re,r,rp)
if (Duel.GetFlagEffect(tp,26005)==0) then Duel.RegisterFlagEffect(tp,26005,RESET_PHASE+PHASE_END,0,0)
else return false end
return Duel.GetFlagEffect(tp,26005)==1
end
function c26005.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c26005.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c26005.filter(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN)
end
function c26005.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(c26005.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
end
--星莲-水难念缚灵 村纱水蜜
function c26012.initial_effect(c)
--summon with no tribute
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(26012,0))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SUMMON_PROC)
e1:SetCondition(c26012.ntcon)
e1:SetOperation(c26012.ntop)
c:RegisterEffect(e1)
--level up
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(26012,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c26012.target)
e2:SetOperation(c26012.operation)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(26012,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,26012)
e3:SetTarget(c26012.sptg)
e3:SetOperation(c26012.spop)
c:RegisterEffect(e3)
end
function c26012.ntcon(e,c)
if c==nil then return true end
return c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c26012.ntop(e,tp,eg,ep,ev,re,r,rp,c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetValue(1000)
e1:SetReset(RESET_EVENT+0xff0000)
c:RegisterEffect(e1)
end
function c26012.filter1(c)
return c:IsFaceup() and c:IsLevelAbove(1) and c:IsLevelBelow(7)
end
function c26012.filter2(c)
return c:IsFaceup() and not c:IsType(TYPE_XYZ) and c:IsSetCard(0x251)
end
function c26012.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c26012.filter1(chkc) end
if chk==0 then return Duel.IsExistingTarget(c26012.filter1,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c26012.filter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c26012.filter1,tp,LOCATION_MZONE,0,1,1,nil)
end
function c26012.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local g=Duel.GetMatchingGroup(c26012.filter2,tp,LOCATION_MZONE,0,nil)
local lc=g:GetFirst()
local lv=tc:GetLevel()
while lc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
lc:RegisterEffect(e1)
lc=g:GetNext()
end
end
end
function c26012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c26012.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c26012.filter(c,e,tp)
return c:IsRace(RACE_ZOMBIE) and c:IsAttribute(ATTRIBUTE_WATER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN)
end
function c26012.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=Duel.GetMatchingGroup(c26012.filter,tp,LOCATION_DECK,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sg)
end
end
--秘封思想家 莲子
function c28002.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28002,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c28002.cost1)
e1:SetTarget(c28002.target)
e1:SetOperation(c28002.operation)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28002,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCost(c28002.cost2)
e2:SetTarget(c28002.shtg)
e2:SetOperation(c28002.shop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c28002.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c28002.filter1(c)
return c:IsSetCard(0x211) and not c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c28002.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28002.filter1,tp,LOCATION_DECK,0,1,nil) end
end
function c28002.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c28002.filter1,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if not tc:IsAbleToGrave() or (tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(28002,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c28002.costfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToRemoveAsCost()
end
function c28002.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28002.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c28002.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c28002.filter2(c)
return c:IsSetCard(0x211) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c28002.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28002.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c28002.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c28002.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetValue(c28003.rdval)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c28003.rdval(e,re,val,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return 0
else
return val
end
end
--秘封思想家 莲子
function c28003.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(28003,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c28003.cost1)
e1:SetTarget(c28003.target)
e1:SetOperation(c28003.operation)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28003,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCost(c28003.cost2)
e2:SetTarget(c28003.shtg)
e2:SetOperation(c28003.shop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c28003.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c28003.filter1(c)
return c:IsSetCard(0x211) and not c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function c28003.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28003.filter1,tp,LOCATION_DECK,0,1,nil) end
end
function c28003.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c28003.filter1,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if not tc:IsAbleToGrave() or (tc:IsAbleToHand() and Duel.SelectYesNo(tp,aux.Stringid(28003,2))) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function c28003.costfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToRemoveAsCost()
end
function c28003.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28003.costfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c28003.costfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c28003.filter2(c)
return c:IsSetCard(0x211) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c28003.shtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28003.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c28003.shop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c28003.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetValue(c28003.rdval)
e1:SetReset(RESET_EVENT+0x1ff0000+RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c28003.rdval(e,re,val,r,rp,rc)
if bit.band(r,REASON_BATTLE)~=0 then
return 0
else
return val
end
end
--秘封 宇佐见莲子
function c28012.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28012,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c28012.spcost)
e2:SetTarget(c28012.sptg)
e2:SetOperation(c28012.spop)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(28012,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c28012.target)
e3:SetOperation(c28012.operation)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(28012,2))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_DESTROY)
e4:SetRange(LOCATION_REMOVED)
e4:SetCondition(c28012.scon)
e4:SetCost(c28012.cost)
e4:SetTarget(c28012.stg)
e4:SetOperation(c28012.sop)
c:RegisterEffect(e4)
end
function c28012.rfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToRemoveAsCost()
end
function c28012.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28012.rfilter,tp,LOCATION_GRAVE,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c28012.rfilter,tp,LOCATION_GRAVE,0,2,2,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c28012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c28012.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)>0 then
c:CompleteProcedure()
end
end
function c28012.cfilter(c)
return not c:IsPublic()
end
function c28012.jfilter(c)
return c:IsAbleToRemove() or c:IsDestructable()
end
function c28012.filter1(c)
return c:IsSetCard(0x208) and c:IsAbleToRemove() and c:IsFaceup()
end
function c28012.filter2(c)
return not c:IsSetCard(0x208) and c:IsDestructable() and c:IsFaceup()
end
function c28012.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28012.cfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsExistingMatchingCard(c28012.jfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c28012.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c28012.cfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsSetCard(0x208) then
local sg1=Duel.SelectMatchingCard(tp,c28012.filter2,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Destroy(sg1,REASON_EFFECT)
else local sg2=Duel.SelectMatchingCard(tp,c28012.filter1,tp,0,LOCATION_MZONE,1,1,e:GetHandler())
Duel.Remove(sg2,POS_FACEUP,REASON_EFFECT)
end
Duel.ShuffleHand(tp)
end
function c28012.filter(c,tp)
return c:IsSetCard(0xc211) and c:GetPreviousControler()==tp and c:GetReasonPlayer()==1-tp
end
function c28012.scon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28012.filter,1,nil,tp)
end
function c28012.costfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToGraveAsCost() and c:IsFaceup()
end
function c28012.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28012.costfilter,tp,LOCATION_REMOVED,0,7,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c28012.costfilter,tp,LOCATION_REMOVED,0,7,7,e:GetHandler())
Duel.SendtoGrave(g,REASON_COST)
end
function c28012.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(aux.TRUE,tp,0xf,0xf,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xf,0xf,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c28012.sop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0xf,0xf,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--秘封 玛艾里贝莉·哈恩
function c28017.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(28017,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCost(c28017.spcost)
e2:SetTarget(c28017.sptg)
e2:SetOperation(c28017.spop)
c:RegisterEffect(e2)
--Activate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(28017,1))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c28017.condition)
e3:SetTarget(c28017.target)
e3:SetOperation(c28017.operation)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EVENT_REMOVE)
c:RegisterEffect(e5)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(28017,2))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_DESTROY)
e4:SetRange(LOCATION_REMOVED)
e4:SetCondition(c28017.scon)
e4:SetCost(c28017.cost)
e4:SetTarget(c28017.stg)
e4:SetOperation(c28017.sop)
c:RegisterEffect(e4)
end
function c28017.costfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToGraveAsCost() and c:IsFaceup()
end
function c28017.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28017.costfilter,tp,LOCATION_REMOVED,0,2,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c28017.costfilter,tp,LOCATION_REMOVED,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c28017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,true,true) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c28017.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)>0 then
c:CompleteProcedure()
end
end
function c28017.condition(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsFaceup() and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c28017.thfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c28017.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28017.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c28017.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c28017.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c28017.filter(c,tp)
return c:IsSetCard(0xa211) and c:GetPreviousControler()==tp and c:GetReasonPlayer()==1-tp
end
function c28017.scon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c28017.filter,1,nil,tp)
end
function c28017.rfilter(c)
return c:IsSetCard(0x211) and c:IsAbleToRemoveAsCost()
end
function c28017.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c28017.rfilter,tp,LOCATION_GRAVE,0,7,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c28017.rfilter,tp,LOCATION_GRAVE,0,7,7,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c28017.stg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0x1e,0x1e,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0x1e,0x1e,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c28017.sop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0x1e,0x1e,nil)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
--命运试金石☪班尼特
function c50101.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50101.xyzfilter)
--Pyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50101,0))
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50101)
e4:SetCost(c50101.bcost)
e4:SetTarget(c50101.btg)
e4:SetOperation(c50101.bop)
c:RegisterEffect(e4)
end
function c50101.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsSetCard(0x250)
end
function c50101.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50101.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50101.bop(e,tp,eg,ep,ev,re,r,rp)
local num=2
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50219 and count>1 then num=4-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50219,num,e)
local heal=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)*1000
local LP=6000-Duel.GetLP(tp)
if LP<0 then LP=0 end
if heal>LP then heal=LP end
Duel.Recover(tp, heal, REASON_EFFECT)
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTargetRange(LOCATION_MZONE, 0)
e3:SetReset(RESET_PHASE+PHASE_END)
e3:SetValue(1000)
Duel.RegisterEffect(e3,tp)
end
--风色诗人☪温迪
function c50108.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50108.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50108,0))
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50108)
e4:SetCost(c50108.bcost)
e4:SetTarget(c50108.btg)
e4:SetOperation(c50108.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50108.value)
c:RegisterEffect(e3)
end
function c50108.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSetCard(0x250)
end
function c50108.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50108.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50108.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50108.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function c50108.bop(e,tp,eg,ep,ev,re,r,rp)
local num=3
local genso,count=TET.ELCounter.Get(1-tp)
TET.ELCounter.Add(nil,1-tp,50240,num,e)
Duel.Damage(1-tp, 600, REASON_EFFECT)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50108.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c50108.value(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_ONFIELD)*200
end
--尘世闲游☪钟离
function c50121.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50121.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50121,0))
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50121)
e4:SetCost(c50121.bcost)
e4:SetTarget(c50121.btg)
e4:SetOperation(c50121.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50121.value)
c:RegisterEffect(e3)
end
function c50121.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsSetCard(0x250)
end
function c50121.bcost(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 c50121.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
end
function c50121.bop(e,tp,eg,ep,ev,re,r,rp)
local num=3
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50234 and count>0 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50234,num,e)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
tc:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_DISABLE)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_DISABLE_EFFECT)
e6:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e6)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
tc=g:GetNext()
end
end
function c50121.value(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*500
end
--川内型轻巡洋舰-那珂
function c50133.initial_effect(c)
local temp = 0
while temp<6 do
c:RegisterFlagEffect(50200,0,0,0)
temp = temp+1
end
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50133,0))
e2:SetCategory(CATEGORY_DISABLE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c50133.negcon)
e2:SetCost(c50133.negcost)
e2:SetTarget(c50133.negtg)
e2:SetOperation(c50133.negop)
c:RegisterEffect(e2)
--recover
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50133,1))
e3:SetCategory(CATEGORY_RECOVER)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EVENT_DISCARD)
e3:SetCost(c50133.rccost)
e3:SetTarget(c50133.target)
e3:SetOperation(c50133.rcop)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EVENT_RELEASE)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EVENT_REMOVE)
c:RegisterEffect(e6)
--cannot special summon
local e4=Effect.CreateEffect(c)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetRange(LOCATION_GRAVE)
e4:SetCode(EFFECT_SPSUMMON_CONDITION)
e4:SetValue(aux.FALSE)
c:RegisterEffect(e4)
end
function c50133.tfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFaceup() and c:IsSetCard(0x4bb)
end
function c50133.negcon(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return g:IsExists(c50133.tfilter,1,nil)
end
function c50133.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c50133.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function c50133.negop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function c50133.rccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,501330)==0 end
Duel.RegisterFlagEffect(tp,501330,RESET_PHASE+PHASE_END,0,1)
end
function c50133.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1700)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1700)
end
function c50133.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 c50158.initial_effect(c)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50158,0))
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50158.btg)
e4:SetOperation(c50158.bop)
c:RegisterEffect(e4)
end
function c50158.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50158.bop(e,tp,eg,ep,ev,re,r,rp)
local num=2
local genso,count=TET.ELCounter.Get(1-tp)
TET.ELCounter.Add(nil,1-tp,50240,num,e)
local g=e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-tp)
Duel.SendtoHand(g,nil,REASON_EFFECT)
end
--陵薮市朝☪钟离
function c50171.initial_effect(c)
--Geo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50171,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50171.btg)
e4:SetOperation(c50171.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50171.value)
c:RegisterEffect(e3)
end
function c50171.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50171.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50234 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50234,num,e)
--destroy replace
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(c50171.reptg)
e2:SetValue(c50171.repval)
e2:SetOperation(c50171.repop)
c:RegisterEffect(e2)
end
function c50171.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0x250) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c50171.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c50171.filter,1,nil,tp)
and c:GetLevel()>1 and not c:IsStatus(STATUS_DESTROY_CONFIRMED) end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c50171.repval(e,c)
return c50171.filter(c,e:GetHandlerPlayer())
end
function c50171.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(-1)
c:RegisterEffect(e1)
end
function c50171.value(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*500
end
--循循守月☪甘雨
function c50210.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50210.xyzfilter)
--Cyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50210,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50210)
e4:SetCost(c50210.bcost)
e4:SetTarget(c50210.btg)
e4:SetOperation(c50210.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e3:SetCondition(c50210.dcon)
e3:SetOperation(c50210.dop)
c:RegisterEffect(e3)
end
function c50210.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x250)
end
function c50210.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50210.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50210.bop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_BATTLE_START)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetOperation(c50210.cop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_PHASE+PHASE_STANDBY)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_PHASE+PHASE_END)
c:RegisterEffect(e3)
end
function c50210.cop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50210 and count>1 then num=4-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50210,num,e)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tg=g:GetMinGroup(Card.GetAttack)
Duel.Destroy(tg,REASON_EFFECT)
end
end
function c50210.dcon(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp and e:GetHandler()==Duel.GetAttacker() and not Duel.GetAttackTarget()
end
function c50210.dop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
--霆霓快雨☪刻晴
function c50213.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50213.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50213,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50213)
e4:SetCost(c50213.bcost)
e4:SetTarget(c50213.btg)
e4:SetOperation(c50213.bop)
c:RegisterEffect(e4)
--pierce
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e7:SetCondition(c50213.damcon)
e7:SetOperation(c50213.damop)
c:RegisterEffect(e7)
end
function c50213.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x250)
end
function c50213.bcost(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 c50213.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50213.bop(e,tp,eg,ep,ev,re,r,rp)
for i = 1, 3 do
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50213 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50213,num,e)
end
end
function c50213.damcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return ep==1-tp and c==Duel.GetAttacker() and Duel.GetAttackTarget() and Duel.GetAttackTarget():IsDefensePos()
end
function c50213.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
--星天水镜☪莫娜
function c50216.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50216.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50216,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50216)
e4:SetCost(c50216.bcost)
e4:SetTarget(c50216.btg)
e4:SetOperation(c50216.bop)
c:RegisterEffect(e4)
--ganlu
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c50216.bop2)
c:RegisterEffect(e2)
end
function c50216.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsSetCard(0x250)
end
function c50216.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50216.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50216.bop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local num=2
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=4-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_DAMAGE)
e2:SetCountLimit(1)
e2:SetLabelObject(c)
e2:SetCondition(c50216.ccon)
e2:SetOperation(c50216.cop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c50216.ccon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep
end
function c50216.cop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabelObject():GetAttack()
Duel.Damage(1-tp, atk, REASON_EFFECT)
end
function c50216.bop2(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
end
--雪霁梅香☪胡桃
function c50219.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50219.xyzfilter)
--Pyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50219,0))
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50219)
e4:SetCost(c50219.bcost)
e4:SetTarget(c50219.btg)
e4:SetOperation(c50219.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50219.value)
c:RegisterEffect(e3)
end
function c50219.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsSetCard(0x250)
end
function c50219.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50219.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50219.natfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function c50219.natfilter(c)
return not c:IsType(TYPE_TOKEN)
end
function c50219.bop(e,tp,eg,ep,ev,re,r,rp)
local num=2
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50219 and count>1 then num=4-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50219,num,e)
local ct=Duel.GetMatchingGroupCount(c50219.natfilter,tp,0,LOCATION_MZONE,nil)
Duel.Draw(tp, ct, REASON_EFFECT)
Duel.Recover(tp, ct*1000, REASON_EFFECT)
end
function c50219.value(e,c)
local ct=400
if Duel.GetLP(c:GetControler())<=4000 then ct=800 end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*ct
end
--一心净土☪雷电影
function c50228.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50228.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50228,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50228)
e4:SetCost(c50228.bcost)
e4:SetTarget(c50228.btg)
e4:SetOperation(c50228.bop)
c:RegisterEffect(e4)
--yl
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(c50228.ylcon)
e2:SetOperation(c50228.ylop)
Duel.RegisterEffect(e2,tp)
end
function c50228.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x250)
end
function c50228.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,3,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,3,3,REASON_COST)
end
function c50228.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50228.bop(e,tp,eg,ep,ev,re,r,rp)
local num=3
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50213 and count>0 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50213,num,e)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(c50228.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ATTACK_ANNOUNCE)
e2:SetOperation(c50228.cop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2,true)
end
function c50228.efilter(e,re)
return e:GetHandlerPlayer()~=re:GetOwnerPlayer()
end
function c50228.ylfilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function c50228.cop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c50228.ylfilter, tp, LOCATION_MZONE, 0, nil)
local gt=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_GRAVE,nil)
local tc=g:GetFirst()
while tc and gt:GetCount()>0 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local sg=gt:Select(tp,1,1,nil)
Duel.Overlay(tc,sg)
gt:RemoveCard(sg:GetFirst())
tc=g:GetNext()
end
end
function c50228.filter(c)
return c:GetPreviousLocation()==LOCATION_OVERLAY
end
function c50228.ylcon(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c50228.filter, nil)
return ct>0
end
function c50228.ylop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=eg:FilterCount(c50228.filter, nil)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(ct*100)
c:RegisterEffect(e2)
end
--闪耀偶像☪芭芭拉
function c50231.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50231.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50231,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50231)
e4:SetCost(c50231.bcost)
e4:SetTarget(c50231.btg)
e4:SetOperation(c50231.bop)
c:RegisterEffect(e4)
end
function c50231.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsSetCard(0x250)
end
function c50231.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50231.filter(c)
return c:IsSetCard(0x250) and c:IsAbleToHand()
end
function c50231.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50231.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c50231.bop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50231.filter,tp,LOCATION_DECK,0,1,1,nil)
local ct=Duel.GetFieldGroupCount(tp, LOCATION_HAND, 0)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.Recover(tp, ct*800, REASON_EFFECT)
end
end
--未授勋之花☪诺艾尔
function c50234.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50234.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50234,0))
e4:SetCategory(CATEGORY_ATKCHANGE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCost(c50234.bcost)
e4:SetTarget(c50234.btg)
e4:SetOperation(c50234.bop)
c:RegisterEffect(e4)
end
function c50234.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsSetCard(0x250)
end
function c50234.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50234.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50234.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50234 and count>0 then num=1-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50234,num,e)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
e1:SetValue(c:GetDefense())
c:RegisterEffect(e1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_ATTACK_ALL)
e5:SetValue(1)
e5:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e5)
end
--无害甜度☪砂糖
function c50240.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50240.xyzfilter)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50240,0))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50240)
e4:SetCost(c50240.bcost)
e4:SetTarget(c50240.btg)
e4:SetOperation(c50240.bop)
c:RegisterEffect(e4)
end
function c50240.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsSetCard(0x250)
end
function c50240.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50240.dfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsDestructable()
end
function c50240.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50240.dfilter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function c50240.bop(e,tp,eg,ep,ev,re,r,rp)
c50240.cop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetOperation(c50240.cop)
Duel.RegisterEffect(e1,tp)
end
function c50240.cop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
TET.ELCounter.Add(nil,1-tp,50240,num,e)
local g=Duel.GetMatchingGroup(c50240.dfilter,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
local sg = g:RandomSelect(tp,1)
Duel.Destroy(sg,REASON_EFFECT)
end
end
--冻冻回魂夜☪七七
function c50277.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,5,75,c50277.xyzfilter)
--Cyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50277,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50277)
e4:SetCost(c50277.bcost)
e4:SetTarget(c50277.btg)
e4:SetOperation(c50277.bop)
c:RegisterEffect(e4)
end
function c50277.xyzfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSetCard(0x250)
end
function c50277.bcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end
function c50277.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50277.bop(e,tp,eg,ep,ev,re,r,rp)
local num=2
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50210 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50210,num,e)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(c)
e1:SetCondition(c50277.ccon)
e1:SetOperation(c50277.cop)
Duel.RegisterEffect(e1,tp)
end
function c50277.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function c50277.cop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabelObject():GetAttack()
Duel.Recover(tp,atk*3,REASON_EFFECT)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<3 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--浮生孰来☪甘雨
function c50310.initial_effect(c)
--Cyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50310,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50310.btg)
e4:SetOperation(c50310.bop)
c:RegisterEffect(e4)
end
function c50310.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE) >= 0
and Duel.IsPlayerCanSpecialSummonMonster(tp,50610,0x250,0x4011,0,2000,1,RACE_PLANT,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c50310.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50210 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50210,num,e)
local c=e:GetHandler()
if Duel.GetMZoneCount(tp)<0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,50610,0x250,0x4011,0,2000,1,RACE_PLANT,ATTRIBUTE_DARK) then return end
local token = Duel.CreateToken(tp,50610)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
--effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(c50310.atklimit)
token:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e4:SetOperation(c50310.desop)
token:RegisterEffect(e4)
end
function c50310.atklimit(e,c)
return c~=e:GetHandler()
end
function c50310.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50210 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50210,num,e)
Duel.Destroy(c,REASON_EFFECT)
end
--沉没的预言☪莫娜
function c50316.initial_effect(c)
--Hydro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50316,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50316.btg)
e4:SetOperation(c50316.bop)
c:RegisterEffect(e4)
end
function c50316.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE) >= 0
and Duel.IsPlayerCanSpecialSummonMonster(tp,50616,0x250,0x4011,0,2000,1,RACE_AQUA,ATTRIBUTE_WATER) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function c50316.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
local c=e:GetHandler()
if Duel.GetMZoneCount(tp)<0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,50616,0x250,0x4011,0,2000,1,RACE_AQUA,ATTRIBUTE_WATER) then return end
local token = Duel.CreateToken(tp,50616)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
--effect
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetValue(c50316.atklimit)
token:RegisterEffect(e3)
token:SetTurnCounter(0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,3)
e4:SetOperation(c50316.desop)
token:RegisterEffect(e4)
token:RegisterFlagEffect(1082946,RESET_PHASE+PHASE_END,0,3)
c50316[c]=e1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_REMAIN_FIELD)
token:RegisterEffect(e1)
end
function c50316.atklimit(e,c)
return c~=e:GetHandler()
end
function c50316.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=3-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
if ct>=3 then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(1082946)
end
end
--赤团开时☪胡桃
function c50319.initial_effect(c)
--Pyro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50319,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50319.btg)
e4:SetOperation(c50319.bop)
c:RegisterEffect(e4)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(c50319.value)
c:RegisterEffect(e3)
end
function c50319.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50319.bop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e1,true)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50319,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_ATTACK_ANNOUNCE)
e3:SetTarget(c50319.btg)
e3:SetOperation(c50319.cop)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e3,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetOperation(c50319.cop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
c:RegisterEffect(e2,true)
end
function c50319.cop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50219 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50219,num,e)
end
function c50319.value(e,c)
local ct=400
if Duel.GetLP(c:GetControler())<=4000 then ct=800 end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)*ct
end
--影寂天下人☪雷电将军
function c50328.initial_effect(c)
--Electro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50328,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50328.btg)
e4:SetOperation(c50328.bop)
c:RegisterEffect(e4)
end
function c50328.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50328.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50213 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50213,num,e)
--effect
local c=e:GetHandler()
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetReset(RESET_PHASE+PHASE_END,3)
e3:SetCondition(c50328.elccon)
e3:SetOperation(c50328.eleop)
Duel.RegisterEffect(e3,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetReset(RESET_PHASE+PHASE_END,3)
e2:SetCondition(c50328.ylcon)
e2:SetOperation(c50328.ylop)
Duel.RegisterEffect(e2,tp)
end
function c50328.elccon(e,tp,eg,ep,ev,re,r,rp)
local a,d=Duel.GetBattleMonster(tp)
return a and a:GetControler()==tp and Duel.GetFlagEffect(tp, 50328)==0
end
function c50328.eleop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50213 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50213,num,e)
Duel.RegisterFlagEffect(tp, 50328, RESET_PHASE+PHASE_END, 0, 1)
end
function c50328.filter(c)
return c:GetPreviousLocation()==LOCATION_OVERLAY
end
function c50328.ylcon(e,tp,eg,ep,ev,re,r,rp)
local ct=eg:FilterCount(c50328.filter, nil)
return ct>0
end
function c50328.atkfilter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function c50328.ylop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=eg:FilterCount(c50328.filter, nil)
local g=Duel.GetMatchingGroup(c50328.atkfilter, tp, LOCATION_MZONE, 0, nil)
local tc=g:GetFirst()
while tc do
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(ct*200)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
--元气迸发☪芭芭拉
function c50331.initial_effect(c)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50331,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,50331)
e2:SetCost(c50331.sccost)
e2:SetTarget(c50331.sctg)
e2:SetOperation(c50331.scop)
c:RegisterEffect(e2)
--Hydro
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50331,1))
e4:SetCategory(CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50331.btg)
e4:SetOperation(c50331.bop)
c:RegisterEffect(e4)
end
function c50331.scfilter(c)
return c:IsSetCard(0x250) and c:IsAbleToHand()
end
function c50331.sccost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeckAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_COST)
end
function c50331.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c50331.scfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c50331.scop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c50331.scfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c50331.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*400)
end
function c50331.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(tp)
if genso==50216 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,tp,50216,num,e)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.Recover(p,ct*400,REASON_EFFECT)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetOperation(c50331.bbop)
Duel.RegisterEffect(e1,tp)
end
function c50331.bbop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
Duel.Recover(tp,ct*400,REASON_EFFECT)
end
--全能女仆☪诺艾尔
function c50334.initial_effect(c)
--Geo
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DESTROY_REPLACE)
e4:SetRange(LOCATION_HAND)
e4:SetCountLimit(1,50334)
e4:SetTarget(c50334.reptg)
e4:SetValue(c50334.repval)
e4:SetOperation(c50334.repop)
c:RegisterEffect(e4)
end
function c50334.filter(c,tp)
return c:IsFaceup() and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
and c:IsSetCard(0x250) and c:IsReason(REASON_BATTLE+REASON_EFFECT) and not c:IsReason(REASON_REPLACE)
end
function c50334.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(c50334.filter,1,nil,tp) and not c:IsPublic() end
return Duel.SelectEffectYesNo(tp,c,96)
end
function c50334.repval(e,c)
return c50334.filter(c,e:GetHandlerPlayer())
end
function c50334.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50234 and count>0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50234,num,e)
end
--混元熵增论☪砂糖
function c50340.initial_effect(c)
--Anemo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50340,0))
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,50340)
e4:SetTarget(c50340.btg)
e4:SetOperation(c50340.bop)
c:RegisterEffect(e4)
local e2 =e4:Clone()
e2:SetCategory(CATEGORY_TODECK)
e2:SetRange(LOCATION_HAND)
e2:SetTarget(c50340.ctg)
e2:SetOperation(c50340.cop)
c:RegisterEffect(e2)
end
function c50340.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c50340.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
TET.ELCounter.Add(nil,1-tp,50240,num,e)
end
function c50340.ctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,LOCATION_GRAVE)
end
function c50340.cop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
TET.ELCounter.Add(nil,1-tp,50240,num,e)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50340,1))
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+0x1fe0000)
c:RegisterEffect(e1)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_GRAVE,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
end
--寒苦回响☪七七
function c50377.initial_effect(c)
--Cryo
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(50377,0))
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c50377.btg)
e4:SetOperation(c50377.bop)
c:RegisterEffect(e4)
end
function c50377.btg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local atk=e:GetHandler():GetAttack()
Duel.SetTargetPlayer(tp)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,atk*2)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<=2 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function c50377.bop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50210 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50210,num,e)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local atk=e:GetHandler():GetAttack()
Duel.Recover(p,atk*2,REASON_EFFECT)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<=2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetOperation(c50377.bbop)
Duel.RegisterEffect(e1,tp)
end
function c50377.bbop(e,tp,eg,ep,ev,re,r,rp)
local num=1
local genso,count=TET.ELCounter.Get(1-tp)
if genso==50216 and count>1 then num=2-count end
if num<0 then num=0 end
TET.ELCounter.Add(nil,1-tp,50216,num,e)
local atk=e:GetHandler():GetAttack()
Duel.Recover(tp,atk*2,REASON_EFFECT)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<=2 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--地理法则☪蓝绿之力
function c50501.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(50501,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(2,50501)
e1:SetCost(c50501.cost1)
e1:SetTarget(c50501.target1)
e1:SetOperation(c50501.operation1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(50501,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(2,50501)
e2:SetCost(c50501.cost2)
e2:SetTarget(c50501.target2)
e2:SetOperation(c50501.operation2)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50501,2))
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(2,50501)
e3:SetCost(c50501.cost3)
e3:SetTarget(c50501.target3)
e3:SetOperation(c50501.operation3)
c:RegisterEffect(e3)
end
function c50501.spfilter4(c,e,tp)
return c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==4
end
function c50501.spfilter5(c,e,tp)
return c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:GetLevel()==5
end
function c50501.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,4000) end
Duel.PayLPCost(tp,4000)
end
function c50501.target1(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingMatchingCard(c50501.spfilter4,tp,LOCATION_DECK,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c50501.spfilter5,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function c50501.operation1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=1 then return end
local c=e:GetHandler()
local g4=Duel.GetMatchingGroup(c50501.spfilter4,tp,LOCATION_DECK,0,nil,e,tp)
local g5=Duel.GetMatchingGroup(c50501.spfilter5,tp,LOCATION_DECK,0,nil,e,tp)
local g1=g4:RandomSelect(tp, 1)
local g2=g5:RandomSelect(tp, 1)
g1:Merge(g2)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c50501.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c50501.splimit(e,c)
return not c:IsSetCard(0x250)
end
function c50501.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,800) end
Duel.PayLPCost(tp,800)
end
function c50501.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50501.spfilter4,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c50501.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
local g4=Duel.GetMatchingGroup(c50501.spfilter4,tp,LOCATION_DECK,0,nil,e,tp)
local g1=g4:RandomSelect(tp, 1)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c50501.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c50501.cost3(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,200) end
Duel.PayLPCost(tp,200)
end
function c50501.target3(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND, e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c50501.operation3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
--天理法则☪元素充能
function c50502.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c50502.activate)
c:RegisterEffect(e1)
--Charge
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50502,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetTarget(c50502.etg)
e3:SetOperation(c50502.eop)
c:RegisterEffect(e3)
end
function c50502.spfilter(c,e,tp)
return c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c50502.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,50502,0,0,0)
local g=Duel.GetMatchingGroup(c50502.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c50502.xyzfilter1(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c50502.xyzfilter2(c)
return bit.band(c:GetReason(),REASON_DESTROY)~=0
end
function c50502.etg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c50502.xyzfilter1(chkc) end
if chk==0 then
local ct=Duel.GetFlagEffect(tp, 50502)+Duel.GetFlagEffect(1-tp, 50502)
local tgg=Duel.IsExistingTarget(c50502.xyzfilter1,tp,LOCATION_MZONE,0,1,nil)
if ct>2 then
return tgg and Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_GRAVE,ct,e:GetHandler())
else
return tgg and Duel.IsExistingMatchingCard(c50502.xyzfilter2,tp,0,LOCATION_GRAVE,ct,e:GetHandler())
end
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c50502.xyzfilter1,tp,LOCATION_MZONE,0,1,1,nil)
end
function c50502.eop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(tp, 50502)+Duel.GetFlagEffect(1-tp, 50502)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local g=Duel.SelectMatchingCard(tp,c50502.xyzfilter2,tp,0,LOCATION_GRAVE,ct,ct,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
--提瓦特☪冒险与羁绊
function c50503.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--pyro
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e1:SetRange(LOCATION_SZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c50503.pcon)
e1:SetValue(500)
c:RegisterEffect(e1)
--Hydro
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_RECOVER)
e2:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(c50503.hcon)
e2:SetOperation(c50503.hop)
c:RegisterEffect(e2)
--Electro
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(50503,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_BOTH_SIDE+EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(c50503.econ)
e3:SetTarget(c50503.etg)
e3:SetOperation(c50503.eop)
c:RegisterEffect(e3)
--Cryo
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DIRECT_ATTACK)
e4:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,0)
e4:SetCondition(c50503.ccon)
e4:SetTarget(aux.TargetBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK))
c:RegisterEffect(e4)
--Anemo
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(50503,1))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e5:SetRange(LOCATION_SZONE)
e5:SetCountLimit(1)
e5:SetCondition(c50503.acon)
e5:SetTarget(c50503.atg)
e5:SetOperation(c50503.aop)
c:RegisterEffect(e5)
--Geo
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetProperty(EFFECT_FLAG_BOTH_SIDE)
e6:SetRange(LOCATION_SZONE)
e6:SetTargetRange(LOCATION_MZONE,0)
e6:SetCondition(c50503.gcon)
e6:SetValue(600)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e7)
end
function c50503.pfilter(c)
return c:IsAttribute(ATTRIBUTE_FIRE) and c:IsFaceup()
end
function c50503.pcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.pfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 2, nil)
end
function c50503.hfilter(c)
return c:IsAttribute(ATTRIBUTE_WATER) and c:IsFaceup()
end
function c50503.hcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.hfilter, tp, LOCATION_MZONE, 0, 2, nil)
and ep==tp and (not re or re:GetHandler()==e:GetHandler())
end
function c50503.hop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp, 300, REASON_EFFECT)
end
function c50503.efilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsFaceup()
end
function c50503.econ(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.efilter, tp, LOCATION_MZONE, 0, 2, nil)
end
function c50503.xyzfilter1(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ)
end
function c50503.xyzfilter2(c)
return bit.band(c:GetReason(),REASON_DESTROY)~=0
end
function c50503.etg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) end
if chk==0 then return Duel.IsExistingMatchingCard(c50503.xyzfilter1,tp,LOCATION_MZONE,0,1,e:GetHandler())
and Duel.IsExistingTarget(c50503.xyzfilter2,tp,0,LOCATION_GRAVE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectTarget(tp,c50503.xyzfilter2,tp,0,LOCATION_GRAVE,1,1,e:GetHandler())
end
function c50503.eop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.GetMatchingGroupCount(c50503.xyzfilter1,tp,LOCATION_MZONE,0,nil)>0 then
local g=Duel.SelectMatchingCard(tp,c50503.xyzfilter1,tp,LOCATION_MZONE,0,1,1,nil)
local sg=g:GetFirst()
Duel.Overlay(sg,tc)
end
end
end
function c50503.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsFaceup()
end
function c50503.ccon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.cfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 2, nil)
end
function c50503.afilter(c)
return c:IsAttribute(ATTRIBUTE_WIND) and c:IsFaceup()
end
function c50503.acon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.afilter, tp, LOCATION_MZONE, 0, 2, nil)
end
function c50503.spfilter(c,e,tp)
return c:IsSetCard(0x250) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c50503.atg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c50503.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c50503.aop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c50503.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c50503.gfilter(c)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsFaceup()
end
function c50503.gcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c50503.gfilter, e:GetHandlerPlayer(), LOCATION_MZONE, 0, 2, nil)
end
--打块女王·星街彗星
local m=66915039
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915034)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcCodeFun(c,66915034,cm.matfilter,1,true,false)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.tg2)
e2:SetOperation(cm.op2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--remove
local e33=Effect.CreateEffect(c)
e33:SetDescription(aux.Stringid(m,0))
e33:SetType(EFFECT_TYPE_QUICK_O)
e33:SetCode(EVENT_FREE_CHAIN)
e33:SetRange(LOCATION_MZONE)
e33:SetProperty(EFFECT_FLAG_CARD_TARGET)
e33:SetCountLimit(1)
e33:SetTarget(cm.rmtg)
e33:SetOperation(cm.rmop)
c:RegisterEffect(e33)
end
function cm.matfilter(c)
return c:IsType(TYPE_SPELL)
end
function cm.cfilter(c,tp)
return c:GetSummonPlayer()==tp
end
function cm.spfilters(c,e,tp)
return c:IsType(TYPE_MONSTER) or c:IsType(TYPE_TRAP)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and eg:IsExists(cm.cfilter,1,nil,1-tp)
end
function cm.tg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (Duel.GetLocationCount(tp,LOCATION_MZONE)>0 or Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0) and Duel.IsPlayerCanSpecialSummonMonster(tp,66915042,0,0x4011,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT) end
end
--
function cm.op2(e,tp,eg,ep,ev,re,r,rp)
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)
if ft1==0 and ft2==0 then return end
local token=Duel.CreateToken(tp,66915042)
local s1=ft1>0 and token:IsCanBeSpecialSummoned(e,0,tp,false,false)
local s2=ft2>0 and token:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
if s1 and s2 then op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))
elseif s1 then op=Duel.SelectOption(tp,aux.Stringid(m,2))
elseif s2 then op=Duel.SelectOption(tp,aux.Stringid(m,3))+1
else op=2 end
local num=0
if op==0 then
if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e2_1=Effect.CreateEffect(e:GetHandler())
e2_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2_1:SetValue(1)
e2_1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
token:RegisterEffect(e2_1,true)
local e2_2=Effect.CreateEffect(e:GetHandler())
e2_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2_2:SetValue(1)
e2_2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
token:RegisterEffect(e2_2,true)
end
elseif op==1 then
if Duel.SpecialSummon(token,0,tp,1-tp,false,false,POS_FACEUP)~=0 then
local e2_1=Effect.CreateEffect(e:GetHandler())
e2_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2_1:SetValue(1)
e2_1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
token:RegisterEffect(e2_1,true)
local e2_2=Effect.CreateEffect(e:GetHandler())
e2_2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
e2_2:SetValue(1)
e2_2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
token:RegisterEffect(e2_2,true)
end
end
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
end
function cm.filterss(c,e,tp)
return c:IsType(TYPE_MONSTER)
end
function cm.filtersss(c,g)
return c:IsFaceup() and g:IsContains(c)
end
function cm.filterssss(c,g)
return g:IsContains(c) and c:IsAbleToRemove()
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tp=c:GetControler()
local tc=Duel.GetFirstTarget()
local cg=tc:GetColumnGroup()
if cg:GetCount()>=0 then
cg:AddCard(tc)
local mg=Duel.GetMatchingGroup(cm.filtersss,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler(),cg)
local ac=mg:GetFirst()
while ac do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(-1500)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
ac:RegisterEffect(e1)
ac=mg:GetNext()
end
cg:RemoveCard(tc)
end
if cg:GetCount()>=1 and c:IsFaceup() and c:IsRelateToEffect(e) then
local atk=(tc:GetColumnGroup():GetCount()+1)*500
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
if cg:GetCount()>=2 then
if tc:GetControler()==1-tp then
cg:AddCard(tc)
end
local b2=Duel.GetMatchingGroup(cm.filtersss,tp,0,LOCATION_ONFIELD,nil,cg)
local nc=b2:GetFirst()
while nc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e2)
if nc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e3)
end
nc=b2:GetNext()
end
cg:RemoveCard(tc)
end
if cg:GetCount()>=3 then
cg:AddCard(tc)
local b3=Duel.GetMatchingGroup(cm.filterssss,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e),cg)
Duel.Remove(b3,POS_FACEUP,REASON_EFFECT)
end
end
\ No newline at end of file
--向着全新的舞台
local m=66915044
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.spfilter(c,e,tp)
return c:IsCode(66915034) and c:IsAbleToDeck()
end
function cm.spfilters(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsLocation(LOCATION_EXTRA)) and aux.IsCodeListed(c,66915034)
end
function cm.spfilterss(c,e,tp)
return c:IsType(TYPE_MONSTER) or c:IsType(TYPE_TRAP)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_GRAVE,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
if Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) and not Duel.IsExistingMatchingCard(cm.spfilterss,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
if Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp) and not Duel.IsExistingMatchingCard(cm.spfilterss,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilters,tp,LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
\ No newline at end of file
--最美好的祈愿
local m=66915045
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915034)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
end
function cm.filters(c)
return not c:IsCode(m) and c:IsAbleToGraveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filters,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filters,tp,LOCATION_HAND+LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp)
local b2=Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.filterss,tp,LOCATION_GRAVE,0,5,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(m,0))
else
op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
end
if op==0 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
e:SetOperation(cm.spop)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK+LOCATION_GRAVE)
else
e:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e:SetOperation(cm.operation1)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
end
function cm.spfilter(c,e,tp)
return c:IsCode(66915034) and Duel.IsPlayerCanSpecialSummonMonster(tp,66915034,nil,0x11,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT,POS_FACEUP)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,e,tp)
if g:GetCount()<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
tc:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
end
function cm.filter(c)
return c:IsCode(66915034) and c:IsAbleToDeck()
end
function cm.filterss(c)
return c:IsAbleToDeck()
end
function cm.gselect(g)
return g:IsExists(Card.IsCode,1,nil,66915034)
end
function cm.operation1(e,tp,eg,ep,ev,re,r,rp)
local tp=e:GetHandler():GetControler()
local g=Duel.GetFieldGroup(tp,LOCATION_GRAVE,0)
if #g>=5 and g:IsExists(Card.IsCode,1,nil,66915034) then
Duel.Hint(HINT_SELECTMSG,p,HINTMSG_DISCARD)
local g1=g:SelectSubGroup(tp,cm.gselect,false,5,5)
Duel.SendtoDeck(g1,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then Duel.ShuffleDeck(tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct==5 then
Duel.BreakEffect()
Duel.Draw(tp,2,REASON_EFFECT)
end
end
end
\ No newline at end of file
--不为人知的幕后
local m=66915046
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915034)
--Activate
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_ACTIVATE)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetTarget(cm.targets)
e11:SetOperation(cm.operation)
c:RegisterEffect(e11)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(cm.spcon)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
end
function cm.filter(c)
return c:IsCode(66915034) and not c:IsForbidden()
end
function cm.filters(c)
return c:IsCode(66915035) and not c:IsForbidden()
end
function cm.targets(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>-1 and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
--destroy
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,1)
c:RegisterEffect(e1)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,nil,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==1 then
Duel.Destroy(c,REASON_RULE)
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
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_SZONE,0,1,nil,e,tp)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end
function cm.spfilter(c,e,tp)
return c:IsCode(66915034) and Duel.IsPlayerCanSpecialSummonMonster(tp,66915034,nil,0x11,0,0,1,RACE_CYBERSE,ATTRIBUTE_LIGHT,POS_FACEUP)
end
function cm.spfilters(c,e,tp)
return c:IsType(TYPE_MONSTER) or c:IsType(TYPE_TRAP)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<1 then return end
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_SZONE,0,nil,e,tp)
if g:GetCount()<1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
local tc=sg:GetFirst()
tc:AddMonsterAttribute(TYPE_NORMAL)
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
if not Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 and Duel.IsExistingMatchingCard(cm.filters,tp,LOCATION_DECK,0,1,nil,tp) then
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local ta=Duel.SelectMatchingCard(tp,cm.filters,tp,LOCATION_DECK,0,1,1,nil,nil,tp):GetFirst()
if ta then
Duel.MoveToField(ta,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
end
\ No newline at end of file
--漫天的繁星也为之黯淡
local m=66915047
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915034)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCode(66915034) or aux.IsCodeListed(c,66915034)
end
function cm.spfilters(c,e,tp)
return c:IsType(TYPE_MONSTER) or c:IsType(TYPE_TRAP)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:GetControler()==tp and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
if not Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0 then
Duel.SetChainLimit(aux.FALSE)
end
end
function cm.disfilter(c)
return (not c:IsDisabled() or c:IsType(TYPE_TRAPMONSTER)) and not (c:IsType(TYPE_NORMAL) and bit.band(c:GetOriginalType(),TYPE_NORMAL)) and c:IsFaceup()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g1=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,tc)
if g1:GetCount()>0 then
local nc=g1:GetFirst()
while nc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e2)
if nc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
nc:RegisterEffect(e3)
end
nc=g1:GetNext()
end
end
end
\ No newline at end of file
--雪山战斧
local m=66915048
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,66915034)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--atk up
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(1000)
c:RegisterEffect(e2)
--Dpierce
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_EQUIP)
e5:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e5)
--Actlimit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(0,1)
e3:SetValue(1)
e3:SetCondition(cm.actcon)
c:RegisterEffect(e3)
--Equip limit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_EQUIP_LIMIT)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e0:SetValue(cm.eqlimit)
c:RegisterEffect(e0)
end
function cm.spfilters(c,e,tp)
return c:IsType(TYPE_MONSTER) or c:IsType(TYPE_TRAP)
end
function cm.actcon(e)
local tc=e:GetHandler():GetEquipTarget()
return Duel.GetAttacker()==tc or Duel.GetAttackTarget()==tc and not Duel.IsExistingMatchingCard(cm.spfilters,tp,LOCATION_DECK,0,1,nil) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>0
end
function cm.eqlimit(e,c)
return c:IsCode(66915034) or aux.IsCodeListed(c,66915034)
end
function cm.filter(c)
return c:IsFaceup() and c:IsCode(66915034) or aux.IsCodeListed(c,66915034)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cm.operation(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
--PP天使
function c66915050.initial_effect(c)
end
--星之原石
function c66915051.initial_effect(c)
end
--星之原石
function c66915052.initial_effect(c)
end
--星符『流星雨』
local m=66916008
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:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetHintTiming(TIMING_BATTLE_START)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--to hand
local e33=Effect.CreateEffect(c)
e33:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e33:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e33:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e33:SetCode(EVENT_TO_GRAVE)
e33:SetCondition(cm.con)
e33:SetTarget(cm.thtg)
e33:SetOperation(cm.thop)
c:RegisterEffect(e33)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_BATTLE_START and Duel.GetTurnPlayer()==tp
end
function cm.filter(c)
return c:IsFaceup() and c:IsSetCard(0x200) and not c:IsHasEffect(EFFECT_EXTRA_ATTACK_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EXTRA_ATTACK_MONSTER)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(cm.val)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CHANGE_DAMAGE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(0,1)
e4:SetValue(cm.damval)
e4:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e4,tp)
local e5=e4:Clone()
e5:SetCode(EFFECT_NO_EFFECT_DAMAGE)
e5:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e5,tp)
end
end
function cm.cfilter(c)
return c:IsSetCard(0x2024)
end
function cm.val(e,c)
local ct=Duel.GetMatchingGroup(cm.cfilter,e:GetHandlerPlayer(),LOCATION_GRAVE,0,nil):GetClassCount(Card.GetCode)
return math.max(0,ct)
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)<Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.IsPlayerCanSpecialSummonMonster(tp,10070,0,0x4011,0,0,1,RACE_FAIRY,ATTRIBUTE_WIND,POS_FACEUP,1-tp) end
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)-Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)-Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<ct then return end
if not Duel.IsPlayerCanSpecialSummonMonster(tp,10070,0,0x4011,0,0,1,RACE_FAIRY,ATTRIBUTE_WIND,POS_FACEUP,1-tp) then return end
for i=1,ct do
local token=Duel.CreateToken(tp,10070)
Duel.SpecialSummonStep(token,0,tp,1-tp,false,false,POS_FACEUP)
end
Duel.SpecialSummonComplete()
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetValue(HALF_DAMAGE)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.damval(e,re,val,r,rp,rc)
if bit.band(r,REASON_EFFECT)~=0 then return 0
else return val end
end
\ No newline at end of file
--silver rain
SR = SR or {}
--素材限制
function SR.MaterialLimit(c)
--cannot xyz
local e_1=Effect.CreateEffect(c)
e_1:SetType(EFFECT_TYPE_SINGLE)
e_1:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e_1:SetRange(LOCATION_MZONE)
e_1:SetValue(SR.metelimit)
c:RegisterEffect(e_1)
--cannot synchro
local e_2=e_1:Clone()
e_2:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e_2)
--cannot fusion
local e_3=e_1:Clone()
e_3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
c:RegisterEffect(e_3)
--cannot link
local e_4=e_1:Clone()
e_4:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e_4)
end
--metelimit
function SR.metelimit(e,c)
if not c then return false end
return not c:IsSetCard(0x456)
end
\ No newline at end of file
--天狗首领✿天魔大人
require "expansions/script/nef/darksyn"
local Cardno=74561056
local cCardno=_G["c"..Cardno]
function cCardno.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
Nef.AddXyzProcedureWithDesc(c,aux.FilterBoolFunction(Card.IsSetCard,0x208),9,2,aux.Stringid(Cardno,0))
--dark synchro summon
DS.AddDarkSynchroProcedureWithDesc(c,nil,nil,9,aux.Stringid(Cardno,5))
-- xyz
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Cardno,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetCountLimit(1,Cardno)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(cCardno.xyzcon)
e1:SetOperation(cCardno.xyzop)
e1:SetValue(SUMMON_TYPE_XYZ)
--c:RegisterEffect(e1)
--1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(Cardno,2))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_BATTLE_START)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCondition(cCardno.atcon)
e2:SetCost(cCardno.atcost)
e2:SetTarget(cCardno.attg)
e2:SetOperation(cCardno.atop)
c:RegisterEffect(e2)
--2
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(Cardno,3))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DAMAGE_STEP_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cCardno.attcon)
--e3:SetCost(cCardno.attcost)
e3:SetTarget(cCardno.atttg)
e3:SetOperation(cCardno.attop)
c:RegisterEffect(e3)
--EN
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(Cardno,4))
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCondition(cCardno.encon)
e4:SetTarget(cCardno.entg)
e4:SetOperation(cCardno.enop)
--c:RegisterEffect(e4)
--EN recover
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(Cardno,4))
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_PHASE+PHASE_END)
e8:SetRange(LOCATION_MZONE)
e8:SetCountLimit(1)
e8:SetTarget(cCardno.entg)
e8:SetOperation(cCardno.enop)
--c:RegisterEffect(e8)
--multi attack
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EFFECT_EXTRA_ATTACK)
e4:SetValue(cCardno.attval)
c:RegisterEffect(e4)
end
function cCardno.attval(e)
return e:GetHandler():GetFlagEffect(Cardno)
end
--1
function cCardno.atcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattleTarget()
end
function cCardno.atcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
local g1=c:GetOverlayGroup()
c:RemoveOverlayCard(tp,1,1,REASON_COST)
local g2=c:GetOverlayGroup()
local g=Group.__sub(g1,g2)
local tc=g:GetFirst()
local atk=0
if tc and tc:IsType(TYPE_MONSTER) then atk=tc:GetAttack() end
e:SetLabel(atk)
end
function cCardno.attg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetBattleTarget()
if tc and not tc:IsDisabled() then Duel.SetOperationInfo(0,CATEGORY_DISABLE,tc,0,0,0) end
Duel.SetOperationInfo(0,CATEGORY_ATKCHANGE,e:GetHandler(),0,0,0)
end
function cCardno.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if tc and not tc:IsDisabled() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_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:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
local atk=e:GetLabel()
if atk>0 and c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(atk)
c:RegisterEffect(e1)
end
end
--2
function cCardno.attcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetBattleTarget()
end
function cCardno.attcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:CheckRemoveOverlayCard(tp,1,REASON_COST) end
c:RemoveOverlayCard(tp,1,1,REASON_COST)
end
function cCardno.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetBattleTarget()
if tc and tc:IsAbleToRemove(tp) then Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,0,0,0) end
end
function cCardno.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
if tc and tc:IsAbleToRemove(tp) then
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
if c:IsRelateToEffect(e) and c:IsFaceup() then
c:RegisterFlagEffect(Cardno,RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END,0,1)
end
end
--EN
function cCardno.encon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetSummonType()==SUMMON_TYPE_SYNCHRO
end
function cCardno.enfilter(c)
return c:IsSetCard(0x208)
end
function cCardno.entg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cCardno.enfilter,tp,LOCATION_GRAVE,0,1,nil) end
end
function cCardno.enop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.IsExistingMatchingCard(cCardno.enfilter,tp,LOCATION_GRAVE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cCardno.enfilter,tp,LOCATION_GRAVE,0,1,2,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
end
-- xyz
function cCardno.xyzfilter(c,tp,xyzc)
return c:IsType(TYPE_XYZ) and c:IsFaceup() and c:IsSetCard(0x224) and c:IsCanBeXyzMaterial(xyzc) and c:IsRank(4)
end
function cCardno.xyzcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetLocationCountFromEx(tp)<0 then return false end
return Duel.IsExistingMatchingCard(cCardno.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp,c)
end
function cCardno.xyzop(e,tp,eg,ep,ev,re,r,rp,c)
local mg = Duel.SelectMatchingCard(tp,cCardno.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
local tc=mg:GetFirst()
if not tc then return end
local mg2=tc:GetOverlayGroup()
if mg2:GetCount()~=0 then
Duel.Overlay(c,mg2)
end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
end
\ No newline at end of file
--再临:琪露诺!
local Cardno=74562015
local cCardno=_G["c"..Cardno]
function c74562015.initial_effect(c)
function cCardno.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(Cardno,0))
......@@ -19,14 +19,14 @@ function cCardno.filter2(c)
return c:IsCode(22088) and c:IsAbleToHand()
end
function cCardno.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cCardno.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cCardno.filter2,tp,LOCATION_DECK,0,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cCardno.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(cCardno.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,0,0)
end
function cCardno.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsExistingMatchingCard(cCardno.filter1,tp,LOCATION_DECK,0,1,nil) and Duel.IsExistingMatchingCard(cCardno.filter2,tp,LOCATION_DECK,0,1,nil) then
local ga=Duel.SelectMatchingCard(tp,cCardno.filter1,tp,LOCATION_DECK,0,1,1,nil)
local gb=Duel.SelectMatchingCard(tp,cCardno.filter2,tp,LOCATION_DECK,0,1,1,nil)
if Duel.IsExistingMatchingCard(cCardno.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) and Duel.IsExistingMatchingCard(cCardno.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) then
local ga=Duel.SelectMatchingCard(tp,cCardno.filter1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
local gb=Duel.SelectMatchingCard(tp,cCardno.filter2,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if ga:GetCount()>0 and gb:GetCount()>0 then
ga:Merge(gb)
Duel.SendtoHand(ga,nil,REASON_EFFECT)
......@@ -43,10 +43,5 @@ function cCardno.activate(e,tp,eg,ep,ev,re,r,rp)
end
end
function cCardno.aclimit(e,re,tp)
return re:GetHandler():IsType(TYPE_MONSTER)
return re:GetHandler():IsType(TYPE_MONSTER) and not re:GetHandler():IsSetCard(0x999)
end
\ No newline at end of file
......@@ -26,37 +26,20 @@ function c74563008.initial_effect(c)
c:RegisterEffect(e4)
end
function c74563008.filter0(c)
return c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER)
return c:IsCanBeFusionMaterial()
end
function c74563008.filter1(c,e)
return c:IsCanBeFusionMaterial() and c:IsType(TYPE_MONSTER) and not c:IsImmuneToEffect(e)
return c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c74563008.filter2(c,e,tp,m,f,chkf)
return (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c74563008.spfilter1(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c74563008.mfilter0(c,e)
return c:IsType(TYPE_SPELL+TYPE_MONSTER) and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c74563008.mfilter2(c,e)
return c:IsType(TYPE_SPELL+TYPE_MONSTER) and c:IsCanBeFusionMaterial()and not c:IsImmuneToEffect(e)
end
function c74563008.spfilter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x372) and (not f or f(c)) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c74563008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c74563008.filter0,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil)
local res=Duel.IsExistingMatchingCard(c74563008.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if res then return true end
local mg2=Duel.GetMatchingGroup(c74563008.mfilter0,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil,e)
mg2:Merge(mg1)
res=Duel.IsExistingMatchingCard(c74563008.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,nil,chkf)
local res=Duel.IsExistingMatchingCard(c74563008.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
......@@ -74,41 +57,31 @@ function c74563008.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c74563008.filter1,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil,e)
local sg1=Duel.GetMatchingGroup(c74563008.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=Duel.GetMatchingGroup(c74563008.mfilter2,tp,LOCATION_ONFIELD+LOCATION_HAND,0,nil,e)
mg2:Merge(mg1)
local sg2=Duel.GetMatchingGroup(c74563008.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,nil,chkf)
sg1:Merge(sg2)
local mg3=nil
local sg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg3=Duel.GetMatchingGroup(c74563008.spfilter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
sg2=Duel.GetMatchingGroup(c74563008.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg3~=nil and sg3:GetCount()>0) then
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg3 then sg:Merge(sg3) end
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg3==nil or not sg3:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
if tc:IsSetCard(0x372) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat2)
Duel.SendtoGrave(mat2,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat)
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
......
--虹之花✿虹霓文花
function c74563027.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunFunRep(c,c74563027.matfilter1,c74563027.matfilter,1,7777776,true)
aux.AddContactFusionProcedure(c,c74563027.cfilter,LOCATION_MZONE+LOCATION_HAND+LOCATION_GRAVE,LOCATION_GRAVE,c74563027.sprop(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c74563027.splimit)
c:RegisterEffect(e1)
--destroy
local e12=Effect.CreateEffect(c)
e12:SetCategory(CATEGORY_DESTROY)
e12:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e12:SetRange(LOCATION_MZONE)
e12:SetCountLimit(1)
e12:SetCode(EVENT_PHASE+PHASE_BATTLE)
e12:SetTarget(c74563027.destg)
e12:SetOperation(c74563027.desop)
c:RegisterEffect(e12)
end
function c74563027.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Nef.PLCounter.Get(tp,999104)~=1 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function c74563027.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
Duel.Destroy(c,REASON_EFFECT)
end
end
function c74563027.matfilter(c)
return c:IsRace(RACE_PLANT)
end
function c74563027.matfilter1(c,fc)
return c:IsSetCard(0x371) and c:IsControler(fc:GetControler())
end
function c74563027.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c74563027.cfilter(c,fc)
return c:IsAbleToRemove() and ((c:IsControler(fc:GetControler()) and c:IsSetCard(0x371)) or (c:IsRace(RACE_PLANT)))
end
function c74563027.sprop(c)
return function(g)
Duel.Remove(g,POS_FACEUP,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_BASE_ATTACK)
e1:SetReset(RESET_EVENT+0xff0000)
e1:SetValue(g:GetCount()*700)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e2)
end
end
\ No newline at end of file
--虹之花✿濑笈叶
require("expansions/script/nef/nef")
function c74563028.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x371),aux.FilterBoolFunction(Card.IsFusionSetCard,0xaa6),true)
--Destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(58074177,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE+LOCATION_REMOVED)
e3:SetCountLimit(1)
e3:SetCondition(c74563028.descon)
e3:SetTarget(c74563028.sptg)
e3:SetOperation(c74563028.spop)
c:RegisterEffect(e3)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND+CATEGORY_LEAVE_GRAVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCountLimit(1,74563028)
e3:SetCondition(c74563028.spcon)
e3:SetOperation(c74563028.spops)
c:RegisterEffect(e3)
Nef.SeasonChange(c)
end
c74563028.hana_mat={
aux.FilterBoolFunction(Card.IsFusionSetCard,0xaa6),
aux.FilterBoolFunction(Card.IsFusionSetCard,0x371),
}
c74563028.material_setcode={0xaa6,0x371}
function c74563028.descon(e,tp,eg,ep,ev,re,r,rp)
return (Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE)
end
function c74563028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) and Nef.PLCounter.Get(tp,999104)==1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c74563028.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c74563028.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_ONFIELD)
end
function c74563028.spops(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetCondition(c74563028.thcon)
e1:SetOperation(c74563028.thop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c74563028.thfilter(c)
return (c:IsCode(24235) or c:IsCode(24094653) or c:IsCode(999007) or (c:IsSetCard(0x371,0xaa9) and c:IsType(TYPE_MONSTER))) and c:IsAbleToHand()
end
function c74563028.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c74563028.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
end
function c74563028.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c74563028.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--苍月的恶魔✿芙兰朵露
local l = c7770096
local lid = 7770096
function l.initial_effect(c)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x815),1)
c:EnableReviveLimit()
c:SetSPSummonOnce(lid)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(l.target)
e1:SetOperation(l.activate)
c:RegisterEffect(e1)
end
function l.filter(c)
local code=c:GetOriginalCode()
local mt=_G["c" .. code]
return mt and mt.DescSetName == 0xa3 and (c:IsType(TYPE_SPELL)or c:IsType(TYPE_TRAP)) and c:IsAbleToGrave()
end
function l.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(l.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,1,tp,LOCATION_DECK)
end
function l.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,l.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--在这狭小的鸟笼中
function c86379001.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetOperation(c86379001.op)
c:RegisterEffect(e0)
--Destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(c86379001.desrepcon)
e1:SetValue(1)
c:RegisterEffect(e1)
--
local e2_1=Effect.CreateEffect(c)
e2_1:SetType(EFFECT_TYPE_SINGLE)
e2_1:SetCode(EFFECT_CANNOT_ATTACK)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(c86379001.tg1)
e3:SetLabelObject(e2_1)
c:RegisterEffect(e3)
--
local e2_2=Effect.CreateEffect(c)
e2_2:SetType(EFFECT_TYPE_SINGLE)
e2_2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2_2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2_2:SetRange(LOCATION_MZONE)
e2_2:SetValue(1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e4:SetTarget(c86379001.tg1)
e4:SetLabelObject(e2_2)
c:RegisterEffect(e4)
--
local e2_3=Effect.CreateEffect(c)
e2_3:SetType(EFFECT_TYPE_SINGLE)
e2_3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2_3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2_3:SetRange(LOCATION_MZONE)
e2_3:SetValue(1)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e5:SetTarget(c86379001.tg1)
e5:SetLabelObject(e2_3)
c:RegisterEffect(e5)
--
local e2_4=Effect.CreateEffect(c)
e2_4:SetType(EFFECT_TYPE_SINGLE)
e2_4:SetCode(EFFECT_CANNOT_TRIGGER)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e6:SetRange(LOCATION_SZONE)
e6:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e6:SetTarget(c86379001.tg1)
e6:SetLabelObject(e2_4)
c:RegisterEffect(e6)
--
local e2_5=Effect.CreateEffect(c)
e2_5:SetType(EFFECT_TYPE_SINGLE)
e2_5:SetCode(EFFECT_IMMUNE_EFFECT)
e2_5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2_5:SetRange(LOCATION_MZONE)
e2_5:SetValue(c86379001.efilter)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e7:SetRange(LOCATION_SZONE)
e7:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e7:SetTarget(c86379001.tg1)
e7:SetLabelObject(e2_5)
c:RegisterEffect(e7)
end
--
function c86379001.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(21,0,aux.Stringid(86379001,0))
end
--
function c86379001.GetMultiLinkedZone(tp)
local f=function(c)
return c:IsFaceup() and c:IsType(TYPE_LINK)
end
local lg=Duel.GetMatchingGroup(f,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local multi_linked_zone=0
local single_linked_zone=0
for tc in aux.Next(lg) do
local zone=tc:GetLinkedZone(tp)&0x7f
multi_linked_zone=single_linked_zone&zone|multi_linked_zone
single_linked_zone=single_linked_zone~zone
end
return multi_linked_zone
end
function c86379001.tg1(e,c)
local zone=c86379001.GetMultiLinkedZone(c:GetControler())
local seq=c:GetSequence()
local zone2=bit.lshift(0x1,seq)
return bit.band(zone,zone2)~=0
end
--
function c86379001.efilter(e,re)
return re:GetHandler()~=e:GetHandler() and not re:GetHandler():IsCode(86379001)
end
--
function c86379001.cfilter(c)
return c:IsFaceup() and c:GetMutualLinkedGroupCount()>0
end
function c86379001.desrepcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(c86379001.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end
--隙间妖怪的式神的式神✿橙
function c86379652.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x208),2)
c:EnableReviveLimit()
--remove
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86379652,0))
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_MOVE)
e1:SetCondition(c86379652.con)
e1:SetTarget(c86379652.tg)
e1:SetOperation(c86379652.op)
c:RegisterEffect(e1)
--battle remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(86379652,1))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_BATTLE_START)
e3:SetCondition(c86379652.descon)
e3:SetTarget(c86379652.destg)
e3:SetOperation(c86379652.desop)
c:RegisterEffect(e3)
end
--
function c86379652.matfilter(c)
return not c:IsLinkType(TYPE_TOKEN)
end
--
function c86379652.xfilter(c)
return c:IsAbleToRemove() and not c:IsCode(86379652)
end
function c86379652.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return c86379652.xfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c86379652.xfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local tg=Duel.SelectTarget(tp,c86379652.xfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tg,1,0,0)
end
function c86379652.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local fid=c:GetFieldID()
local ct=Duel.GetTurnCount()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 and not tc:IsType(TYPE_TOKEN) then
tc:RegisterFlagEffect(86379652,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2,fid)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(fid,ct)
e1:SetLabelObject(tc)
e1:SetCondition(c86379652.con1_1)
e1:SetOperation(c86379652.op1_1)
e1:SetReset(RESET_PHASE+PHASE_STANDBY,2)
Duel.RegisterEffect(e1,tp)
end
end
end
function c86379652.con1_1(e,tp,eg,ep,ev,re,r,rp)
local fid,ct=e:GetLabel()
return Duel.GetTurnCount()~=ct
end
function c86379652.op1_1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local fid,ct=e:GetLabel()
if tc:GetFlagEffect(86379652)>0 and tc:GetFlagEffectLabel(86379652)==fid then
Duel.ReturnToField(tc)
end
end
--
function c86379652.con(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsLocation(LOCATION_MZONE) and c:IsPreviousLocation(LOCATION_REMOVED) and not c:IsReason(REASON_SPSUMMON)
end
--
function c86379652.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
return bc and bc:IsAbleToRemove()
end
function c86379652.destg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemove() end
local g=Group.CreateGroup()
g:AddCard(c)
g:AddCard(c:GetBattleTarget())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,0,0)
end
function c86379652.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local rg=Group.CreateGroup()
local fid=c:GetFieldID()
if c:IsRelateToBattle() then
rg:AddCard(c)
end
if bc:IsRelateToBattle() then
rg:AddCard(bc)
end
if rg:GetCount()>0 then
if Duel.Remove(rg,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
rg:Remove(Card.IsType,nil,TYPE_TOKEN)
if rg:GetCount()>0 then
rg:KeepAlive()
for tc in aux.Next(rg) do
tc:RegisterFlagEffect(86379653,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(rg)
e1:SetOperation(c86379652.op1_2)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
end
end
function c86379652.refilter(c,fid)
return c:GetFlagEffect(86379653)>0
and c:GetFlagEffectLabel(86379653)==fid
end
function c86379652.op1_2(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
local sg=g:Filter(c86379652.refilter,nil,e:GetLabel())
if sg:GetCount()<1 then return end
for tc in aux.Next(sg) do
Duel.ReturnToField(tc)
end
end
......@@ -128,12 +128,12 @@ function c86379694.op1_2(e,tp,eg,ep,ev,re,r,rp)
end
--
function c86379694.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>9
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>12
end
function c86379694.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
while Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>9 and g:GetCount()>0 do
while Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,LOCATION_ONFIELD)>12 and g:GetCount()>0 do
local sg=g:GetMaxGroup(Card.GetFieldID)
local tc=sg:GetFirst()
g:RemoveCard(tc)
......
--市场之神✿天弓千亦
function c86379840.initial_effect(c)
c:EnableReviveLimit()
--spsummon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(aux.linklimit)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c86379840.sprcon)
e1:SetTarget(c86379840.sprtg)
e1:SetOperation(c86379840.sprop)
e1:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e1)
end
--
function c86379840.sprfilter(c,lc)
return c:IsFaceup() and c:IsCanBeLinkMaterial(lc)
end
function c86379840.cfilter(c,type)
return c:IsFaceup() and c:IsType(type)
end
function c86379840.fselect(g,tp,lc)
local ct=0
for i,type in ipairs({TYPE_FUSION,TYPE_RITUAL,TYPE_SYNCHRO,TYPE_XYZ,TYPE_PENDULUM,TYPE_LINK}) do
if g:IsExists(c86379840.cfilter,1,nil,type) then
ct=ct+1
end
end
return Duel.GetLocationCountFromEx(tp,tp,g,lc)>0 and ct==#g
end
function c86379840.sprcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local rg=Duel.GetMatchingGroup(c86379840.sprfilter,tp,LOCATION_MZONE,0,nil,c)
return rg:CheckSubGroup(c86379840.fselect,1,6,tp,c)
end
function c86379840.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetMatchingGroup(c86379840.sprfilter,tp,LOCATION_MZONE,0,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local sg=rg:SelectSubGroup(tp,c86379840.fselect,true,1,6,tp,c)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c86379840.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local sg=e:GetLabelObject()
local ct=sg:GetCount()
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_MATERIAL+REASON_LINK)
if ct==1 then
local mcode=c:GetOriginalCode()
local tcode=86379841
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END)
sg:GetFirst():RegisterEffect(e1,true)
end
if ct==2 then
local mcode=c:GetOriginalCode()
local tcode=86379842
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end
if ct==3 then
local mcode=c:GetOriginalCode()
local tcode=86379843
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end
if ct==4 then
local mcode=c:GetOriginalCode()
local tcode=86379844
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end
if ct==5 then
local mcode=c:GetOriginalCode()
local tcode=86379845
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
end
if ct==6 then
local mcode=c:GetOriginalCode()
local tcode=86379846
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.SetMetatable(c,_G["c"..tcode])
Duel.SwapDeckAndGrave(tp)
Duel.SwapDeckAndGrave(1-tp)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e2:SetReset(RESET_EVENT+0x1fe0000)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not mcode then return end
c:SetEntityCode(mcode)
c:ReplaceEffect(mcode,0,0)
Duel.SetMetatable(c,_G["c"..mcode])
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetRange(0)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCode(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
c:RegisterEffect(e3)
end
--嫉妒『妒意引爆』
function c86379879.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_END_PHASE,0)
e1:SetCondition(c86379879.con)
e1:SetTarget(c86379879.tg)
e1:SetOperation(c86379879.op)
c:RegisterEffect(e1)
--
if not c86379879.global_check then
c86379879.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(c86379879.checkop1)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_LEAVE_FIELD_P)
ge2:SetOperation(c86379879.checkop2)
Duel.RegisterEffect(ge2,0)
local ge3=Effect.CreateEffect(c)
ge3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge3:SetCode(EVENT_CHAIN_NEGATED)
ge3:SetOperation(c86379879.checkop3)
Duel.RegisterEffect(ge3,0)
local ge4=ge3:Clone()
ge4:SetCode(EVENT_CHAIN_DISABLED)
Duel.RegisterEffect(ge4,0)
local ge5=Effect.CreateEffect(c)
ge5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge5:SetCode(EVENT_DAMAGE)
ge5:SetOperation(c86379879.checkop5)
Duel.RegisterEffect(ge5,0)
end
end
--
function c86379879.checkop1(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(1-rp,86379879,RESET_PHASE+PHASE_END,0,1)
end
function c86379879.filter2(c,tp)
return c:GetControler()==tp and c:GetReasonPlayer()==1-tp
end
function c86379879.checkop2(e,tp,eg,ep,ev,re,r,rp)
local sg1=eg:Filter(c86379879.filter2,nil,tp)
local sg2=eg:Filter(c86379879.filter2,nil,1-tp)
if sg1:GetCount()>0 then
local ct1=sg1:GetCount()
for i=1,ct1 do
Duel.RegisterFlagEffect(tp,86379879,RESET_PHASE+PHASE_END,0,1)
end
end
if sg2:GetCount()>0 then
local ct2=sg2:GetCount()
for i=1,ct2 do
Duel.RegisterFlagEffect(1-tp,86379879,RESET_PHASE+PHASE_END,0,1)
end
end
end
function c86379879.checkop3(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local ce=rc:GetReasonEffect()
if ce and (ce:GetHandler():GetControler()~=ep or ce:GetOwnerPlayer()~=ep) then
Duel.RegisterFlagEffect(ep,86379879,RESET_PHASE+PHASE_END,0,1)
end
end
function c86379879.checkop5(e,tp,eg,ep,ev,re,r,rp)
if ep==tp and tp~=rp then
local ct1=math.ceil(ev/1000)
for i=1,ct1 do
Duel.RegisterFlagEffect(tp,86379879,RESET_PHASE+PHASE_END,0,1)
end
end
if ep~=tp and tp==rp then
local ct2=math.ceil(ev/1000)
for i=1,ct2 do
Duel.RegisterFlagEffect(1-tp,86379879,RESET_PHASE+PHASE_END,0,1)
end
end
end
--
function c86379879.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_END and Duel.GetTurnPlayer()==tp
end
function c86379879.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,86379879)>0 end
end
function c86379879.op(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFlagEffect(tp,86379879)
for i=1,ct do
Duel.RegisterFlagEffect(1-tp,86379871,RESET_PHASE+PHASE_END,0,2)
end
end
--紧急瞬间偷袭
function c99677710.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(99677710,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,99677710+EFFECT_COUNT_CODE_DUEL)
e1:SetTarget(c99677710.target)
e1:SetOperation(c99677710.operation)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(99677710,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_DESTROYED)
e2:SetCondition(c99677710.thcon)
e2:SetTarget(c99677710.thtg)
e2:SetOperation(c99677710.thop)
c:RegisterEffect(e2)
end
function c99677710.filter(c,e,tp)
return c:IsFaceup() and c:IsAbleToDeck()
and Duel.IsExistingMatchingCard(c99677710.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,c:GetCode())
end
function c99677710.spfilter(c,e,tp,code)
return c:IsSetCard(0x70e) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c99677710.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c99677710.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c99677710.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c99677710.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c99677710.operation(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local tc=Duel.GetFirstTarget()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c99677710.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT)
end
end
end
function c99677710.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
function c99677710.thfilter(c)
return c:IsSetCard(0x70e) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand() and c:IsFaceup()
end
function c99677710.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c99677710.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function c99677710.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c99677710.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--光符「天照」
local M = c999212
local Mid = 999212
function M.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(M.activate)
c:RegisterEffect(e1)
end
function M.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
--atkup
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_ONFIELD)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(M.uptg)
e1:SetValue(300)
c:RegisterEffect(e1)
--defup
local e0=e1:Clone()
e0:SetCode(EFFECT_UPDATE_DEFENSE)
e0:SetValue(300)
c:RegisterEffect(e0)
--sp1
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(Mid,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_ONFIELD)
e2:SetCountLimit(1,Mid)
e2:SetCondition(M.spcon1)
e2:SetTarget(M.sptarget1)
e2:SetOperation(M.spop1)
c:RegisterEffect(e2)
--sp2
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetDescription(aux.Stringid(Mid,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_SZONE)
e3:SetCondition(M.encon)
e3:SetTarget(M.entarget)
e3:SetOperation(M.enop)
c:RegisterEffect(e3)
end
function M.chkfilter(c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function M.uptg(e,c)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
--
function M.spcon1(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(M.chkfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil) > 2
end
function M.spfilter1(c,e,tp,lv)
local temp = c:GetLevel()
if temp == 0 then temp = c:GetRank() end
if temp == 0 then return false end
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsSetCard(0x208) and temp<=lv
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp, tp, nil, c)>0
end
function M.sptarget1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local lv = Duel.GetMatchingGroupCount(M.chkfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil)
return Duel.IsExistingMatchingCard(M.spfilter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function M.spop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local lv = Duel.GetMatchingGroupCount(M.chkfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil)
local g=Duel.SelectMatchingCard(tp,M.spfilter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,lv)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
--
function M.encon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(M.chkfilter,tp,LOCATION_MZONE+LOCATION_EXTRA,0,nil)>4 and not e:GetHandler():IsStatus(STATUS_CHAINING)
end
function M.entarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and
Duel.IsPlayerCanSpecialSummonMonster(tp,Mid,0,0x21,2000,0,4,RACE_BEAST,ATTRIBUTE_LIGHT) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,2000,0)
end
function M.enop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0
or not Duel.IsPlayerCanSpecialSummonMonster(tp,Mid,0,0x21,2000,0,4,RACE_BEAST,ATTRIBUTE_LIGHT) then return end
c:AddMonsterAttribute(TYPE_EFFECT+TYPE_TRAP)
Duel.SpecialSummon(c,0,tp,tp,true,false,POS_FACEUP)
end
\ No newline at end of file
Duel.LoadScript("nef/nef.lua")
Duel.LoadScript("nef/msc.lua")
Duel.LoadScript("nef/fus.lua")
Duel.LoadScript("nef/ets.lua")
Duel.LoadScript("nef/elf.lua")
Duel.LoadScript("nef/dss.lua")
Duel.LoadScript("nef/afi.lua")
-- require "expansions/script/nef/nef"
-- require "expansions/script/nef/msc"
-- require "expansions/script/nef/fus"
-- require "expansions/script/nef/ets"
-- require "expansions/script/nef/elf"
-- require "expansions/script/nef/dss"
-- require "expansions/script/nef/afi"
-- require "nef/nef"
-- require "nef/msc"
-- require "nef/fus"
-- require "nef/ets"
-- require "nef/elf"
-- require "nef/dss"
-- require "nef/afi"
\ 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