Commit 58a6bde6 authored by Nemo Ma's avatar Nemo Ma

maint

parent cc5efc1c
...@@ -748,6 +748,10 @@ ...@@ -748,6 +748,10 @@
30002065 0 30002065 0
30010000 0 30010000 0
30012000 0 30012000 0
#220321
22020310 0
89389005 0
15000129 1
#220313 #220313
22060110 0 22060110 0
79029169 0 79029169 0
...@@ -882,7 +886,7 @@ ...@@ -882,7 +886,7 @@
33700785 0 33700785 0
33700786 0 33700786 0
33700787 0 33700787 0
33701009 1 --亚玛丽欧只能有一位 33701009 0 --亚玛丽欧只能有一位
#33720036 1 --亚玛丽欧只能有一位 #33720036 1 --亚玛丽欧只能有一位
#33720037 1 --Ai 只有一个 时空特使的司令的能力很珍贵 #33720037 1 --Ai 只有一个 时空特使的司令的能力很珍贵
#33720038 1 --Hoover 只有一个 标记能力者很费体力 #33720038 1 --Hoover 只有一个 标记能力者很费体力
......
No preview for this file type
--界限龙 努特
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103001
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,nil,rstg.target(rsop.list(cm.xyzfilter,"sp",LOCATION_EXTRA)),cm.xyzop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"sp","de",nil,nil,rstg.target(rsop.list(cm.spfilter,"sp",LOCATION_HAND+LOCATION_GRAVE)),rsop.operation(aux.NecroValleyFilter(cm.spfilter),"sp",LOCATION_HAND+LOCATION_GRAVE))
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.matfilter(c)
return c:IsRace(RACE_DRAGON) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
end
function cm.xyzfilter(xyzc,e,tp)
if not xyzc:IsType(TYPE_XYZ) then return false end
local matc=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
return mg:IsContains(matc) and mg:CheckSubGroup(cm.xyzfilter2,1,#mg,xyzc,matc)
end
function cm.xyzfilter2(g,xyzc,matc)
return g:IsContains(matc) and xyzc:IsXyzSummonable(g,#g,#g)
end
function cm.xyzop(e,tp)
local c=aux.ExceptThisCard(e)
if not c then return end
rsof.SelectHint(tp,"sp")
local xyzc=Duel.SelectMatchingCard(tp,cm.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if not xyzc then return end
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
Duel.SetSelectedCard(c)
rsof.SelectHint(tp,HINTMSG_XMATERIAL)
local mat=mg:SelectSubGroup(tp,cm.xyzfilter2,false,1,#mg,xyzc,c)
Duel.XyzSummon(tp,xyzc,mat)
if mat:IsExists(Card.IsPreviousLocation,1,nil,LOCATION_HAND) then
Duel.ShuffleHand(tp)
end
end
function cm.spfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsSetCard(0x337) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
\ No newline at end of file
--界限龙王 努特
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103002
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,4,2,nil,nil,99)
c:EnableReviveLimit()
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_MZONE,nil,rscost.rmxyz(1),rstg.target(rsop.list(cm.spfilter,"sp",LOCATION_GRAVE+LOCATION_HAND)),cm.spop)
local e2=rsef.I(c,{m,1},{1,m+100},"sp",nil,LOCATION_MZONE,cm.spcon2,cm.spcost2,rstg.target(rsop.list(cm.spfilter2,"sp",LOCATION_DECK)),cm.spop2)
end
function cm.spfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function cm.spop(e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #sg>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function cm.spcon2(e,tp)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsSetCard,1,nil,0x337)
end
function cm.spcost2(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetAttackAnnouncedCount()==0
and c:CheckRemoveOverlayCard(tp,2,REASON_COST) end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_OATH)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
c:RemoveOverlayCard(tp,2,2,REASON_COST)
end
function cm.spfilter2(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsSetCard(0x337) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spop2(e,tp)
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,nil,rssf.SummonBuff({0,0}))
end
end
\ No newline at end of file
--界限龙 乌鲁姆
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103003
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp,fus",nil,LOCATION_HAND+LOCATION_MZONE,nil,nil,cm.fustg,cm.fusop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"se,th","de",nil,nil,rstg.target(rsop.list(cm.thfilter,"th",LOCATION_DECK)),rsop.operation(cm.thfilter,"th",LOCATION_DECK))
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.thfilter(c)
return c:IsSetCard(0x337) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.filter1(c,e)
return not c:IsImmuneToEffect(e) and c:IsRace(RACE_DRAGON)
end
function cm.filter2(c,e,tp,m,f,gc,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,gc,chkf)
end
function cm.fustg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if not c:IsRace(RACE_DRAGON) then return false end
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsRace,nil,RACE_DRAGON)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.fusop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) or not c:IsRace(RACE_DRAGON) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
\ No newline at end of file
--界限龙王 乌鲁姆
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103004
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.FilterBoolFunction(Card.IsAttackAbove,2000),false)
local e1=rsef.QO(c,nil,{m,0},{1,m},"se,th",nil,LOCATION_MZONE,nil,rscost.cost(cm.resfilter,"res"),rstg.target2(cm.fun,rsop.list(cm.thfilter,"th",LOCATION_DECK)),cm.thop)
local e2=rsef.FTO(c,EVENT_TO_GRAVE,{m,1},{1,m+100},"sp","tg,dsp,de",LOCATION_GRAVE,nil,rscost.cost(Card.IsAbleToExtraAsCost,"te"),cm.sptg,cm.spop)
local e3=rsef.RegisterClone(c,e2,"code",EVENT_REMOVE)
end
function cm.spfilter2(c,e,tp)
return c:GetPreviousRaceOnField()&RACE_DRAGON ~=0 and c:IsRace(RACE_DRAGON) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup() and c:IsReason(REASON_BATTLE)))
end
function cm.spop(e,tp)
local tc=rscf.GetTargetCard()
if tc then
rssf.SpecialSummon(tc)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return eg:IsExists(cm.spfilter2,1,c,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
rsof.SelectHint(tp,"sp")
local sg=eg:FilterSelect(tp,cm.spfilter2,1,1,c,e,tp)
Duel.SetTargetCard(sg)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg,#sg,0,0)
end
function cm.resfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsReleasable()
end
function cm.fun(g,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.thfilter(c)
return c:IsSetCard(0x337) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.actfilter(c,tp)
return c:IsCode(10103016) and c:GetActivateEffect():IsActivatable(tp,true,true)
end
function cm.thop(e,tp,eg)
rsof.SelectHint(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 and Duel.SendtoHand(tg,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,tg)
local ag=Duel.GetMatchingGroup(cm.actfilter,tp,LOCATION_DECK,0,nil,tp)
if #ag>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
rsof.SelectHint(tp,HINTMSG_SELF)
local tc=ag:Select(tp,1,1,nil):GetFirst()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
te:UseCountLimit(tp,1,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
\ No newline at end of file
--界限龙 蒂雅玛特
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103005
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,nil,cm.syntg,cm.synop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"sp","de",nil,rscost.reglabel(100),cm.sptg,cm.spop)
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.rmfilter(c)
return c:IsSetCard(0x337) and c:IsAbleToRemoveAsCost()
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x1337) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.rmfilter2(g,tp)
return Duel.GetLocationCountFromEx(tp,tp,g)>0 and g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) and g:IsExists(Card.IsOnField,1,nil)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local b1=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
local b2=g:CheckSubGroup(cm.rmfilter2,2,2,tp)
if chk==0 then
if e:GetLabel()==100 then return b1 and b2
else return b1 and Duel.GetLocationCountFromEx(tp)>0
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
rsof.SelectHint(tp,"rm")
local rg=g:SelectSubGroup(tp,cm.rmfilter2,false,2,2,tp)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp)
if Duel.GetLocationCountFromEx(tp)<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,nil,rssf.SummonBuff({0,0}))
end
end
function cm.matfilter(c)
return c:IsRace(RACE_DRAGON) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
end
function cm.synfilter(sync,e,tp)
local matc=e:GetHandler()
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
return mg:IsContains(matc) and sync:IsSynchroSummonable(matc,mg)
end
function cm.reg(sg,e,tp)
local c=e:GetHandler()
local list={}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_HAND_SYNCHRO)
e1:SetTargetRange(0,99)
c:RegisterEffect(e1)
table.insert(list,e1)
for sync in aux.Next(sg) do
local bool,f1,f2,f3,f4,minct,maxct,gc=rscf.GetSynchroProduce(sync)
if bool then
local e2=rscf.AddSynchroMixProcedure(sync,f1,f2,f3,f4,minct,maxct)
table.insert(list,e2)
end
end
return list
end
function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local sg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_EXTRA,0,nil,TYPE_SYNCHRO)
local list=cm.reg(sg,e,tp)
local res=sg:IsExists(cm.synfilter,1,nil,e,tp)
for _,es in pairs(list) do
es:Reset()
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.synop(e,tp)
local c=aux.ExceptThisCard(e)
if not c then return end
local sg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_EXTRA,0,nil,TYPE_SYNCHRO)
local list={}
if c:IsLocation(LOCATION_HAND) then
list=cm.reg(sg,e,tp)
end
rsof.SelectHint(tp,"sp")
local sync=sg:Select(tp,1,1,nil):GetFirst()
if sync then
local mg=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,nil)
Duel.SynchroSummon(tp,sync,c,mg)
if sync:GetMaterial():IsExists(Card.IsPreviousLocation,1,nil,LOCATION_HAND) then
Duel.ShuffleHand(tp)
end
for _,es in pairs(list) do
es:Reset()
end
end
end
\ No newline at end of file
--界限龙王 蒂雅玛特
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103006
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(nil),1)
c:EnableReviveLimit()
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},{1,m},"rm,dr","tg,de",nil,nil,rstg.target2(cm.fun,Card.IsAbleToRemove,"rm",LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE),cm.rmop)
local e2=rsef.FTO(c,EVENT_PHASE+PHASE_STANDBY,{m,1},{1,m+100},"sp,rm,ga",nil,LOCATION_MZONE,nil,nil,nil,cm.effop)
end
function cm.effop(e,tp)
local e1=rsef.FC({e:GetHandler(),tp},EVENT_PHASE+PHASE_STANDBY,{m,3},1)
rsef.RegisterSolve(e1,cm.effcon,nil,nil,cm.effop2)
e1:SetLabel(Duel.GetTurnCount())
end
function cm.effcon(e,tp)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if Duel.GetTurnCount()==e:GetLabel() then return false end
if (b1 or b2) then return true
else
e:Reset()
return false
end
end
function cm.spfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.effop2(e,tp)
Duel.Hint(HINT_CARD,0,m)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil)
local b2=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local op=rsof.SelectOption(tp,b1,{m,4},b2,{m,5})
if op==1 then
rsof.SelectHint(tp,"rm")
local rg=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.HintSelection(rg)
Duel.Remove(rg,POS_FACEUP,REASON_EFFECT)
elseif op==2 then
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.HintSelection(sg)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
e:Reset()
end
function cm.fun(g,e,tp)
if g:GetFirst():IsFaceup() and g:GetFirst():IsSetCard(0x337) then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function cm.rmop(e,tp)
local tc=rscf.GetTargetCard()
if tc and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)>0 and tc:IsLocation(LOCATION_REMOVED) and tc:IsSetCard(0x337) and Duel.IsPlayerCanDraw(tp,1) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
\ No newline at end of file
--界限龙 布内
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103007
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,nil,cm.rittg,cm.ritop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"des","de,tg",nil,nil,rstg.target(aux.TRUE,"des",LOCATION_ONFIELD,LOCATION_ONFIELD),cm.desop)
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.desop(e,tp)
local tc=rscf.GetTargetCard()
if tc then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function cm.ritfilter(c,e,tp,m1)
if not c:IsSetCard(0x1337) or c:GetType()&0x81~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m1:Filter(Card.IsCanBeRitualMaterial,c,c)
aux.GCheckAdditional=aux.RitualCheckAdditional(c,c:GetLevel(),"Equal")
local res=mg:CheckSubGroup(cm.mfilter,1,c:GetLevel(),c,e:GetHandler())
aux.GCheckAdditional=nil
return res
end
function cm.mfilter(g,ritc,matc)
return g:IsContains(matc) and Duel.GetMZoneCount(tp,g,tp)>0 and aux.RitualCheckGreater(g,ritc,ritc:GetLevel())
end
function cm.rittg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp):Filter(Card.IsRace,nil,RACE_DRAGON)
return Duel.IsExistingMatchingCard(cm.ritfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,e,tp,mg1)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.ritop(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e)
if not c then return end
local mg1=Duel.GetRitualMaterial(tp):Filter(Card.IsRace,nil,RACE_DRAGON)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.ritfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,e,tp,mg1):GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Equal")
Duel.SetSelectedCard(c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat=mg:SelectSubGroup(tp,cm.mfilter,false,1,99,tc,c)
aux.GCheckAdditional=nil
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
\ No newline at end of file
--界限龙王 布内
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103008
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1=rsef.QO(c,nil,{m,0},{1,m},"des","tg",LOCATION_MZONE,nil,rscost.reglabel(100),cm.destg,cm.desop,{0,TIMINGS_CHECK_MONSTER })
local e1=rsef.I(c,{m,1},{1,m+100},"dr,sp","ptg",LOCATION_MZONE+LOCATION_HAND,cm.drcon,rscost.cost(Card.IsReleasable,"res"),cm.drtg,cm.drop)
end
function cm.drcon(e,tp)
return Duel.IsExistingMatchingCard(rscf.FilterFaceUp(Card.IsSetCard,0x337),tp,LOCATION_MZONE,0,1,e:GetHandler())
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_HAND)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)~=0 then
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
Duel.BreakEffect()
if tc:IsType(TYPE_MONSTER) and tc:IsRace(RACE_DRAGON) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
rssf.SpecialSummon(tc)
end
end
Duel.ShuffleHand(tp)
end
end
function cm.cfilter(c,tp)
local eg=c:GetEquipGroup()
eg:AddCard(c)
return c:IsRace(RACE_DRAGON) and Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,eg)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()==100 then
return Duel.CheckReleaseGroupEx(tp,cm.cfilter,1,nil,tp)
else
return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
local g=Duel.SelectReleaseGroupEx(tp,cm.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
rsof.SelectHint(tp,"des")
local dg=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0)
end
function cm.desop(e,tp)
local dg=rsgf.GetTargetGroup()
if #dg>0 then
Duel.Destroy(dg,REASON_EFFECT)
end
end
\ No newline at end of file
--界限龙王 卡奥斯
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103009
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1=rscf.SetSpecialSummonProduce(c,LOCATION_HAND+LOCATION_GRAVE,cm.spcon,cm.spop)
local e2=rsef.SV_UPDATE(c,"atk",1000,cm.atkcon)
local e3=rsef.SV_IMMUNE_EFFECT(c,cm.val,cm.atkcon)
local e4=rsef.QO(c,EVENT_CHAINING,{m,0},{1,m},nil,nil,LOCATION_MZONE,cm.cecon,nil,cm.cetg,cm.ceop)
end
function cm.cecon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
function cm.cetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,nil,1,nil) and Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,0,LOCATION_HAND,1,nil,REASON_EFFECT) end
end
function cm.ceop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetType()==TYPE_SPELL or c:GetType()==TYPE_TRAP then
c:CancelToGrave(false)
end
if Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_EFFECT,nil)~=0 then
local rg=Duel.SelectReleaseGroup(1-tp,nil,1,1,nil)
if #rg>0 then
Duel.Release(rg,REASON_EFFECT)
end
end
end
function cm.atkcon(e)
return e:GetHandler():GetFlagEffect(m)>0
end
function cm.val(e,re)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler()~=e:GetHandler()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,0x337)
return g:CheckSubGroup(cm.rfilter,2,2,tp)
end
function cm.rfilter(g,tp)
return Duel.GetMZoneCount(tp,g,tp)>0
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,0x337)
rsof.SelectHint(tp,"res")
local rg=g:SelectSubGroup(tp,cm.rfilter,false,2,2,tp)
if rg:IsExists(Card.IsSetCard,2,nil,0x1337) then
c:RegisterFlagEffect(m,rsreset.est-RESET_TOFIELD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
Duel.Release(rg,REASON_EFFECT)
end
--界限龙神 卡奥斯
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103010
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,true)
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND+LOCATION_GRAVE,cm.spcon,cm.spop)
local e3=rsef.SV_IMMUNE_EFFECT(c,nil,cm.imcon)
local e4=rsef.STF(c,EVENT_SPSUMMON_SUCCESS,{m,0},nil,"tg",nil,nil,nil,cm.tdtg,cm.tdop)
end
function cm.tdfilter(c)
return Duel.IsPlayerCanSendtoGrave(c:GetControler(),c)
end
function cm.tdtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
if chk==0 then return #g>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,#g,PLAYER_ALL,LOCATION_ONFIELD)
end
function cm.tdop(e,tp)
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if #g>0 then
Duel.SendtoGrave(g,REASON_RULE)
end
end
function cm.imcon(e)
return e:GetHandler():GetTurnID()==Duel.GetTurnCount() and e:GetHandler():IsSummonType(SUMMON_TYPE_SPECIAL)
end
function cm.spcheck(g,tp)
return Duel.GetMZoneCount(tp,g,tp)>0
end
function cm.spcon(e,c)
if c==nil then return true end
local g=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,0x1337)
return g:CheckSubGroup(cm.spcheck,4,4,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(tp):Filter(Card.IsSetCard,nil,0x1337)
rsof.SelectHint(tp,"res")
local rg=g:SelectSubGroup(tp,cm.rfilter,false,2,2,tp)
Duel.Release(rg,REASON_EFFECT)
end
\ No newline at end of file
--界限龙 阿勒克托
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103011
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND,rscon.excard(rscf.FilterFaceUp(Card.IsSetCard,0x1337),LOCATION_MZONE),nil,rstg.target(rsop.list(cm.spfilter,"sp")),cm.spop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},nil,"de,tg",nil,nil,cm.copytg,cm.copyop)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if c then
rssf.SpecialSummon(c)
end
end
function cm.copyfilter(c,e,tp,eg,ep,ev,re,r,rp)
if not c.rs_ghostdom_dragon_effect or not c:IsOriginalSetCard(0x337) or c:GetOriginalLevel()~=4 or c:IsCode(m) or c:IsFacedown() then return false end
local e1=c.rs_ghostdom_dragon_effect[1]
local e2=c.rs_ghostdom_dragon_effect[2]
local target1=e1:GetTarget()
local target2=e2:GetTarget()
if not target1 or target1(e,tp,eg,ep,ev,re,r,rp,0) then return true end
if not target2 or target2(e,tp,eg,ep,ev,re,r,rp,0) then return true end
return false
end
function cm.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
return cm.copyfilter(chkc,e,tp,eg,ep,ev,re,r,rp)
end
if chk==0 then return Duel.IsExistingTarget(cm.copyfilter,tp,LOCATION_MZONE,0,1,nil,e,tp,eg,ep,ev,re,r,rp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tc=Duel.SelectTarget(tp,cm.copyfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp):GetFirst()
local e1=tc.rs_ghostdom_dragon_effect[1]
local e2=tc.rs_ghostdom_dragon_effect[2]
local target1=e1:GetTarget()
local target2=e2:GetTarget()
local b1=not target1 or target1(e,tp,eg,ep,ev,re,r,rp,0)
local b2=not target2 or target2(e,tp,eg,ep,ev,re,r,rp,0)
local op=rsof.SelectOption(tp,b1,e1:GetDescription(),b2,e2:GetDescription())
local te=e2
if op==1 then te=e1 end
Duel.ClearTargetCard()
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty()|EFFECT_FLAG_CARD_TARGET)
local tg=te:GetTarget()
if tg then
tg(e,tp,eg,ep,ev,re,r,rp,1)
end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
end
function cm.copyop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
--界限龙 提姆福涅
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103012
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e1=rsef.I(c,{m,0},{1,m},nil,nil,LOCATION_PZONE,nil,rscost.cost(cm.resfilter,"res",LOCATION_HAND+LOCATION_MZONE),rstg.target(rsop.list(cm.pfilter,nil,LOCATION_GRAVE+LOCATION_DECK)),cm.pop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"td,dr","de,tg",nil,nil,rstg.target2(cm.fun,cm.tdfilter,"td",LOCATION_GRAVE,0,3),cm.tdop)
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.fun(g,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.tdfilter(c,e,tp)
return c:IsRace(RACE_DRAGON) and c:IsAbleToDeck() and Duel.IsPlayerCanDraw(tp,1)
end
function cm.tdop(e,tp)
local g=rsgf.GetTargetGroup()
if #g<=0 or Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<=0 then return end
local og=Duel.GetOperatedGroup()
if og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK) then
Duel.ShuffleDeck(tp)
end
Duel.Draw(tp,1,REASON_EFFECT)
end
function cm.resfilter(c)
return c:IsReleasable() and c:IsRace(RACE_DRAGON)
end
function cm.pfilter(c,e,tp)
return c:IsSetCard(0x337) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and c:CheckUniqueOnField(tp) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
end
function cm.pop(e,tp)
local c=aux.ExceptThisCard(e)
if not c then return end
rsof.SelectHint(tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.pfilter),tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--冥魂龙 墨该拉
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103013
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND+LOCATION_MZONE,nil,nil,cm.linktg,cm.linkop)
local e2=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"th","de,tg",nil,nil,rstg.target(cm.thfilter,"th",LOCATION_GRAVE+LOCATION_REMOVED),cm.thop)
cm.rs_ghostdom_dragon_effect={e1,e2}
end
function cm.thfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x337) and c:IsAbleToHand()
end
function cm.thop(e,tp)
local tc=rscf.GetTargetCard()
if tc then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.matfilter(c)
return not c:IsRace(RACE_DRAGON)
end
function cm.lkfilter(c)
return c:IsType(TYPE_LINK) and c:IsSpecialSummonable(SUMMON_TYPE_LINK)
end
function cm.reg(mg,e,tp)
local c=e:GetHandler()
local list={}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_EXTRA_LINK_MATERIAL)
e1:SetTargetRange(LOCATION_HAND,0)
e1:SetValue(aux.TRUE)
Duel.RegisterEffect(e1,tp)
table.insert(list,e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCode(EFFECT_MUST_BE_LMATERIAL)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e2:SetTargetRange(1,0)
c:RegisterEffect(e2)
table.insert(list,e2)
for tc in aux.Next(mg) do
if not tc:IsRace(RACE_DRAGON) or (tc:IsOnField() and tc:IsFacedown()) then
local e3=rsef.SV_CANNOT_BE_MATERIAL({c,tc},"link")
table.insert(list,e2)
end
end
return list
end
function cm.linktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER)
local list=cm.reg(mg,e,tp)
local res=Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil)
for _,effect in pairs(list) do
effect:Reset()
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.linkop(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e)
if not c then return end
local mg=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_MZONE+LOCATION_HAND,0,nil,TYPE_MONSTER)
local list=cm.reg(mg,e,tp)
rsof.SelectHint(tp,"sp")
local tc=Duel.SelectMatchingCard(tp,cm.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
if tc then
Duel.SpecialSummonRule(tp,tc,SUMMON_TYPE_LINK)
end
for _,effect in ipairs(list) do
effect:Reset()
end
end
--冥魂龙王 墨该拉
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103014
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.lfilter,2,2,cm.gf)
c:EnableReviveLimit()
local e1=rsef.I(c,{m,0},{1,m},"sp","tg",LOCATION_MZONE,nil,nil,rstg.target2(cm.fun,cm.mvfilter,nil,LOCATION_MZONE),cm.mvop)
local e2=rsef.FTO(c,EVENT_SPSUMMON_SUCCESS,{m,1},{1,m+100},"se,th","de",LOCATION_MZONE,nil,nil,cm.thtg,cm.thop)
end
function cm.cfilter(c,g)
return c:IsFaceup() and g:IsContains(c) and c:IsSetCard(0x337)
end
function cm.thfilter(c,g)
return c:IsAbleToHand() and g:IsExists(Card.IsCode,1,nil,c:GetCode())
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local lg=e:GetHandler():GetLinkedGroup()
local g=eg:Filter(cm.cfilter,nil,lg)
if chk==0 then return #g>0 and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,g) end
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
rsof.SelectHint(tp,"th")
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,g)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.lfilter(c)
return c:IsLinkRace(RACE_DRAGON) and c:IsAttackAbove(2000)
end
function cm.gf(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x337)
end
function cm.mvfilter(c,e,tp)
local seq=c:GetSequence()
return seq<=4 and ((Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) and seq>1) or (Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) and seq<4))
end
function cm.fun(g,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_HAND)
end
function cm.mvop(e,tp)
local c=aux.ExceptThisCard(e)
local tc=rscf.GetTargetCard()
if not c or not c:IsControler(tp) or not tc or tc:GetSequence()>4 or not tc:IsControler(tp) then return false end
local flag=0
local seq=tc:GetSequence()
if Duel.CheckLocation(tp,LOCATION_MZONE,seq-1) and seq>0 then
flag=bit.replace(flag,0x1,seq-1)
end
if Duel.CheckLocation(tp,LOCATION_MZONE,seq+1) and seq<4 then
flag=bit.replace(flag,0x1,seq+1)
end
flag=bit.bxor(flag,0xff)
if flag<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,flag)
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
local linkzone=c:GetLinkedZone(tp)
local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_HAND,0,nil,e,tp,linkzone)
if linkzone>0 and #sg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
rsof.SelectHint(tp,"sp")
local sc=sg:Select(tp,1,1,nil):GetFirst()
Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEUP,linkzone)
end
end
function cm.spfilter(c,e,tp,zone)
return c:IsRace(RACE_DRAGON) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone)
end
\ No newline at end of file
--冥魂龙王 提姆福涅
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10103015
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_PZONE,nil,rscost.reglabel(100),cm.sptg,cm.spop)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},"td,atk","de",LOCATION_MZONE,rscon.phmp,nil,rstg.target(rsop.list(cm.tdfilter,"td",LOCATION_REMOVED,0,true)),cm.tdop)
end
function cm.tdfilter(c)
return c:IsRace(RACE_DRAGON) and c:IsAbleToDeck() and c:IsFaceup()
end
function cm.tdop(e,tp)
local tg=Duel.GetMatchingGroup(cm.tdfilter,tp,LOCATION_REMOVED,0,nil)
if #tg<=0 then return end
local ct=Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
local g=Duel.GetMatchingGroup(rscf.FilterFaceUp(Card.IsRace,RACE_DRAGON),tp,LOCATION_MZONE,0,nil)
if ct>0 and #g>0 then
for tc in aux.Next(g) do
local e1=rsef.SV_UPDATE({e:GetHandler(),tc},"atk",300*ct,nil,rsreset.est,"cd")
end
end
end
function cm.rmfilter(c)
return c:IsSetCard(0x337) and c:IsAbleToRemoveAsCost()
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.rmfilter2(g,tp)
return Duel.GetMZoneCount(tp,g,tp)>0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.rmfilter,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_HAND,0,nil)
local b1=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_PZONE,0,1,nil,e,tp)
local b2=g:CheckSubGroup(cm.rmfilter2,2,2,tp)
if chk==0 then
if e:GetLabel()==100 then return b1 and b2
else return b1 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
rsof.SelectHint(tp,"rm")
local rg=g:SelectSubGroup(tp,cm.rmfilter2,false,2,2,tp)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_PZONE,0,1,1,nil,e,tp)
if #sg>0 then
Duel.HintSelection(sg)
rssf.SpecialSummon(sg)
end
end
\ No newline at end of file
--混沌炼金术:二重蒸馏
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10115001
local cm=_G["c"..m]
if not rsv.AlchementBio then
rsv.AlchementBio={}
rsab=rsv.AlchementBio
function rsab.typecheck1(c)
return c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK)
end
function rsab.typecheck2(c)
return c:IsType(TYPE_RITUAL+TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function rsab.descon(e,tp)
return e:GetHandler():IsReason(REASON_BATTLE+REASON_EFFECT)
end
function rsab.MaterialGainEffectFun(c,code,cate,tg,op)
local e1=rsef.SC(c,EVENT_BE_MATERIAL,nil,nil,"cd",rsab.matcon,rsab.matop(code,cate,tg,op))
return e1
end
function rsab.matcon(e,tp,eg,ep,ev,re,r,rp)
return r&REASON_RITUAL+REASON_FUSION+REASON_SYNCHRO+REASON_XYZ+REASON_LINK ~=0
end
function rsab.matop(code,cate,tg,op)
return function(e,tp,eg)
local c=e:GetHandler()
local rc=c:GetReasonCard()
local og=rsgf.Mix2(rc,eg)
for tc in aux.Next(og) do
local e1=rsef.QO({tc,true},nil,{code,1},1,cate,nil,LOCATION_MZONE,nil,nil,tg,op)
e1:SetReset(rsreset.est)
if not tc:IsType(TYPE_EFFECT) then
local e2=rsef.SV_ADD({c,tc,true},"type",TYPE_EFFECT,nil,rsreset.est)
end
tc:RegisterFlagEffect(m,rsreset.est,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(code,1))
end
end
end
function rsab.ComplexSummonFun(c,code,summon1,summon2)
local isfus=summon1=="fus" or summon2=="fus"
local flag=not isfus and "sp" or "sp,fus"
local e1=rsef.ACT(c,nil,nil,{1,code},flag,nil,nil,nil,rsab.sptg(summon1,summon2),rsab.spop(summon1,summon2))
return e1
end
function rsab.synfilter(c)
return c:IsCanBeSynchroMaterial()
end
function rsab.xyzfilter(c)
return c:IsCanBeXyzMaterial(nil)
end
function rsab.linkfilter(c)
return c:IsCanBeLinkMaterial(nil)
end
function rsab.getmaterial(tp,mix1,mix2)
local ritg=Duel.GetRitualMaterial(tp):Filter(Card.IsOnField,nil)
local fusg=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local syng=Duel.GetMatchingGroup(rsab.synfilter,tp,LOCATION_MZONE,0,nil)
local xyzg=Duel.GetMatchingGroup(rsab.xyzfilter,tp,LOCATION_MZONE,0,nil)
local linkg=Duel.GetMatchingGroup(rsab.linkfilter,tp,LOCATION_MZONE,0,nil)
local list={ritg,fusg,syng,xyzg,linkg}
local list2={"rit","fus","syn","xyz","link"}
if not mix1 then
return ritg,fusg,syng,xyzg,linkg
else
local _,index=rsof.Table_List(list2,mix1)
local g1=list[index]
local _,index2=rsof.Table_List(list2,mix2)
local g2=list[index2]
local f=function(c,g)
return g:IsContains(c)
end
local mixg=g1:Filter(f,nil,g2)
return mixg
end
end
function rsab.sptg(summon1,summon2)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
local mixg=rsab.getmaterial(tp,summon1,summon2)
if chk==0 then return Duel.IsExistingMatchingCard(rsab.spfilter0,tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE,0,1,nil,e,tp,mixg,summon1,summon2) and Duel.IsPlayerCanSpecialSummonCount(tp,2) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_EXTRA+LOCATION_HAND)
end
end
function rsab.spfilter0(c,e,tp,mixg,summon1,summon2)
return rsab.checktype(c,e,tp,summon1) and Duel.IsExistingMatchingCard(rsab.spfilter2,tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE,0,1,c,e,tp,c,mixg,summon1,summon2)
end
function rsab.spfilter1(c,e,tp,mixg,summon1,summon2)
return rsab.checktype(c,e,tp,summon1) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(rsab.spfilter2),tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE,0,1,c,e,tp,c,mixg,summon1,summon2)
end
function rsab.spfilter2(c,e,tp,c1,mixg,summon1,summon2)
return rsab.checktype(c,e,tp,summon2) and mixg:CheckSubGroup(rsab.spcheck,1,#mixg,e,tp,c1,c,summon1,summon2)
end
function rsab.spcheck(g,e,tp,c1,c2,summon1,summon2)
local sumzone1=rsab.zonecheckfun(tp,g,c1,c2,summon1,summon2)
if sumzone1==0 then return false end
local list={rsab.ritcheck,rsab.fuscheck,rsab.syncheck,rsab.xyzcheck,rsab.linkcheck}
local list2={"rit","fus","syn","xyz","link"}
local _,index=rsof.Table_List(list2,summon1)
local fun=list[index]
local bool1=fun(g,e,tp,c1)
local _,index2=rsof.Table_List(list2,summon2)
local fun2=list[index2]
local bool2=fun2(g,e,tp,c2)
return bool1 and bool2
end
function rsab.checktype(c,e,tp,summon)
if summon=="rit" then return c:GetType()&0x81==0x81 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true)
elseif summon=="fus" then return c:IsType(TYPE_FUSION) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and not c:IsLocation(LOCATION_GRAVE)
elseif summon=="syn" then return c:IsType(TYPE_SYNCHRO) and not c:IsLocation(LOCATION_GRAVE)
elseif summon=="xyz" then return c:IsType(TYPE_XYZ) and not c:IsLocation(LOCATION_GRAVE)
elseif summon=="link" then return c:IsType(TYPE_LINK) and not c:IsLocation(LOCATION_GRAVE)
end
end
function rsab.ritcheck(g,e,tp,ritc)
aux.GCheckAdditional=aux.RitualCheckAdditional(ritc,ritc:GetLevel(),"Equal")
local bool=aux.RitualCheckEqual(g,ritc,ritc:GetLevel())
aux.GCheckAdditional=nil
return bool
end
function rsab.checkfilter(g)
return function(tp,sg,fc)
return #sg==#g
end
end
function rsab.fuscheck(g,e,tp,fusc)
aux.FCheckAdditional=rsab.checkfilter(g)
local bool=fusc:CheckFusionMaterial(g,nil,tp)
aux.FCheckAdditional=nil
return bool
end
function rsab.syncheck(g,e,tp,sync)
local bool,f1,f2,f3,f4,minct,maxct,gc=rscf.GetSynchroProduce(sync)
if not f2 and not f3 then
return Duel.CheckSynchroMaterial(sync,f1,f4,#g-1,#g-1,nil,g)
else
--problem
return sync:IsSynchroSummonable(nil,g)
end
end
function rsab.xyzcheck(g,e,tp,xyzc)
return xyzc:IsXyzSummonable(g,#g,#g)
end
function rsab.spop(summon1,summon2)
return function(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerCanSpecialSummonCount(tp,2) then return end
local mixg=rsab.getmaterial(tp,summon1,summon2)
local list={rsab.ritcheck,rsab.fuscheck,rsab.syncheck,rsab.xyzcheck,rsab.linkcheck}
local list2={"rit","fus","syn","xyz","link"}
local _,index=rsof.Table_List(list2,summon1)
local fun1=list[index]
local _,index2=rsof.Table_List(list2,summon2)
local fun2=list[index2]
rsof.SelectHint(tp,{m,index-1})
local sc1=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(rsab.spfilter1),tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,nil,e,tp,mixg,summon1,summon2):GetFirst()
if not sc1 then return end
local _,index2=rsof.Table_List(list2,summon2)
rsof.SelectHint(tp,{m,index2-1})
local sc2=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(rsab.spfilter2),tp,LOCATION_HAND+LOCATION_EXTRA+LOCATION_GRAVE,0,1,1,sc1,e,tp,sc1,mixg,summon1,summon2):GetFirst()
rsof.SelectHint(tp,{m,5})
local mat=mixg:SelectSubGroup(tp,rsab.spcheck,false,1,#mixg,e,tp,sc1,sc2,summon1,summon2)
local reason=REASON_MATERIAL
sc1:SetMaterial(mat)
local sumzone1=rsab.zonecheckfun(tp,mat,sc1,sc2,summon1,summon2)
if summon1~="xyz" and summon2~="xyz" then
rsab.materialsendfun(mat,summon1,summon2)
end
rsab.summonfun(sc1,mat,e,tp,summon1,sumzone1)
if summon2=="xyz" then
rsab.materialregfun(mat,e,tp,summon1)
end
Duel.BreakEffect()
sc2:SetMaterial(mat)
rsab.summonfun(sc2,mat,e,tp,summon2)
if summon2~="xyz" and not (summon1=="rit" and summon2=="fus") and not (summon1=="xyz" and (summon2=="rit" or summon2=="syn")) then
rsab.materialregfun(mat,e,tp,summon2)
end
end
end
function rsab.zonecheckfun(tp,mat,sc1,sc2,summon1,summon2)
local checkg=summon2=="xyz" and Group.CreateGroup() or mat
local list={0x1,0x2,0x4,0x8,0x10}
local sumzone1=0
if summon1=="rit" then
local mzct=Duel.GetMZoneCount(tp,checkg,tp)
local exmzct=Duel.GetLocationCountFromEx(tp,tp,checkg,sc2)
local exmzct1=Duel.GetLocationCountFromEx(tp,tp,checkg,sc2,0x1f)
local exmzct2=Duel.GetLocationCountFromEx(tp,tp,checkg,sc2,0x60)
if exmzct2>0 and exmzct1==0 and mzct>0 then
sumzone1=0x1f
end
if exmzct>0 and mzct>0 then
for _,zone in pairs(list) do
if Duel.GetMZoneCount(tp,checkg,tp,LOCATION_REASON_TOFIELD,zone)>0 and Duel.GetLocationCountFromEx(tp,tp,mat,sc2,0x7f-zone)>0 then
sumzone1=sumzone1|zone
end
end
end
elseif summon2=="rit" then
local mzct=Duel.GetMZoneCount(tp,mat,tp)
local exmzct=Duel.GetLocationCountFromEx(tp,tp,mat,sc1)
local exmzct1=Duel.GetLocationCountFromEx(tp,tp,mat,sc1,0x1f)
local exmzct2=Duel.GetLocationCountFromEx(tp,tp,mat,sc1,0x60)
if exmzct2>0 and exmzct1==0 and mzct>0 then
sumzone1=0x60
end
if exmzct1>0 and mzct>0 then
for _,zone in pairs(list) do
if Duel.GetMZoneCount(tp,mat,tp,LOCATION_REASON_TOFIELD,0x1f-zone)>0 and Duel.GetLocationCountFromEx(tp,tp,mat,sc2,zone)>0 then
sumzone1=sumzone1|zone
end
end
end
else
local list2={0x20,0x40,0x1,0x2,0x4,0x8,0x10}
for _,zone in pairs(list2) do
if Duel.GetLocationCountFromEx(tp,tp,checkg,sc1,zone)>0 and Duel.GetLocationCountFromEx(tp,tp,mat,sc2,rsab.zonesub(zone))>0 then
sumzone1=sumzone1|zone
end
end
end
return sumzone1
end
function rsab.zonesub(zone1)
if zone1==0x20 then return 0x7f-zone1-0x40
elseif zone1==0x40 then return 0x7f-zone1-0x20
else return 0x7f-zone1
end
end
function rsab.materialreasonfun(summon1)
local list={ REASON_RITUAL,REASON_FUSION,REASON_SYNCHRO,REASON_XYZ,REASON_LINK }
local list2={"rit","fus","syn","xyz","link"}
local _,index=rsof.Table_List(list2,summon1)
local reason1=list[index]
return reason1
end
function rsab.materialsendfun(mat,summon1,summon2)
local reason1=rsab.materialreasonfun(summon1)
local reason2=rsab.materialreasonfun(summon2)
Duel.SendtoGrave(mat,REASON_EFFECT+REASON_MATERIAL+reason1+reason2)
end
function rsab.materialregfun(mat,e,tp,summon1)
local reason1=rsab.materialreasonfun(summon1)
Duel.RaiseEvent(mat,EVENT_BE_MATERIAL,e,reason,tp,tp,0)
for mc in aux.Next(mat) do
Duel.RaiseSingleEvent(mc,EVENT_BE_MATERIAL,e,reason1,tp,tp,0)
end
end
function rsab.summonfun(sc,mat,e,tp,summon1,sumzone1)
if not sumzone1 then sumzone1=0x7f end
if summon1=="rit" then
Duel.BreakEffect()
Duel.SpecialSummon(sc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP,sumzone1)
elseif summon1=="fus" then
Duel.BreakEffect()
Duel.SpecialSummon(sc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP,sumzone1)
elseif summon1=="syn" then
Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP,sumzone1)
elseif summon1=="xyz" then
Duel.Overlay(sc,mat)
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP,sumzone1)
end
sc:CompleteProcedure()
end
-------------------
end
-------------------
if cm then
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"syn","xyz")
end
-------------------
end
--混沌炼金术:溶解
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115002
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"fus","syn")
end
--混沌炼金术:煅烧
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115003
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"xyz","fus")
end
--混沌炼金术:蒸馏
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115004
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"rit","fus")
end
--代号:空间
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115005
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"rit","syn")
end
--混沌炼金术:提纯
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115006
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsab.ComplexSummonFun(c,m,"xyz","rit")
end
--炼金生命体·中立
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115007
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},nil,"sum","de,dsp",nil,nil,rstg.target(rsop.list(cm.sumfilter,"sum",LOCATION_HAND)),cm.sumop)
local e3=rsef.RegisterClone(c,e1,"code",EVENT_SUMMON_SUCCESS)
local e2=rsab.MaterialGainEffectFun(c,m,"des,th",rstg.target(rsop.list({Card.IsDestructable,"des",true},{cm.thfilter,"th",LOCATION_HAND })),cm.matop)
end
function cm.sumfilter(c,e,tp)
return c:IsSetCard(0x3330) and c:IsSummonable(true,nil)
end
function cm.sumop(e,tp)
rsof.SelectHint(tp,"sum")
local sc=Duel.SelectMatchingCard(tp,cm.sumfilter,tp,LOCATION_HAND,0,1,1,nil):GetFirst()
if sc then
Duel.Summon(tp,sc,true,nil)
end
end
function cm.thfilter(c)
return ((c:IsSetCard(0x3330) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0x3331)) and c:IsAbleToHand()
end
function cm.thcheck(g)
return #g==1 or g:FilterCount(Card.IsSetCard,nil,0x3331)<#g
end
function cm.matop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or Duel.Destroy(c,REASON_EFFECT)<=0 then return end
local g1=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_GRAVE,0,nil)
if #g1>0 then
rsof.SelectHint(tp,"th")
local tg=g1:SelectSubGroup(tp,cm.thcheck,false,1,2)
Duel.HintSelection(tg)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--炼金生命体·守序
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115008
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.spcon,cm.spop)
local e2=rsab.MaterialGainEffectFun(c,m,"des,sp",rstg.target(rsop.list({cm.desfilter,"des",true},{cm.spfilter,"sp",LOCATION_EXTRA })),cm.matop)
end
function cm.spcfilter(c)
return c:IsSetCard(0x3331) and not c:IsPublic()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_HAND,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
end
function cm.desfilter(c)
return c:IsDestructable() and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function cm.spfilter(c,e,tp)
return not c:IsCode(e:GetHandler():GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x3330)
end
function cm.matop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or Duel.Destroy(c,REASON_EFFECT)<=0 or Duel.GetLocationCountFromEx(tp)<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,nil,rssf.SummonBuff({0,0}))
end
end
\ No newline at end of file
--炼金生命体·混乱
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115009
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},{1,m},"se,th","de,dsp",nil,nil,rstg.target(rsop.list(cm.thfilter,"th",LOCATION_DECK)),cm.thop)
local e3=rsef.RegisterClone(c,e1,"code",EVENT_SUMMON_SUCCESS)
local e2=rsab.MaterialGainEffectFun(c,m,"des,sp",rstg.target(rsop.list({cm.desfilter,"des",true},{cm.spfilter,"sp",LOCATION_DECK })),cm.matop)
end
function cm.thfilter(c)
return c:IsSetCard(0x3331) and c:IsAbleToHand()
end
function cm.thop(e,tp)
rsof.SelectHint(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.desfilter(c)
return c:IsDestructable() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x3330) and not c:IsCode(m)
end
function cm.matop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or Duel.Destroy(c,REASON_EFFECT)<=0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg)
end
end
\ No newline at end of file
--炼金生命体·善良
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115010
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.spcon)
local e2=rsab.MaterialGainEffectFun(c,m,"des,sp",rstg.target(rsop.list({cm.desfilter,"des",true},{cm.spfilter,"sp",LOCATION_HAND+LOCATION_GRAVE })),cm.matop)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3330) and not c:IsCode(m)
end
function cm.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.IsExistingMatchingCard(cm.cfilter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function cm.desfilter(c)
return c:IsDestructable() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsSetCard(0x3330) and c:IsLevel(4) and not c:IsCode(m)
end
function cm.matop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or Duel.Destroy(c,REASON_EFFECT)<=0 or Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,math.min(ft,2),nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg)
end
end
\ No newline at end of file
--炼金生命体·邪恶
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115011
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.STO(c,EVENT_SPSUMMON_SUCCESS,{m,0},{1,m},"se,th","de,dsp",nil,nil,rstg.target(rsop.list(cm.thfilter,"th",LOCATION_DECK)),cm.thop)
local e3=rsef.RegisterClone(c,e1,"code",EVENT_SUMMON_SUCCESS)
local e2=rsab.MaterialGainEffectFun(c,m,"des,se,th",rstg.target(rsop.list({cm.desfilter,"des",true},{cm.spfilter,"th",LOCATION_DECK })),cm.matop)
end
function cm.thfilter(c)
return c:IsSetCard(0x3330) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.thop(e,tp)
rsof.SelectHint(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.desfilter(c)
return c:IsDestructable() and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.thfilter2(c)
return c:IsSetCard(0x3331) and c:IsAbleToHand()
end
function cm.matop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or Duel.Destroy(c,REASON_EFFECT)<=0 then return end
rsof.SelectHint(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter2,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
\ No newline at end of file
--炼金生命体 聚合球孢体
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115012
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
local e1=rsef.I(c,{m,0},1,"des",nil,LOCATION_MZONE,nil,rscost.reglabel(100),cm.destg,cm.desop)
local e2=rsef.FTO(c,EVENT_PHASE+PHASE_END,{m,1},{1,m},"td,sp","tg",LOCATION_GRAVE,nil,nil,rstg.target0(cm.fun1,cm.fun2,cm.tdfilter,"td",LOCATION_GRAVE,0,2,2,c),cm.spop)
end
function cm.cfilter(c,tp)
local eg=c:GetEquipGroup()
return rsab.typecheck1(c) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,eg)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
else return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp)
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
local rg=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,nil,tp)
Duel.Release(rg,REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,PLAYER_ALL,LOCATION_ONFIELD)
end
function cm.desop(e,tp)
rsof.SelectHint(tp,"des")
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,2,nil)
if #dg>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function cm.fun1(e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.fun2(g,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function cm.tdfilter(c)
return rsab.typecheck1(c) and c:IsAbleToDeck()
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
local g=rsgf.GetTargetGroup()
if #g<=0 or Duel.SendtoDeck(g,nil,2,REASON_EFFECT)<=0 then return end
local og=Duel.GetOperatedGroup()
if #og<=0 or not og:IsExists(Card.IsLocation,1,nil,LOCATION_DECK+LOCATION_EXTRA) then return end
if c then rssf.SpecialSummon(c) end
end
\ No newline at end of file
--炼金生命体 聚合缠绕体
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115013
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,4,2)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_MZONE,nil,rscost.rmxyz(1),rstg.target(rsop.list(cm.spfilter,"sp",LOCATION_HAND+LOCATION_GRAVE)),cm.spop)
local e2=rsef.STO(c,EVENT_DESTROYED,{m,1},{1,m+100},"se,th","de,dsp",rsab.descon,nil,rstg.target(rsop.list({cm.thfilter,"th",LOCATION_HAND })),cm.thop)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.spop(e,tp)
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if #sg>0 then
rssf.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,nil,rssf.SummonBuff(nil,true))
end
end
function cm.thfilter(c)
return ((c:IsSetCard(0x3330) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0x3331)) and c:IsAbleToHand()
end
function cm.thcheck(g)
return #g==1 or g:FilterCount(Card.IsSetCard,nil,0x3331)<#g
end
function cm.thop(e,tp)
local g1=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #g1>0 then
rsof.SelectHint(tp,"th")
local tg=g1:SelectSubGroup(tp,cm.thcheck,false,1,2)
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
--炼金生命体 聚合雾状体
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115014
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
local e1=rsef.QO(c,nil,{m,0},{1,m},nil,"tg",LOCATION_MZONE,nil,nil,rstg.target(Card.IsFaceup,nil,LOCATION_MZONE,LOCATION_MZONE),cm.limitop)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},nil,"tg",LOCATION_HAND+LOCATION_MZONE,nil,rscost.cost(Card.IsReleasable,"res"),rstg.target(cm.pfilter,nil,LOCATION_MZONE,0,1,1,c),cm.pop)
--local e2=rsef.STO(c,EVENT_DESTROYED,{m,1},{1,m+100},nil,"de,dsp",rsab.descon,nil,rstg.target(rsop.list(cm.setfilter,nil,LOCATION_GRAVE)),cm.setop)
end
function cm.pfilter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x3330)
end
function cm.pop(e,tp)
local c,tc=e:GetHandler(),rscf.GetTargetCard()
if not tc then return end
local e1=rsef.SV_IMMUNE_EFFECT({c,tc},rsval.imoe,nil,rsreset.est_pend)
end
function cm.limitop(e,tp)
local c,tc=e:GetHandler(),rscf.GetTargetCard()
if not tc then return end
tc:RegisterFlagEffect(m,rsreset.est_pend,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,2))
local e1,e2=rsef.SV_LIMIT({c,tc},"ress,resns",nil,nil,rsreset.est_pend,"cd")
local e3,e4,e5,e6=rsef.SV_CANNOT_BE_MATERIAL({c,tc},"fus,syn,xyz,link",nil,nil,rsreset.est_pend,"cd")
end
function cm.setfilter(c)
return c:IsSSetable() and c:IsSetCard(0x3331) and c:IsType(TYPE_SPELL)
end
function cm.setop(e,tp)
local ct=Duel.GetLocationCount(tp,LOCATION_SZONE)
if ct<=0 then return end
rsof.SelectHint(tp,HINTMSG_SET)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,ct,nil)
if #sg>0 then
Duel.HintSelection(sg)
Duel.SSet(tp,sg)
Duel.ConfirmCards(1-tp,sg)
end
end
--炼金生命体 聚合熔融体
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115015
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,2,true)
local e1=rsef.QO(c,EVENT_CHAINING,{m,0},{1,m},"neg,des","dsp,dcal",LOCATION_MZONE,cm.negcon,nil,cm.negtg,cm.negop)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_DESTROYED)
e2:SetCountLimit(1,m+100)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0
or (sg:IsExists(Card.IsRace,1,c,c:GetRace())
and not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute()))
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()>1 and rp==1-tp
end
function cm.checkchain(ev,tp,e)
local ng=Group.CreateGroup()
local dg=Group.CreateGroup()
for i=1,ev do
local te,p=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if p~=tp then
local tc=te:GetHandler()
ng:AddCard(tc)
if e then
if Duel.NegateActivation(i) and tc:IsRelateToEffect(e) and tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
else
if tc:IsRelateToEffect(te) then
dg:AddCard(tc)
end
end
end
end
return ng,dg
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ng,dg=cm.checkchain(ev,tp)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,#ng,0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0)
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
local ng,dg=cm.checkchain(ev,tp,e)
Duel.Destroy(dg,REASON_EFFECT)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return bit.band(r,REASON_EFFECT+REASON_BATTLE)~=0
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and cm.spfilter(chkc,e,tp) and chkc~=e:GetHandler() end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingTarget(cm.spfilter,tp,LOCATION_GRAVE,0,1,c,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,c,e,tp)
g:AddCard(c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
and not Duel.IsPlayerAffectedByEffect(tp,59822133) and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
local g=Group.FromCards(c,tc)
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--炼金生命体 聚合奇形体
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115016
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2,2,cm.gf)
local e1=rsef.SV_CANNOT_BE_MATERIAL(c,"link",nil,nil,nil,"cd,uc")
local e2=rsef.I(c,{m,0},1,"sp",nil,LOCATION_MZONE,nil,nil,cm.sptg,cm.spop)
local e3=rsef.I(c,{m,0},nil,"sp",nil,LOCATION_GRAVE,nil,rscost.cost(cm.resfilter,"res",LOCATION_MZONE),rstg.target(rsop.list(cm.spfilter,"sp",true)),cm.spop2)
end
function cm.gf(g)
return g:GetClassCount(Card.GetLinkAttribute)==#g
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)>0 end
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if not c or c:IsControler(1-tp) or Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(c,nseq)
local zone=c:GetLinkedZone(tp)&0x1f
if zone==0 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.spfilter0),tp,LOCATION_HAND+LOCATION_GRAVE,0,nil,e,tp,zone)
if #g<=0 or not Duel.SelectYesNo(tp,aux.Stringid(m,2)) then return end
rsof.SelectHint(tp,"sp")
local sg=g:SelectSubGroup(tp,cm.spcheck,false,1,2,e,tp,zone)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP,zone)~=0 then
local og=Duel.GetOperatedGroup()
for tc in aux.Next(og) do
local e1=rsef.SV_CANNOT_BE_MATERIAL({c,tc},"link",nil,nil,rsreset.est)
end
end
end
function cm.spfilter0(c,e,tp,zone)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,zone) and c:IsLevel(4) and c:IsSetCard(0x3330)
end
function cm.spcheck(g,e,tp,zone)
local ct=Duel.GetMZoneCount(tp,Group.CreateGroup(),tp,LOCATION_REASON_TOFIELD,zone)
return #g<=ct and g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)<=1 and g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE)<=1
end
function cm.resfilter(c,e,tp)
return c:IsReleasable() and rsab.typecheck2(c) and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spop2(e,tp)
local c=aux.ExceptThisCard(e)
if c then rssf.SpecialSummon(c) end
end
\ No newline at end of file
--混沌炼金术·X
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115017
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_FZONE,nil,rscost.reglabel(100),cm.sptg,cm.spop)
local e3=rsef.FTO(c,EVENT_SPSUMMON_SUCCESS,{m,1},nil,nil,"tg,de",LOCATION_FZONE,cm.mvcon,nil,cm.mvtg,cm.mvop)
local e4=rsef.RegisterClone(c,e3,"code",EVENT_SUMMON_SUCCESS)
end
function cm.resfilter(c,tp)
return c:IsSetCard(0x3330) and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function cm.spfilter(c,e,tp)
return c:IsCode(10115016) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
if chk==0 then
if e:GetLabel()==100 then return Duel.CheckReleaseGroup(tp,cm.resfilter,1,nil,tp) and b1
else
return b1
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
local rg=Duel.SelectReleaseGroup(tp,cm.resfilter,1,1,nil,tp)
Duel.Release(rg,REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if not c then return end
if Duel.GetLocationCountFromEx(tp)<=0 then return end
rsof.SelectHint(tp,"sp")
local tc=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
tc:SetMaterial(nil)
if rssf.SpecialSummon(tc,SUMMON_TYPE_LINK)>0 then
tc:CompleteProcedure()
end
end
end
function cm.mvcon(e,tp,eg)
local lg=Duel.GetMatchingGroup(rscf.FilterFaceUp(Card.IsCode,10115016),tp,LOCATION_MZONE,0,nil)
local zone=0
for tc in aux.Next(lg) do
zone=zone|tc:GetLinkedZone(tp)
end
return eg:IsExists(cm.cfilter,1,nil,tp,zone)
end
function cm.cfilter(c,tp,zone)
local seq=c:GetSequence()
if c:IsLocation(LOCATION_MZONE) then
if c:IsControler(1-tp) then seq=seq+16 end
else
seq=c:GetPreviousSequence()
if c:GetPreviousControler()==1-tp then seq=seq+16 end
end
return bit.extract(zone,seq)~=0
end
function cm.mvtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_CONTROL)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_MZONE,0,1,nil) and ft>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_MZONE,0,1,2,nil)
end
function cm.cfilter2(c,e,tp)
return c:IsControler(tp) and not c:IsImmuneToEffect(e)
end
function cm.mvop(e,tp,eg,ep,ev,re,r,rp)
local c=aux.ExceptThisCard(e)
local tg=rsgf.GetTargetGroup(cm.cfilter2,e,tp)
if not c or #tg<=0 then return end
for tc in aux.Next(tg) do
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOZONE)
local s=Duel.SelectDisableField(tp,1,LOCATION_MZONE,0,0)
local nseq=math.log(s,2)
Duel.MoveSequence(tc,nseq)
end
end
\ No newline at end of file
--炼金生命体·始源
if not pcall(function() require("expansions/script/c10115001") end) then require("script/c10115001") end
local m=10115018
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.matfilter,1,1)
c:EnableReviveLimit()
local e1=rsef.STO(c,EVENT_DESTROYED,{m,1},{1,m},"dr","de,dsp,ptg",rsab.descon,nil,cm.drtg,cm.drop)
end
function cm.matfilter(c)
return c:IsLinkSetCard(0x3330) and not c:IsLinkCode(m)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--大魔王 折磨女王安达利尔
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10121001
local cm=_G["c"..m]
if not rsv.Diablo then
rsv.Diablo={}
rsdio=rsv.Diablo
function rsdio.AngelHandXyzEffect(sc,bool)
local e1=Effect.CreateEffect(sc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(10121011)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
sc:RegisterEffect(e1)
local e2=Effect.CreateEffect(sc)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE+LOCATION_HAND)
e2:SetCode(10121011)
sc:RegisterEffect(e2)
if not bool then
local e3=Effect.CreateEffect(sc)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_DECK)
e3:SetCode(EFFECT_SPSUMMON_CONDITION)
sc:RegisterEffect(e3)
end
return e1
end
function rsdio.DMSpecialSummonEffect(sc,mcode,bool)
local e1=Effect.CreateEffect(sc)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetDescription(aux.Stringid(m,1))
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,mcode)
e1:SetCondition(function(e,c)
if c==nil then return true end
if c:IsHasEffect(EFFECT_NECRO_VALLEY) then return false end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.CheckRemoveOverlayCard(c:GetControler(),1,0,2,REASON_COST)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,c)
Duel.RemoveOverlayCard(tp,1,0,2,2,REASON_COST)
end)
sc:RegisterEffect(e1)
if not bool then
local e2=Effect.CreateEffect(sc)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_DECK)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
sc:RegisterEffect(e2)
end
return e1
end
function rsdio.XyzEffect(sc,ct)
local minct=math.ceil(ct/2)
rscf.AddXyzProcedureLevelFree_Special(sc,aux.TRUE,rsdio.gfilter(ct),minct,99)
rscf.SetExtraXyzMaterial(sc,rsdio.materialfilter,LOCATION_HAND,LOCATION_MZONE,rsdio.matop)
end
function rsdio.gfilter(ct)
return function(g,xyzc,tp,ogbase)
if g:FilterCount(rsdio.bookcheck,nil,tp)>1 then return false end
if g:IsExists(Card.IsLocation,1,nil,LOCATION_HAND) and not
g:IsExists(Card.IsHasEffect,1,nil,10121011) and #ogbase==0 then return false
end
if not g:IsExists(Card.IsHasEffect,1,nil,10121003) then
if g:IsExists(rsdio.bookcheck,1,nil,tp) then
local tc=g:Filter(rsdio.bookcheck,nil,tp):GetFirst()
if g:FilterCount(Card.IsXyzLevel,tc,xyzc,10)~=#g-1 then return false end
else
if g:FilterCount(Card.IsXyzLevel,nil,xyzc,10)~=#g then return false end
end
end
if not g:IsExists(Card.IsHasEffect,1,nil,10121003) and #g<ct then return false end
return true
end
end
function rsdio.bookcheck(c,tp)
return c:IsHasEffect(10121010) and c:IsControler(1-tp) and Duel.GetFlagEffect(tp,10121010)<=0
end
function rsdio.materialfilter(c,xyzc)
local tp=xyzc:GetControler()
return ((c:IsHasEffect(10121011) or Duel.IsPlayerAffectedByEffect(tp,10121011)) and c:IsControler(tp)) or rsdio.bookcheck(c,tp) and c:IsType(TYPE_MONSTER)
end
function rsdio.matop(e,tp,mat)
if mat:IsExists(rsdio.bookcheck,1,nil,tp) then
Duel.RegisterFlagEffect(tp,10121010,rsreset.pend,0,1)
end
end
-------
end
if cm then
function cm.initial_effect(c)
rsdio.DMSpecialSummonEffect(c,m)
--xyz
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_NEGATE)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(cm.xyzcost)
e2:SetCondition(cm.xyzcon)
e2:SetTarget(cm.xyztg)
e2:SetOperation(cm.xyzop)
c:RegisterEffect(e2)
end
function cm.xyzcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:GetFlagEffect(m)==0 end
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.filter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
if Duel.NegateActivation(ev) and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) and tc:IsType(TYPE_XYZ) and tc:IsControler(tp) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,rc) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
end
-----
end
--大魔王 痛苦之王督瑞尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121002
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.DMSpecialSummonEffect(c,m,true)
--xyz
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,m+100)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCondition(cm.xyzcon)
e2:SetTarget(cm.xyztg)
e2:SetOperation(cm.xyzop)
c:RegisterEffect(e2)
local e1=e2:Clone()
e1:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e1)
end
function cm.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.cfilter(c,tp,e)
return c:IsControler(1-tp) and not c:IsType(TYPE_TOKEN) and c:IsAbleToChangeControler() and (not e or (c:IsRelateToEffect(e)))
end
function cm.filter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
local tg=eg:Filter(cm.cfilter,nil,tp)
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,tg) and tg:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,tg)
for rc in aux.Next(eg) do
rc:CreateEffectRelation(e)
end
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
local tg=eg:Filter(cm.cfilter,nil,tp,e)
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) and tc:IsType(TYPE_XYZ) and tg:GetCount()>0 and tc:IsControler(tp) then
tg:AddCard(c)
Duel.Overlay(tc,tg)
end
end
--大魔王 罪恶之王阿兹莫丹
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121003
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
rsdio.XyzEffect(c,2)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(rscost.rmxyz(1))
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--act limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(cm.aclimit)
e2:SetCondition(cm.accon)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e3)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
end
function cm.accon(e)
return not rscon.phmp(e)
end
function cm.aclimit(e,re,tp)
return not re:GetHandler():IsImmuneToEffect(e)
end
function cm.filter(c,e,tp)
return (c:IsSetCard(0xa331) or c:IsSetCard(0xc331)) 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 return Duel.IsExistingMatchingCard(cm.filter,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 cm.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,aux.NecroValleyFilter(cm.filter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--大魔王 谎言之王彼列
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121004
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.DMSpecialSummonEffect(c,m,true)
--xyz
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.xyztg)
e2:SetCountLimit(1,m+100)
e2:SetOperation(cm.xyzop)
c:RegisterEffect(e2)
end
function cm.filter(c)
return c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function cm.filter2(c,tp)
return not c:IsType(TYPE_TOKEN) and (c:IsControler(tp) or c:IsAbleToChangeControler())
end
function cm.xyzop(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) and c:IsRelateToEffect(e) and tc:IsType(TYPE_XYZ) and tc:IsControler(tp) then
Duel.Overlay(tc,Group.FromCards(c))
local g=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,LOCATION_ONFIELD+LOCATION_GRAVE,tc,tp)
if tc:GetOverlayGroup():IsContains(c) and g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) and tc:IsControler(tp) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,rshint.xyz)
local xyzg=g:Select(tp,1,1,nil)
Duel.HintSelection(xyzg)
local xyzc=xyzg:GetFirst()
if not xyzc:IsImmuneToEffect(e) then
local xyzmg=xyzc:GetOverlayGroup()
if xyzmg:GetCount()>0 then
Duel.SendtoGrave(xyzmg,REASON_RULE)
end
Duel.Overlay(tc,xyzg)
end
end
end
end
function cm.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tc=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
--大魔神 憎恨之王墨菲斯托
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121005
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
rsdio.XyzEffect(c,2)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCondition(cm.macon1)
e2:SetOperation(cm.maop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.regcon)
e3:SetOperation(cm.regop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_CHAIN_SOLVED)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.macon2)
e4:SetOperation(cm.maop2)
c:RegisterEffect(e4)
--get effect
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,1))
e5:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_SPSUMMON_SUCCESS)
e5:SetCondition(cm.macon1)
e5:SetOperation(cm.maop1)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e6:SetCode(EVENT_SPSUMMON_SUCCESS)
e6:SetCondition(cm.regcon)
e6:SetOperation(cm.regop)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e7:SetCode(EVENT_CHAIN_SOLVED)
e7:SetCondition(cm.macon2)
e7:SetOperation(cm.maop2)
c:RegisterEffect(e7)
local e8=e2:Clone()
e8:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e8)
local e9=e5:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
local e10=e3:Clone()
e10:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e10)
local e11=e6:Clone()
e11:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e11)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.mfilter,1,nil,1-tp)
and re and re:IsHasType(EFFECT_TYPE_ACTIONS) and not re:IsHasType(EFFECT_TYPE_CONTINUOUS)
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterFlagEffect(tp,m,RESET_CHAIN,0,1)
end
function cm.macon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
end
function cm.maop2(e,tp,eg,ep,ev,re,r,rp)
local n=Duel.GetFlagEffect(tp,m)
Duel.ResetFlagEffect(tp,m)
local dg=Duel.GetDecktopGroup(1-tp,n)
if dg:GetCount()<=0 or not e:GetHandler():IsType(TYPE_XYZ) then return end
Duel.Hint(HINT_CARD,0,m)
Duel.Overlay(e:GetHandler(),dg)
end
function cm.mfilter(c,sp)
return c:GetSummonPlayer()==sp
end
function cm.macon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.mfilter,1,nil,1-tp)
and (not re or not re:IsHasType(EFFECT_TYPE_ACTIONS) or re:IsHasType(EFFECT_TYPE_CONTINUOUS))
end
function cm.maop1(e,tp,eg,ep,ev,re,r,rp)
local dg=Duel.GetDecktopGroup(1-tp,1)
if dg:GetCount()<=0 or not e:GetHandler():IsType(TYPE_XYZ) then return end
Duel.Hint(HINT_CARD,0,m)
Duel.Overlay(e:GetHandler(),dg)
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)
return (c:IsSetCard(0xa331) or c:IsSetCard(0xc331)) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.filter),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
--大魔神 毁灭之王巴尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121006
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedure(c,nil,10,3,nil,nil,99)
--rsdio.XyzEffect(c,4)(暂时无法正常使用)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCategory(CATEGORY_DRAW)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetLabel(1)
e1:SetCondition(cm.con)
e1:SetCountLimit(1)
e1:SetCost(rscost.rmxyz(1))
e1:SetTarget(cm.drtg)
e1:SetOperation(cm.drop)
local e2=e1:Clone()
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
c:RegisterEffect(e2)
e1:SetRange(LOCATION_MZONE)
c:RegisterEffect(e1)
--togr
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetCode(EFFECT_SEND_REPLACE)
e3:SetTarget(cm.rtg)
e3:SetCondition(cm.con)
e3:SetLabel(3)
e3:SetValue(cm.rval)
e3:SetOperation(cm.rop)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
c:RegisterEffect(e4)
e3:SetRange(LOCATION_MZONE)
c:RegisterEffect(e3)
--immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
e5:SetLabel(10)
e5:SetCondition(cm.con)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetValue(cm.efilter)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetType(EFFECT_TYPE_XMATERIAL)
c:RegisterEffect(e6)
e5:SetRange(LOCATION_MZONE)
c:RegisterEffect(e5)
--cannot to Grave as cost
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetCode(EFFECT_CANNOT_TO_GRAVE_AS_COST)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e6:SetTargetRange(0x47,0x47)
e6:SetCondition(cm.con)
e6:SetLabel(3)
e6:SetTarget(cm.cgtg)
e6:SetValue(1)
local e7=e6:Clone()
e7:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e7)
e6:SetRange(LOCATION_MZONE)
c:RegisterEffect(e6)
end
function cm.cgtg(e,c)
return c:GetOwner()~=e:GetHandlerPlayer()
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function cm.efilter(e,te)
return te:GetOwnerPlayer()~=e:GetHandlerPlayer()
end
function cm.dfilter(c,tp)
return c:GetDestination()==LOCATION_GRAVE and c:GetOwner()~=tp and not c:IsLocation(LOCATION_OVERLAY) and not c:IsType(TYPE_SPELL+TYPE_TRAP+TYPE_TOKEN)
end
function cm.rtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(cm.dfilter,1,nil,tp) and e:GetHandler():IsType(TYPE_XYZ) end
local g=eg:Filter(cm.dfilter,nil,tp)
g:KeepAlive()
e:SetLabelObject(g)
return true
end
function cm.rop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetLabelObject()
Duel.Overlay(e:GetHandler(),g)
g:Clear()
end
function cm.rval(e,c)
return cm.dfilter(c,e:GetHandlerPlayer())
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end
\ No newline at end of file
--大魔神 恐惧之王迪亚波罗
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121007
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
rsdio.XyzEffect(c,4)
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.macon)
e1:SetTarget(cm.matg)
e1:SetOperation(cm.maop)
c:RegisterEffect(e1)
--disable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetOperation(cm.disop)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
c:RegisterEffect(e3)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
end
function cm.mafilter(c,tp)
return (c:IsControler(tp) or c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsAbleToChangeControler()) and not c:IsType(TYPE_TOKEN)
end
function cm.matg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc~=c and cm.mafilter(chkc,tp) end
if chk==0 then return c:IsType(TYPE_XYZ) and Duel.IsExistingTarget(cm.mafilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) and Duel.GetFieldGroupCount(tp,LOCATION_GRAVE,LOCATION_GRAVE)>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.mafilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local g=Duel.GetFieldGroup(tp,LOCATION_GRAVE,LOCATION_GRAVE)
if tc:IsRelateToEffect(e) then
g:AddCard(tc)
end
if c:IsRelateToEffect(e) and g:GetCount()>0 then
local sg,sg2=Group.CreateGroup(),Group.CreateGroup()
for tc in aux.Next(g) do
if not tc:IsImmuneToEffect(e) then
local og=tc:GetOverlayGroup()
sg2:Merge(og)
sg:AddCard(tc)
end
end
if sg2:GetCount()>0 then Duel.SendtoGrave(sg2,REASON_RULE) end
if sg:GetCount()>0 then Duel.Overlay(c,sg) end
end
end
function cm.macon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetOverlayGroup()
if ep~=tp and g:GetCount()>0 and g:IsExists(Card.IsCode,1,nil,re:GetHandler():GetCode()) then
Duel.NegateEffect(ev)
end
end
--暗黑天使 衣卒尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
function c10121008.initial_effect(c)
rsdio.AngelHandXyzEffect(c,true)
--xyzlv
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_XYZ_LEVEL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE+LOCATION_HAND)
e1:SetValue(c10121008.xyzlv)
--c:RegisterEffect(e1)
--todeck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10121008,0))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,10121008)
e2:SetTarget(c10121008.target)
e2:SetOperation(c10121008.operation)
c:RegisterEffect(e2)
end
function c10121008.xyzlv(e,c,rc)
local lv=e:GetHandler():GetLevel()
if rc:IsSetCard(0xa331) or rc:IsSetCard(0xc331) then
return 0x100000+lv
else
return lv
end
end
function c10121008.filter(c)
return (c:IsSetCard(0xa331) or c:IsSetCard(0xc331)) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function c10121008.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c10121008.filter(chkc) and chkc~=c end
if chk==0 then return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c10121008.filter,tp,LOCATION_GRAVE,0,5,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c10121008.filter,tp,LOCATION_GRAVE,0,5,5,c)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,5,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,tp,LOCATION_GRAVE+LOCATION_HAND)
end
function c10121008.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)~=5 then return end
Duel.SendtoDeck(tg,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 and c:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function c10121008.xyzlv(e,c,rc)
local lv=e:GetHandler():GetLevel()
if rc:IsSetCard(0xa331) or rc:IsSetCard(0x331) then return 0xa0000+lv
else return lv
end
end
\ No newline at end of file
--李奥瑞克 骷髅王
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
function c10121009.initial_effect(c)
rsdio.DMSpecialSummonEffect(c,10121009,true)
--xyz
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(10121003)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_ONFIELD)
c:RegisterEffect(e1)
end
--天使长 英勇之英普瑞斯
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121011
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.AngelHandXyzEffect(c,true)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCost(rscost.rmxyz(1))
e2:SetTarget(cm.matg)
e2:SetOperation(cm.maop)
c:RegisterEffect(e2)
end
function cm.matg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(cm.mafilter,tp,LOCATION_DECK,0,1,nil) end
end
function cm.mafilter(nb)
return nb:IsType(TYPE_MONSTER) and not nb:IsCode(m)
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsType(TYPE_XYZ) then return end
Duel.Hint(HINT_SELECTMSG,tp,rshint.xyz)
local g=Duel.SelectMatchingCard(tp,cm.mafilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
\ No newline at end of file
--天使长 希望之奥瑞尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121012
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.AngelHandXyzEffect(c,true)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.thfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_OVERLAY) and c:IsType(TYPE_MONSTER) and (c:IsAbleToHand() or (c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0))
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and cm.thfilter(chkc,e,tp) and chkc:IsLocation(LOCATION_GRAVE) end
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_EFFECT) and Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,tp,LOCATION_GRAVE)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
if not tc:IsRelateToEffect(e) then return end
local a1=tc:IsAbleToHand()
local a2=tc:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
if not a1 and not a2 then return end
local op=rsof.SelectOption(tp,a1,1190,a2,1152)
if op==1 then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)<=0 then return end
else
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)<=0 then return end
end
if c:CheckRemoveOverlayCard(tp,1,REASON_EFFECT) then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
end
--天使长 命运之伊瑟瑞尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121013
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.AngelHandXyzEffect(c,true)
Duel.EnableGlobalFlag(GLOBALFLAG_DETACH_EVENT)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetCountLimit(1)
e2:SetTarget(cm.matg)
e2:SetOperation(cm.maop)
c:RegisterEffect(e2)
if cm.check==nil then
cm.check=true
--checkremove
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_DETACH_MATERIAL)
ge1:SetOperation(cm.ctop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.matg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ) and Duel.GetFlagEffect(tp,m)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>0 end
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local hg=Duel.GetFieldGroup(tp,0,LOCATION_DECK)
local ct=Duel.GetFlagEffect(tp,m)
local xyzct=math.min(hg:GetCount(),ct)
local tbl={}
for i=1,xyzct do
tbl[i]=i
end
local ct2=Duel.AnnounceNumber(tp,table.unpack(tbl))
local xyzg=Duel.GetDecktopGroup(1-tp,ct2)
if not c:IsRelateToEffect(e) or not c:IsType(TYPE_XYZ) or hg:GetCount()<1 then return end
if xyzg:GetCount()>0 then
Duel.Overlay(c,xyzg)
end
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
for i=1,eg:GetCount() do
Duel.RegisterFlagEffect(rp,m,RESET_PHASE+PHASE_END,0,1)
end
end
--[[if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10121013
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.AngelHandXyzEffect(c)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCondition(cm.macon)
e2:SetCost(cm.macost)
e2:SetOperation(cm.maop)
c:RegisterEffect(e2)
end
function cm.macost(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.macon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=6 and e:GetHandler():IsType(TYPE_XYZ)
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsType(TYPE_XYZ) or hg:GetCount()<=5 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=hg:Select(1-tp,hg:GetCount()-5,hg:GetCount()-5,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
--]]
\ No newline at end of file
--天使长 智慧之马赛尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121014
local cm=_G["c"..m]
function cm.initial_effect(c)
rsdio.XyzEffect(c,2)
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.macon)
e1:SetCost(cm.macost)
e1:SetOperation(cm.maop)
c:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_XYZ_LEVEL)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(cm.lvtg)
e2:SetValue(cm.lvval)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e3)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
end
function cm.lvtg(e,c)
return c:IsType(TYPE_XYZ) and c:GetRank()==10
end
function cm.lvval(e,c,rc)
return 10
end
function cm.macost(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.macon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>=6 and e:GetHandler():IsType(TYPE_XYZ)
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local hg=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or not c:IsType(TYPE_XYZ) or hg:GetCount()<=5 then return end
Duel.Hint(HINT_SELECTMSG,tp,rshint.xyz)
local g=hg:Select(1-tp,hg:GetCount()-5,hg:GetCount()-5,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
--正义之大天使 泰瑞尔
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121015
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
rsdio.XyzEffect(c,3)
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.macost)
e1:SetTarget(cm.matg)
e1:SetOperation(cm.maop)
c:RegisterEffect(e1)
--activate cost
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetCost(cm.costchk)
e2:SetOperation(cm.costop)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e3)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
--accumulate
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(0x10000000+m)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(0,1)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e5)
e4:SetRange(LOCATION_MZONE)
c:RegisterEffect(e4)
end
function cm.costchk(e,te_or_c,tp)
local ct=Duel.GetFlagEffect(tp,m)
local mct=Duel.GetOverlayCount(e:GetHandlerPlayer(),1,0)
return Duel.CheckLPCost(tp,mct*100*ct)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local mct=Duel.GetOverlayCount(e:GetHandlerPlayer(),1,0)
Duel.PayLPCost(tp,mct*100)
end
function cm.macost(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.matg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>0 and e:GetHandler():IsType(TYPE_XYZ) end
end
function cm.maop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetFieldGroup(tp,0,LOCATION_EXTRA)
if g:GetCount()<=0 or not c:IsType(TYPE_XYZ) or not c:IsRelateToEffect(e) then return end
Duel.ConfirmCards(tp,g)
Duel.Hint(HINT_SELECTMSG,tp,rshint.xyz)
local mg=g:Select(tp,1,1,nil)
g:Remove(Card.IsCode,nil,mg:GetFirst():GetCode())
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
local mg2=g:Select(tp,1,1,nil)
mg:Merge(mg2)
end
Duel.Overlay(c,mg)
end
--创造之大天使 伊纳瑞斯
if not pcall(function() require("expansions/script/c10121001") end) then require("script/c10121001") end
local m=10121016
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
rsdio.XyzEffect(c,3)
--bbb shi bbb
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--atkup
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_XYZ))
e2:SetValue(cm.atkval)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_FIELD)
c:RegisterEffect(e3)
e2:SetRange(LOCATION_MZONE)
c:RegisterEffect(e2)
end
function cm.atkval(e,c)
return c:GetOverlayCount()*100
end
function cm.filter(c,e,tp,mc)
return (c:IsSetCard(0xa331) or c:IsSetCard(0xc331)) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,c)>0
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp,tp,c)>0 and c:IsFaceup()
and c:IsRelateToEffect(e) and c:IsControler(tp) and not c:IsImmuneToEffect(e)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,c)
local tc=g:GetFirst()
if tc then
local mg=c:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(tc,mg)
end
tc:SetMaterial(Group.FromCards(c))
Duel.Overlay(tc,Group.FromCards(c))
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
function cm.spcost(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
\ No newline at end of file
--空想乌托邦 混沌之海
local m=10122001
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
if not rsv.Utoland then
rsv.Utoland={}
rsul=rsv.Utoland
rsul.hint={0,TIMINGS_CHECK_MONSTER+TIMING_CHAIN_END+TIMING_END_PHASE }
function rsul.GraveDestroyActivateEffect(c,code)
local e1=rsef.QO(c,nil,{m,8},{1,code},nil,nil,LOCATION_GRAVE,nil,rscost.cost(Card.IsAbleToHandAsCost,"th"),rsul.gdtg,rsul.gdop,rsul.hint)
e1:SetLabel(code)
return e1
end
function rsul.gdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if chkc then return false end
if chk==0 then return tc and tc:IsCanBeEffectTarget(e) and e:GetHandler():GetActivateEffect():IsActivatable(tp) end
Duel.SetTargetCard(tc)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,tc,1,tp,LOCATION_FZONE)
end
function rsul.gdop(e,tp,eg,ep,ev,re,r,rp)
local tc,c=Duel.GetFirstTarget(),e:GetHandler()
local te=tc:GetActivateEffect()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and te:IsActivatable(tp) then
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function rsul.ToHandActivateEffect(c,code)
local e1=rsef.QO(c,nil,{m,8},{1,code},nil,nil,LOCATION_FZONE,nil,rscost.cost(Card.IsAbleToHandAsCost,"th"),rsul.thtg,rsul.thop,rsul.hint)
e1:SetLabel(code)
return e1
end
function rsul.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(rsul.thfilter,tp,LOCATION_HAND,0,1,nil,tp,e:GetLabel()) end
end
function rsul.thfilter(c,tp,code)
if not c:IsType(TYPE_FIELD) or c:IsCode(code) then return false end
local te=c:GetActivateEffect()
--for i,pe in ipairs({Duel.IsPlayerAffectedByEffect(tp,EFFECT_CANNOT_ACTIVATE)}) do
--local con,val=pe:GetCondition(),pe:GetValue()
--if (not con or con(pe)) and val(pe,te,1-tp) then return false --end
--end
--return not c:IsHasEffect(EFFECT_CANNOT_TRIGGER) and not c:IsHasEffect(EFFECT_CANNOT_ACTIVATE)
return te:IsActivatable(tp,true)
end
function rsul.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,7))
local tc=Duel.SelectMatchingCard(tp,rsul.thfilter,tp,LOCATION_HAND,0,1,1,nil,tp,e:GetLabel()):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
function rsul.SpecialOrPlaceBool(tp,tc,ct,maxct)
if not ct then ct=1 end
if not maxct then maxct=ct end
if type(maxct)=="function" then maxct=math.min(maxct(tp),ct) end
local szonect=Duel.IsPlayerAffectedByEffect(tp,10122021) and Duel.GetLocationCount(tp,LOCATION_SZONE) or 0
if szonect>0 and tc and tc:IsLocation(LOCATION_SZONE) then szonect=szonect+1 end
local mzonect=not tc and Duel.GetLocationCount(tp,LOCATION_MZONE) or Duel.GetMZoneCount(tp,tc)
if not Duel.IsPlayerCanSpecialSummonMonster(tp,10122011,0xc333,0x4011,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_DARK) then mzonect=0 end
if mzonect>0 and Duel.IsPlayerAffectedByEffect(tp,59822133) then mzonect=1 end
return mzonect+szonect>=ct,mzonect,szonect
end
function rsul.TokenTg(ct,maxct)
if not ct then ct=1 end
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return rsul.SpecialOrPlaceBool(tp,nil,ct,maxct) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
end
--[[ "useless because move to szone cannot directly point zone"
function rsul.TokenOp(op,ignore,ct,maxct)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not ignore and not c:IsRelateToEffect(e)) then return end
if not ct then ct=1 end
if not maxct then maxct=ct end
if type(maxct)=="function" then maxct=math.min(maxct(tp),ct) end
local bool,mzonect,szonect=rsul.SpecialOrPlaceBool(tp,nil,ct)
if not bool then return end
local complete=false
for i=1,maxct do
if mzonect+szonect<=0 or (i>1 and not Duel.SelectYesNo(tp,aux.Stringid(10122016,1))) then break end
local zone=0
local token=Duel.CreateToken(tp,10122011)
local loc=LOCATION_MZONE+LOCATION_SZONE
if mzonect<=0 then loc=loc-LOCATION_MZONE end
if szonect<=0 then loc=loc-LOCATION_SZONE end
local spzone=Duel.SelectDisableField(tp,1,0,loc,0)
if spzone<=0x10 then
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP)>0 then
complete=true
mzonect=mzonect-1
op({e:GetHandler(),token},e)
end
else
Duel.MoveToField(token,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
szonect=szonect-1
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(rsreset.est-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
token:RegisterEffect(e1,true)
rsul.TokenSpellOp(c,token)
end
end
if complete then
Duel.SpecialSummonComplete()
end
end
end--]]
function rsul.TokenOp(op,ignore,ct,maxct)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if (not ignore and not c:IsRelateToEffect(e)) then return end
if not op then op=rsul.basetkop end
if not ct then ct=1 end
if not maxct then maxct=ct end
local bool,mzonect,szonect=rsul.SpecialOrPlaceBool(tp,nil,ct)
if not bool then return end
local complete=false
for i=1,maxct do
if mzonect+szonect<=0 then break end
local zone=0
local token=Duel.CreateToken(tp,10122011)
local b1=mzonect>0
local b2=szonect>0
local b3=i>ct
local sel=rsof.SelectOption(tp,b3,{m,5},b1,{10122021,0},b2,{10122021,1},true)
if sel==1 then
break
elseif sel==2 then
if Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP) then
complete=true
mzonect=mzonect-1
op({e:GetHandler(),token},e)
end
else
Duel.MoveToField(token,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
szonect=szonect-1
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(rsreset.est-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
token:RegisterEffect(e1,true)
rsul.TokenSpellOp(c,token)
end
end
if complete then
Duel.SpecialSummonComplete()
end
end
end
function rsul.TokenSpellOp(c,tc)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetRange(LOCATION_SZONE)
e0:SetTargetRange(LOCATION_MZONE,0)
e0:SetReset(rsreset.est)
e0:SetDescription(aux.Stringid(m,1))
e0:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e0:SetTarget(function(e,sc)
return e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,tp):IsContains(sc)
end)
e0:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e0:SetValue(aux.indoval)
tc:RegisterEffect(e0)
local e1=e0:Clone()
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetValue(function(e,re,rp)
return rp==1-e:GetHandlerPlayer()
end)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetReset(rsreset.est)
e3:SetCondition(function(e,tp)
return Duel.GetTurnPlayer()==tp
end)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-tp):FilterCount(Card.IsAbleToRemove,nil)>0 end
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=e:GetHandler():GetColumnGroup():Filter(Card.IsControler,nil,1-tp):Filter(Card.IsAbleToRemove,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_CARD,0,10122011)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end)
tc:RegisterEffect(e3)
end
function rsul.basetkop(c,e)
rsef.SV_INDESTRUCTABLE(c,"battle",1,nil,rsreset.est,nil,{m,3})
rsef.SV_LIMIT(c,"ress",1,nil,rsreset.est,nil,{m,6})
end
function rsul.advtkop(c,e)
rsef.SV_INDESTRUCTABLE(c,"ct",rsval.indbae("battle"),nil,rsreset.est,nil,{m,1},1)
rsef.SV_LIMIT(c,"ress",1,nil,rsreset.est,nil,{m,4})
end
-------
end
if cm then
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.ToHandActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp",nil,LOCATION_FZONE,nil,rscost.lpcost(500),rsul.TokenTg(1),rsul.TokenOp(),rsul.hint)
end
------
end
\ No newline at end of file
--空想星界 幽暗密林
local m=10122002
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.ToHandActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp","tg",LOCATION_FZONE,nil,nil,cm.tg,rsul.TokenOp(cm.op,nil,1),rsul.hint)
end
function cm.tg(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.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) and rsul.SpecialOrPlaceBool(tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.op(c,e)
rsul.basetkop(c,e)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
e:SetLabelObject(tc)
c[2]:SetCardTarget(tc)
c[2]:CreateRelation(tc,RESET_EVENT+0x5020000)
tc:CreateRelation(c[2],RESET_EVENT+0x5fe0000)
rsef.SV_IMMUNE_EFFECT(c,cm.val,nil,rsreset.est,nil,{m,4})
end
end
function cm.val(e,re)
local tc,c=e:GetLabelObject(),e:GetHandler()
return re:GetOwner()==tc and tc:IsRelateToCard(c) and c:IsRelateToCard(tc)
end
--空想星界 星降平原
local m=10122003
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.ToHandActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp",nil,LOCATION_FZONE,nil,rscost.cost(cm.cfilter,"dish",LOCATION_HAND),rsul.TokenTg(2),rsul.TokenOp(nil,nil,2),rsul.hint)
end
function cm.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
\ No newline at end of file
--空想星界 星辉沼地
local m=10122004
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.ToHandActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp","tg",LOCATION_FZONE,nil,rscost.reglabel(100),cm.tg,rsul.TokenOp(nil,nil,2),rsul.hint)
end
function cm.cfilter(c,tp)
return c:IsCode(10122011) and rsul.SpecialOrPlaceBool(tp,c,2)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp)
local g2=Duel.GetMatchingGroup(Card.IsReleasable,tp,LOCATION_SZONE,0,nil)
g1:Merge(g2)
if chk==0 then
if e:GetLabel()==100 then
return g1:IsExists(cm.cfilter,1,nil,tp)
else
return rsul.SpecialOrPlaceBool(tp,nil,2)
end
end
if e:GetLabel()==100 then
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g1:FilterSelect(tp,cm.cfilter,1,1,nil,tp)
Duel.Release(rg,REASON_COST)
end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,0,0)
end
--空想的沉吟
function c10122005.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c10122005.target)
e1:SetOperation(c10122005.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10122005,4))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c10122005.setcost)
e2:SetTarget(c10122005.settg)
e2:SetOperation(c10122005.setop)
c:RegisterEffect(e2)
end
function c10122005.rfilter(c,rc)
return c:IsCode(10122011) and c:IsReleasable() and rc:IsSSetable(true)
end
function c10122005.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c10122005.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local g1=Duel.GetReleaseGroup(tp):Filter(Card.IsCode,nil,10122011)
local g2=Duel.GetMatchingGroup(c10122005.rfilter,tp,LOCATION_SZONE,0,nil,c)
if chk==0 then
if e:GetLabel()==1 then
e:SetLabel(0)
return g2:GetCount()>0 or (g1:GetCount()>0 and c:IsSSetable())
else
return c:IsSSetable()
end
end
if e:GetLabel()==1 then
e:SetLabel(0)
g1:Merge(g2)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g1:Select(tp,1,1,nil)
Duel.Release(rg,REASON_COST)
end
end
function c10122005.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if not c:IsAbleToHand() and not c:IsSSetable() then return end
if c:IsAbleToHand() and (not c:IsSSetable() or not Duel.SelectYesNo(tp,aux.Stringid(10122005,5))) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
else
Duel.SSet(tp,c)
Duel.ConfirmCards(1-tp,c)
end
end
function c10122005.desfilter(c)
return c:IsFaceup() and c:IsCode(10122011) and c:IsDestructable()
end
function c10122005.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c10122005.desfilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g1=Duel.SelectTarget(tp,c10122005.desfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
e:SetLabelObject(g1:GetFirst())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g2=Duel.SelectTarget(tp,Card.IsDestructable,tp,0,LOCATION_ONFIELD,1,1,nil)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g1,g1:GetCount(),0,0)
end
function c10122005.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c10122005.tgfilter1),tp,LOCATION_GRAVE,0,nil,tp)
if tg:GetCount()<=0 or not Duel.SelectYesNo(tp,aux.Stringid(10122005,2)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local tc=tg:Select(tp,1,1,nil):GetFirst()
local te=tc:GetActivateEffect()
if tc:IsAbleToHand() and (not te:IsActivatable(tp) or not Duel.SelectYesNo(tp,aux.Stringid(10122005,1))) then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
else
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
end
function c10122005.tgfilter1(c,tp)
return c:IsType(TYPE_FIELD) and (c:IsAbleToHand() or c:GetActivateEffect():IsActivatable(tp)) and c:IsSetCard(0xc333)
end
--空想的低语
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function c10122006.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,0x1e0)
e1:SetTarget(c10122006.target)
e1:SetOperation(c10122006.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10122006,4))
e2:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCost(c10122006.cost)
e2:SetTarget(c10122006.settg)
e2:SetOperation(c10122006.setop)
c:RegisterEffect(e2)
end
function c10122006.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(10122006)==0 end
e:GetHandler():RegisterFlagEffect(10122006,RESET_CHAIN,0,1)
end
function c10122006.desfilter(c)
return c:GetSequence()==5 and c:IsDestructable() and c:IsFaceup() and c:IsSetCard(0xc333)
end
function c10122006.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_SZONE) and chkc:IsControler(tp) and c10122006.desfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10122006.desfilter,tp,LOCATION_SZONE,0,1,nil) and e:GetHandler():IsSSetable() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c10122006.desfilter,tp,LOCATION_SZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_GRAVE)
end
function c10122006.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 and c:IsRelateToEffect(e) and (c:IsSSetable() or c:IsAbleToHand()) then
if c:IsAbleToHand() and (not c:IsSSetable() or not Duel.SelectYesNo(tp,aux.Stringid(10122006,0))) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
else
Duel.SSet(tp,c)
Duel.ConfirmCards(1-tp,c)
end
e:SetLabel(0)
if rsul.thtg(e,tp,eg,ep,ev,re,r,rp,0) and Duel.SelectYesNo(tp,aux.Stringid(10122006,3)) then
rsul.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function c10122006.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc333)
end
function c10122006.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and chkc:IsControler(tp) and c10122006.atkfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10122006.atkfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectTarget(tp,c10122006.atkfilter,tp,LOCATION_ONFIELD,0,1,2,nil)
end
function c10122006.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e):Filter(Card.IsFaceup,nil)
if g:GetCount()<=0 then return end
for tc in aux.Next(g) do
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(10122006,2))
e2:SetProperty(EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetOwnerPlayer(tp)
if Duel.GetTurnPlayer()==tp then
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_SELF_TURN,2)
else
e2:SetReset(RESET_EVENT+0x1fe0000+RESET_PHASE+PHASE_END+RESET_SELF_TURN)
end
e2:SetValue(c10122006.efilter)
tc:RegisterEffect(e2)
if not tc:IsImmuneToEffect(e) and tc:IsLocation(LOCATION_MZONE) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(3000)
tc:RegisterEffect(e1)
end
end
end
function c10122006.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
\ No newline at end of file
--空想的境界限
function c10122007.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10122007,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetHintTiming(TIMING_DAMAGE_STEP)
e1:SetTarget(c10122007.target)
e1:SetOperation(c10122007.activate)
c:RegisterEffect(e1)
end
function c10122007.effectfilter(e,ct)
local p=e:GetHandler():GetControler()
local te,tp=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
return p==tp and te:IsActiveType(TYPE_SPELL) and te:GetHandler():IsType(TYPE_FIELD)
end
function c10122007.acfilter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp) and c:IsSetCard(0xc333)
end
function c10122007.rfilter(c)
return c:IsType(TYPE_FIELD) and c:IsAbleToGrave()
end
function c10122007.tkfilter(c)
return c:IsCode(10122007) and c:IsFaceup()
end
function c10122007.effilter(c)
return c:IsType(TYPE_EFFECT) and c:IsFaceup()
end
function c10122007.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local sel=0
if Duel.IsExistingMatchingCard(c10122007.rfilter,tp,LOCATION_HAND+LOCATION_FZONE,0,1,nil) and Duel.IsExistingMatchingCard(c10122007.acfilter,tp,LOCATION_DECK,0,1,nil,tp) and Duel.GetCurrentPhase()~=PHASE_DAMAGE then sel=sel+1 end
if Duel.IsExistingTarget(c10122007.tkfilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(c10122007.effilter,tp,0,LOCATION_MZONE,1,nil) then sel=sel+2 end
e:SetLabel(sel)
return sel~=0
end
local sel=e:GetLabel()
if sel==3 then
sel=Duel.SelectOption(tp,aux.Stringid(10122007,0),aux.Stringid(10122007,1))+1
elseif sel==1 then
Duel.SelectOption(tp,aux.Stringid(10122007,0))
else
Duel.SelectOption(tp,aux.Stringid(10122007,1))
end
e:SetLabel(sel)
if sel==1 then
e:SetCategory(CATEGORY_TOGRAVE)
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_FZONE+LOCATION_HAND)
else
e:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET)
e:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,c10122007.tkfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
end
function c10122007.activate(e,tp,eg,ep,ev,re,r,rp)
local op=e:GetLabel()
local emg=Duel.GetMatchingGroup(c10122007.effilter,tp,0,LOCATION_MZONE,nil)
if op==1 and Duel.IsExistingMatchingCard(c10122007.rfilter,tp,LOCATION_HAND+LOCATION_FZONE,0,1,nil) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10122007.rfilter,tp,LOCATION_HAND+LOCATION_FZONE,0,1,1,nil)
if Duel.SendtoGrave(g,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_GRAVE) then return end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10122007,5))
local tc=Duel.SelectMatchingCard(tp,c10122007.acfilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
elseif op==2 then
local tc=Duel.GetFirstTarget()
if not tc or tc:IsFacedown() or not tc:IsRelateToEffect(e) or emg:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPPO)
local mg=emg:Select(tp,1,1,nil)
Duel.HintSelection(mg)
local mc=mg:GetFirst()
local code=mc:GetOriginalCodeRule()
tc:CopyEffect(code,RESET_EVENT+0x1fe0000)
if not tc:IsType(TYPE_EFFECT) then
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
e0:SetValue(TYPE_EFFECT)
e0:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e0)
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
--tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(10122007,4))
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT+EFFECT_FLAG_CLIENT_HINT)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetReset(RESET_EVENT+0x1fe0000)
e3:SetValue(mc:GetAttack())
tc:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
e4:SetValue(mc:GetDefense())
tc:RegisterEffect(e4)
end
end
--空想界限 乌托邦的引领神
function c10122008.initial_effect(c)
c:EnableReviveLimit()
--aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionCode,10122011),2,false)
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkCode,10122011),2)
--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(c10122008.splimit)
--c:RegisterEffect(e0)
--special summon rule
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c10122008.sprcon)
e1:SetOperation(c10122008.sprop)
--c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(c10122008.atkval)
--c:RegisterEffect(e2)
--negate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e2:SetDescription(aux.Stringid(10122008,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetCountLimit(1)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c10122008.discon)
e2:SetCost(c10122008.discost)
e2:SetTarget(c10122008.distg)
e2:SetOperation(c10122008.disop)
c:RegisterEffect(e2)
--token
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10122008,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetCondition(c10122008.spcon)
e3:SetTarget(c10122008.sptg)
e3:SetOperation(c10122008.spop)
--c:RegisterEffect(e3)
--avoid battle damage
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_REVERSE_DAMAGE)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa330))
e4:SetValue(1)
c:RegisterEffect(e4)
--indes
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(1)
--c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_CANNOT_REMOVE)
--c:RegisterEffect(e6)
--battle indestructable
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetValue(1)
--c:RegisterEffect(e7)
--immue
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetCode(EFFECT_IMMUNE_EFFECT)
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(c10122008.con)
e8:SetValue(c10122008.efilter)
c:RegisterEffect(e8)
end
function c10122008.efilter(e,te)
return e:GetOwnerPlayer()~=te:GetOwnerPlayer()
end
function c10122008.con(e)
--stack over limit
--if not Duel.IsExistingMatchingCard(c10122017.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler()) then return false end
return Duel.IsExistingMatchingCard(c10122017.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c10122008.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c10122008.sprfilter(c,fc)
return c:IsFusionCode(10122011) and c:IsCanBeFusionMaterial(fc) and not c:IsHasEffect(6205579)
end
function c10122008.sprfilter1(c,tp,g)
return g:IsExists(c10122008.sprfilter2,1,c,tp,c)
end
function c10122008.sprfilter2(c,tp,mc)
return Duel.GetLocationCountFromEx(tp,tp,Group.FromCards(c,mc))>0
end
function c10122008.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetReleaseGroup(tp):Filter(c10122008.sprfilter,nil,c)
return g:IsExists(c10122008.sprfilter1,1,nil,tp,g)
end
function c10122008.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetReleaseGroup(tp):Filter(c10122008.sprfilter,nil,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g1=g:FilterSelect(tp,c10122008.sprfilter1,1,1,nil,tp,g)
local mc=g1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=g:FilterSelect(tp,c10122008.sprfilter2,1,1,mc,tp,mc)
g1:Merge(g2)
c:SetMaterial(g1)
Duel.Release(g1,REASON_COST+REASON_FUSION+REASON_MATERIAL)
end
function c10122008.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousPosition(POS_FACEUP) and not c:IsLocation(LOCATION_DECK)
end
function c10122008.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ft,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ft,0,0)
end
function c10122008.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 or not Duel.IsPlayerCanSpecialSummonMonster(tp,10122011,0xc333,0x4011,0,0,1,RACE_SPELLCASTER,ATTRIBUTE_DARK)then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
for i=1,ft do
local token=Duel.CreateToken(tp,10122011)
Duel.SpecialSummonStep(token,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetDescription(aux.Stringid(10122008,3))
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CLIENT_HINT)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+0x1fe0000)
token:RegisterEffect(e1,true)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetDescription(aux.Stringid(10122008,2))
--token:RegisterEffect(e2,true)
end
Duel.SpecialSummonComplete()
end
function c10122008.discon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and rp~=tp
end
function c10122008.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local g1=Duel.GetReleaseGroup(tp):Filter(Card.IsCode,nil,10122011)
local g2=Duel.GetMatchingGroup(c10122008.rfilter,tp,LOCATION_SZONE,0,nil)
g1:Merge(g2)
if chk==0 then return g1:GetCount()>0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local rg=g1:Select(tp,1,1,nil)
Duel.Release(rg,REASON_COST)
end
function c10122008.rfilter(c)
return c:IsCode(10122011) and c:IsReleasable()
end
function c10122008.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsAbleToRemove() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function c10122008.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateActivation(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c10122008.atkval(e,c)
return Duel.GetMatchingGroupCount(c10122008.atkfilter,c:GetControler(),LOCATION_ONFIELD,0,nil)*1500
end
function c10122008.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc333)
end
--空想的湮灭
function c10122009.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10122009,0))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCost(c10122009.cost)
e1:SetCondition(c10122009.condition)
e1:SetTarget(c10122009.target)
e1:SetOperation(c10122009.activate)
c:RegisterEffect(e1)
--banish
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10122009,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c10122009.rmtg)
e2:SetOperation(c10122009.rmop)
c:RegisterEffect(e2)
end
function c10122009.rmfilter(c)
return c:IsCode(10122011) and c:IsAbleToRemove()
end
function c10122009.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c10122009.rmfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c10122009.rmfilter,tp,LOCATION_ONFIELD,0,5,nil) and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,c10122009.rmfilter,tp,LOCATION_ONFIELD,0,5,5,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
g:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,LOCATION_ONFIELD+LOCATION_GRAVE)
end
function c10122009.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if not g or g:FilterCount(Card.IsRelateToEffect,nil,e)~=5 or g2:GetCount()<=0 then return end
g:Merge(g2)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c10122009.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c10122009.cfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=3 end
local tg=Group.CreateGroup()
for i=1,3 do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local tc=g:Select(tp,1,1,nil):GetFirst()
if tc then
tg:AddCard(tc)
g:Remove(Card.IsCode,nil,tc:GetCode())
end
end
Duel.SendtoGrave(tg,REASON_COST)
end
function c10122009.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp
end
function c10122009.cfilter(c)
return c:IsSetCard(0xc333) and c:IsAbleToGraveAsCost() and c:IsType(TYPE_FIELD)
end
function c10122009.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(1-tp,1) and Duel.IsPlayerCanDraw(tp,1) end
end
function c10122009.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c10122009.repop)
end
function c10122009.acfilter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and c:IsSetCard(0xc333)
end
function c10122009.thfilter(c,tp)
return c:IsType(TYPE_FIELD) and c:IsAbleToHand() and c:IsSetCard(0xc333)
end
function c10122009.repop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)<=0 and Duel.Draw(1-tp,1,REASON_EFFECT)<=0 then return end
local g=Duel.GetMatchingGroup(c10122009.acfilter,tp,0,LOCATION_HAND,nil,tp)
if g:GetCount()<=0 or Duel.SelectYesNo(1-tp,aux.Stringid(10122009,2)) then return end
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10122009,3))
local tc=g:Select(tp,1,1,nil):GetFirst()
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
--空想的轮回
function c10122012.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10122012,3))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c10122012.target)
e1:SetOperation(c10122012.operation)
c:RegisterEffect(e1)
end
function c10122012.dhfilter(c)
return c:IsSetCard(0xc333) and c:IsDiscardable()
end
function c10122012.thfilter(c)
return c:IsSetCard(0xc333) and c:IsAbleToHand() and not c:IsCode(10122012)
end
function c10122012.refilter(c)
return c:IsCode(10122011) and c:IsReleasableByEffect()
end
function c10122012.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local b1=Duel.IsExistingMatchingCard(c10122012.dhfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,2)
local b2=Duel.IsExistingMatchingCard(c10122012.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
local b3=Duel.IsExistingMatchingCard(c10122012.refilter,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerCanDraw(tp,1)
if chk==0 then return b1 or b2 or b3 end
local ops={}
local opval={}
local off=1
if b1 then
ops[off]=aux.Stringid(10122012,0)
opval[off-1]=1
off=off+1
end
if b2 then
ops[off]=aux.Stringid(10122012,1)
opval[off-1]=2
off=off+1
end
if b3 then
ops[off]=aux.Stringid(10122012,2)
opval[off-1]=3
off=off+1
end
local op=Duel.SelectOption(tp,table.unpack(ops))
local sel=opval[op]
e:SetLabel(sel)
if sel==1 then
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e:SetCategory(CATEGORY_HANDES+CATEGORY_DRAW)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
elseif sel==2 then
e:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
else
e:SetCategory(CATEGORY_RELEASE+CATEGORY_DRAW)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function c10122012.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sel=e:GetLabel()
local b1=Duel.IsExistingMatchingCard(c10122012.dhfilter,tp,LOCATION_HAND,0,1,nil) and Duel.IsPlayerCanDraw(tp,2)
local b2=Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c10122012.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil)
local b3=Duel.CheckReleaseGroup(tp,c10122012.refilter,1,nil) and Duel.IsPlayerCanDraw(tp,1)
if sel==1 and b1 then
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.DiscardHand(p,c10122012.dhfilter,1,1,REASON_EFFECT+REASON_DISCARD)~=0 then
Duel.Draw(p,d,REASON_EFFECT)
end
elseif sel==2 and b2 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c10122012.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
elseif sel==3 and b3 then
local sg=Duel.SelectReleaseGroup(tp,c10122012.refilter,1,1,nil)
if Duel.Release(sg,REASON_EFFECT)~=0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--深层空想 恶魂之冢
local m=10122013
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.GraveDestroyActivateEffect(c,m)
local e3=rsef.FTO(c,EVENT_SUMMON_SUCCESS,{m,0},nil,"tk,sp","de",LOCATION_FZONE,cm.con,nil,rsul.TokenTg(1),rsul.TokenOp(rsul.advtkop))
local e4=rsef.RegisterClone(c,e3,"code",EVENT_SPSUMMON_SUCCESS)
end
function cm.cfilter(c,tp)
return c:GetSummonPlayer()~=tp
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
--深层空想 失落雨林
local m=10122014
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.GraveDestroyActivateEffect(c,m)
local e3=rsef.FTO(c,EVENT_CHAIN_SOLVING,{m,0},nil,"tk,sp","de",LOCATION_FZONE,cm.con,nil,rsul.TokenTg(1),rsul.TokenOp(rsul.advtkop))
end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
end
--深层空想 死域之海
local m=10122015
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.GraveDestroyActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp",nil,LOCATION_FZONE,nil,rscost.reglabel(100),cm.tg,nil,rsul.hint)
end
function cm.cfilter(c,tp)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0xc333)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if e:GetLabel()~=100 then return false end
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE,0,1,nil) and rsul.SpecialOrPlaceBool(tp)
end
local ct=rsul.SpecialOrPlaceBool(tp,nil,2) and 2 or 1
rsof.SelectHint(tp,"rm")
local rg=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE,0,1,ct,nil,tp)
Duel.Remove(rg,POS_FACEUP,REASON_COST)
e:SetOperation(rsul.TokenOp(rsul.advtkop,nil,#rg))
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,ct,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,ct,0,0)
end
--深层空想 燃魂沙丘
local m=10122016
local cm=_G["c"..m]
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsul.GraveDestroyActivateEffect(c,m)
local e3=rsef.QO(c,nil,{m,0},1,"tk,sp",nil,LOCATION_FZONE,nil,nil,cm.tg,nil,rsul.hint)
if cm.counter==nil then
cm.counter=true
cm[0]=0
cm[1]=0
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(cm.ctop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAIN_NEGATED)
ge2:SetOperation(cm.ctop2)
Duel.RegisterEffect(ge2,0)
local ge3=ge1:Clone()
ge3:SetCode(4179255)
ge3:SetOperation(cm.ctop)
Duel.RegisterEffect(ge3,0)
local ge4=ge1:Clone()
ge4:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge4:SetOperation(cm.ctop3)
Duel.RegisterEffect(ge4,0)
end
end
function cm.ctop3(e,tp,eg,ep,ev,re,r,rp)
cm[0]=0
cm[1]=0
end
function cm.ctop(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsType(TYPE_FIELD) then return end
cm[rp]=cm[rp]+1
end
function cm.ctop2(e,tp,eg,ep,ev,re,r,rp)
if not re:IsHasType(EFFECT_TYPE_ACTIVATE) or not re:GetHandler():IsType(TYPE_FIELD) then return end
cm[rp]=cm[rp]-1
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return cm[tp]>0 and rsul.SpecialOrPlaceBool(tp) end
e:SetOperation(rsul.TokenOp(cm.op,nil,1,cm[tp]))
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.op(c)
rsef.SV_LIMIT(c,"ress",1,nil,rsreset.est,nil,{m,3})
end
--乌托兰的织梦人
if not pcall(function() require("expansions/script/c10122001") end) then require("script/c10122001") end
function c10122017.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_TOKEN),1,1)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetCondition(c10122017.con)
e1:SetValue(10122011)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c10122017.con)
e2:SetValue(aux.imval1)
--c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10122017,0))
e3:SetCategory(CATEGORY_TOKEN+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,10122017)
e3:SetHintTiming(0,0x1e0)
e3:SetCondition(c10122017.con2)
e3:SetTarget(rsul.TokenTg(1))
e3:SetOperation(rsul.TokenOp(c10122017.op,true))
c:RegisterEffect(e3)
--immue
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(c10122017.con)
e4:SetValue(c10122017.efilter)
c:RegisterEffect(e4)
end
function c10122017.efilter(e,te)
return e:GetOwnerPlayer()~=te:GetOwnerPlayer()
end
function c10122017.con2(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function c10122017.con(e)
--stack over limit
--if not Duel.IsExistingMatchingCard(c10122017.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler()) then return false end
return Duel.IsExistingMatchingCard(c10122017.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c10122017.tgfilter2(c)
--return c:IsFaceup() and (c:GetOriginalCode()==10122011 or (c:IsHasEffect(10122018) and c:IsCode(10122011)))
return c:IsFaceup() and ((c:IsType(TYPE_TOKEN) and c:IsCode(10122011)) or (c:IsHasEffect(10122018) and c:IsCode(10122011)))
end
function c10122017.tgfilter(c)
return c:IsFaceup() and c:IsCode(10122011)
end
function c10122017.op(c,tc)
rsef.SV_CANNOT_BE_MATERIAL(c,"link",1,nil,rsreset.est_pend,nil,{10122017,2})
rsef.SV_LIMIT(c,"ress",1,nil,rsreset.est,nil,{10122017,1})
end
--乌托兰的盗梦者
function c10122018.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkCode,10122011),2,2)
--
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetRange(LOCATION_MZONE)
e0:SetCode(10122018)
c:RegisterEffect(e0)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(10122011)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.imval1)
--c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(1)
--c:RegisterEffect(e3)
--immue
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10122018,0))
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1)
e4:SetHintTiming(0,0x1e0)
e4:SetCost(c10122018.cost)
e4:SetTarget(c10122018.tg)
e4:SetOperation(c10122018.op)
--c:RegisterEffect(e4)
--target
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc333))
e5:SetValue(1)
c:RegisterEffect(e5)
--battle indestructable
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(LOCATION_MZONE,0)
e7:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc333))
e7:SetValue(1)
c:RegisterEffect(e7)
--inactivatable
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD)
e8:SetCode(EFFECT_CANNOT_INACTIVATE)
e8:SetRange(LOCATION_MZONE)
e8:SetValue(c10122018.effectfilter)
c:RegisterEffect(e8)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_FIELD)
e9:SetCode(EFFECT_CANNOT_DISEFFECT)
e9:SetRange(LOCATION_MZONE)
e9:SetValue(c10122018.effectfilter2)
c:RegisterEffect(e9)
--cannot disable
local e10=Effect.CreateEffect(c)
e10:SetType(EFFECT_TYPE_FIELD)
e10:SetCode(EFFECT_CANNOT_DISABLE)
e10:SetRange(LOCATION_MZONE)
e10:SetTargetRange(0xff,0)
e10:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc333))
c:RegisterEffect(e10)
end
function c10122018.effectfilter2(e,ev)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler():IsSetCard(0xc333) --and bit.band(loc,LOCATION_ONFIELD+LOCATION_GRAVE)~=0
end
function c10122018.effectfilter(e,ev)
local p=e:GetHandler():GetControler()
local te,tp,loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER,CHAININFO_TRIGGERING_LOCATION)
return p==tp and te:GetHandler():IsSetCard(0xc333)
end
function c10122018.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,Card.IsCode,1,nil,10122011) end
local g=Duel.SelectReleaseGroup(tp,Card.IsCode,1,1,nil,10122011)
Duel.Release(g,REASON_COST)
end
function c10122018.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CARDTYPE)
e:SetLabel(Duel.AnnounceType(tp))
end
function c10122018.op(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xc333))
e1:SetValue(c10122018.efilter)
e1:SetLabel(e:GetLabel())
Duel.RegisterEffect(e1,tp)
end
function c10122018.efilter(e,te)
local etype=e:GetLabel()
return te:GetOwnerPlayer()~=e:GetHandlerPlayer() and ((te:IsActiveType(TYPE_MONSTER) and etype==1) or (te:IsActiveType(TYPE_SPELL) and etype==2) or (te:IsActiveType(TYPE_TRAP) and etype==3))
end
--乌托兰的造访者
function c10122019.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkCode,10122011),2,2)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetCondition(c10122019.con)
e1:SetValue(10122011)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetValue(aux.imval1)
--c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e3:SetValue(1)
--c:RegisterEffect(e3)
--activate
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(10122019,0))
e4:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e4:SetCategory(CATEGORY_TODECK+CATEGORY_RECOVER)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetCountLimit(1,10122019)
e4:SetCondition(c10122019.con2)
e4:SetTarget(c10122019.tg)
e4:SetOperation(c10122019.op)
c:RegisterEffect(e4)
--immue
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(c10122019.con)
e5:SetValue(c10122019.efilter)
c:RegisterEffect(e5)
end
function c10122019.efilter(e,te)
return e:GetOwnerPlayer()~=te:GetOwnerPlayer()
end
function c10122019.con(e)
--stack over limit
--if not Duel.IsExistingMatchingCard(c10122019.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler()) then return false end
return Duel.IsExistingMatchingCard(c10122019.tgfilter2,e:GetHandlerPlayer(),LOCATION_ONFIELD,0,1,e:GetHandler())
end
function c10122019.tgfilter2(c)
--return c:IsFaceup() and (c:GetOriginalCode()==10122011 or (c:IsHasEffect(10122018) and c:IsCode(10122011)))
return c:IsFaceup() and ((c:IsType(TYPE_TOKEN) and c:IsCode(10122011)) or (c:IsHasEffect(10122018) and c:IsCode(10122011)))
end
function c10122019.tgfilter(c)
return c:IsFaceup() and c:IsCode(10122011)
end
function c10122019.cfilter(c,tp)
return c:IsFaceup() and c:IsCode(10122011) and c:IsControler(tp)
end
function c10122019.con2(e,tp,eg,ep,ev,re,r,rp)
return eg and eg:IsExists(c10122019.cfilter,1,e:GetHandler(),tp)
end
function c10122019.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp) and c:IsSetCard(0xc333)
end
function c10122019.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10122019.filter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,0,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,0)
end
function c10122019.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10122020,0))
local tc=Duel.SelectMatchingCard(tp,c10122019.filter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(c10122019.tdfilter),tp,LOCATION_GRAVE,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(10122019,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=g:Select(tp,1,999,nil)
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)~=0 then
local ct=Duel.GetOperatedGroup():FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
Duel.Recover(tp,ct*800,REASON_EFFECT)
end
end
end
end
function c10122019.tdfilter(c)
return c:IsSetCard(0xc333) and c:IsAbleToDeck()
end
--乌托兰最深层-迷失域的主人
function c10122020.initial_effect(c)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(10122011)
c:RegisterEffect(e1)
--activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10122020,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,0x1e0)
e2:SetRange(LOCATION_MZONE+LOCATION_HAND)
e2:SetCondition(c10122020.condition)
e2:SetCost(c10122020.cost)
e2:SetTarget(c10122020.target)
e2:SetOperation(c10122020.operation)
e2:SetLabel(LOCATION_DECK)
c:RegisterEffect(e2)
--activate2
local e3=e2:Clone()
e3:SetRange(LOCATION_GRAVE)
e3:SetCondition(aux.TRUE)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c10122020.target)
e3:SetOperation(c10122020.operation)
e3:SetLabel(LOCATION_HAND)
c:RegisterEffect(e3)
end
function c10122020.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c10122020.cost(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 c10122020.filter(c,tp)
return c:IsType(TYPE_FIELD) and c:GetActivateEffect():IsActivatable(tp,true) and c:IsSetCard(0xc333)
end
function c10122020.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10122020.filter,tp,e:GetLabel(),0,1,nil,tp) end
end
function c10122020.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(10122020,0))
local tc=Duel.SelectMatchingCard(tp,c10122020.filter,tp,e:GetLabel(),0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
Duel.RaiseEvent(tc,4179255,te,0,tp,tp,Duel.GetCurrentChain())
end
end
--乌托兰的梦魇
function c10122021.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkCode,10122011),1,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(10122021)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
c:RegisterEffect(e1)
end
--幻层驱动器 阻隔层
if not pcall(function() require("expansions/script/c10199990") end) then require("script/c10199990") end
local m=10130001
local cm=_G["c"..m]
if not rsv.QuantumDriver then
rsv.QuantumDriver={}
rsqd=rsv.QuantumDriver
function rsqd.FlipFun(c,code,cate,tg,op)
local e1=rsef.STO(c,EVENT_FLIP,{code,0},{1,code},{cate,"pos"},"de",nil,nil,tg,rsqd.flipop(op))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
return e1
end
function rsqd.flipop(extraop)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=rscf.GetRelationThisCard(e)
if c and not c:IsStatus(STATUS_BATTLE_DESTROYED) and not c:IsStatus(STATUS_DESTROY_CONFIRMED) and c:IsCanTurnSet() and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.ChangePosition(c,POS_FACEDOWN_DEFENSE)
end
extraop(e,tp,eg,ep,ev,re,r,rp)
end
end
function rsqd.FlipFun2(c,code,cate,flag,tg,op)
local e1=rsef.STO(c,EVENT_FLIP,{code,0},{1,code+100},{cate,"pos"},{"de",flag},nil,nil,tg,op)
local e2=rsef.RegisterClone(c,e1,"code",EVENT_TO_GRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_FLIP+EFFECT_TYPE_TRIGGER_O)
return e1,e2
end
function rsqd.SetFun(tc,e,tp)
if tc:IsType(TYPE_SPELL+TYPE_TRAP) then
Duel.SSet(tp,Group.FromCards(tc))
Duel.ConfirmCards(1-tp,tc)
else
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,tc)
end
end
end
function rsqd.SetFilter(c,e,tp)
return ((c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE))) or (c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable())
end
function rsqd.SetCode(c)
if not rsqd.SetFun_Switch then
rsqd.SetFun_Switch=true
local e1=rsef.FC({c,0},EVENT_CHANGE_POS)
e1:RegisterSolve(rsqd.setcon,nil,nil,rsqd.setop)
local e2=rsef.RegisterClone({c,0},e1,"code",EVENT_SPSUMMON_SUCCESS)
local e3=rsef.RegisterClone({c,0},e1,"code",EVENT_MSET)
end
end
function rsqd.setop(e,tp,eg,ep,ev,re,r,rp)
local sg=eg:Filter(Card.IsFacedown,nil)
if #sg>0 then
Duel.RaiseEvent(sg,m,e,REASON_EFFECT,rp,ep,ev)
end
end
function rsqd.shcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function rsqd.shfilter(c)
return c:IsFacedown() and c:GetSequence()<5
end
function rsqd.ShuffleOp(e,tp)
local sg=Duel.GetMatchingGroup(rsqd.shfilter,tp,LOCATION_MZONE,0,nil)
Duel.ShuffleSetCard(sg)
end
function rsqd.ContinuousFun(c)
--local e1=rsef.SV_IMMUNE_EFFECT(c,nil,rscon.excard(Card.IsFacedown,LOCATION_MZONE))
local e2=rsef.FTO(c,m,{m,3},nil,nil,"de,dsp",LOCATION_SZONE,rsqd.shcon,nil,rsop.target(rsqd.shfilter,nil,LOCATION_MZONE),rsqd.ShuffleOp)
--return e1,e2
return e2
end
---------------
end
---------------
if cm then
function cm.initial_effect(c)
rsqd.SetCode(c)
local e1=rsqd.FlipFun(c,m,"se,th",rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.op)
local e2=rsef.FTO(c,m,{m,1},{1,m+100},"sp","de,dsp",LOCATION_HAND,cm.spcon,nil,rsop.target(cm.spfilter,"sp"),cm.spop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.thfilter(c)
return c:IsSetCard(0xa336) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.op(e,tp)
rsof.SelectHint(tp,"th")
local tg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #tg>0 then
Duel.SendtoHand(tg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg)
end
end
function cm.spcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if c and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,c)
end
end
---------------
end
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130002
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsqd.FlipFun(c,m,"sp",cm.tg,cm.op)
local e2=rsef.FTO(c,EVENT_FLIP,{m,1},{1,m+100},"sp","de,dsp",LOCATION_HAND,cm.spcon,nil,rsop.target(cm.spfilter,"sp"),cm.spop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>2 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,0,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,0,tp,LOCATION_DECK)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,3)
local g=Duel.GetDecktopGroup(tp,3)
if #g<=0 then return end
if not g:IsExists(rsqd.SetFilter,1,nil,e,tp) or not Duel.SelectYesNo(tp,aux.Stringid(m,2)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=g:FilterSelect(tp,rsqd.SetFilter,1,1,nil,e,tp):GetFirst()
rsqd.SetFun(tc,e,tp)
end
function cm.spcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.spfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if c and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,c)
end
end
\ No newline at end of file
--幻层驱动 壳层
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130003
local cm=_G["c"..m]
function cm.initial_effect(c)
rsqd.SetCode(c)
local e1=rsqd.FlipFun(c,m,"des",rsop.target(aux.TRUE,"des",LOCATION_ONFIELD,LOCATION_ONFIELD),cm.op)
local e2=rsef.FTO(c,10130001,{m,1},{1,m+100},nil,"de,dsp",LOCATION_HAND,cm.actcon,rscost.cost(Card.IsDiscardable,"dish"),rsop.target(cm.actfilter,nil,LOCATION_DECK),cm.actop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.op(e,tp)
rsof.SelectHint(tp,"des")
local dg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #dg>0 then
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
function cm.actcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.actfilter(c,e,tp)
return c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xa336) and c:GetActivateEffect():IsActivatable(tp)
end
function cm.actop(e,tp)
rsof.SelectHint(tp,rshint.act)
local tc=Duel.SelectMatchingCard(tp,cm.actfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
\ No newline at end of file
--幻层驱动 硬化层
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130004
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsqd.FlipFun(c,m,"atk,def,dis",rsop.target(cm.disfilter,"dis",LOCATION_MZONE,LOCATION_ONFIELD),cm.op)
local e2=rsef.FTO(c,EVENT_FLIP,{m,1},{1,m+100},"sp","de,dsp",LOCATION_HAND,cm.setcon,rscost.cost(Card.IsDiscardable,"dish"),rsop.target(cm.setfilter,nil,LOCATION_DECK),cm.setop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.disfilter(c)
return c:IsFaceup() and not (c:IsAttack(0) and c:IsDefense(0) and c:IsDisabled())
end
function cm.op(e,tp)
local c=e:GetHandler()
rsof.SelectHint(tp,"dis")
local tc=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if not tc then return end
Duel.HintSelection(rsgf.Mix2(tc))
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1,e2=rsef.SV_SET({c,tc},"atkf,deff",0,nil,rsreset.est,"cd")
local e3,e4=rsef.SV_LIMIT({c,tc},"dis,dise",nil,nil,rsreset.est,"cd")
end
function cm.setcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.setfilter(c,e,tp)
if not c:IsSetCard(0xa336) or c:IsCode(m) then return false end
return rsqd.SetFilter(c,e,tp)
end
function cm.setop(e,tp)
rsof.SelectHint(tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
rsqd.SetFun(tc,e,tp)
end
\ No newline at end of file
--幻层驱动 填充层
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130005
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsqd.FlipFun(c,m,"sp,th",rsop.target2(cm.fun,cm.setfilter,nil,LOCATION_DECK),cm.op)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},"pos",nil,LOCATION_HAND,nil,c.cost,rsop.target(cm.posfilter,"pos",LOCATION_MZONE),cm.posop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.fun(g,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE)
end
function cm.setfilter(c,e,tp)
if not c:IsSetCard(0xa336) or c:IsCode(m) then return false end
if c:IsAbleToHand() then return true end
return rsqd.SetFilter(c,e,tp)
end
function cm.op(e,tp)
rsof.SelectHint(tp,HINTMSG_SELF)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.setfilter),tp,LOCATION_GRAVE,0,1,1,nil):GetFirst()
if not tc then return end
local b1=tc:IsAbleToHand()
local b2=rsqd.SetFilter(tc,e,tp)
if b1 and (not b2 or Duel.SelectOption(tp,1190,aux.Stringid(m,2))==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
rsqd.SetFun(tc,e,tp)
end
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function cm.posfilter(c)
return c:IsFacedown() and c:IsSetCard(0xa336)
end
function cm.posop(e,tp)
rsof.SelectHint(tp,"pos")
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEUP_DEFENSE)
end
end
\ No newline at end of file
--幻层驱动器 真空层
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130006
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsqd.FlipFun(c,m,"def",nil,cm.op)
local e2=rsef.QO(c,nil,{m,1},{1,m+100},"pos",nil,LOCATION_HAND,nil,c.cost,rsop.target(cm.posfilter,"pos",LOCATION_MZONE),cm.posop)
cm.QuantumDriver_EffectList={e1,e2}
end
function cm.op(e,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa336))
e1:SetValue(200)
Duel.RegisterEffect(e1,tp)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_PUBLIC)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
end
function cm.posfilter(c)
return c:IsCanTurnSet() and c:IsSetCard(0xa336)
end
function cm.posop(e,tp)
rsof.SelectHint(tp,"pos")
local g=Duel.SelectMatchingCard(tp,cm.posfilter,tp,LOCATION_MZONE,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--幻层驱动 导流层
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130007
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsef.FV_UPDATE(c,"def",800,aux.TargetBoolFunction(Card.IsSetCard,0xa336),{LOCATION_MZONE,0})
local e3=rsqd.ContinuousFun(c)
--Extra summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,0))
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(LOCATION_HAND,0)
e4:SetCode(EFFECT_EXTRA_SET_COUNT)
c:RegisterEffect(e4)
--Pos Change
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SET_POSITION)
e5:SetRange(LOCATION_SZONE)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa336))
e5:SetTargetRange(LOCATION_MZONE,0)
e5:SetValue(POS_FACEUP_DEFENSE)
c:RegisterEffect(e5)
end
\ No newline at end of file
--幻层驱动 联动骨架
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130008
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsef.FV_CANNOT_BE_TARGET(c,"effect",aux.tgoval,aux.TargetBoolFunction(Card.IsSetCard,0xa336),{LOCATION_MZONE,0},cm.con)
local e3=rsef.FV_INDESTRUCTABLE(c,"effect",aux.indoval,cm.tg,{LOCATION_ONFIELD,0},cm.con)
local e4=rsef.FV_IMMUNE_EFFECT(c,rsval.imoe,cm.imtg,{LOCATION_ONFIELD,0},cm.con2)
local e5=rsqd.ContinuousFun(c)
end
function cm.cfilter(c)
return c:IsSetCard(0xa336) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsType(TYPE_CONTINUOUS) and c:IsFaceup()
end
function cm.con(e,tp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_ONFIELD,0,2,nil)
end
function cm.cfilter2(c)
return c:IsSetCard(0xa336) or c:IsFacedown()
end
function cm.con2(e,tp)
return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_MZONE,0,2,nil)
end
function cm.tg(e,c)
return c:IsSetCard(0xa336) or c:IsFacedown()
end
function cm.imtg(e,c)
return c:IsSetCard(0xa336) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
\ No newline at end of file
--幻层驱动 超Ω构筑
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130009
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,true)
local e2=rsef.QO(c,nil,{m,1},{1,m},"pos",nil,LOCATION_MZONE,nil,rscost.cost(Card.IsCanTurnSet,{nil,cm.fun}),nil,cm.op)
local e3,e4=rsqd.FlipFun2(c,m,"dr","ptg",cm.drtg,cm.drop)
cm.QuantumDriver_EffectList={e3,e2}
end
function cm.fun(g,e,tp)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
function cm.op(e,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PUBLIC)
e1:SetTargetRange(0,LOCATION_HAND)
e1:SetReset(rsreset.pend,2)
Duel.RegisterEffect(e1,tp)
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
rsqd.ShuffleOp(e,tp)
rsof.SelectHint(1-tp,"pos")
local tg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(tg)
Duel.ChangePosition(tg,POS_FACEUP_DEFENSE)
end
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
if Duel.Draw(p,d,REASON_EFFECT)==2 then
Duel.ShuffleHand(p)
Duel.BreakEffect()
Duel.DiscardHand(p,nil,1,1,REASON_EFFECT+REASON_DISCARD)
end
end
--幻层驱动 超Ψ构筑
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130010
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,true)
local e2=rsef.QO(c,nil,{m,1},{1,m},"pos",nil,LOCATION_MZONE,nil,rscost.cost(Card.IsCanTurnSet,{nil,cm.fun}),nil,cm.op)
local e3,e4=rsqd.FlipFun2(c,m,"des,rm",nil,rsop.target(Card.IsAbleToRemove,"des,rm",LOCATION_ONFIELD,LOCATION_ONFIELD),cm.desop2)
cm.QuantumDriver_EffectList={e3,e2}
end
function cm.fun(g,e,tp)
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
function cm.op(e,tp)
local c=e:GetHandler()
local e1=rsef.FC({c,tp},EVENT_PHASE+PHASE_END,{m,0},1,nil,nil,cm.descon,cm.desop,{rsreset.pend,2})
e1:SetLabel(Duel.GetTurnCount())
local g=Duel.GetMatchingGroup(Card.IsFacedown,tp,LOCATION_MZONE,0,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
rsqd.ShuffleOp(e,tp)
rsof.SelectHint(1-tp,"pos")
local tg=g:Select(1-tp,1,1,nil)
Duel.HintSelection(tg)
Duel.ChangePosition(tg,POS_FACEUP_DEFENSE)
end
end
function cm.descon(e,tp)
return Duel.GetTurnCount()~=e:GetLabel() and Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP)
end
function cm.desop(e,tp)
Duel.Hint(HINT_CARD,0,m)
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.Destroy(g,REASON_EFFECT)
end
function cm.desop2(e,tp)
rsof.SelectHint(tp,"des")
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)
end
end
\ No newline at end of file
--应急核心
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130011
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e4=rsqd.ContinuousFun(c)
--pos
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_POSITION)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DAMAGE_STEP_END)
e2:SetRange(LOCATION_SZONE)
e2:SetCondition(cm.poscon)
e2:SetOperation(cm.posop)
c:RegisterEffect(e2)
--defense attack
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_DEFENSE_ATTACK)
e3:SetRange(LOCATION_SZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0xa336))
e3:SetValue(1)
c:RegisterEffect(e3)
end
function cm.checkfilter(c,tp)
if not c then return false end
return c:IsControler(tp) and c:IsSetCard(0xa336) and c:IsCanTurnSet() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.poscon(e,tp,eg)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
return cm.checkfilter(a,tp) or cm.checkfilter(d,tp)
end
function cm.posop(e,tp)
local a=Duel.GetAttacker()
local d=Duel.GetAttackTarget()
local list={a,d}
local g=Group.CreateGroup()
for _,tc in pairs(list) do
if cm.checkfilter(tc,tp) then
rsgf.Mix(g,tc)
end
end
if #g>0 then
Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
end
end
\ No newline at end of file
--量子驱动组装
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130012
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c,nil,nil,nil,"sp")
e1:RegisterSolve(nil,nil,cm.tg,cm.act)
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and c:IsSetCard(0xa336)
end
function cm.resfilter(c,tp)
return c:IsSetCard(0xa336) and Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
local b2=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.CheckReleaseGroupEx(tp,cm.resfilter,1,nil,tp)
if chk==0 then return b1 or b2 end
local op=rsof.SelectOption(tp,b1,{m,0},b2,{m,1})
e:SetLabel(op)
if op==1 then
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,tp,LOCATION_HAND+LOCATION_MZONE)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function cm.actfilter(c,e,tp)
return c:IsType(TYPE_CONTINUOUS) and c:IsSetCard(0xa336) and c:GetActivateEffect():IsActivatable(tp)
end
function cm.act(e,tp)
local op=e:GetLabel()
if op==1 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,math.min(2,ft),nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg)
end
else
local b2=Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.CheckReleaseGroupEx(tp,cm.resfilter,1,nil,tp)
if not b2 then return end
local rg=Duel.SelectReleaseGroupEx(tp,cm.resfilter,1,1,nil,tp)
if Duel.Release(rg,REASON_EFFECT)<=0 then return end
rsof.SelectHint(tp,"sp")
local sg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #sg>0 and Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)>0 then
Duel.ConfirmCards(1-tp,sg)
if Duel.IsExistingMatchingCard(cm.actfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
Duel.BreakEffect()
rsof.SelectHint(tp,rshint.act)
local tc=Duel.SelectMatchingCard(tp,cm.actfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local te=tc:GetActivateEffect()
local tep=tc:GetControler()
local cost=te:GetCost()
if cost then cost(te,tep,eg,ep,ev,re,r,rp,1) end
end
end
end
end
\ No newline at end of file
--量子驱动 Δ构筑
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130013
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.lfilter,1,1)
c:EnableReviveLimit()
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_MZONE,nil,nil,rsop.target(cm.spfilter,"sp",LOCATION_HAND),cm.op)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
c:RegisterEffect(e2)
cm.QuantumDriver_EffectList={nil,e1}
end
function cm.lfilter(c)
return c:IsLinkType(TYPE_FLIP) and c:IsSetCard(0xa336)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xa336) and c:IsType(TYPE_FLIP) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
rsof.SelectHint(tp,"sp")
local sc=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp):GetFirst()
if not sc or Duel.SpecialSummon(sc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)<=0 then return end
Duel.ConfirmCards(1-tp,sc)
local effectlist=sc.QuantumDriver_EffectList
if not effectlist or not effectlist[1] then return end
local te=effectlist[1]
local tg=te:GetTarget()
if tg and not tg(e,tp,eg,ep,ev,re,r,rp,0) then return end
if not Duel.SelectYesNo(tp,aux.Stringid(m,1)) then return end
local op=te:GetOperation()
op(e,tp,eg,ep,ev,re,r,rp)
end
--量子驱动 聚变核心
if not pcall(function() require("expansions/script/c10130001") end) then require("script/c10130001") end
local m=10130014
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=rsef.ACT(c)
local e2=rsef.FTO(c,10130001,{m,0},nil,"rm","de,dsp",LOCATION_SZONE,rsqd.shcon,nil,rsop.target(rsqd.shfilter,nil,LOCATION_MZONE),cm.op)
local e3=rsef.FTO(c,EVENT_FLIP,{m,1},nil,"rm","de,dsp",LOCATION_SZONE,cm.rmcon,nil,cm.rmtg,cm.rmop)
end
function cm.op(e,tp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_EXTRA,nil)
if #g>0 and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
local rg=g:RandomSelect(tp,1)
Duel.Remove(rg,POS_FACEDOWN,REASON_EFFECT)
end
rsqd.ShuffleOp(e,tp)
end
function cm.rmcon(e,tp,eg)
return eg:IsExists(Card.IsControler,1,nil,tp)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local rg=Duel.GetDecktopGroup(tp,3)
if chk==0 then return rg:FilterCount(Card.IsAbleToRemove,nil)==3 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,1-tp,LOCATION_DECK)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end
local g=Duel.GetDecktopGroup(1-tp,3)
Duel.DisableShuffleCheck()
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetDescription(1164)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetTarget(cid.stg)
e1:SetOperation(cid.sop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetCost(cid.cost)
e3:SetTarget(cid.tg)
e3:SetOperation(cid.op)
c:RegisterEffect(e3)
end
function cid.cfilter(c)
if not c:IsSetCard(0xc97) or not c:IsType(TYPE_MONSTER) then return false end
if c:IsLocation(LOCATION_HAND) then return c:IsDiscardable(REASON_EFFECT)
else return c:IsAbleToRemove() end
end
function cid.spfilter(c,e,tp,t)
if not c:IsSetCard(0x6c97) then return false end
if not t then t={
[TYPE_FUSION]=SUMMON_TYPE_FUSION,
[TYPE_SYNCHRO]=SUMMON_TYPE_SYNCHRO,
[TYPE_BIGBANG]=SUMMON_TYPE_BIGBANG,
[TYPE_EVOLUTE]=SUMMON_TYPE_EVOLUTE,
} end
local st=t[c:GetType()&TYPE_EXTRA]
return st~=nil and c:IsCanBeSpecialSummoned(e,st,tp,false,false)
end
function cid.stg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable(REASON_EFFECT) and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,c)
and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cid.sop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local mg=Duel.GetMatchingGroup(cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
if not c:IsRelateToEffect(e) or #mg<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g=mg:Select(tp,2,2,nil)+c
local t={
[TYPE_FUSION]=SUMMON_TYPE_FUSION,
[TYPE_SYNCHRO]=SUMMON_TYPE_SYNCHRO,
[TYPE_BIGBANG]=SUMMON_TYPE_BIGBANG,
[TYPE_EVOLUTE]=SUMMON_TYPE_EVOLUTE,
}
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,t):GetFirst()
if sc then
sc:SetMaterial(g)
Duel.Remove(g:Filter(Card.IsLocation,nil,LOCATION_GRAVE),POS_FACEUP,REASON_EFFECT)
Duel.SendtoGrave(g:Filter(Card.IsLocation,nil,LOCATION_HAND),REASON_EFFECT+REASON_DISCARD)
Duel.BreakEffect()
Duel.SpecialSummon(sc,t[sc:GetType()&TYPE_EXTRA],tp,tp,false,false,POS_FACEUP)
end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.op(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
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetTarget(cid.xtg)
e1:SetOperation(cid.xop)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetCost(cid.cost)
e3:SetTarget(cid.tg)
e3:SetOperation(cid.op)
c:RegisterEffect(e3)
end
function cid.cfilter(c)
if not c:IsSetCard(0xc97) or not c:IsType(TYPE_MONSTER) then return false end
if c:IsLocation(LOCATION_HAND) then return c:IsDiscardable(REASON_EFFECT)
else return c:IsAbleToRemove() end
end
function cid.spfilter(c,e,tp,t)
if not c:IsSetCard(0x9c97) then return false end
if not t then t={
[TYPE_XYZ]=SUMMON_TYPE_XYZ,
[TYPE_LINK]=SUMMON_TYPE_LINK,
[TYPE_TIMELEAP]=SUMMON_TYPE_BIGBANG,
[TYPE_SPATIAL]=SUMMON_TYPE_EVOLUTE,
} end
local st=t[c:GetType()&TYPE_EXTRA]
return st~=nil and c:IsCanBeSpecialSummoned(e,st,tp,false,false)
end
function cid.xtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable(REASON_EFFECT) and Duel.GetLocationCountFromEx(tp)>0
and Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,2,c)
and Duel.IsExistingMatchingCard(cid.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cid.xop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local mg=Duel.GetMatchingGroup(cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,c)
if not c:IsRelateToEffect(e) or #mg<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SMATERIAL)
local g=mg:Select(tp,2,2,nil)+c
local t={
[TYPE_XYZ]=SUMMON_TYPE_XYZ,
[TYPE_LINK]=SUMMON_TYPE_LINK,
[TYPE_TIMELEAP]=SUMMON_TYPE_BIGBANG,
[TYPE_SPATIAL]=SUMMON_TYPE_EVOLUTE,
}
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cid.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,t):GetFirst()
if sc then
sc:SetMaterial(g)
if not sc:IsType(TYPE_XYZ) then
Duel.Remove(g:Filter(Card.IsLocation,nil,LOCATION_GRAVE),POS_FACEUP,REASON_EFFECT)
Duel.SendtoGrave(g:Filter(Card.IsLocation,nil,LOCATION_HAND),REASON_EFFECT+REASON_DISCARD)
else Duel.Overlay(sc,g) end
Duel.BreakEffect()
Duel.SpecialSummon(sc,t[sc:GetType()&TYPE_EXTRA],tp,tp,false,false,POS_FACEUP)
end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.op(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
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetRange(LOCATION_PZONE)
e0:SetCode(EFFECT_CANNOT_ACTIVATE)
e0:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e0:SetTargetRange(0,1)
e0:SetCondition(cid.con)
e0:SetValue(cid.splimit)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE)
e4:SetRange(LOCATION_PZONE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x6c97,0x9c97) end)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW+CATEGORY_REMOVE)
e3:SetCondition(cid.con)
e3:SetCost(cid.cost)
e3:SetTarget(cid.rttg)
e3:SetOperation(cid.rtop)
c:RegisterEffect(e3)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cid.hspcon)
e1:SetOperation(function(e,tp) Duel.Damage(tp,2000,REASON_COST) end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_F)
e2:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON)
e2:SetCountLimit(1)
e2:SetCondition(cid.rmcon)
e2:SetTarget(cid.rmtg)
e2:SetOperation(cid.rmop)
c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_REMOVE)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCategory(CATEGORY_TOEXTRA)
e5:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e5:SetTarget(cid.target)
e5:SetOperation(cid.operation)
c:RegisterEffect(e5)
end
function cid.con(e)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),id+1)
end
function cid.splimit(e,re,tp)
local rc=re:GetHandler()
return re:IsActiveType(TYPE_PENDULUM) and rc:IsLocation(LOCATION_PZONE)
end
function cid.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,2000,REASON_COST)
end
function cid.filter1(c)
return c:IsSetCard(0xc97) and c:IsAbleToRemove()
end
function cid.rttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) and Duel.IsExistingMatchingCard(Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(cid.filter1,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function cid.rtop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tg=Duel.SelectMatchingCard(tp,Card.IsAbleToDeck,tp,LOCATION_REMOVED,0,1,3,nil)
if Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)==0
or tg:IsExists(aux.NOT(Card.IsLocation),1,nil,LOCATION_DECK+LOCATION_EXTRA) then return end
if tg:IsExists(Card.IsLocation,1,nil,LOCATION_EXTRA) then Duel.ShuffleDeck(tp) end
if Duel.Draw(tp,2,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.filter1),tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil)
if #g>0 then
Duel.BreakEffect()
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cid.nfilter(c)
return c:GetSummonLocation()==LOCATION_EXTRA or c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function cid.rmcon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0 and eg:IsExists(cid.nfilter,1,nil)
end
function cid.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,2000)
end
function cid.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Damage(1-tp,2000,REASON_EFFECT)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsForbidden() end
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsForbidden() then return end
local b1=Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
if b1 and Duel.SelectOption(tp,1160,1105)==0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
else
Duel.SelectOption(tp,1105)
Duel.SendtoExtraP(c,nil,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.EnablePendulumAttribute(c)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(cid.splimit)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_DISABLE)
e4:SetRange(LOCATION_PZONE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x6c97,0x9c97) end)
c:RegisterEffect(e4)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_PZONE)
e6:SetCountLimit(1)
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetCondition(function(e) return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),id-1) end)
e6:SetCost(cid.cost)
e6:SetTarget(cid.sptg)
e6:SetOperation(cid.spop)
c:RegisterEffect(e6)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
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:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cid.hspcon)
e1:SetOperation(function(e,tp) Duel.Damage(tp,2000,REASON_COST) end)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_DAMAGE)
e3:SetCondition(function(e) return e:GetHandler():GetBattleTarget()~=nil end)
e3:SetTarget(cid.tg)
e3:SetOperation(cid.op)
c:RegisterEffect(e3)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_REMOVE)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCategory(CATEGORY_TOEXTRA)
e5:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e5:SetTarget(cid.target)
e5:SetOperation(cid.operation)
c:RegisterEffect(e5)
end
function cid.splimit(e,c,sump,sumtype,sumpos,targetp)
if sumtype&SUMMON_TYPE_PENDULUM~=SUMMON_TYPE_PENDULUM then return false end
local tp=e:GetHandlerPlayer()
return sump==tp or Duel.GetFieldCard(tp,LOCATION_PZONE,1-e:GetHandler():GetSequence()):IsCode(id-1)
end
function cid.hspcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,2000,REASON_COST)
end
function cid.filter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsFaceup() or c:IsLocation(LOCATION_HAND))
and c:IsSetCard(0x3c97) and c:IsLevel(4)
end
function cid.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_HAND+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_REMOVED)
end
function cid.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
if ft>3 then ft=3 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.SpecialSummon(Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_HAND+LOCATION_REMOVED,0,1,3,nil,e,tp),0,tp,tp,false,false,POS_FACEUP)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local tc=e:GetHandler():GetBattleTarget()
Duel.SetOperationInfo(0,CATEGORY_REMOVE,tc,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,tc:GetAttack()//2)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=c:GetBattleTarget()
local atk=tc:GetAttack()//2
if tc:IsRelateToBattle() and Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0
and tc:IsLocation(LOCATION_REMOVED) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(function() Duel.ReturnToField(tc) end)
Duel.RegisterEffect(e1,tp)
if atk>0 then Duel.Damage(tp,atk,REASON_EFFECT) end
end
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsForbidden() end
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsForbidden() then return end
local b1=Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)
if b1 and Duel.SelectOption(tp,1160,1105)==0 then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
else
Duel.SelectOption(tp,1105)
Duel.SendtoExtraP(c,nil,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_HAND)
e2:SetCountLimit(1,id*10)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cid.thtg)
e2:SetOperation(cid.thop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id*10+1)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_DAMAGE)
e3:SetLabelObject(e2)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetCost(cid.cost)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0xac97) and c:IsAbleToHand()
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cid.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cid.cfilter(c)
return c:IsAbleToRemoveAsCost() and c:IsSetCard(0xac97) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_GRAVE,0,1,1,nil),POS_FACEUP,REASON_COST)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND) then
Duel.BreakEffect()
Duel.Damage(tp,500,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCondition(cid.discon)
e2:SetCost(cid.discost)
e2:SetTarget(cid.distg)
e2:SetOperation(cid.disop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id+1000)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetCost(cid.cost)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.cfilter(c,tp)
return c:IsSetCard(0xc97) and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp)
end
function cid.discon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp or e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not Duel.IsChainDisablable(ev) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:IsExists(cid.cfilter,1,nil,tp)
end
function cid.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,500,REASON_COST)
end
function cid.distg(e,tp,eg,ep,ev,re,r,rp,chk)
local rc=re:GetHandler()
if chk==0 then return not rc:IsStatus(STATUS_DISABLED) end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if rc:IsAbleToRemove() and rc:IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function cid.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
local rc=re:GetHandler()
if rc:IsRelateToEffect(re) then
Duel.Remove(rc,POS_FACEUP,REASON_EFFECT)
end
end
function cid.filter(c)
return c:IsSetCard(0xc97) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost() and not c:IsCode(id)
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_GRAVE,0,1,1,nil),POS_FACEUP,REASON_COST)
end
function cid.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 cid.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_ATTACK)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cid.mfilter,2,99,function(g) return g:IsExists(Card.IsLinkSetCard,1,nil,0xc97) end)
c:SetUniqueOnField(1,0,id)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(cid.disable)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cid.tgcon)
e1:SetValue(cid.efilter)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id)
e4:SetCost(cid.cost)
e4:SetTarget(cid.nstg)
e4:SetOperation(cid.nsop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,id+1000)
e5:SetCategory(CATEGORY_REMOVE)
e5:SetCondition(cid.con)
e5:SetTarget(cid.tg)
e5:SetOperation(cid.op)
c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id+2000)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.disable(e,c)
return (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and c:IsType(TYPE_LINK)
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,2000,REASON_COST)
end
function cid.nsfilter(c,e,tp,g)
if c:IsLevelAbove(8) and g and g:IsExists(Card.IsLevel,1,nil,4) then return false end
return c:IsSetCard(0x3c97) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,tp,e:GetHandler():GetLinkedZone()) and (c:IsLevel(4) or c:IsLevelAbove(8))
end
function cid.nstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE,LOCATION_REASON_TOFIELD,e:GetHandler():GetLinkedZone())>0 and Duel.IsExistingMatchingCard(cid.nsfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED)
end
function cid.nsop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE,LOCATION_REASON_TOFIELD,e:GetHandler():GetLinkedZone())
local mg=Duel.GetMatchingGroup(cid.nsfilter,tp,LOCATION_GRAVE+LOCATION_HAND+LOCATION_REMOVED,0,nil,e,tp)
if not e:GetHandler():IsRelateToEffect(e) or ft<=0 or ft<=1 and not mg:IsExists(Card.IsLevelAbove,1,nil,8) then return end
if ft>2 then ft=2 end
local g=Group.CreateGroup()
for i=1,ft do
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=mg:FilterSelect(tp,cid.nsfilter,1,1,nil,e,tp,g)
g:Merge(sg)
if #sg==0 or sg:GetFirst():IsLevelAbove(8) or i==ft then break end
end
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP,e:GetHandler():GetLinkedZone())
end
function cid.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3c97)
end
function cid.tgcon(e)
return Duel.IsExistingMatchingCard(cid.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cid.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,3,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND)
end
function cid.filter(c)
return c:IsSetCard(0xc97) and c:IsAbleToRemove()
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.filter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_HAND,0,3,3,nil),POS_FACEUP,REASON_EFFECT)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cid.mfilter,3,true)
c:SetUniqueOnField(1,0,id)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(cid.disable)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cid.tgcon)
e1:SetValue(cid.efilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DAMAGE+CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCondition(function() local ph=Duel.GetCurrentPhase() return ph==PHASE_MAIN1 or ph==PHASE_MAIN2 end)
e2:SetTarget(cid.eqtg)
e2:SetOperation(cid.eqop)
c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,id+1000)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCategory(CATEGORY_TOHAND)
e5:SetCondition(cid.con)
e5:SetTarget(cid.tg)
e5:SetOperation(cid.op)
c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id+2000)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.mfilter(c,fc,sub,mg,sg)
return c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_DARK) and (not sg or sg:FilterCount(aux.TRUE,c)==0 or sg:IsExists(Card.IsFusionSetCard,1,c,0xc97) or c:IsFusionSetCard(0xc97))
end
function cid.disable(e,c)
return (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and c:IsType(TYPE_FUSION)
end
function cid.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3c97)
end
function cid.tgcon(e)
return Duel.IsExistingMatchingCard(cid.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cid.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cid.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and aux.nzatk(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local atk=math.ceil(Duel.SelectTarget(tp,aux.nzatk,tp,0,LOCATION_MZONE,1,1,nil):GetFirst():GetAttack()/2)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,atk)
end
function cid.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
local atk=math.ceil(tc:GetAttack()/2)
if tc:IsRelateToEffect(e) and Duel.Damage(1-tp,atk,REASON_EFFECT)>0
and c:IsRelateToEffect(e) and c:IsFaceup() then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
c:RegisterEffect(e2)
end
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION) and r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard,Card.IsAbleToHand),tp,LOCATION_REMOVED,0,2,nil,0xc97) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_REMOVED)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.AND(Card.IsFaceup,Card.IsSetCard,Card.IsAbleToHand),tp,LOCATION_REMOVED,0,2,2,nil,0xc97)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_REMOVED)
end
function cid.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x3c97) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.SendtoDeck(c,nil,0,REASON_EFFECT)==0
or not c:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCount(tp,LOCATION_MZONE)<=1
or Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_REMOVED,0,2,2,nil,e,tp)
if #g>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
aux.AddSynchroProcedure2(c,aux.FilterBoolFunction(Card.IsCode,id-8),aux.NonTuner(cid.mfilter))
c:SetUniqueOnField(1,0,id)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(cid.disable)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cid.tgcon)
e1:SetValue(cid.efilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,id)
e2:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e2:SetCost(cid.cost)
e2:SetTarget(cid.drtg)
e2:SetOperation(cid.drop)
c:RegisterEffect(e2)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,id+1000)
e5:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e5:SetCategory(CATEGORY_REMOVE)
e5:SetCondition(cid.con)
e5:SetTarget(cid.tg)
e5:SetOperation(cid.op)
c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id+2000)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.mfilter(c)
return c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cid.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and not c:IsSetCard(0xc97)
end
function cid.disable(e,c)
return (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and c:IsType(TYPE_SYNCHRO)
end
function cid.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3c97)
end
function cid.tgcon(e)
return Duel.IsExistingMatchingCard(cid.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cid.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
Duel.SendtoDeck(Duel.SelectMatchingCard(tp,Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_REMOVED,0,1,1,nil),nil,2,REASON_COST)
end
function cid.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_HAND)
end
function cid.rmfilter(c)
return c:IsSetCard(0xc97) and c:IsAbleToRemove() and (not c:IsOnField() or c:IsFaceup())
end
function cid.drop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Draw(tp,1,REASON_EFFECT)==0 then return end
local g=Duel.GetMatchingGroup(aux.NecroValleyFilter(cid.rmfilter),tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.BreakEffect()
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_SYNCHRO) and r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>4 end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,tp,LOCATION_DECK)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmDecktop(tp,5)
Duel.Remove(Duel.GetDecktopGroup(tp,5):Filter(Card.IsSetCard,nil,0xc97):SelectSubGroup(tp,aux.dncheck,false,2,2),POS_FACEUP,REASON_EFFECT)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
aux.AddXyzProcedureLevelFree(c,cid.mfilter,function(g) return g:IsExists(Card.IsSetCard,1,nil,0xc97) end,2,2)
c:SetUniqueOnField(1,0,id)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(cid.disable)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cid.tgcon)
e1:SetValue(cid.efilter)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_MZONE)
e4:SetCode(EVENT_CHAINING)
e4:SetCondition(cid.condition)
e4:SetCost(cid.cost)
e4:SetTarget(cid.distg)
e4:SetOperation(cid.disop)
c:RegisterEffect(e4)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e0:SetCode(EVENT_PHASE+PHASE_STANDBY)
e0:SetRange(LOCATION_MZONE)
e0:SetCountLimit(1,id)
e0:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e0:SetOperation(cid.atop)
c:RegisterEffect(e0)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetCountLimit(1,id+1000)
e5:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e5:SetCondition(cid.con)
e5:SetTarget(cid.tg)
e5:SetOperation(cid.op)
c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCategory(CATEGORY_TODECK+CATEGORY_DAMAGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.mfilter(c,xc)
return c:IsXyzLevel(xc,4) and c:IsRace(RACE_FIEND) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cid.disable(e,c)
return (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and c:IsType(TYPE_XYZ)
end
function cid.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3c97)
end
function cid.tgcon(e)
return Duel.IsExistingMatchingCard(cid.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cid.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cid.mtfilter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3c97)
end
function cid.atop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cid.mtfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then Duel.Overlay(c,g) end
end
function cid.condition(e,tp,eg,ep,ev,re,r,rp)
return rp~=tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
and re:IsActiveType(TYPE_MONSTER) and Duel.IsChainDisablable(ev)
end
function cid.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 cid.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not re:GetHandler():IsDisabled() end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsAbleToRemove() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_REMOVE,eg,1,0,0)
end
end
function cid.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK) and r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.AND(Card.IsSetCard,Card.IsAbleToHand),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,0xc97) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.AND(Card.IsSetCard,Card.IsAbleToHand)),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,0xc97)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,1000,REASON_EFFECT)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,0,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
c:SetUniqueOnField(1,0,id)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cid.tgcon)
e1:SetValue(cid.efilter)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTarget(cid.disable)
c:RegisterEffect(e2)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetCode(EFFECT_UPDATE_ATTACK)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(0,LOCATION_MZONE)
e7:SetValue(function(e,c) return -Duel.GetMatchingGroupCount(cid.filter,tp,LOCATION_REMOVED,0,nil)*200 end)
c:RegisterEffect(e7)
local e6=e7:Clone()
e6:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e6)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_BE_BATTLE_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1,id+200)
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetCondition(cid.damcon)
e5:SetTarget(cid.damtg)
e5:SetOperation(cid.damop)
c:RegisterEffect(e5)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_LEAVE_FIELD)
e4:SetCountLimit(1,id+100)
e4:SetCategory(CATEGORY_RECOVER+CATEGORY_ATKCHANGE)
e4:SetCondition(cid.con)
e4:SetTarget(cid.datktg)
e4:SetOperation(cid.datcop)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id)
e3:SetCategory(CATEGORY_RECOVER+CATEGORY_ATKCHANGE)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetTarget(cid.tg)
e3:SetOperation(cid.op)
c:RegisterEffect(e3)
end
function cid.tgfilter(c)
return c:IsFaceup() and c:IsSetCard(0x3c97)
end
function cid.tgcon(e)
return Duel.IsExistingMatchingCard(cid.tgfilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cid.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cid.disable(e,c)
return (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) and c:GetType()&0x81==0x81
end
function cid.filter(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0xc97)
end
function cid.damcon(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bt=eg:GetFirst()
return c==Duel.GetAttacker() and bt:IsFaceup() and bt:GetControler()~=c:GetControler()
end
function cid.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,0,nil,PLAYER_ALL,0)
end
function cid.damop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() then
Duel.Damage(1-tp,bc:GetBaseAttack()//2,REASON_EFFECT,true)
Duel.Damage(tp,bc:GetBaseAttack()//2,REASON_EFFECT,true)
Duel.RDComplete()
end
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_RITUAL) and r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.datktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() and aux.nzatk(chkc) end
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectTarget(tp,aux.AND(Card.IsFaceup,aux.nzatk),tp,0,LOCATION_MZONE,1,1,nil):GetFirst()
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,tc and tc:GetAttack() or 0)
end
function cid.datkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) and Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(0)
tc:RegisterEffect(e1)
end
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Damage(tp,1000,REASON_EFFECT)
if c:IsRelateToEffect(e) then
Duel.BreakEffect()
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetCondition(function(e,tp,eg) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x6c97,0x9c97) and eg:IsExists(Card.IsSetCard,1,nil,0xc97) end)
e2:SetTarget(cid.rmtg)
e2:SetOperation(cid.rmop)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetRange(LOCATION_FZONE)
e4:SetCondition(function(e,tp) return Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x6c97) and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x9c97) end)
e4:SetValue(function(e,re) return e:GetOwnerPlayer()~=re:GetOwnerPlayer() end)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_BATTLE_DAMAGE_TO_EFFECT)
e5:SetRange(LOCATION_FZONE)
e5:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetProperty(EFFECT_FLAG_DELAY)
e6:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e6:SetCountLimit(1,id+1000)
e6:SetCondition(function(e,tp) return e:GetHandler():GetReasonPlayer()~=tp and not e:GetHandler():IsReason(REASON_RULE) end)
e6:SetCost(cid.cost)
e6:SetTarget(cid.target)
e6:SetOperation(cid.operation)
c:RegisterEffect(e6)
end
function cid.filter(c)
return c:IsSetCard(0xc97) and c:IsAbleToRemove()
end
function cid.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_GRAVE)
end
function cid.rmop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_GRAVE,0,1,2,nil),POS_FACEUP,REASON_EFFECT)
end
function cid.repfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc97)
end
function cid.repcfilter(c,e,val)
return c:IsDefenseAbove(val) and not c:IsImmuneToEffect(e)
end
function cid.rev(e,re,dam,r,rp,rc)
local g=Duel.GetMatchingGroup(cid.repfilter,tp,LOCATION_MZONE,0,1,nil,e,dam)
local rec=rc
if not rec and re then rec=re:GetHandler() end
local val=dam
Duel.DisableActionCheck(true)
if rec:IsSetCard(0xc97) and rec:GetOwner()==e:GetHandlerPlayer() and r&REASON_COST+REASON_EFFECT>0 and #g>0
and g:FilterCount(cid.repcfilter,nil,e,dam)==#g and Duel.GetFlagEffect(tp,id)<2 then
local tg=g:Filter(cid.repcfilter,nil,e,dam)
Duel.HintSelection(tg)
for tc in aux.Next(tg) do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetValue(-dam)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
val=0
end
Duel.DisableActionCheck(false)
return val
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)>0 then
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetCost(cid.cost(1000))
e1:SetTarget(cid.target)
e1:SetOperation(cid.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCountLimit(1,id+1000)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(function(e) local re=e:GetHandler():GetReasonEffect() return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost(500))
e2:SetTarget(cid.thtg)
e2:SetOperation(cid.thop)
c:RegisterEffect(e2)
end
function cid.cost(v)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,v,REASON_COST)
end
end
function cid.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc97) and c:IsAbleToRemove()
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cid.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cid.filter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,cid.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,2,1-tp,LOCATION_ONFIELD)
end
function cid.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
local ct=(tc:IsSetCard(0x9c97,0x6c97)) and 2 or 1
if not tc:IsRelateToEffect(e) or Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,ct,nil)
if #g>0 then
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function cid.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:SetUniqueOnField(1,0,id)
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)
e1:SetTarget(cid.target)
e1:SetOperation(cid.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_EQUIP_LIMIT)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_PHASE+PHASE_STANDBY)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetProperty(CATEGORY_DAMAGE)
e3:SetTarget(cid.damtg)
e3:SetOperation(cid.damop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCategory(CATEGORY_DAMAGE+CATEGORY_DESTROY)
e4:SetCondition(function(e,tp) return Duel.GetTurnPlayer()==tp end)
e4:SetOperation(cid.mtop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_REMOVE)
e5:SetCountLimit(1,id)
e5:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e5:SetCategory(CATEGORY_EQUIP)
e5:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) and e:GetHandler():CheckUniqueOnField(tp) end)
e5:SetTarget(cid.tg)
e5:SetOperation(cid.op)
c:RegisterEffect(e5)
end
function cid.target(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.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,c,tc)
end
end
function cid.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ec=e:GetHandler():GetEquipTarget()
if ec then
ec:CreateEffectRelation(e)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,ec:GetAttack()//2)
end
end
function cid.damop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetHandler():GetEquipTarget()
if c:IsRelateToEffect(e) and tc and tc:IsRelateToEffect(e) then
local atk=tc:GetAttack()//2
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.RDComplete()
end
end
function cid.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
if Duel.SelectYesNo(tp,1122) and Duel.Damage(tp,1000,REASON_EFFECT)>0 then return end
Duel.Destroy(c,REASON_EFFECT)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local tc=Duel.SelectMatchingCard(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil):GetFirst()
if tc then Duel.Equip(tp,c,tc) end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(cid.rev)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,id)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DAMAGE)
e4:SetDescription(1113)
e4:SetTarget(cid.atktg)
e4:SetOperation(cid.atkop)
c:RegisterEffect(e4)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCountLimit(1,id+1000)
e2:SetCategory(CATEGORY_RECOVER+CATEGORY_DAMAGE)
e2:SetDescription(1122)
e2:SetCondition(cid.con)
e2:SetTarget(cid.tg)
e2:SetOperation(cid.op)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_REMOVE)
e3:SetCountLimit(1,id+2000)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_REMOVE)
e3:SetDescription(1110)
e3:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e3:SetCost(cid.cost)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.rev(e,re,dam,r,rp,rc)
local c=e:GetHandler()
if r&REASON_COST+REASON_EFFECT==0 or c:IsImmuneToEffect(e) then return dam end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(dam)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e1)
return 0
end
function cid.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and aux.nzatk(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(aux.nzatk,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,aux.nzatk,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,c)
end
function cid.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
local atk=tc:GetAttack()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(0)
tc:RegisterEffect(e1)
if atk>0 then Duel.Damage(tp,atk,REASON_EFFECT) end
end
end
function cid.con(e,tp,eg,ep,ev,re,r,rp)
e:SetLabel(e:GetHandler():GetPreviousAttackOnField())
return r&REASON_EFFECT+REASON_BATTLE~=0 and (r&REASON_BATTLE~=0 or rp~=tp)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,e:GetLabel())
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local d=e:GetLabel()
if Duel.Recover(tp,d,REASON_EFFECT)<1 then return end
Duel.BreakEffect()
Duel.Damage(1-tp,Duel.GetLP(1-tp)//2,REASON_EFFECT,true)
Duel.Damage(tp,Duel.GetLP(tp)//2,REASON_EFFECT,true)
Duel.RDComplete()
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,2000,REASON_COST)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)~=0 then
Duel.DisableShuffleCheck()
Duel.Remove(Duel.GetDecktopGroup(tp,5),POS_FACEUP,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
c:SetUniqueOnField(1,0)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_MUST_ATTACK)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_ACTIVATE)
e5:SetRange(LOCATION_SZONE)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(0,1)
e5:SetCondition(function(e) local ph=Duel.GetCurrentPhase() return ph>=PHASE_BATTLE_START and ph<=PHASE_BATTLE and Duel.IsExistingMatchingCard(aux.AND(Card.IsFaceup,Card.IsSetCard),e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil,0x6c97,0x9c97) end)
e5:SetValue(function(e,re,tp) return re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE) end)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(id,0))
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetRange(LOCATION_FZONE)
e6:SetProperty(EFFECT_FLAG_EVENT_PLAYER+EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e6:SetCode(EVENT_CUSTOM+id)
e6:SetCountLimit(1)
e6:SetCost(cid.negcost)
e6:SetOperation(cid.operation)
c:RegisterEffect(e6)
if not cid.global_check then
cid.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_ATTACK_ANNOUNCE)
ge1:SetOperation(cid.regop)
Duel.RegisterEffect(ge1,0)
end
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,id)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost)
e2:SetTarget(cid.settg)
e2:SetOperation(cid.setop)
c:RegisterEffect(e2)
end
function cid.regop(e,tp,eg,ep,ev,re,r,rp)
local ac=Duel.GetAttacker()
local bc=Duel.GetAttackTarget()
local g=Group.FromCards(ac)
if bc then g:AddCard(bc) end
g=g:Filter(aux.AND(Card.IsFaceup,Card.IsSetCard),nil,0xc97)
if #g>0 then Duel.RaiseEvent(g,EVENT_CUSTOM+id,re,r,rp,1-tp,0) end
end
function cid.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCode(EFFECT_FLAG_OATH)
e1:SetCountLimit(1,id)
e1:SetOperation(function(e,tp) local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0) Duel.Remove(g:Select(tp,math.min(3,#g),3,nil),POS_FACEDOWN,REASON_EFFECT) end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if Duel.NegateAttack() then Duel.SkipPhase(tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1) end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,3000,REASON_COST)
end
function cid.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function cid.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
c:EnableReviveLimit()
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetTarget(cid.target)
e1:SetOperation(cid.operation)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetValue(function(e) return Duel.GetMatchingGroupCount(cid.atkfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,0,nil)*100 end)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_REVERSE_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(1,0)
e2:SetValue(function(e,re,r,rp,rc) return r&REASON_EFFECT+REASON_COST>0 end)
c:RegisterEffect(e2)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_PIERCE)
c:RegisterEffect(e0)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_REMOVE)
e4:SetCountLimit(1,id+100)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e4:SetCost(cid.cost)
e4:SetTarget(cid.tg)
e4:SetOperation(cid.op)
c:RegisterEffect(e4)
end
function cid.filter(c)
return c:IsSetCard(0xac97) and c:IsSSetable()
end
function cid.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
tc:RegisterEffect(e2)
end
end
function cid.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0xac97) and c:IsAbleToRemove()
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(cid.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,#g,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(Duel.GetMatchingGroup(cid.rmfilter,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil),POS_FACEUP,REASON_EFFECT)
end
function cid.atkfilter(c)
return c:IsFaceup() and c:IsSetCard(0xac97) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,2000,REASON_COST)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SendtoHand(c,nil,REASON_EFFECT)>0 and c:IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,c)
Duel.DisableShuffleCheck()
Duel.Remove(Duel.GetDecktopGroup(tp,5),POS_FACEUP,REASON_EFFECT)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetCountLimit(1,id)
e1:SetTarget(cid.tg)
e1:SetOperation(cid.op)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_REMOVE)
e4:SetCountLimit(1,id+100)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e4:SetCost(cid.cost)
e4:SetTarget(cid.thtg)
e4:SetOperation(cid.thop)
c:RegisterEffect(e4)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function cid.filter(c)
return (c:IsFaceup() or c:IsLocation(LOCATION_DECK)) and c:IsSetCard(0x3c97) and c:IsType(TYPE_PENDULUM) and c:IsAbleToHand()
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_DECK+LOCATION_EXTRA,0,nil):SelectSubGroup(tp,aux.dncheck,false,2,2)
if #g==2 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.sfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc97) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_PZONE)>1
and Duel.GetMatchingGroup(cid.filter,tp,LOCATION_EXTRA,0,nil):GetClassCount(Card.GetCode)>1 end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_EXTRA)
end
function cid.thop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_PZONE)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.GetMatchingGroup(cid.filter,tp,LOCATION_EXTRA,0,nil):SelectSubGroup(tp,aux.dncheck,false,2,2)
if #g==2 then for tc in aux.Next(g) do Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true) end end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e0:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetCondition(cid.spcon)
e0:SetOperation(cid.spop)
c:RegisterEffect(e0)
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:SetValue(function(e,c) return Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsSetCard),e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,c,0xc97)*500 end)
c:RegisterEffect(e2)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_REMOVE)
e1:SetCountLimit(1,id+100)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetDescription(1109)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e1:SetCost(cid.cost)
e1:SetTarget(cid.tg)
e1:SetOperation(cid.op)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetCategory(CATEGORY_REMOVE)
e3:SetDescription(1100)
e3:SetTarget(cid.target)
e3:SetOperation(cid.operation)
c:RegisterEffect(e3)
end
function cid.cfilter(c)
return c:IsAbleToRemoveAsCost() and (c:IsType(TYPE_MONSTER) and c:IsSetCard(0x3c97) or c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0xac97))
end
function cid.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c)
end
function cid.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,c),POS_FACEUP,REASON_COST)
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.thfilter(c)
return (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED)) and c:IsSetCard(0xac97) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.thfilter,tp,LOCATION_REMOVED+LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED+LOCATION_DECK+LOCATION_GRAVE)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.thfilter),tp,LOCATION_REMOVED+LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
end
function cid.rmfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,Duel.GetMatchingGroup(cid.rmfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,nil),1,0,0)
end
function cid.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cid.rmfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,LOCATION_GRAVE+LOCATION_ONFIELD,1,1,nil)
if #g>0 then Duel.Remove(g,POS_FACEUP,REASON_EFFECT) end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=aux.AddRitualProcUltimate(c,aux.FilterBoolFunction(Card.IsSetCard,0xc97),Card.GetLevel,"Greater",LOCATION_HAND+LOCATION_GRAVE,aux.FilterBoolFunction(aux.AND(Card.IsFaceup,Card.IsSetCard),0xc97),cid.mfilter)
e1:SetOperation(cid.RitualUltimateOperation(aux.FilterBoolFunction(Card.IsSetCard,0xc97),Card.GetLevel,"Greater",LOCATION_HAND+LOCATION_GRAVE,aux.FilterBoolFunction(aux.AND(Card.IsFaceup,Card.IsSetCard),0xc97),cid.mfilter))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(2,id)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost)
e2:SetTarget(cid.tg)
e2:SetOperation(cid.op)
c:RegisterEffect(e2)
end
function cid.mfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsRace(RACE_FIEND)
end
function cid.RitualUltimateOperation(filter,level_function,greater_or_equal,summon_location,grave_filter,mat_filter)
return function(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp):Filter(Card.IsOnField,nil)
if mat_filter then mg=mg:Filter(mat_filter,nil,e,tp) end
local exg=nil
if grave_filter then
exg=Duel.GetMatchingGroup(aux.RitualExtraFilter,tp,LOCATION_REMOVED,0,nil,grave_filter)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(aux.RitualUltimateFilter),tp,summon_location,0,1,1,nil,filter,e,tp,mg,exg,level_function,greater_or_equal)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if exg then
mg:Merge(exg)
end
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local lv=level_function(tc)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,lv,greater_or_equal)
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,lv,tp,tc,lv,greater_or_equal)
aux.GCheckAdditional=nil
tc:SetMaterial(mat)
Duel.SendtoGrave(mat:Filter(Card.IsLocation,nil,LOCATION_REMOVED),REASON_RETURN+REASON_MATERIAL+REASON_RITUAL+REASON_EFFECT)
Duel.ReleaseRitualMaterial(mat:Filter(Card.IsOnField,nil))
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,500,REASON_COST)
end
function cid.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoHand(c,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,c)
end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_DAMAGE)
e1:SetCost(cid.cost(0x6c97,0x9c97))
e1:SetTarget(cid.rmtg)
e1:SetOperation(cid.rmop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+100)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost(0xc97))
e2:SetTarget(cid.settg)
e2:SetOperation(cid.setop)
c:RegisterEffect(e2)
end
function cid.filter(c)
return c:IsFaceup() and c:IsSetCard(0x6c97,0x9c97) and c:IsAbleToRemove()
end
function cid.rmtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.GetMatchingGroupCount(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil)>0 end
end
function cid.rmop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetMatchingGroup(Card.IsFacedown,tp,0,LOCATION_EXTRA,nil):RandomSelect(1-tp,1):GetFirst()
if not tc then return end
local atk=tc:GetTextAttack()//2
if atk<1 then return end
Duel.BreakEffect()
Duel.Damage(tp,atk,REASON_EFFECT)
local c=e:GetHandler()
local code={tc:GetOriginalCodeRule()}
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(function(ef,ref) return ref:GetHandler():IsCode(table.unpack(code)) and ref:IsActiveType(TYPE_MONSTER) end)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e1:SetTarget(aux.TargetBoolFunction(Card.IsCode,table.unpack(code)))
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e4,tp)
end
function cid.cfilter(c,sets)
return c:IsSetCard(table.unpack(sets)) and c:IsAbleToRemoveAsCost()
end
function cid.cost(...)
local sets={...}
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil,sets) end
Duel.Remove(Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil,sets),POS_FACEUP,REASON_COST)
end
end
function cid.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsSSetable() end
end
function cid.setop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then Duel.SSet(tp,c) end
end
--created by Walrus, coded by Lyris
local cid,id=GetID()
function cid.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
c:SetUniqueOnField(1,0,id)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cid.descon)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,id+100)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetCondition(cid.condition(cid.rcfilter))
e3:SetCost(cid.cost(2,cid.sfilter))
e3:SetTarget(cid.tg(LOCATION_DECK+LOCATION_HAND))
e3:SetOperation(cid.op(LOCATION_DECK+LOCATION_HAND))
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCountLimit(1,id+200)
e4:SetCondition(cid.condition(aux.FilterEqualFunction(Card.GetSummonLocation,LOCATION_EXTRA)))
e4:SetCost(cid.cost(3))
e4:SetTarget(cid.tg(LOCATION_EXTRA))
e4:SetOperation(cid.op(LOCATION_EXTRA))
c:RegisterEffect(e4)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_REMOVE)
e1:SetCountLimit(1,id+200)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetCondition(function(e) local re=e:GetHandler():GetReasonEffect() return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e1:SetTarget(cid.rectg)
e1:SetOperation(cid.recop)
c:RegisterEffect(e1)
end
function cid.descon(e)
return not Duel.IsEnvironment(id-15)
end
function cid.rectg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsSummonType),tp,LOCATION_MZONE,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct*500)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,ct*500)
end
function cid.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(tp,Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsSummonType),tp,LOCATION_MZONE,LOCATION_MZONE,nil,SUMMON_TYPE_SPECIAL)*500,REASON_EFFECT)
end
function cid.rcfilter(c)
return c:IsType(TYPE_RITUAL) and c:IsSummonType(SUMMON_TYPE_RITUAL)
end
function cid.condition(f)
return function(e,tp,eg,ep,ev,re,r,rp)
local typ=0
for tc in aux.Next(eg) do if tc:GetSummonPlayer()~=tp then typ=typ|tc:GetType()&TYPE_EXTRA+TYPE_RITUAL end end
e:SetLabel(typ)
return typ>0 and eg:IsExists(f,1,nil)
end
end
function cid.sfilter(c)
return c:IsSetCard(0x3c97) and c:IsLevel(4)
end
function cid.cfilter(c,f)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0xc97) and c:IsAbleToRemoveAsCost() and (not f or f(c))
end
function cid.cost(ct,f)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_GRAVE,0,ct,nil,f) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_GRAVE,0,ct,ct,nil,f),POS_FACEUP,REASON_COST)
end
end
function cid.filter(c,e,tp)
local typ=e:GetLabel()
if typ&TYPE_XYZ>0 and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)<2 then return false end
return c:IsType(typ) and c:IsSetCard(0xc97) and c:IsCanBeSpecialSummoned(e,0,tp,true,false)
and (typ&TYPE_EXTRA>0 and c:IsSetCard(0x6c97,0x9c97) and Duel.GetLocationCountFromEx(tp)>0 or Duel.GetLocationCount(tp,LOCATION_MZONE)>0)
end
function cid.tg(loc)
return function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,loc,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,loc)
end
end
function cid.op(loc)
return function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cid.filter,tp,loc,0,1,1,nil,e,tp):GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,true,false,POS_FACEUP) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_SELF_TURN,Duel.GetTurnPlayer()==tp and 2 or 1)
tc:RegisterEffect(e1)
end
if Duel.SpecialSummonComplete()==1 and tc:IsType(TYPE_XYZ) then
Duel.BreakEffect()
Duel.DisableShuffleCheck()
Duel.Overlay(tc,Duel.GetDecktopGroup(tp,2))
end
end
end
--腼腆妹·千石抚子
function c9950305.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCondition(c9950305.condition)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950305,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(c9950305.spcon)
e2:SetTarget(c9950305.sptg)
e2:SetOperation(c9950305.spop)
c:RegisterEffect(e2)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950305,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,9950305)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c9950305.thtg)
e2:SetOperation(c9950305.thop)
c:RegisterEffect(e2)
end
function c9950305.condition(e)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950305.spcon(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsDisabled() and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950305.filter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:GetCode()~=9950305 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950305.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c9950305.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c9950305.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9950305.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c9950305.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c9950305.thfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c9950305.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950305.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9950305.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9950305.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--前发娘·千石抚子
function c9950306.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950306,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetCode(EVENT_DRAW)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c9950306.spcon)
e1:SetCost(c9950306.spcost)
e1:SetTarget(c9950306.sptg)
e1:SetOperation(c9950306.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950306,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCountLimit(1,99503060)
e2:SetCondition(c9950306.srcon)
e2:SetTarget(c9950306.srtg)
e2:SetOperation(c9950306.srop)
c:RegisterEffect(e2)
--discard
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950306,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,9950306)
e2:SetTarget(c9950306.distg)
e2:SetOperation(c9950306.disop)
c:RegisterEffect(e2)
end
function c9950306.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
return ev==ct and eg:IsContains(c)
end
function c9950306.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not e:GetHandler():IsPublic() end
end
function c9950306.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c9950306.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 c9950306.srcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950306.thfilter(c)
return c:IsSetCard(0x5ba2) and c:IsAbleToHand()
end
function c9950306.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetMatchingGroup(c9950306.thfilter,tp,LOCATION_DECK,0,nil)
return g:GetClassCount(Card.GetCode)>=2
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function c9950306.srop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c9950306.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetClassCount(Card.GetCode)<2 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tg1=g:SelectSubGroup(tp,aux.dncheck,false,2,2)
Duel.SendtoHand(tg1,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tg1)
end
function c9950306.disfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c9950306.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950306.disfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,1500)
end
function c9950306.disop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9950306.disfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.BreakEffect()
Duel.Recover(tp,1500,REASON_EFFECT)
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_BATTLE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetValue(HALF_DAMAGE)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
--室内派·千石抚子
function c9950307.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(c9950307.spcon)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950307,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,9950307)
e2:SetCondition(c9950307.spcon2)
e2:SetCost(c9950307.spcost)
e2:SetTarget(c9950307.sptg)
e2:SetOperation(c9950307.spop)
c:RegisterEffect(e2)
--Rank Up
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950307,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e3:SetCountLimit(1,99503070)
e3:SetTarget(c9950307.target)
e3:SetOperation(c9950307.operation)
c:RegisterEffect(e3)
end
function c9950307.spcon(e,c)
if c==nil then return true end
return Duel.GetFieldGroupCount(c:GetControler(),LOCATION_HAND,0)==1
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end
function c9950307.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950307.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function c9950307.filter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and not c:IsCode(9950307) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950307.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c9950307.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c9950307.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9950307.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c9950307.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if ft<sg:GetCount() or (sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
function c9950307.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x5ba2)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c9950307.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetRank()-1,c)
end
function c9950307.spfilter(c,e,tp,rank,mc)
return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_REPTILE)) and c:IsType(TYPE_XYZ) and c:IsRank(rank) and mc:IsCanBeXyzMaterial(c,tp)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c9950307.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c9950307.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c9950307.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c9950307.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c9950307.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and tc:IsFaceup()
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9950307.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()-1,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c9950307.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c9950307.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsAttribute(ATTRIBUTE_DARK)
end
--千石抚子
function c9950308.initial_effect(c)
--direct attack
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DIRECT_ATTACK)
e1:SetCondition(c9950308.con)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,9950308)
e2:SetTarget(c9950308.settg)
e2:SetOperation(c9950308.setop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--return deck
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950308,1))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,99503080)
e2:SetTarget(c9950308.target)
e2:SetOperation(c9950308.operation)
c:RegisterEffect(e2)
end
function c9950308.con(e)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950308.filter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c9950308.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingMatchingCard(c9950308.filter,tp,LOCATION_DECK,0,1,nil) end
end
function c9950308.setop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c9950308.filter,tp,LOCATION_DECK,0,1,1,nil)
local tc=g:GetFirst()
if tc and Duel.SSet(tp,tc)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c9950308.filter2(c)
return c:IsSetCard(0x5ba2) and not c:IsCode(9950308) and c:IsAbleToDeck() and c:IsFaceup()
end
function c9950308.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and c9950308.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9950308.filter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c9950308.filter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c9950308.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
Duel.SendtoDeck(tc,nil,0,REASON_EFFECT)
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
--恋爱循环·千石抚子
function c9950309.initial_effect(c)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950309,0))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCountLimit(1,9950309)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(c9950309.negcon)
e2:SetTarget(c9950309.negtg)
e2:SetOperation(c9950309.negop)
c:RegisterEffect(e2)
--lv change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950309,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetTarget(c9950309.lvtg)
e3:SetOperation(c9950309.lvop)
c:RegisterEffect(e3)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950309,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetCountLimit(1,99503090)
e1:SetCondition(c9950309.spcon)
e1:SetCost(aux.bfgcost)
e1:SetTarget(c9950309.sptg)
e1:SetOperation(c9950309.spop)
c:RegisterEffect(e1)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950309.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950309.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950309,0))
end
function c9950309.negcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950309.negtg(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 c9950309.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950309,0))
end
function c9950309.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950309.filter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsLevelBelow(4) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950309.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c9950309.filter(chkc,e,tp) end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.IsExistingTarget(c9950309.filter,tp,LOCATION_GRAVE,0,2,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9950309.filter,tp,LOCATION_GRAVE,0,2,2,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,2,0,0)
end
function c9950309.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<sg:GetCount()
or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
local tc=sg:GetFirst()
local c=e:GetHandler()
while tc do
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,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
end
tc=sg:GetNext()
end
Duel.SpecialSummonComplete()
end
function c9950309.filter(c)
return c:IsFaceup() and c:IsLevelAbove(4) and (c:IsRace(RACE_REPTILE) or c:IsAttribute(ATTRIBUTE_DARK))
end
function c9950309.lvtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950309.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(9950309,1))
local lv=Duel.AnnounceLevel(tp,1,3)
e:SetLabel(lv)
end
function c9950309.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c9950309.filter,tp,LOCATION_MZONE,0,nil)
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
\ No newline at end of file
--朽绳·千石抚子
function c9950310.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--to grave1
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950310,0))
e2:SetCategory(CATEGORY_TOGRAVE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c9950310.tgcost1)
e2:SetTarget(c9950310.tgtg1)
e2:SetOperation(c9950310.tgop1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950310,1))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,9950310)
e3:SetCost(c9950310.tgcost2)
e3:SetTarget(c9950310.tgtg2)
e3:SetOperation(c9950310.tgop2)
c:RegisterEffect(e3)
end
function c9950310.tgcost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
local g=Duel.SelectMatchingCard(tp,Card.IsDiscardable,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
end
function c9950310.filter1(c)
return c:IsRace(RACE_REPTILE) and c:IsAbleToGrave()
end
function c9950310.tgtg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950310.filter1,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function c9950310.tgop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9950310.filter1,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c9950310.tgcost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c9950310.filter2(c)
return c:IsSetCard(0x5ba2) and c:IsAbleToGrave()
end
function c9950310.exfilter(c)
return c:IsSummonType(SUMMON_TYPE_SPECIAL)
end
function c9950310.tgtg2(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=Duel.GetMatchingGroupCount(c9950310.exfilter,tp,0,LOCATION_MZONE,nil)
local g=Duel.GetMatchingGroup(c9950310.filter2,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
if chk==0 then return ct>0 and g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c9950310.tgop2(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetMatchingGroupCount(c9950310.exfilter,tp,0,LOCATION_MZONE,nil)
if ct<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.GetMatchingGroup(c9950310.filter2,tp,LOCATION_HAND+LOCATION_DECK,0,nil)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,ct)
aux.GCheckAdditional=nil
if sg:GetCount()>0 then
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
--千石抚子与贝木泥舟
function c9950311.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950311,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCost(c9950311.setcost)
e2:SetTarget(c9950311.settg)
e2:SetOperation(c9950311.setop)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950311,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,9950311)
e3:SetCondition(c9950311.spcon)
e3:SetCost(c9950311.spcost)
e3:SetTarget(c9950311.sptg)
e3:SetOperation(c9950311.spop)
c:RegisterEffect(e3)
end
function c9950311.costfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c9950311.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950311.costfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c9950311.costfilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function c9950311.setfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsCode(9950311) and c:IsSSetable()
end
function c9950311.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950311.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c9950311.setop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c9950311.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g)
end
end
function c9950311.spcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950311.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function c9950311.filter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950311.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c9950311.filter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c9950311.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct>2 then ct=2 end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9950311.filter,tp,LOCATION_GRAVE,0,1,ct,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,g:GetCount(),0,0)
end
function c9950311.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)>0 then return end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()==0 or ft<sg:GetCount() or (sg:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
--神抚子与北白蛇神社
function c9950312.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(c9950312.activate)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950312,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e2:SetRange(LOCATION_FZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCost(c9950312.cost)
e2:SetTarget(c9950312.target)
e2:SetOperation(c9950312.operation)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950312,2))
e3:SetCategory(CATEGORY_TOGRAVE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1,EFFECT_COUNT_CODE_SINGLE)
e3:SetRange(LOCATION_FZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCost(c9950312.cost)
e3:SetTarget(c9950312.target2)
e3:SetOperation(c9950312.operation2)
c:RegisterEffect(e3)
--set
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(9950312,1))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCondition(c9950312.setcon)
e5:SetTarget(c9950312.settg)
e5:SetOperation(c9950312.setop)
c:RegisterEffect(e5)
end
function c9950312.thfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5ba2) and c:IsAbleToGrave()
end
function c9950312.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(c9950312.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9950312,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoGrave(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
function c9950312.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGraveAsCost,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsAbleToGraveAsCost,1,1,REASON_COST)
end
function c9950312.filter1(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5ba2) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950312.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c9950312.filter1(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c9950312.filter1,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c9950312.filter1,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function c9950312.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
function c9950312.filter2(c)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsSetCard(0x5ba2)
end
function c9950312.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and c9950312.filter2(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9950312.filter2,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,c9950312.filter2,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c9950312.operation2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoGrave(tc,REASON_EFFECT+REASON_RETURN)
end
end
function c9950312.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_DESTROY) and c:IsReason(REASON_EFFECT) and c:GetPreviousControler()==tp
end
function c9950312.setfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSetCard(0x5ba2) and not c:IsCode(9950312) and c:IsSSetable()
end
function c9950312.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950312.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
end
function c9950312.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local tc=Duel.SelectMatchingCard(tp,c9950312.setfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil):GetFirst()
if tc then
Duel.SSet(tp,tc)
end
end
--抚子·心灵封闭
function c9950313.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950313,1))
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1)
e2:SetCost(c9950313.cost)
e2:SetTarget(c9950313.target)
e2:SetOperation(c9950313.operation)
c:RegisterEffect(e2)
--to hand
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_GRAVE)
e3:SetCountLimit(1,9950313)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c9950313.thtg)
e3:SetOperation(c9950313.thop)
c:RegisterEffect(e3)
end
function c9950313.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x5ba2)
end
function c9950313.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,c9950313.cfilter,1,nil) end
local cg=Duel.SelectReleaseGroup(tp,c9950313.cfilter,1,1,nil)
Duel.Release(cg,REASON_COST)
end
function c9950313.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_ONFIELD) and chkc:IsControler(1-tp) and chkc:IsAbleToRemove() end
if chk==0 then return Duel.IsExistingTarget(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_GRAVE+LOCATION_ONFIELD,1,2,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),1-tp,LOCATION_GRAVE+LOCATION_ONFIELD)
end
function c9950313.operation(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not g then return end
g=g:Filter(Card.IsRelateToEffect,nil,e)
Duel.Remove(g,POS_FACEUP,REASON_EFFECT)
end
function c9950313.thfilter(c)
return c:IsSetCard(0x5ba2) and c:IsAbleToHand()
end
function c9950313.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c9950313.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9950313.thfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c9950313.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c9950313.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--抚子·蛇变化
function c9950314.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(aux.dscon)
c:RegisterEffect(e1)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950314,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c9950314.sptg)
e3:SetOperation(c9950314.spop)
c:RegisterEffect(e3)
--special summon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(9950314,2))
e4:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetRange(LOCATION_GRAVE)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCountLimit(1,9950314)
e4:SetCost(aux.bfgcost)
e4:SetTarget(c9950314.sptg2)
e4:SetOperation(c9950314.spop2)
c:RegisterEffect(e4)
end
function c9950314.tgfilter(c,e,tp)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x5ba2)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(c9950314.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c:GetRank()-1,c)
end
function c9950314.spfilter2(c,e,tp,rank,mc)
return (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_REPTILE)) and c:IsType(TYPE_XYZ) and c:IsRank(rank) and mc:IsCanBeXyzMaterial(c,tp)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function c9950314.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c9950314.tgfilter(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(c9950314.tgfilter,tp,LOCATION_MZONE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c9950314.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c9950314.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsControler(tp) and tc:IsFaceup()
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9950314.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc:GetRank()-1,tc)
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()>0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end
end
function c9950314.spfilter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950314.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,nil)
and Duel.IsExistingMatchingCard(c9950314.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c9950314.spop2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 and Duel.SendtoGrave(g,REASON_EFFECT)~=0 and g:GetFirst():IsLocation(LOCATION_GRAVE) then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9950314.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)
end
end
end
\ No newline at end of file
--恋爱少女·抚子
function c9950315.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),4,2)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950315,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,9950315)
e1:SetCost(c9950315.cost)
e1:SetTarget(c9950315.thtg)
e1:SetOperation(c9950315.thop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950315,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,9950315)
e2:SetCost(c9950315.cost)
e2:SetTarget(c9950315.sptg)
e2:SetOperation(c9950315.spop)
c:RegisterEffect(e2)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_TO_HAND)
e1:SetCountLimit(1,99503150)
e1:SetCondition(c9950315.condition)
e1:SetTarget(c9950315.target)
e1:SetOperation(c9950315.activate)
c:RegisterEffect(e1)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950315.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950315.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950315,0))
end
function c9950315.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 c9950315.thfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c9950315.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c9950315.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c9950315.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c9950315.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 c9950315.spfilter(c,e,tp)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c9950315.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9950315.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 c9950315.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9950315.spfilter,tp,LOCATION_HAND+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
function c9950315.cfilter(c,tp)
return c:IsControler(tp) and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW)
end
function c9950315.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c9950315.cfilter,1,nil,1-tp) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950315.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=eg:Filter(c9950315.cfilter,nil,1-tp)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,1000)
end
function c9950315.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()~=0 then
Duel.SendtoGrave(g,REASON_EFFECT)
if g:IsExists(Card.IsLocation,1,nil,LOCATION_GRAVE) then
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950315,0))
end
--蛇之符·抚子
function c9950316.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),3,3)
c:EnableReviveLimit()
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950316,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,9950316)
e1:SetCost(c9950316.thcost)
e1:SetTarget(c9950316.thtg)
e1:SetOperation(c9950316.thop)
c:RegisterEffect(e1)
--gain ATK
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetValue(c9950316.atkval)
c:RegisterEffect(e2)
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950316,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(c9950316.discon)
e1:SetTarget(c9950316.distg)
e1:SetOperation(c9950316.disop)
c:RegisterEffect(e1)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950316.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950316.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950316,0))
end
function c9950316.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c9950316.thfilter(c)
return c:IsSetCard(0x5ba2) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c9950316.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) and chkc:IsControler(tp) and c9950316.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c9950316.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c9950316.thfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c9950316.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c9950316.atkval(e,c)
return Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_MZONE)*1000
end
function c9950316.discon(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return false end
local tg=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return tg and tg:GetCount()==1 and tg:GetFirst():IsOnField() and Duel.IsChainNegatable(ev) and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950316.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,eg,1,0,0)
end
end
function c9950316.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.SendtoGrave(eg,REASON_EFFECT)
end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950316,0))
end
\ No newline at end of file
--囮物语·神抚子
function c9950317.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),2,4)
c:EnableReviveLimit()
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e4)
--damage val
local e5=e3:Clone()
e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e5)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950317,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCost(c9950317.cost)
e1:SetTarget(c9950317.target)
e1:SetOperation(c9950317.operation)
c:RegisterEffect(e1)
--Damage
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(9950317,1))
e5:SetCategory(CATEGORY_DAMAGE)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_MZONE)
e5:SetCountLimit(1)
e5:SetCondition(c9950317.damcon)
e5:SetTarget(c9950317.damtg)
e5:SetOperation(c9950317.damop)
c:RegisterEffect(e5)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950317.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950317.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950317,0))
end
function c9950317.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 c9950317.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,1,0,0)
end
function c9950317.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsPreviousLocation(LOCATION_MZONE) then
local atk=tc:GetTextAttack()
if atk<0 then atk=0 end
Duel.BreakEffect()
Duel.Damage(1-tp,atk,REASON_EFFECT)
end
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950317,0))
end
function c9950317.damcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp and Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0
end
function c9950317.damtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,4000)
end
function c9950317.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(1-tp,4000,REASON_EFFECT,true)
Duel.RDComplete()
end
--究极白蛇神·神抚子
function c9950318.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_REPTILE),1,6)
c:EnableReviveLimit()
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--damage val
local e5=e3:Clone()
e5:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
c:RegisterEffect(e5)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(c9950318.efilter)
c:RegisterEffect(e3)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(9950318,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c9950318.spcost)
e2:SetTarget(c9950318.target)
e2:SetOperation(c9950318.operation)
c:RegisterEffect(e2)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950318.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950318.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950318,0))
end
function c9950318.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c9950318.filter(c,e,sp)
return c:IsAttackBelow(3000) and (c:IsAttribute(ATTRIBUTE_DARK) or c:IsRace(RACE_REPTILE)) and c:IsCanBeSpecialSummoned(e,0,sp,false,false)
end
function c9950318.spcost(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 c9950318.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c9950318.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_EXTRA)
end
function c9950318.gfilter(c,rank)
return c:IsRank(rank)
end
function c9950318.operation(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local tg=Duel.GetMatchingGroup(c9950318.filter,tp,LOCATION_EXTRA,0,nil,e,tp)
if ft<=0 or tg:GetCount()==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,ft,ft,nil)
local c=e:GetHandler()
local tc=g:GetFirst()
while tc do
Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(500)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(9950318,2))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_DAMAGE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_BATTLE_START)
e1:SetCondition(c9950318.descon2)
e1:SetTarget(c9950318.destg2)
e1:SetOperation(c9950318.desop2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
Duel.SpecialSummonComplete()
end
function c9950318.descon2(e,tp,eg,ep,ev,re,r,rp)
local d=Duel.GetAttackTarget()
if d==e:GetHandler() then d=Duel.GetAttacker() end
e:SetLabelObject(d)
return d~=nil
end
function c9950318.destg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local d=e:GetLabelObject()
Duel.SetOperationInfo(0,CATEGORY_DESTROY,d,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,1-tp,d:GetBaseAttack())
end
function c9950318.desop2(e,tp,eg,ep,ev,re,r,rp)
local d=e:GetLabelObject()
local dam=d:GetBaseAttack()
if d:IsRelateToBattle() and Duel.Destroy(d,REASON_EFFECT)~=0 and dam>0 then
Duel.Damage(1-tp,dam,REASON_EFFECT)
end
end
\ No newline at end of file
--伪物语·抚子
function c9950320.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_DARK),4,2)
c:EnableReviveLimit()
--atk/def
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(c9950320.value)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e2)
--deckdes
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(9950320,0))
e3:SetCategory(CATEGORY_DECKDES)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,9950320)
e3:SetCost(c9950320.cost)
e3:SetTarget(c9950320.target)
e3:SetOperation(c9950320.operation)
c:RegisterEffect(e3)
--spsummon bgm
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_SPSUMMON_SUCCESS)
e8:SetOperation(c9950320.sumsuc)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e9)
end
function c9950320.sumsuc(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950320,0))
end
function c9950320.value(e,c)
return Duel.GetMatchingGroupCount(Card.IsAttribute,0,LOCATION_GRAVE,LOCATION_GRAVE,nil,ATTRIBUTE_DARK)*500
end
function c9950320.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 c9950320.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDiscardDeck(tp,5) and Duel.IsPlayerCanDiscardDeck(1-tp,5) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,PLAYER_ALL,5)
end
function c9950320.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsLocation(LOCATION_GRAVE)
end
function c9950320.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetDecktopGroup(tp,5)
local g2=Duel.GetDecktopGroup(1-tp,5)
g1:Merge(g2)
local ct=g1:FilterCount(c9950320.cfilter,nil)
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if ct~=0 and dg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9950320,1)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sdg=dg:Select(tp,1,ct,nil)
Duel.HintSelection(sdg)
Duel.SendtoGrave(sdg,REASON_EFFECT)
end
Duel.DisableShuffleCheck()
Duel.SendtoGrave(g1,REASON_EFFECT)
Duel.Hint(HINT_MUSIC,0,aux.Stringid(9950320,0))
end
--created & coded by Walrus
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cid.target)
e1:SetOperation(cid.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCountLimit(1,id+1000)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetTarget(cid.thtg)
e2:SetOperation(cid.thop)
c:RegisterEffect(e2)
end
function cid.filter(c)
return c:IsSetCard(0xc97) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500)
end
function cid.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.filter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)==0 or not g:GetFirst():IsLocation(LOCATION_HAND) then return end
Duel.ConfirmCards(1-tp,g)
Duel.Damage(tp,500,REASON_EFFECT)
end
function cid.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xc97) and c:IsAbleToHand() and not c:IsCode(id)
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,500)
end
function cid.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_REMOVED,0,1,1,nil)
if Duel.SendtoHand(g,nil,REASON_EFFECT)==0 then return end
Duel.ConfirmCards(1-tp,g)
if g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.BreakEffect()
Duel.Damage(tp,500,REASON_EFFECT)
end
end
--created & coded by Walrus
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cid.target)
e1:SetOperation(cid.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCountLimit(1,id+1000)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e2:SetCondition(function(e,tp,eg,ep,ev,re) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetTarget(cid.target)
e2:SetOperation(cid.activate)
c:RegisterEffect(e2)
end
function cid.filter(c)
return c:IsFaceup() and c:IsSetCard(0xc97) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_REMOVED)
end
function cid.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--created & coded by Walrus
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cid.target)
e1:SetOperation(cid.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCountLimit(1,id+1000)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetTarget(cid.rmtg)
e2:SetOperation(cid.rmop)
c:RegisterEffect(e2)
end
function cid.sfilter1(c)
return c:IsSetCard(0xcc97) and (c:IsFaceup() or not c:IsLocation(LOCATION_REMOVED))
end
function cid.sfilter2(c)
return c:IsSetCard(0x3c97) and c:IsType(TYPE_MONSTER) and (c:IsFaceup() or c:IsLocation(LOCATION_DECK))
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.sfilter1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil)
and Duel.IsExistingMatchingCard(cid.sfilter2,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,2,tp,LOCATION_DECK)
end
function cid.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.sfilter1),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil):GetFirst()
if Duel.SendtoHand(tc,nil,REASON_EFFECT)==0 or not tc:IsLocation(LOCATION_HAND) then return end
Duel.ConfirmCards(1-tp,tc)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetTarget(aux.TargetBoolFunction(aux.NOT(Card.IsSetCard),0xc97))
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_FLIP_SUMMON)
Duel.RegisterEffect(e3,tp)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
Duel.RegisterEffect(e4,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cid.sfilter2,tp,LOCATION_DECK+LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
function cid.filter(c,e,tp)
return c:IsSetCard(0x3c97) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsFaceup() or c:IsLocation(LOCATION_GRAVE))
end
function cid.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function cid.rmop(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 tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cid.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil,e,tp):GetFirst()
if not tc then return end
if Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) 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+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKSHF)
tc:RegisterEffect(e1,true)
end
Duel.SpecialSummonComplete()
Duel.Damage(tp,1000,REASON_EFFECT)
end
--created & coded by Walrus
local cid,id=GetID()
function cid.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCountLimit(1,id)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(cid.target)
e1:SetOperation(cid.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetCountLimit(1,id+1000)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost)
e2:SetTarget(cid.thtg)
e2:SetOperation(cid.thop)
c:RegisterEffect(e2)
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and chkc:IsSetCard(0x3c97) and chkc:IsAbleToHand() and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(aux.AND(Card.IsAbleToHand,Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,nil,0x3c97) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,aux.AND(Card.IsAbleToHand,Card.IsFaceup,Card.IsSetCard),tp,LOCATION_MZONE,0,1,1,nil,0x3c97)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cid.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Damage(tp,1000,REASON_COST)
end
function cid.cfilter(c)
return c:IsSetCard(0xcc97) and c:IsAbleToHand() and (not c:IsLocation(LOCATION_REMOVED) or c:IsFaceup())
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.cfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
end
function cid.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cid.cfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--created & coded by Walrus
local cid,id=GetID()
function cid.initial_effect(c)
aux.CannotBeEDMaterial(c,nil,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(cid.condition)
e1:SetTarget(cid.target)
e1:SetOperation(cid.operation)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_DEFENSE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(function(e,c) return Duel.GetMatchingGroupCount(aux.AND(Card.IsFaceup,Card.IsSetCard),e:GetHandlerPlayer(),LOCATION_MZONE,LOCATION_MZONE,c,0xc97)*500 end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCountLimit(1,id)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_REMOVE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re and re:GetHandler():IsSetCard(0xc97) and e:GetHandler():IsReason(REASON_EFFECT) end)
e2:SetCost(cid.cost)
e2:SetTarget(cid.thtg)
e2:SetOperation(cid.thop)
c:RegisterEffect(e2)
end
function cid.condition(e,tp,eg,ep,ev,re,r,rp)
local at=Duel.GetAttacker()
return at:GetControler()~=tp and Duel.GetAttackTarget()==nil
end
function cid.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 and 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 cid.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP_DEFENSE)>0 then
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
Duel.BreakEffect()
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_BATTLE_STEP,1)
end
end
function cid.filter(c)
return c:IsSetCard(0xc97) and c:IsAbleToRemoveAsCost()
end
function cid.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cid.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(Duel.SelectMatchingCard(tp,cid.filter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil),POS_FACEUP,REASON_COST)
end
function cid.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,c,1,0,0)
end
function cid.thop(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
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