Commit 5793d8fc authored by REIKAI's avatar REIKAI 💬

delete some cards

parent c5786922
No preview for this file type
--捕兽夹
function c16101107.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16101107,0))
e1:SetCategory(CATEGORY_CONTROL)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(c16101107.target)
e1:SetOperation(c16101107.operation)
c:RegisterEffect(e1)
local e4=e1:Clone()
e4:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetCode(EVENT_FLIP_SUMMON_SUCCESS)
c:RegisterEffect(e5)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c16101107.handcon)
c:RegisterEffect(e2)
end
function c16101107.cfilter(c,tp)
return (c:IsRace(RACE_BEAST) or c:IsRace(RACE_BEASTWARRIOR) or c:IsRace(RACE_WINDBEAST)) and c:GetSummonPlayer()==1-tp and c:IsFaceup()
end
function c16101107.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return eg:IsExists(c16101107.cfilter,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>eg:Filter(c16101107.cfilter,nil,tp):GetCount()-1 end
Duel.SetTargetCard(eg)
Duel.SetOperationInfo(0,CATEGORY_CONTROL,eg,eg:GetCount(),0,0)
end
function c16101107.operation(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c16101107.cfilter,nil,tp)
if g:GetCount()>Duel.GetLocationCount(tp,LOCATION_MZONE) then return end
local tc=g:GetFirst()
while tc do
if tc:IsFaceup() and tc:IsRelateToEffect(e) and Duel.GetControl(tc,tp)~=0 then
tc:RegisterFlagEffect(16101107,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(16101107,1))
end
tc=g:GetNext()
end
end
function c16101107.handcon(e)
return Duel.GetFieldGroupCount(e:GetHandlerPlayer(),LOCATION_ONFIELD,0)==0
end
\ No newline at end of file
--崩解
function c16101125.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(c16101125.cost)
e1:SetTarget(c16101125.target)
e1:SetOperation(c16101125.activate)
c:RegisterEffect(e1)
end
function c16101125.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,6000) end
Duel.PayLPCost(tp,6000)
end
function c16101125.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and Duel.IsPlayerCanRemove(tp) end
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,sg,sg:GetCount(),0,0)
end
function c16101125.activate(e,tp,eg,ep,ev,re,r,rp)
local sg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--SCP-49 疫医
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102000,"SCP")
local kh=c16102000
function c16102000.initial_effect(c)
c:EnableReviveLimit()
--leave F
local e0=rsef.SV_REDIRECT(c,"leave",LOCATION_HAND,rscon.excard2(rscf.CheckSetCard,LOCATION_ONFIELD,0,1,nil,"SCP_J"))
--SpecialSummonRule
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.sprcon,cm.sprop)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16102000,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,16102000)
e3:SetCondition(kh.sprcon1)
e3:SetTarget(kh.sptg)
e3:SetOperation(kh.spop)
c:RegisterEffect(e3)
--disable and reduce ATK
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16102000,0))
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetCountLimit(1)
e4:SetCondition(kh.condition1)
e4:SetTarget(kh.target)
e4:SetOperation(kh.operation)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e5:SetHintTiming(TIMING_DAMAGE_STEP,0x21e0)
e5:SetCondition(kh.condition2)
c:RegisterEffect(e5)
end
function cm.spcfilter(c,tp)
return c:IsReleasable() and c:IsType(TYPE_FUSION) and c:IsFaceup()
end
function cm.spzfilter(c,tp)
return Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.sprcon(e,c,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
return (g1+g2):IsExists(cm.spzfilter,1,nil,tp)
end
function cm.sprop(e,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
local sg=(g1+g2):SelectSubGroup(tp,cm.spzfilter,false,1,1,tp)
Duel.Release(sg,REASON_COST)
end
function kh.tgrfilter(c)
return c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsLocation(LOCATION_GRAVE)
end
function kh.sprcon1(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(kh.tgrfilter,1,nil)
end
function kh.spfilter(c,e,tp)
return c:IsPreviousLocation(LOCATION_ONFIELD)
and c:IsLocation(LOCATION_GRAVE) and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP) and c:IsType(TYPE_MONSTER)
end
function kh.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and eg:IsExists(kh.spfilter,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,eg,1,0,0)
end
function kh.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local sg=nil
local g=eg:Filter(kh.spfilter,nil,e,tp)
if g:GetCount()==0 then return end
if g:GetCount()==1 then
sg=g
else
sg=g:Select(tp,1,1,nil)
end
if Duel.SpecialSummon(sg,0,tp,tp,true,false,POS_FACEUP)~=0 then
sg=sg:GetFirst()
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_REMOVED)
sg:RegisterEffect(e1,true)
end
end
function kh.descfilter(c)
return c:IsFaceup() and c:CheckSetCard("SCP") and not c:CheckSetCard("SCP_J") and not c:IsCode(16102000)
end
function kh.condition1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(kh.descfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
function kh.filter1(c)
return c:IsFaceup()
end
function kh.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and kh.filter1(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(kh.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,kh.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,e:GetHandler())
end
function kh.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) then
local op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
if op==0 then
Duel.Recover(tc:GetControler(),tc:GetTextAttack(),REASON_EFFECT)
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_ATTACK)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_CANNOT_TRIGGER)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e4)
end
if op==1 then
local L1=Duel.GetLP(tc:GetControler())
if L1<tc:GetTextAttack() then Duel.SetLP(tc:GetControler(),0) end
if L1>=tc:GetTextAttack() then Duel.SetLP(tc:GetControler(),L1-tc:GetTextAttack()) end
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetValue(tc:GetAttack()*2)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
end
function kh.condition2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(kh.descfilter,tp,LOCATION_ONFIELD,0,1,e:GetHandler())
end
\ No newline at end of file
--SCP-682 不灭孽蜥
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102001,"SCP")
local kh=c16102001
function kh.initial_effect(c)
c:EnableReviveLimit()
--leave F
local e0=rsef.SV_REDIRECT(c,"leave",LOCATION_HAND,rscon.excard2(rscf.CheckSetCard,LOCATION_ONFIELD,0,1,nil,"SCP_J"))
--SpecialSummonRule
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.sprcon,cm.sprop)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16102001,0))
e3:SetCategory(CATEGORY_NEGATE+CATEGORY_TOHAND)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(kh.discon)
e3:SetTarget(kh.distg)
e3:SetOperation(kh.disop)
c:RegisterEffect(e3)
--
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(16102001,4))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_BATTLED)
e4:SetCondition(kh.condition)
e4:SetTarget(kh.target)
e4:SetOperation(kh.operation)
c:RegisterEffect(e4)
end
function kh.lecon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(kh.filter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.spcfilter(c,tp)
return c:IsReleasable() and c:IsType(TYPE_XYZ) and c:IsFaceup()
end
function cm.spcfilter2(c,tp)
return c:IsControler(tp) and c:IsCode(16102002)
end
function cm.spzfilter(g,tp)
if Duel.GetMZoneCount(tp,g,tp)<=0 then return false end
return g:FilterCount(cm.spcfilter2,nil,tp)==2 or (#g==1 and g:IsExists(cm.spcfilter,1,nil,tp))
end
function cm.sprcon(e,c,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
return (g1+g2):CheckSubGroup(cm.spzfilter,1,2,tp)
end
function cm.sprop(e,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
rshint.Select(tp,"res")
local sg=(g1+g2):SelectSubGroup(tp,cm.spzfilter,false,1,2,tp)
Duel.Release(sg,REASON_COST)
end
function kh.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and Duel.IsChainDisablable(ev)
end
function kh.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function kh.disop(e,tp,eg,ep,ev,re,r,rp)
local tpe=bit.band(re:GetActiveType(),0x7)
local c=e:GetHandler()
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(tpe)
e1:SetValue(kh.efilter)
e1:SetOwnerPlayer(tp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
--if not Duel.IsExistingMatchingCard(kh.cfilter,tp,LOCATION_GRAVE,0,1,nil) then return end
--if Duel.SelectYesNo(tp,aux.Stringid(16102001,7)) then
--Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
--local g=Duel.SelectMatchingCard(tp,kh.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
--Duel.SendtoHand(g,nil,REASON_EFFECT)
--end
end
function kh.efilter(e,re)
local tpe=e:GetLabel()
return tpe==re:GetHandler():GetType()
end
function kh.condition(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetHandler():GetBattleTarget()
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED)
end
function kh.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function kh.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=e:GetHandler():GetBattleTarget()
if bc:IsRelateToBattle() then
local op=Duel.SelectOption(tp,aux.Stringid(16102001,2),aux.Stringid(16102001,3))
if op==0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
e1:SetValue(bc:GetTextAttack())
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(16102001,6))
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2,true)
end
if op==1 then
local code=bc:GetOriginalCodeRule()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_ADD_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetDescription(aux.Stringid(16102001,5))
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CLIENT_HINT)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END,2)
c:RegisterEffect(e2,true)
if not bc:IsType(TYPE_TRAPMONSTER) then
local cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
end
end
end
end
function kh.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then c:ResetEffect(cid,RESET_COPY) end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
\ No newline at end of file
--D级人员
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102002,"SCP_J")
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"dr,th",nil,LOCATION_MZONE,nil,rscost.cost(Card.IsReleasable,"res",LOCATION_ONFIELD),rsop.target(1,"dr"),cm.drop)
local e2=rsef.I(c,{m,1},nil,"sp",nil,LOCATION_HAND,cm.spcon,nil,rsop.target(rscf.spfilter2,"sp"),cm.spop)
end
function cm.drop(e,tp)
if Duel.Draw(tp,1,REASON_EFFECT)<=0 then return end
local tc=Duel.GetOperatedGroup():GetFirst()
Duel.ConfirmCards(1-tp,tc)
if tc:CheckSetCard("SCP") and Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
rsop.SelectToHand(tp,Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,1,nil,{})
end
Duel.ShuffleHand(tp)
end
function cm.spcon(e,tp)
return Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)==0
end
function cm.spop(e,tp)
local c=e:GetHandler()
local e1,e2=rsef.FV_LIMIT_PLAYER({c,tp},"sp,sum",nil,cm.ltg,{1,0},nil,rsreset.pend)
if c:IsRelateToEffect(e) then
rssf.SpecialSummon(c)
end
end
function cm.ltg(e,c)
return not c:CheckSetCard("SCP")
end
\ No newline at end of file
--SCP基金会 Doctors
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102003,"SCP_J")
function cm.initial_effect(c)
local e1=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_HAND+LOCATION_GRAVE,rscon.excard2(Card.IsCode,LOCATION_ONFIELD,0,1,nil,m+1),rscost.cost(Card.IsReleasable,"res",LOCATION_HAND+LOCATION_ONFIELD),rsop.target2(cm.fun,rscf.spfilter2(),"sp"),cm.spop)
local e2=rsef.STO(c,EVENT_SUMMON_SUCCESS,{m,1},nil,"se,th","de,dsp",nil,nil,rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.thop)
local e3=rsef.RegisterClone(c,e2,"code",EVENT_SPSUMMON_SUCCESS)
end
function cm.fun(g,e,tp)
if e:GetHandler():IsLocation(rsloc.hg) then
Duel.SetTargetCard(e:GetHandler())
end
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if c then
rssf.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP,nil,{"leave",LOCATION_REMOVED })
end
end
function cm.thfilter(c)
return c:IsAbleToHand() and c:IsType(TYPE_MONSTER) and c:CheckSetCard("SCP")
end
function cm.thop(e,tp)
local c=e:GetHandler()
local e1,e2=rsef.FV_LIMIT_PLAYER({c,tp},"sp,sum",nil,cm.ltg,{1,0},nil,rsreset.pend)
rsop.SelectToHand(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{})
end
function cm.ltg(e,c)
return not c:CheckSetCard("SCP")
end
\ No newline at end of file
--基金会
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102004,"SCP_J")
function cm.initial_effect(c)
local e1=rsef.ACT(c,nil,nil,{1,m,1},"se,th,tg",nil,nil,nil,rsop.target(cm.thfilter,"th",LOCATION_DECK),cm.thop)
local e2=rsef.FTO(c,EVENT_SPSUMMON_SUCCESS,{m,1},nil,"sp","de,tg",LOCATION_FZONE,cm.spcon,nil,rstg.target(rscf.spfilter2(Card.IsCode,m-2),"sp",LOCATION_GRAVE),cm.spop)
local e3,e4=rsef.FV_LIMIT_PLAYER(c,"sp,sum",nil,cm.ltg,{1,0})
--local e5=rsef.SV_REDIRECT(c,"leave",LOCATION_HAND,rscon.excard2(rscf.CheckSetCard,LOCATION_MZONE,0,1,nil,"SCP"))
end
function cm.thfilter(c)
return c:CheckSetCard("SCP") and (c:IsAbleToHand() or c:IsAbleToGrave()) and c:IsType(TYPE_MONSTER)
end
function cm.thop(e,tp)
rsop.SelectSolve(HINTMSG_SELF,tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,{cm.solvefun,tp})
end
function cm.solvefun(g,tp)
local tc=g:GetFirst()
local b1=tc:CheckSetCard("SCP") and (tc:IsAbleToHand() or tc:IsAbleToGrave()) and tc:IsType(TYPE_MONSTER)
local op=rsop.SelectOption(tp,b1,{m,0},b1,{m,2},true)
if op==1 then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
function cm.cfilter(c,tp)
return c:CheckSetCard("SCP") and c:IsControler(tp) and not c:CheckSetCard("SCP_J")
end
function cm.spcon(e,tp,eg)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.spop(e,tp)
local tc=rscf.GetTargetCard()
if tc then
rssf.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP,nil,{"dis,dise",true,"tri~",true})
end
end
function cm.ltg(e,c)
return not c:CheckSetCard("SCP")
end
\ No newline at end of file
--SCP-173 雕像-最初之作
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102005,"SCP")
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,false)
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.sprcon,cm.sprop)
local e3=rsef.FTO(c,EVENT_CHAIN_SOLVING,{m,0},{1,m},"des","de",LOCATION_MZONE,cm.descon,nil,rsop.target(aux.TRUE,"des",0,LOCATION_ONFIELD),cm.desop)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e4:SetValue(cm.atlimit)
c:RegisterEffect(e4)
local e5=rsef.SV_REDIRECT(c,"leave",LOCATION_HAND,rscon.excard2(rscf.CheckSetCard,LOCATION_ONFIELD,0,1,nil,"SCP_J"))
end
function cm.spcfilter(c,tp)
return c:IsReleasable() and c:IsType(TYPE_SYNCHRO) and c:IsFaceup()
end
function cm.spzfilter(c,tp)
return Duel.GetMZoneCount(tp,c,tp)>0
end
function cm.sprcon(e,c,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
return (g1+g2):IsExists(cm.spzfilter,1,nil,tp)
end
function cm.sprop(e,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
local sg=(g1+g2):SelectSubGroup(tp,cm.spzfilter,false,1,1,tp)
Duel.Release(sg,REASON_COST)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
if rp==tp then return false end
if not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return true end
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
return not g:IsContains(e:GetHandler())
end
function cm.desop(e,tp)
local ct,og,rc=rsop.SelectDestroy(tp,aux.TRUE,tp,0,LOCATION_ONFIELD,1,1,nil,{})
if rc and not rc:IsLocation(LOCATION_HAND+LOCATION_DECK)
and not rc:IsHasEffect(EFFECT_NECRO_VALLEY) then
if rc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (not rc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp,tp,nil,rc)>0)
and rc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.SpecialSummon(rc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,rc)
elseif (rc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and rc:IsSSetable() and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.BreakEffect()
Duel.SSet(tp,rc)
end
end
end
function cm.atlimit(e,c)
return c~=e:GetHandler()
end
\ No newline at end of file
--SCP-96 害羞的人
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102006,"SCP")
function cm.initial_effect(c)
local e1=rscf.SetSummonCondition(c,false)
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.sprcon,cm.sprop)
--local e3=rsef.FTO(c,EVENT_CHAIN_SOLVING,{m,0},nil,"des","de",LOCATION_MZONE,cm.descon,nil,rsop.target(aux.TRUE,"des",LOCATION_MZONE,LOCATION_MZONE,true),cm.desop)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_BECOME_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.descon2)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--Damage Calc
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_TOGRAVE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.tgcon)
e4:SetOperation(cm.tgop)
c:RegisterEffect(e4)
local e5=rsef.SV_REDIRECT(c,"leave",LOCATION_HAND,rscon.excard2(rscf.CheckSetCard,LOCATION_ONFIELD,0,1,nil,"SCP_J"))
end
function cm.spcfilter(c,tp)
return c:IsReleasable() and c:IsType(TYPE_LINK) and c:IsFaceup()
end
function cm.spcfilter2(c,tp)
return c:IsControler(tp) and c:IsCode(16102002)
end
function cm.spzfilter(g,tp)
if Duel.GetMZoneCount(tp,g,tp)<=0 then return false end
return g:FilterCount(cm.spcfilter2,nil,tp)==2 or (#g==1 and g:IsExists(cm.spcfilter,1,nil,tp))
end
function cm.sprcon(e,c,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
return (g1+g2):CheckSubGroup(cm.spzfilter,1,2,tp)
end
function cm.sprop(e,tp)
local g1=Duel.GetReleaseGroup(tp,true):Filter(Card.IsCode,nil,16102002)
local g2=Duel.GetMatchingGroup(cm.spcfilter,tp,LOCATION_MZONE,0,nil,tp)
rshint.Select(tp,"res")
local sg=(g1+g2):SelectSubGroup(tp,cm.spzfilter,false,1,2,tp)
Duel.Release(sg,REASON_COST)
end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and eg:IsContains(e:GetHandler())
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,TYPE_MONSTER)
and not e:GetHandler():IsStatus(STATUS_CHAINING) end
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_MONSTER)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,TYPE_MONSTER)
Duel.Destroy(g,REASON_EFFECT)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return (c==Duel.GetAttacker() or c==Duel.GetAttackTarget()) and c:GetBattleTarget()
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if not bc or not bc:IsRelateToBattle() then return end
Duel.SendtoGrave(bc,REASON_RULE)
if c:IsChainAttackable() then
Duel.ChainAttack()
end
end
--SCP-343 神
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102010,"SCP")
function cm.initial_effect(c)
c:SetUniqueOnField(1,1,m)
local e1=rscf.SetSummonCondition(c,false)
local e2=rscf.SetSpecialSummonProduce(c,LOCATION_HAND,cm.sprcon,cm.sprop)
local e3=rsef.FTO(c,EVENT_ATTACK_ANNOUNCE,{m,0},nil,"sp",nil,LOCATION_HAND,cm.spcon,nil,rsop.target(cm.spfilter,"sp"),cm.spop)
local e4,e5=rsef.SV_INDESTRUCTABLE(c,"battle,effect")
--local e6=rsef.FV_LIMIT_PLAYER(c,"res",nil,cm.restg,{1,1})
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetCode(EFFECT_REFLECT_BATTLE_DAMAGE)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=rsef.QO(c,EVENT_CHAINING,{m,3},1,"th","tg",LOCATION_MZONE,nil,nil,rstg.target(cm.ff,"th",LOCATION_GRAVE,LOCATION_GRAVE),cm.tdop)
end
function cm.gfilter(g,tp)
return Duel.GetMZoneCount(tp,g,tp)>0 and g:GetClassCount(Card.GetRace)==#g
end
function cm.sprcon(e,c,tp)
local g=Duel.GetReleaseGroup(tp)
return g:CheckSubGroup(cm.gfilter,3,3,tp)
end
function cm.sprop(e,tp)
local g=Duel.GetReleaseGroup(tp)
rshint.Select(tp,"res")
local rg=g:SelectSubGroup(tp,cm.gfilter,false,3,3,tp)
Duel.Release(rg,REASON_COST)
end
function cm.spfilter(c,e,tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,true,true)
end
function cm.spcon(e,tp)
return Duel.GetTurnPlayer()~=tp and not Duel.GetAttackTarget() and Duel.GetLP(tp)<=1500
end
function cm.spop(e,tp)
local c=aux.ExceptThisCard(e)
if c and rssf.SpecialSummon(c,0,tp,tp,true,true,POS_FACEUP)>0 then
c:CompleteProcedure()
end
local e1=rsef.FV_LIMIT_PLAYER({e:GetHandler(),tp},"act",cm.val,nil,{1,1},nil,rsreset.pend)
end
function cm.val(e,re)
return re:GetHandler()~=e:GetHandler()
end
function cm.restg(e,c)
return c==e:GetHandler()
end
function cm.ff(c)
return c:IsAbleToHand() or c:IsAbleToDeck()
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,cm.repop)
local tc=rscf.GetTargetCard()
if tc then
local op=Duel.SelectOption(tp,aux.Stringid(16102010,1),aux.Stringid(16102010,2))
if op==0 then
Duel.SendtoHand(tc,nil,REASON_EFFECT) end
if op==1 then
Duel.SendtoDeck(tc,nil,2,REASON_EFFECT) end
end
end
function cm.repop(e,tp)
local c=aux.ExceptThisCard(e)
if Duel.Recover(tp,1000,REASON_EFFECT)>0 and c then
Duel.SendtoDeck(c,nil,2,REASON_EFFECT)
end
end
\ No newline at end of file
--SCP-2000 机械降神
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102011,"SCP")
c16102011.dfc_front_side=16102011
c16102011.dfc_back_side=16102012
function c16102011.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16102011+EFFECT_COUNT_CODE_DUEL+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target1)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16102011,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCategory(CATEGORY_TODECK+CATEGORY_DRAW)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.condition)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetLP(tp)<=1000 or Duel.GetLP(1-tp)<=1000
end
function cm.tdfilter(c)
return (c:IsLocation(0x1e) or c:IsLocation(LOCATION_REMOVED) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) and c:IsAbleToDeck()
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetChainLimit(aux.FALSE)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.tdfilter,tp,0x7e,0x7e,e:GetHandler())
if chk==0 then return g:GetCount()>0 and Duel.IsPlayerCanDraw(tp) and Duel.IsPlayerCanDraw(1-tp) end
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,5,0,0)
Duel.SetChainLimit(aux.FALSE)
end
function cm.sfilter(c,tp)
return c:IsLocation(LOCATION_DECK) and c:IsControler(tp)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(aux.NecroValleyFilter(cm.tdfilter),tp,0x7e,0x7e,e:GetHandler())
Duel.SendtoDeck(tg,nil,0,REASON_EFFECT)
local g=Duel.GetOperatedGroup()
if g:IsExists(cm.sfilter,1,nil,tp) then Duel.ShuffleDeck(tp) end
if g:IsExists(cm.sfilter,1,nil,1-tp) then Duel.ShuffleDeck(1-tp) end
local ct=g:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if ct>0 and Duel.Draw(tp,5,REASON_EFFECT)==5 and Duel.Draw(1-tp,5,REASON_EFFECT)==5 then
Duel.SetLP(tp,8000)
Duel.SetLP(1-tp,8000)
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return end
local tcode=c.dfc_back_side
c:SetEntityCode(tcode,true)
c:ReplaceEffect(tcode,0,0)
Duel.Hint(HINT_CARD,1,m+1)
end
end
\ No newline at end of file
--SCP-2000 机械降神
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102012,"SCP")
c16102012.dfc_front_side=16102011
c16102012.dfc_back_side=16102012
function cm.initial_effect(c)
local e0=rsef.ACT(c)
local e1=rsef.SV_IMMUNE_EFFECT(c,rsval.imes)
--local e2=rsef.FV_LIMIT_PLAYER(c,"res",nil,cm.restg,{1,1})
local e3=rsef.FV_LIMIT_PLAYER(c,"dr",nil,nil,{1,0})
local e4=rsef.I(c,{m,0},{1},"sp",nil,LOCATION_SZONE,nil,nil,rsop.target(cm.spfilter,"sp",LOCATION_DECK),cm.spop)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DRAW_COUNT)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_SZONE)
e5:SetTargetRange(1,0)
e5:SetValue(0)
c:RegisterEffect(e5)
--changge
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_ADJUST)
e6:SetRange(LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_HAND+LOCATION_EXTRA)
e6:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE)
e6:SetCountLimit(1)
e6:SetCondition(cm.backon)
e6:SetOperation(cm.backop)
c:RegisterEffect(e6)
end
function cm.restg(e,c)
return c==e:GetHandler()
end
function cm.spfilter(c,e,tp)
return c:CheckSetCard("SCP") and c:IsCanBeSpecialSummoned(e,0,tp,true,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsType(TYPE_MONSTER)
end
function cm.spop(e,tp)
rsop.SelectSpecialSummon(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,{0,tp,tp,true,false,POS_FACEUP,nil,{"leave",LOCATION_DECK }},e,tp)
end
function cm.backon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c.dfc_front_side and c:GetOriginalCode()==c.dfc_back_side
end
function cm.backop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tcode=c.dfc_front_side
c:SetEntityCode(tcode)
Duel.ConfirmCards(tp,Group.FromCards(c))
Duel.ConfirmCards(1-tp,Group.FromCards(c))
c:ReplaceEffect(tcode,0,0)
Duel.Hint(HINT_CARD,1,m-1)
end
\ No newline at end of file
--SCP基金会 Dr.Clef
if not pcall(function() require("expansions/script/c16101100") end) then require("script/c16101100") end
local m,cm=rscf.DefineCard(16102013,"SCP_J")
function cm.initial_effect(c)
aux.AddLinkProcedure(c,cm.lkfilter,4,4)
c:EnableReviveLimit()
c:SetUniqueOnField(1,1,m)
local e1=rsef.SV_INDESTRUCTABLE(c,"effect")
local e2=rsef.I(c,{m,0},{1,m},"sp",nil,LOCATION_MZONE,nil,nil,rsop.target(cm.spfilter,"sp",LOCATION_DECK),cm.spop)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100)
e3:SetCondition(cm.chcon)
e3:SetTarget(cm.chtg)
e3:SetOperation(cm.chop)
c:RegisterEffect(e3)
end
function cm.lkfilter(c)
return c:CheckSetCard("SCP")
end
function cm.spfilter(c,e,tp)
return c:IsCode(16102002) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsType(TYPE_MONSTER)
end
function cm.spop(e,tp)
if not Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) then return end
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
tc=g:GetFirst()
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_TRIGGER)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
Duel.SpecialSummonComplete()
end
function cm.chcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp or ep~=tp
end
function cm.filter(c)
return c:IsReleasable()
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,re:GetHandler():GetControler(),LOCATION_ONFIELD+LOCATION_HAND,0,1,re:GetHandler()) end
end
function cm.chop(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 g=Duel.GetFieldGroup(tp,LOCATION_ONFIELD+LOCATION_HAND,0)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
sg=g:Select(tp,1,1,e:GetHandler())
Duel.Release(sg,REASON_EFFECT)
end
end
\ No newline at end of file
--MysticElement 加斯帕
local m=16105000
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--level change
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.chcon)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--S SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_MAIN_END)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
---------------P effecct
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_PZONE)
e3:SetCondition(cm.spcon1)
e3:SetOperation(cm.cost)
c:RegisterEffect(e3)
--Cannot p
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_PZONE)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(1,0)
e4:SetTarget(cm.splimit)
c:RegisterEffect(e4)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END,1)
e1:SetTarget(cm.thsplimit)
Duel.RegisterEffect(e1,tp)
end
function cm.thsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.filter(c)
return c:IsFaceup() and c:GetLevel()>0 and c:GetLevel()~=1
end
function cm.chcon(e,tp,eg,ep,ev,re,r,rp,chk)
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler())
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsFaceup() and c:IsRelateToEffect(e)) then return end
local op=Duel.SelectOption(tp,aux.Stringid(m,2),aux.Stringid(m,3))
if op==0 then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
if op==1 then
if c:IsFaceup() and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_LEVEL)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetValue(-2)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
if not Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) then return end
local g=Duel.GetMatchingGroup(cm.filter,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
local tc=g:GetFirst()
while (tc)
do
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CHANGE_LEVEL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetValue(1)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return Duel.GetTurnPlayer()~=tp and (ph==PHASE_MAIN1 or ph==PHASE_MAIN2)
end
function cm.filter1(tc,c,e)
if not tc:IsFaceup() or not tc:IsCanBeSynchroMaterial() then return false end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SYNCHRO_MATERIAL)
tc:RegisterEffect(e1,true)
e:SetLabelObject(e1)
return true
end
function cm.synfilter(c,mg)
return c:IsSynchroSummonable(nil,mg)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local mg=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetHandler(),e)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler(),mg) 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()
local te=e:GetLabelObject()
te:Reset()
local mg=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_MZONE,LOCATION_MZONE,nil,e:GetHandler(),e)
local te=e:GetLabelObject()
if c:IsControler(1-tp) or not c:IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,e:GetHandler(),mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),c,mg)
te:Reset()
end
end
function cm.cfilter(c)
return c:IsFacedown() or not c:IsLevel(10)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil)
end
\ No newline at end of file
--MysticElement 梅尔基奥尔
local m=16105004
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--Fus
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_EXTRA)
e2:SetCost(cm.thcost)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
---------------P effecct
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e3:SetRange(LOCATION_PZONE)
e3:SetCondition(cm.spcon1)
e3:SetOperation(cm.cost1)
c:RegisterEffect(e3)
--Cannot p
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_PZONE)
e4:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTargetRange(1,0)
e4:SetTarget(cm.splimit)
c:RegisterEffect(e4)
end
function cm.cost1(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END,1)
e1:SetTarget(cm.splimit)
Duel.RegisterEffect(e1,tp)
end
function cm.cfilter(c)
return c:IsFacedown() or not c:IsLevel(10)
end
function cm.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,Duel.GetTurnPlayer(),LOCATION_MZONE,0,1,nil)
end
function cm.counterfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
--fusion substitute
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_FUSION_SUBSTITUTE)
e1:SetCondition(cm.subcon)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(m)
c:RegisterEffect(e2)
e:SetLabelObject(e1)
end
function cm.subcon(e)
return e:GetHandler():IsLocation(LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED+LOCATION_DECK+LOCATION_EXTRA)
end
function cm.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (c:IsSetCard(0xcc3) or c:IsLevel(10)) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
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,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
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,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,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.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,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
local se=e:GetLabelObject()
se:Reset()
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.thsplimit)
e1:SetReset(RESET_PHASE+PHASE_END,1)
Duel.RegisterEffect(e1,tp)
end
function cm.thsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end
function cm.thfilter(c)
return c:IsLevel(10) and c:IsAbleToHand()
end
function cm.thconf(c)
return c:IsFaceup() and c:IsLevel(10)
end
function cm.thcon(e,tp)
return Duel.IsExistingMatchingCard(cm.thconf,tp,LOCATION_MZONE,0,1,nil)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_EXTRA)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
if not Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_GRAVE,0,1,nil) then return end
local g=Group.CreateGroup()
g:AddCard(e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local tc=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
g:Merge(tc)
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
\ No newline at end of file
--MysticGate 天堂之孔
local m=16105008
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
---------------P effecct
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.ctgcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_PZONE,0)
e2:SetCondition(cm.ctgcon)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--Cannot p
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit)
c:RegisterEffect(e3)
---
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.counterfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
end
function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end
function cm.ctgcon(e,tp)
return Duel.IsExistingMatchingCard(Card.IsCode,e:GetHandlerPlayer(),LOCATION_PZONE,0,1,e:GetHandler(),16105010)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND,0,2,nil,e,tp) ) then return end
local tc1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then tc1=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,cm.spfiter,tp,LOCATION_HAND,0,1,math.min(tc1,2),nil,e,tp)
if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
\ No newline at end of file
--MysticGate 地狱之孔
local m=16105010
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
---------------P effecct
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetCondition(cm.ctgcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--cannot be target
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetRange(LOCATION_PZONE)
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetTargetRange(LOCATION_PZONE,0)
e2:SetCondition(cm.ctgcon)
e2:SetValue(aux.indoval)
c:RegisterEffect(e2)
--Cannot p
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_PZONE)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_CANNOT_DISABLE)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit)
c:RegisterEffect(e3)
---
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.counterfilter)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.counterfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetLabelObject(e)
e1:SetTarget(cm.spsplimit)
Duel.RegisterEffect(e1,tp)
end
function cm.spsplimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3))
end
function cm.ctgcon(e,tp)
return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_PZONE,0,1,e:GetHandler(),16105008)
end
function cm.spfilter(c,e,tp)
return c:IsLevel(10) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not (e:GetHandler():IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)) then return end
local tc1=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then tc1=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,math.min(tc1,2),nil,e,tp)
if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)==2 then
Duel.Destroy(e:GetHandler(),REASON_EFFECT)
end
end
end
\ No newline at end of file
--MysticGate 末日门
local m=16105012
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.mfilter,1,1)
--SendtoGrave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.tgcon)
e1:SetTarget(cm.tgtg)
e1:SetOperation(cm.tgop)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,m+1)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.mfilter(c)
return c:GetLevel()>=10 and c:IsRace(RACE_FIEND)
end
function cm.tgfilter(c)
return c:IsAbleToGrave() and c:IsRace(RACE_FIEND)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
end
function cm.filter(c,e,tp)
return c:IsRace(RACE_FIEND) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
if g:GetCount()>0 then
Duel.ConfirmCards(tp,g)
if g:IsExists(cm.filter,1,nil,e,tp) then
local g1=g:FilterSelect(tp,cm.filter,1,1,nil,e,tp)
Duel.SpecialSummon(g1,0,tp,tp,false,false,POS_FACEUP)
end
Duel.ShuffleHand(1-tp)
end
end
\ No newline at end of file
local m=16105014
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.mfilter,1,1)
end
function cm.mfilter(c)
return c:IsLinkType(TYPE_XYZ) and ((c:IsRankAbove(10) and c:IsRace(RACE_FAIRY)) or c:IsSetCard(0xcc3))
end
\ No newline at end of file
--对Mystic的探究
function c16105016.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,16105016+EFFECT_COUNT_CODE_OATH)
e1:SetCost(c16105016.cost)
e1:SetTarget(c16105016.target)
e1:SetOperation(c16105016.activate)
c:RegisterEffect(e1)
end
function c16105016.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c16105016.filter(c)
return c:IsRace(RACE_FAIRY) and c:IsAttack(0) and c:IsDefense(0) and c:IsAbleToHand() and c:GetLevel()>=10
end
function c16105016.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16105016.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16105016.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16105016.filter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--MysticGate 新星门
local m=16105020
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
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+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
--
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.chtg)
e3:SetOperation(cm.chop)
c:RegisterEffect(e3)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
function cm.chfilter(c)
return c:IsFaceup() and c:GetLeftScale()~=13
end
function cm.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.chfilter,tp,LOCATION_PZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local sg=Duel.SelectTarget(tp,cm.chfilter,tp,LOCATION_PZONE,0,1,1,nil)
end
function cm.chop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local sc=Duel.GetFirstTarget()
if sc:IsRelateToEffect(e) and c:IsRelateToEffect(e) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_LSCALE)
e1:SetValue(13)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_RSCALE)
sc:RegisterEffect(e2)
end
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_EXTRA_PENDULUM_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetCountLimit(1,29432356)
e3:SetValue(cm.pendvalue)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.pendvalue(e,c)
return c:IsType(TYPE_MONSTER)
end
\ No newline at end of file
--MysticDragon 超星龙
local m=16105022
local cm=_G["c"..m]
function cm.initial_effect(c)
--S summon
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0xcc3),aux.NonTuner(cm.synfilter),1)
-----P EFFECT
--imm
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_IMMUNE_EFFECT)
e0:SetRange(LOCATION_PZONE)
e0:SetTargetRange(0,LOCATION_ONFIELD)
e0:SetTarget(cm.efilter1)
e0:SetValue(cm.efilter2)
c:RegisterEffect(e0)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCode(PHASE_STANDBY+EVENT_PHASE)
e1:SetCondition(cm.sppcon)
e1:SetTarget(cm.spptarget)
e1:SetOperation(cm.sppop)
c:RegisterEffect(e1)
----Monster Effect
--cannot special summon
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(cm.slimit)
c:RegisterEffect(e2)
--set p
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
--trigger
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.discon)
e4:SetCost(cm.cost)
e4:SetTarget(cm.distg)
e4:SetOperation(cm.disop)
c:RegisterEffect(e4)
--disable spsummon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,3))
e5:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EVENT_SUMMON)
e5:SetCondition(cm.dscon)
e5:SetCost(cm.cost)
e5:SetTarget(cm.dstg)
e5:SetOperation(cm.dsop)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EVENT_FLIP_SUMMON)
c:RegisterEffect(e6)
local e7=e5:Clone()
e7:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e7)
--To Pzone
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,4))
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetRange(LOCATION_EXTRA)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1)
e8:SetTarget(cm.toptarget)
e8:SetOperation(cm.topop)
c:RegisterEffect(e8)
end
function cm.sppcon(e,tp)
return Duel.GetTurnPlayer()==tp
end
function cm.slimit(e,se,sp,st)
return se:GetHandler()==e:GetHandler() or (bit.band(st,SUMMON_TYPE_SYNCHRO)==SUMMON_TYPE_SYNCHRO) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM)
end
function cm.synfilter(c)
return c:GetOriginalLevel()==10
end
function cm.efilter1(e,ct)
return true
end
function cm.efilter2(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.tdfilter(c)
return c:IsLevel(10) and c:IsAbleToHand() and c:IsFaceup()
end
function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,0,0,tp,LOCATION_GRAVE)
end
function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local num=Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_MZONE,nil)
if not (c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc=Duel.SelectMatchingCard(tp,cm.tdfiter,tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,num,nil)
if tc:GetCount()>0 then
if Duel.SendtoHand(tc,nil,REASON_EFFECT)~=0 then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function cm.setfilter1(c)
return c:IsCode(16105020) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if chk==0 then return #g==num1
and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0 end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local g1=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if not #g==#g1 or not Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) or g1:GetCount()<1 then return end
if not Duel.SendtoHand(g1,nil,REASON_EFFECT)==#g then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g2=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,tc1)
local tc2=g2:GetFirst()
if Duel.MoveToField(tc1,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
if Duel.MoveToField(tc2,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
tc2:SetStatus(STATUS_EFFECT_ENABLED,true)
end
tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev)
end
function cm.costfilter(c)
return c:IsCode(16105020) and c:IsAbleToExtra()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoExtraP(g,nil,REASON_COST)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
function cm.dscon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function cm.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE_SUMMON,eg,eg:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,eg:GetCount(),0,0)
end
function cm.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.SendtoDeck(eg,nil,2,REASON_EFFECT)
end
function cm.toptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) and #g==num1 and e:GetHandler():IsFaceup() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function cm.topop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) or not e:GetHandler():IsFaceup() or not e:GetHandler():IsRelateToEffect(e) then return false end
local num=Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)
local g1=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if num~=g1:GetCount() then return false end
if Duel.SendtoHand(g1,nil,REASON_EFFECT)==num then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
e:GetHandler():SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
\ No newline at end of file
--MysticDragon
local m=16105024
local cm=_G["c"..m]
function cm.initial_effect(c)
--S summon
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0xcc3),4,true)
-----P EFFECT
--imm
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e0:SetRange(LOCATION_PZONE)
e0:SetTargetRange(0,LOCATION_ONFIELD)
e0:SetTarget(cm.efilter1)
e0:SetValue(aux.tgoval)
c:RegisterEffect(e0)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_TOEXTRA)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCode(PHASE_STANDBY+EVENT_PHASE)
e1:SetCondition(cm.sppcon)
e1:SetTarget(cm.spptarget)
e1:SetOperation(cm.sppop)
c:RegisterEffect(e1)
----Monster Effect
--cannot special summon
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(cm.slimit)
c:RegisterEffect(e2)
--set p
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
--trigger
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(cm.disrmcost)
e4:SetTarget(cm.disrmtg)
e4:SetOperation(cm.disrmop)
c:RegisterEffect(e4)
--To Pzone
local e8=Effect.CreateEffect(c)
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetRange(LOCATION_EXTRA)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1)
e8:SetTarget(cm.toptarget)
e8:SetOperation(cm.topop)
c:RegisterEffect(e8)
end
function cm.sppcon(e,tp)
local tp=e:GetHandler():GetControler()
return Duel.GetTurnPlayer()==tp
end
function cm.slimit(e,se,sp,st)
return (bit.band(st,SUMMON_TYPE_FUSION)==SUMMON_TYPE_FUSION) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM)
end
function cm.synfilter(c)
return c:GetOriginalLevel()==10
end
function cm.efilter1(e,ct)
return true
end
function cm.efilter2(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.tdfilter(c)
return c:IsSetCard(0xcc3) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_DECK,0,1,nil) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,tp,0)
end
function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(cm.tdilter,tp,LOCATION_DECK,0,1,nil) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) and c:IsAbleToExtra()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local tc=Duel.SelectMatchingCard(tp,cm.tdilter,tp,LOCATION_DECK,0,1,1,nil)
if tc:GetCount()>0 then
tc=tc:GetFirst()
if Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
Duel.SendtoExtraP(c,nil,REASON_EFFECT)
end
end
end
function cm.setfilter1(c)
return c:IsCode(16105026) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.settfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsType(TYPE_PENDULUM)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil,e,tp)
if #g==2 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end
if chk==0 then return #g==num1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=#g and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0 end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil,e,tp)
if #g==2 and Duel.IsPlayerAffectedByEffect(tp,59822133) then return false end
if not (#g==num1
and Duel.GetLocationCount(tp,LOCATION_MZONE)>=#g and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0) then return end
if not Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)==num1 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g2=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,tc1)
local tc2=g2:GetFirst()
if Duel.MoveToField(tc1,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
if Duel.MoveToField(tc2,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
tc2:SetStatus(STATUS_EFFECT_ENABLED,true)
end
tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
function cm.costfilter(c)
return c:IsCode(16105026) and c:IsAbleToExtra()
end
function cm.disrmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(m)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoExtraP(g,nil,REASON_COST)
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFlagEffect(tp,m)==0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)>0
local b2=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_REMOVED,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function cm.disrmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.GetFlagEffect(tp,m)==0 and Duel.GetMatchingGroupCount(nil,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)>0
local b2=Duel.IsExistingMatchingCard(aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_REMOVED,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,3))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,4))+1
else return end
if op==0 then
local cad=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
local sc=cad:GetFirst()
while sc do
sc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,2,1,aux.Stringid(m,5))
sc=cad:GetNext()
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(cm.actfilter)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local g=Duel.SelectMatchingCard(tp,aux.disfilter1,tp,0,LOCATION_ONFIELD+LOCATION_REMOVED,1,2,nil)
if g:GetCount()<1 then return end
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_REMOVE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.actfilter(e,re,tp)
return re:GetHandler():GetFlagEffect(m)>0
end
function cm.toptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) and #g==num1 and e:GetHandler():IsFaceup() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function cm.topop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) or not e:GetHandler():IsFaceup() or not e:GetHandler():IsRelateToEffect(e) then return false end
local num=Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)
local g1=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if num~=g1:GetCount() then return false end
if Duel.SendtoHand(g1,nil,REASON_EFFECT)==num then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--MysticGate 阴门
local m=16105026
local cm=_G["c"..m]
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
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+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tetg)
e3:SetOperation(cm.teop)
c:RegisterEffect(e3)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
--e3
function cm.tefilter(c)
return c:IsSetCard(0xcc3) and c:IsType(TYPE_MONSTER) and not c:IsCode(m+4) and c:IsAbleToHand()
end
function cm.tetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tefilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.teop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return false end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local g=Duel.SelectMatchingCard(tp,cm.tefilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoHand(c,nil,REASON_EFFECT)
local sc=g:GetFirst()
while sc do
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetTargetRange(1,1)
e5:SetTarget(cm.distg)
e5:SetReset(RESET_PHASE+PHASE_END)
e5:SetLabelObject(sc)
Duel.RegisterEffect(e5,tp)
sc=g:GetNext()
end
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.distg(e,c)
local sc=e:GetLabelObject()
return c:IsOriginalCodeRule(sc:GetOriginalCodeRule())
end
function cm.splimit0(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10))
end
\ No newline at end of file
--MysticDragon
local m=16105028
local cm=_G["c"..m]
function cm.initial_effect(c)
--S summon
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c,false)
aux.AddXyzProcedureLevelFree(c,cm.mfilter,nil,3,3)
-----P EFFECT
--imm
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e0:SetRange(LOCATION_PZONE)
e0:SetTargetRange(0,LOCATION_ONFIELD)
e0:SetTarget(cm.efilter1)
e0:SetValue(aux.indoval)
c:RegisterEffect(e0)
--SpecialSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e1:SetCategory(CATEGORY_TOEXTRA+CATEGORY_SPECIAL_SUMMON)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1)
e1:SetCode(PHASE_STANDBY+EVENT_PHASE)
e1:SetCondition(cm.sppcon)
e1:SetTarget(cm.spptarget)
e1:SetOperation(cm.sppop)
c:RegisterEffect(e1)
----Monster Effect
--cannot special summon
local e2=Effect.CreateEffect(c)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
e2:SetValue(cm.slimit)
c:RegisterEffect(e2)
--set p
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.settg)
e3:SetOperation(cm.setop)
c:RegisterEffect(e3)
--trigger
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,2))
e4:SetCategory(CATEGORY_TODECK)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(cm.disrmcost)
e4:SetTarget(cm.disrmtg)
e4:SetOperation(cm.disrmop)
c:RegisterEffect(e4)
--To Pzone
local e8=Effect.CreateEffect(c)
e8:SetCategory(CATEGORY_TOHAND)
e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetRange(LOCATION_EXTRA)
e8:SetCode(EVENT_FREE_CHAIN)
e8:SetCountLimit(1)
e8:SetTarget(cm.toptarget)
e8:SetOperation(cm.topop)
c:RegisterEffect(e8)
end
cm.pendulum_level=12
function cm.sppcon(e,tp)
return Duel.GetTurnPlayer()==tp
end
function cm.mfilter(c,xyzc)
return c:IsSetCard(0xcc3)
end
function cm.slimit(e,se,sp,st)
return (bit.band(st,SUMMON_TYPE_XYZ)==SUMMON_TYPE_XYZ) or (bit.band(st,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM)
end
function cm.synfilter(c)
return c:GetOriginalLevel()==10
end
function cm.efilter1(e,ct)
return true
end
function cm.efilter2(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function cm.tdfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsType(TYPE_MONSTER)
end
function cm.spptarget(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tdfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) and e:GetHandler():IsAbleToExtra() end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,e:GetHandler(),1,tp,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,0,1,tp,0)
end
function cm.sppop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not (c:IsRelateToEffect(e) and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and c:IsAbleToExtra()) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tdfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if tc:GetCount()>0 then
if Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)~=0 then
Duel.SendtoExtraP(c,nil,REASON_EFFECT)
end
end
end
function cm.setfilter1(c)
return c:IsCode(16105030) and c:IsType(TYPE_PENDULUM) and not c:IsForbidden()
end
function cm.settfilter(c)
return c:IsAbleToExtra() and c:IsType(TYPE_PENDULUM)
end
function cm.settg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil)
if chk==0 then return #g==num1
and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0 end
end
function cm.setop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(cm.settfilter,tp,LOCATION_PZONE,0,nil,e,tp)
if not (#g==num1
and Duel.IsExistingMatchingCard(cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,2,nil) and num1>0) then return end
if not Duel.SendtoExtraP(g,nil,REASON_EFFECT)==#g then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g1=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tc1=g1:GetFirst()
if not tc1 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g2=Duel.SelectMatchingCard(tp,cm.setfilter1,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,tc1)
local tc2=g2:GetFirst()
if Duel.MoveToField(tc1,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
if Duel.MoveToField(tc2,tp,tp,LOCATION_PZONE,POS_FACEUP,false) then
tc2:SetStatus(STATUS_EFFECT_ENABLED,true)
end
tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
function cm.costfilter(c)
return c:IsCode(16105030) and c:IsAbleToExtra()
end
function cm.tddfilter(c)
return c:IsAbleToDeck()
end
function cm.disrmcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,nil) and c:GetFlagEffect(m)==0 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoExtraP(g,nil,REASON_COST)
c:RegisterFlagEffect(m,RESET_CHAIN,0,1)
end
function cm.disrmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFlagEffect(tp,m)==0
local b2=Duel.IsExistingMatchingCard(cm.tddfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0
if chk==0 then return b1 or b2 end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,0,1,0,0)
end
function cm.filter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function cm.disrmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local b1=Duel.GetFlagEffect(tp,m)==0
local b2=Duel.IsExistingMatchingCard(cm.tddfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil)
and Duel.GetFlagEffect(tp,m+1)==0
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,3),aux.Stringid(m,4))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,3))
elseif b2 then op=Duel.SelectOption(tp,aux.Stringid(m,4))+1
else return end
if op==0 then
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(cm.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.tddfilter,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,2,nil)
if g:GetCount()<1 then return end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_TO_HAND)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetTarget(cm.cntg)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
Duel.RegisterFlagEffect(tp,m+1,RESET_PHASE+PHASE_END,0,1)
end
end
function cm.cntg(e,c)
return c:IsLocation(LOCATION_DECK)
end
function cm.aclimit(e,re,tp)
return re:GetActivateLocation()==LOCATION_HAND
end
function cm.toptarget(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
local num1=Duel.GetMatchingGroupCount(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) and #g==num1 and e:GetHandler():IsFaceup() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,g:GetCount(),0,0)
end
function cm.topop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_PZONE,0,1,nil) or not e:GetHandler():IsFaceup() or not e:GetHandler():IsRelateToEffect(e) then return false end
local num=Duel.GetFieldGroupCount(tp,LOCATION_PZONE,0)
local g1=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,LOCATION_PZONE,0,nil)
if num~=g1:GetCount() then return false end
if Duel.SendtoHand(g1,nil,REASON_EFFECT)==num then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
\ No newline at end of file
--MysticGate 阳门
local m=16105030
local cm=_G["c"..m]
function c16105030.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
--splimit
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+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_TOEXTRA)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1,m)
e3:SetTarget(cm.tetg)
e3:SetOperation(cm.teop)
c:RegisterEffect(e3)
end
function cm.splimit(e,c,tp,sumtp,sumpos)
return not (c:IsLevel(10) or c:IsRank(10) or c:IsSetCard(0xcc3)) and bit.band(sumtp,SUMMON_TYPE_PENDULUM)==SUMMON_TYPE_PENDULUM
end
--e3
function cm.tefilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsSetCard(0xcc3) and not c:IsCode(m-4)
end
function cm.tetg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.tefilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOEXTRA,nil,1,tp,LOCATION_DECK)
end
function cm.teop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return false end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(m,3))
local g=Duel.SelectMatchingCard(tp,cm.tefilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoExtraP(g,tp,REASON_EFFECT)
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.splimit0)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function cm.splimit0(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsSetCard(0xcc3) or c:IsLevel(10) or c:IsRank(10))
end
\ No newline at end of file
--Mystic Story
local m=16105032
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.chtg2)
e4:SetOperation(cm.chop2)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_FZONE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():SetTurnCounter(0)
--destroy
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,3)
cm[e:GetHandler()]=e1
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(m)
end
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xcc3) and c:IsControler(tp) and bit.band(c:GetSummonLocation(),LOCATION_EXTRA)~=0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.tgfilter(c,tp,eg)
local sc1=c:GetLeftScale()
local sc2=c:GetRightScale()
return eg:IsContains(c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,sc1,sc2)
end
function cm.thfilter(c,sc1,sc2)
return c:IsSetCard(0x9cc3) and c:IsAbleToHand() and c:GetLeftScale()==sc1 and c:GetRightScale()==sc2 and c:IsType(TYPE_PENDULUM)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc,tp,eg) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg)
end
if eg:GetCount()==1 then
Duel.SetTargetCard(eg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,eg)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local sc1=c:GetLeftScale()
local sc2=c:GetRightScale()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,sc1,sc2)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
if thg:GetCount()>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
end
end
\ No newline at end of file
local m=16105034
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_TOHAND)
e4:SetType(EFFECT_TYPE_TRIGGER_F+EFFECT_TYPE_FIELD)
e4:SetCode(EVENT_PHASE+PHASE_END)
e4:SetRange(LOCATION_FZONE)
e4:SetCountLimit(1)
e4:SetTarget(cm.chtg2)
e4:SetOperation(cm.chop2)
c:RegisterEffect(e4)
--
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_FZONE)
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e5:SetValue(1)
c:RegisterEffect(e5)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
e:GetHandler():SetTurnCounter(0)
--destroy
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(cm.descon)
e1:SetOperation(cm.desop)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN,3)
e:GetHandler():RegisterEffect(e1)
e:GetHandler():RegisterFlagEffect(m,RESET_PHASE+PHASE_END+RESET_OPPO_TURN,0,3)
cm[e:GetHandler()]=e1
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetTurnCounter()
ct=ct+1
c:SetTurnCounter(ct)
if ct==3 then
Duel.Destroy(c,REASON_RULE)
c:ResetFlagEffect(m)
end
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsSetCard(0xcc3) and c:IsControler(tp) and bit.band(c:GetSummonLocation(),LOCATION_EXTRA)~=0
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil,tp)
end
function cm.tgfilter(c,tp,eg)
local sc1=c:GetLeftScale()
local sc2=c:GetRightScale()
return eg:IsContains(c) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil,sc1,sc2)
end
function cm.thfilter(c,sc1,sc2)
return not c:IsForbidden() and c:IsType(TYPE_PENDULUM) and c:IsSetCard(0x3cc3) and c:GetLeftScale()==sc1 and c:GetRightScale()==sc2
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.tgfilter(chkc,tp,eg) end
if chk==0 then return Duel.IsExistingTarget(cm.tgfilter,tp,LOCATION_MZONE,0,1,nil,tp,eg) and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
end
if eg:GetCount()==1 then
Duel.SetTargetCard(eg)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,eg)
end
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
local sc1=c:GetLeftScale()
local sc2=c:GetRightScale()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil,sc1,sc2)
if g:GetCount()>0 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
end
function cm.chtg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,LOCATION_ONFIELD)
end
function cm.chop2(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) or not Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=Duel.SelectMatchingCard(tp,Card.IsAbleToHand,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
if thg:GetCount()>0 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
end
end
\ No newline at end of file
--记录的神因子
local m=16105036
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,0))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_IGNITION)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetTarget(cm.sptg)
e6:SetOperation(cm.spop)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
Sr_spsumback={}
Sr_spsumback[1]=0
local res1=Effect.CreateEffect(c)
res1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
res1:SetCode(RESET_PHASE+PHASE_END)
res1:SetOperation(cm.reset)
Duel.RegisterEffect(res1,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function is_include(value,tab)
if tab==nil then return false end
for k,v in ipairs(tab) do
if v == value then
return true
end
end
return false
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
local spgp=eg:Filter(Card.IsSetCard,nil,0xcc3)
if spgp:GetCount()<=0 then return false end
local tc=spgp:GetFirst()
while tc do
Sr_spsumback[#Sr_spsumback+1]=tc:GetOriginalCode()
tc=spgp:GetNext()
end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
Sr_spsumback={}
Sr_spsumback[1]=0
end
function cm.thfilter(c)
return c:IsSetCard(0xcc3) and c:IsAbleToHand()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
if Duel.SendtoHand(sg,nil,REASON_EFFECT)~=0 then
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.ConfirmCards(1-tp,sg)
end
end
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and is_include(c:GetCode(),Sr_spsumback)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetFlagEffect(tp,m)==0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc1=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
if Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)~=0 and g:GetFirst():IsType(TYPE_NORMAL) then
local e2=Effect.CreateEffect(tc1)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_SZONE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_LINK_SPELL_KOISHI)
e2:SetValue(LINK_MARKER_TOP+LINK_MARKER_TOP_LEFT+LINK_MARKER_TOP_RIGHT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc1:RegisterEffect(e2)
end
end
end
\ No newline at end of file
--MysticMystic 南瓜杰克
function c16105038.initial_effect(c)
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c16105038.matfilter,2)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(16105038,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,16105038)
e1:SetCondition(c16105038.spcon)
e1:SetTarget(c16105038.sptg)
e1:SetOperation(c16105038.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16105038,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,16105039)
e2:SetCondition(c16105038.thcon)
e2:SetTarget(c16105038.thtg)
e2:SetOperation(c16105038.thop)
c:RegisterEffect(e2)
end
function c16105038.matfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevelAbove(10) or c:IsRankAbove(10)
end
function c16105038.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c16105038.spfilter(c,e,tp)
return (c:IsLevelAbove(10) or c:IsRankAbove(10)) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_GRAVE) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function c16105038.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA+LOCATION_GRAVE)
end
function c16105038.spop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(c16105038.spfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil,e,tp)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if Duel.Destroy(tc,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c16105038.spfilter),tp,LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil,e,tp)
if sg:GetCount()>0 then
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
end
end
function c16105038.thcon(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():GetOriginalLevel()>9 or re:GetHandler():GetOriginalRank()>9
end
function c16105038.thfilter(c)
return c:IsSetCard(0xcc3) and c:IsType(TYPE_SPELL) and c:IsAbleToHand()
end
function c16105038.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c16105038.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c16105038.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c16105038.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
--Mystic探究者 波莉
local m=16105100
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.chrtg)
e1:SetOperation(cm.chrop)
c:RegisterEffect(e1)
--tohand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.thcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
end
function cm.chrtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
end
function cm.chrop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetCode(EFFECT_CHANGE_RACE)
e1:SetValue(RACE_FAIRY)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function cm.thfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsAbleToHand()
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local thg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if thg:GetCount()==1 then
Duel.SendtoHand(thg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,thg)
end
end
\ No newline at end of file
--Mystic探究者 旅者
local m=16105102
local cm=_G["c"..m]
function cm.initial_effect(c)
--tograve
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.tg1)
e1:SetOperation(cm.op1)
c:RegisterEffect(e1)
--SpecialSummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.condition)
e2:SetCost(cm.cost2)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--
end
function cm.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_COST)
end
function cm.tg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.thfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsAbleToGrave()
end
function cm.op1(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) then return end
local num=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local thg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,num+1,nil)
if thg:GetCount()>0 then
Duel.SendtoGrave(thg,REASON_EFFECT)
tc=thg:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=thg:GetNext()
end
end
end
function cm.condition(e,tp)
return Duel.GetTurnPlayer()~=tp
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xcc3) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
return Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>=1
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>=1 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,nil,e,tp)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if tc:GetCount()>0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--探究者的召集
local m=16105104
local cm=_G["c"..m]
function cm.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost)
e2:SetTarget(cm.target1)
e2:SetOperation(cm.activate1)
c:RegisterEffect(e2)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0x6cc3) 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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetTargetRange(1,0)
e2:SetValue(cm.aclimit)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.aclimit(e,re,tp)
local c=re:GetHandler()
return re:IsActiveType(TYPE_MONSTER) and c:IsAttribute(e:GetLabel())
end
function cm.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp) and e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function cm.activate1(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler() or not e:GetHandler():IsRelateToEffect(e) or not Duel.IsPlayerCanDraw(tp) or not e:GetHandler():IsAbleToDeck() then return end
Duel.SendtoDeck(e:GetHandler(),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)
if ct==1 then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
local dc=Duel.GetOperatedGroup():GetFirst()
if dc:IsType(TYPE_NORMAL) and not dc:IsSetCard(0x6cc3) and dc:IsSetCard(0xcc3)
then
Duel.BreakEffect()
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
\ No newline at end of file
--Mystic降临
local m=16105106
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,7000) end
Duel.PayLPCost(tp,7000)
end
function cm.filter(c,e,tp)
return c:IsSetCard(0xcc3) 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.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--Mystic探索者 乌鸦女士
function c16105108.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c16105108.matfilter,2)
--P Set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(16105108,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,16105109)
e2:SetTarget(c16105108.destg)
e2:SetOperation(c16105108.desop)
c:RegisterEffect(e2)
--draw
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(16105108,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,16105108)
e3:SetCondition(c16105108.drcon)
e3:SetTarget(c16105108.drtg)
e3:SetOperation(c16105108.drop)
c:RegisterEffect(e3)
end
function c16105108.matfilter(c)
return c:IsSetCard(0xcc3) or c:IsLevelAbove(10) or c:IsRankAbove(10)
end
function c16105108.thfilter(c)
return c:IsType(TYPE_PENDULUM) and c:IsLevelAbove(10) and not c:IsForbidden()
end
function c16105108.setfilter(c)
if not c:IsLocation(LOCATION_PZONE) then return c:IsFaceup() and (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1))
else return c:IsFaceup() end
end
function c16105108.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsOnField() and chkc:IsControler(tp) and chkc:IsFaceup() and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(c16105108.setfilter,tp,LOCATION_ONFIELD,0,1,c)
and Duel.IsExistingMatchingCard(c16105108.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_ONFIELD,0,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c16105108.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if not (Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1)) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELECT)
local g=Duel.SelectMatchingCard(tp,c16105108.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
local tc1=g:GetFirst()
Duel.MoveToField(tc1,tp,tp,LOCATION_PZONE,POS_FACEUP,false)
tc1:SetStatus(STATUS_EFFECT_ENABLED,true)
end
end
end
function c16105108.drcfilter(c,tp)
return c:IsPreviousLocation(LOCATION_PZONE) and c:GetPreviousControler()==tp
end
function c16105108.drcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c16105108.drcfilter,1,nil,tp)
end
function c16105108.spfilter(c,e,tp)
return (c:IsLevelAbove(10) or c:IsRankAbove(10)) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c16105108.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c16105108.drop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsExistingMatchingCard(c16105108.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c16105108.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
--神秘学召唤
function c16105110.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c16105110.target)
e1:SetOperation(c16105110.activate)
c:RegisterEffect(e1)
end
function c16105110.filter(c,e,tp,m)
local b=0
if not c:IsSetCard(0xcc3) then return end
if c:IsType(TYPE_SYNCHRO) then b=SUMMON_TYPE_SYNCHRO
elseif c:IsType(TYPE_FUSION) then b=SUMMON_TYPE_FUSION
elseif c:IsType(TYPE_XYZ) then b=SUMMON_TYPE_XYZ
elseif c:IsType(TYPE_RITUAL) then b=TYPE_RITUAL
else b=0 end
m=m:Filter(c16105110.matfilter,nil,c)
local num=c:GetLevel()+c:GetRank()
return c:IsCanBeSpecialSummoned(e,b,tp,true,true) and (c:IsLevelAbove(1) or c:IsRankAbove(1)) and m:CheckWithSumEqual(c16105110.sumfun,num,1,99)
end
function c16105110.sumfun(c)
return c:GetLevel()+c:GetRank()+c:GetLink()
end
function c16105110.matfilter(c,mc)
if mc==nil then return true end
return c:IsType(TYPE_MONSTER) and (c:IsAbleToDeck() and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_ONFIELD) and c:IsType(TYPE_PENDULUM)))) or (mc:IsType(TYPE_RITUAL) and c:IsLocation(LOCATION_EXTRA) and c:IsAbleToGrave() and c~=mc)
end
function c16105110.tdfilter(c)
return not c:IsLocation(LOCATION_EXTRA)
end
function c16105110.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return false end
local mg=Duel.GetMatchingGroup(c16105110.matfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_EXTRA,LOCATION_ONFIELD,nil)
return Duel.IsExistingMatchingCard(c16105110.filter,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c16105110.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local mg=Duel.GetMatchingGroup(c16105110.matfilter,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_EXTRA,LOCATION_ONFIELD,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,c16105110.filter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,mg)
if tg:GetCount()>0 then
local tc=tg:GetFirst()
local num=tc:GetLevel()+tc:GetRank()
mg=mg:Filter(c16105110.matfilter,nil,tc)
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(16105110,1))
local mat=mg:SelectWithSumEqual(tp,c16105110.sumfun,num,1,99)
tc:SetMaterial(mat)
mat1=mat:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
mat=mat:Filter(c16105110.tdfilter,nil)
Duel.SendtoDeck(mat,nil,2,REASON_EFFECT)
Duel.SendtoGrave(mat1,REASON_EFFECT)
Duel.BreakEffect()
Duel.SpecialSummon(tc,0,tp,tp,true,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
\ No newline at end of file
......@@ -20,6 +20,7 @@ function cm.initial_effect(c)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.thcon)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
......@@ -64,6 +65,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
and mg:CheckSubGroup(cm.xyzfilter0,2,2,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:SelectSubGroup(tp,cm.xyzfilter0,false,2,2,e,tp)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,sg1:GetCount(),0,0)
end
......@@ -127,6 +129,9 @@ function cm.spfilter1(c,e,tp,mc,sc,rk)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
----
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(tp,m)>0
end
function cm.thfilter(c)
return c:IsSetCard(0x95) and c:IsAbleToHand()
end
......
......@@ -22,7 +22,7 @@ function cm.initial_effect(c)
e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
end
function cm.mgfilter(c)
return c:IsFaceup()
......
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