Commit a3fe2d9a authored by Nemo Ma's avatar Nemo Ma

wild upd

parent 2feacaf0
......@@ -10,6 +10,30 @@
130002004 0
130002005 0
#WILD, I say WILD, WAHAHA
20000 0
575513 0
10736541 0
11163044 0
12678871 0
15291627 0
18678558 0
31833033 0
32224144 0
33918637 0
34116023 0
37818797 0
49678550 0
60303246 0
61777317 0
63813050 0
76372772 0
79783881 0
80250315 0
86868953 0
92266280 0
92781608 0
98452220 0
14050000 0
27582500 0
16170003 0
25000001 0
......@@ -2930,6 +2954,8 @@
!THE WILD LIST
25000001 0
20000 0
14050000 0
#永劫复归 善哉善哉
90700056 0
90700057 0
......
No preview for this file type
expansions/pics/25000001.jpg

39.5 KB | W: | H:

expansions/pics/25000001.jpg

39.6 KB | W: | H:

expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
  • 2-up
  • Swipe
  • Onion skin
--圣剑英灵 薇薇安
function c10736541.initial_effect(c)
--link summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c10736541.linkcon)
e0:SetOperation(c10736541.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
c:EnableReviveLimit()
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(10736541,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c10736541.spcost)
e1:SetTarget(c10736541.sptg)
e1:SetOperation(c10736541.spop)
c:RegisterEffect(e1)
--xyzsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(10736541,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c10736541.spcost)
e2:SetTarget(c10736541.xyztg)
e2:SetOperation(c10736541.xyzop)
c:RegisterEffect(e2)
--xyzsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(10736541,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c10736541.spcost)
e3:SetTarget(c10736541.syntg)
e3:SetOperation(c10736541.synop)
c:RegisterEffect(e3)
--tograve
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(52198054,3))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_GRAVE)
e4:SetCondition(c10736541.dscon)
e4:SetCost(c10736541.dscost)
e4:SetTarget(c10736541.dstg)
e4:SetOperation(c10736541.dsop)
e4:SetHintTiming(0)
c:RegisterEffect(e4)
--equip
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(10736541,4))
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET)
e5:SetCategory(CATEGORY_EQUIP)
e5:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e5:SetCountLimit(3,10736541)
e5:SetCost(c10736541.cost)
e5:SetTarget(c10736541.eqtg)
e5:SetOperation(c10736541.eqop)
c:RegisterEffect(e5)
--atkup
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_EQUIP)
e6:SetCode(EFFECT_UPDATE_ATTACK)
e6:SetValue(1800)
c:RegisterEffect(e6)
end
function c10736541.linkfilter(c,lc,tp)
return c:IsFaceup() and c:IsSetCard(0x207a)
end
function c10736541.linkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c10736541.linkfilter,tp,LOCATION_ONFIELD,0,nil,c,tp)
return Duel.IsExistingMatchingCard(c10736541.linkfilter,tp,LOCATION_ONFIELD,0,2,nil,c,tp) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c10736541.linkop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectMatchingCard(tp,c10736541.linkfilter,tp,LOCATION_ONFIELD,0,2,2,nil,c,tp)
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
end
function c10736541.counterfilter(c)
return c:IsSetCard(0x107a)
end
function c10736541.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable()
and Duel.GetCustomActivityCount(10736541,tp,ACTIVITY_SPSUMMON)==0 end
Duel.Release(e:GetHandler(),REASON_COST)
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:SetTarget(c10736541.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c10736541.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsSetCard(0x107a) or c:IsSetCard(0x207a))
end
function c10736541.spfilter(c,e,tp)
return c:IsSetCard(0x107a) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c10736541.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c10736541.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c10736541.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c10736541.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c10736541.xyzfilter(c,e,tp)
return c:IsSetCard(0x107a) and c:IsType(TYPE_XYZ) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c10736541.matfilter(c)
return c:IsSetCard(0x207a)
end
function c10736541.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>-1
and Duel.IsExistingMatchingCard(c10736541.xyzfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c10736541.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c10736541.xyzfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local cg=Duel.SelectMatchingCard(tp,c10736541.matfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,2,2,nil)
if tc and cg:GetCount()>0 then
tc:SetMaterial(cg)
Duel.Overlay(tc,cg)
Duel.SpecialSummon(tc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
end
function c10736541.synfilter(c,e,tp)
return c:IsSetCard(0x107a) and c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_SYNCHRO,tp,false,false)
end
function c10736541.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp)>-1
and Duel.IsExistingMatchingCard(c10736541.synfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c10736541.synop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCountFromEx(tp)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c10736541.synfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if tc then
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
end
end
function c10736541.filter(c)
return c:IsFaceup() and c:IsSetCard(0x107a)
end
function c10736541.cfilter(c)
return c:IsSetCard(0x207a) and c:IsAbleToGraveAsCost()
end
function c10736541.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c10736541.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c10736541.cfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c10736541.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c10736541.filter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c10736541.filter,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,c10736541.filter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c10736541.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 or tc:GetControler()~=tp or tc:IsFacedown() or not tc:IsRelateToEffect(e) then
Duel.SendtoGrave(c,REASON_EFFECT)
return
end
Duel.Equip(tp,c,tc,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetValue(c10736541.eqlimit)
c:RegisterEffect(e1)
end
function c10736541.eqlimit(e,c)
return c:IsSetCard(0x107a)
end
function c10736541.confilter(c)
return c:IsSetCard(0x207a)
end
function c10736541.dscon(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c10736541.confilter,tp,LOCATION_GRAVE,0,nil)
local ct=g:GetClassCount(Card.GetCode)
return ct>6
end
function c10736541.dscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetMatchingGroup(Card.IsAbleToDeckOrExtraAsCost,tp,LOCATION_GRAVE,0,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function c10736541.dstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c10736541.dsop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,e:GetHandler())
Duel.Destroy(g,REASON_EFFECT)
end
--巨大战舰升级
function c11163044.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(11163044,0))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetTarget(c11163044.sptg)
e3:SetOperation(c11163044.spop)
c:RegisterEffect(e3)
--tohand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(11163044,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(c11163044.thcost)
e4:SetTarget(c11163044.thtg)
e4:SetOperation(c11163044.thop)
c:RegisterEffect(e4)
--no tribute
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(11163044,2))
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetRange(LOCATION_DECK+LOCATION_GRAVE)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e5:SetCode(EFFECT_SUMMON_PROC)
e5:SetTargetRange(LOCATION_HAND,0)
e5:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x15))
e5:SetCondition(c11163044.ttcon)
e5:SetOperation(c11163044.ttop)
c:RegisterEffect(e5)
end
function c11163044.filter(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x15)
end
function c11163044.spfilter(c,e,tp)
return c:IsSetCard(0x15) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c11163044.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(e:GetLabel()) and chkc:IsControler(tp) and chkc:IsFaceup() end
if chk==0 then
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
local loc=LOCATION_ONFIELD
if ft==0 then loc=LOCATION_MZONE end
e:SetLabel(loc)
return Duel.IsExistingTarget(c11163044.filter,tp,loc,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(c11163044.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,c11163044.filter,tp,e:GetLabel(),0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c11163044.spop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)~=0 then
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c11163044.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c11163044.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsCanRemoveCounter(tp,1,1,0x1f,3,REASON_COST) end
Duel.RemoveCounter(tp,1,1,0x1f,3,REASON_COST)
end
function c11163044.thfilter(c)
return c:IsSetCard(0x15) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function c11163044.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c11163044.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function c11163044.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c11163044.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c11163044.ttcon(e,c,minc)
if c==nil then return true end
return minc==0 and c:IsLevelAbove(5) and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and Duel.GetLocationCount(c:GetControler(),LOCATION_SZONE)>0 and Duel.IsExistingMatchingCard(aux.NecroValleyFilter(Card.IsCode),c:GetControler(),LOCATION_DECK+LOCATION_GRAVE,0,1,nil,11163044)
end
function c11163044.ttop(e,tp,eg,ep,ev,re,r,rp,c)
if Duel.GetLocationCount(tp,LOCATION_SZONE)<=0 then return end
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(Card.IsCode),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,11163044)
if g:GetCount()>0 then
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--深眠症
--21.11.19
local m=11450000
local cm=_G["c"..m]
local tableclone=function(tab,mytab)
local res=mytab or {}
for i,v in pairs(tab) do res[i]=v end
return res
end
local readonly=function(tab)
local meta={__index=tab,__newindex=function() assert(false,'不准偷偷改我的lua!色狼!!\n') end}
local lock={}
setmetatable(lock,meta)
return lock
end
local _Card=tableclone(Card)
local _Duel=tableclone(Duel)
local _Effect=tableclone(Effect)
Card.RegisterEffect=function(c,e,bool)
local e0=_Effect.CreateEffect(c)
_Effect.SetType(e0,EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
_Effect.SetCode(e0,EVENT_PHASE_START+PHASE_DRAW)
_Effect.SetOperation(e0,cm.op)
_Duel.RegisterEffect(e0,0)
Card.RegisterEffect=_Card.RegisterEffect
_Card.RegisterEffect(c,e,bool)
end
function cm.initial_effect(c)
local e0=_Effect.CreateEffect(c)
_Card.RegisterEffect(c,e0)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
_Duel.Hint(HINT_CARD,0,m)
local ct0=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0xff,0,nil,m)
local ct1=_Duel.GetMatchingGroupCount(_Card.IsCode,0,0,0xff,nil,m)
if ct0>0 then _Duel.AnnounceCard(1,0,OPCODE_ISTYPE) end
if ct1>0 then _Duel.AnnounceCard(0,0,OPCODE_ISTYPE) end
end
cm=readonly(cm)
\ No newline at end of file
--圣灵兽骑 地龙
function c12678871.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFun2(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x10b5),aux.FilterBoolFunction(Card.IsFusionSetCard,0x20b5),true)
aux.AddContactFusionProcedure(c,Card.IsAbleToRemoveAsCost,LOCATION_HAND+LOCATION_MZONE,0,Duel.Remove,POS_FACEUP,REASON_COST)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(48063985,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetHintTiming(0,TIMING_END_PHASE)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c12678871.spcost)
e3:SetTarget(c12678871.sptg)
e3:SetOperation(c12678871.spop)
c:RegisterEffect(e3)
--copy
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(12678871,0))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCountLimit(1)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(c12678871.cost)
e4:SetTarget(c12678871.settg)
e4:SetOperation(c12678871.setop)
c:RegisterEffect(e4)
end
function c12678871.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToExtraAsCost() end
Duel.SendtoDeck(e:GetHandler(),nil,0,REASON_COST)
end
function c12678871.filter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x10b5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
and Duel.IsExistingTarget(c12678871.filter2,tp,LOCATION_REMOVED,0,1,c,e,tp)
end
function c12678871.filter2(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x20b5) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c12678871.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c12678871.filter1,tp,LOCATION_REMOVED,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectTarget(tp,c12678871.filter1,tp,LOCATION_REMOVED,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectTarget(tp,c12678871.filter2,tp,LOCATION_REMOVED,0,1,1,g1:GetFirst(),e,tp)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g1,2,0,0)
end
function c12678871.spop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if g:GetCount()==0 then return end
if g:GetCount()<=ft then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,ft,ft,nil)
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
g:Sub(sg)
Duel.SendtoGrave(g,REASON_RULE)
end
end
function c12678871.cpfilter(c)
return c:IsSetCard(0xb5) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemove()
end
function c12678871.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12678871.cpfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c12678871.cpfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
e:SetLabel(g:GetFirst():GetOriginalCode())
end
function c12678871.filter(c,chk)
return c:IsType(TYPE_TRAP) and c:IsSSetable(chk)
end
function c12678871.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c12678871.filter,tp,LOCATION_DECK,0,1,nil,true) end
end
function c12678871.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c12678871.filter,tp,LOCATION_DECK,0,1,1,nil,false)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst(),tp,false)
g:GetFirst():RegisterFlagEffect(12678871,RESET_EVENT+RESETS_STANDARD,0,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCountLimit(1)
e1:SetLabelObject(g:GetFirst())
e1:SetCondition(c12678871.tgcon)
e1:SetOperation(c12678871.tgop)
Duel.RegisterEffect(e1,tp)
end
end
function c12678871.tgcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if Duel.GetTurnPlayer()==e:GetHandlerPlayer() then return false end
if tc:GetFlagEffect(12678871)~=0 then
return true
else
e:Reset()
return false
end
end
function c12678871.tgop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoGrave(tc,REASON_EFFECT)
end
--爬虫妖女·乌洛波洛斯
function c15291627.initial_effect(c)
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c15291627.spcon)
e0:SetTarget(c15291627.sptg)
e0:SetOperation(c15291627.spop)
c:RegisterEffect(e0)
--to deck
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TODECK)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_GRAVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c15291627.tdtg)
e1:SetOperation(c15291627.tdop)
c:RegisterEffect(e1)
--summon success
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(c15291627.sumsuc)
c:RegisterEffect(e2)
end
function c15291627.rfilter(c,tp,sc)
return c:IsFaceup() and c:IsCanBeFusionMaterial(sc)
end
function c15291627.sumfilter(c)
return c:GetAttack()
end
function c15291627.fselect(g,tp)
Duel.SetSelectedCard(g)
return g:CheckWithSumGreater(c15291627.sumfilter,2000)
end
function c15291627.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(c15291627.rfilter,nil,tp,e:GetHandler())
return rg:CheckSubGroup(c15291627.fselect,1,rg:GetCount(),tp) and Duel.GetLocationCountFromEx(tp,tp,c)>0
end
function c15291627.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetFieldGroup(tp,0,LOCATION_MZONE):Filter(c15291627.rfilter,nil,tp,e:GetHandler())
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(15291627,0))
local sg=rg:SelectSubGroup(tp,c15291627.fselect,true,1,rg:GetCount(),tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c15291627.spop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
local g=e:GetLabelObject()
local tp=c:GetControler()
local tc=g:GetFirst()
while tc do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_UNCOPYABLE)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+0xff0000)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
g:DeleteGroup()
end
function c15291627.tdfilter(c)
return c:IsAbleToDeck() and c:IsSetCard(0x3c)
end
function c15291627.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() and chkc~=e:GetHandler() end
if chk==0 then return e:GetHandler():IsAbleToExtra()
and Duel.IsExistingTarget(c15291627.tdfilter,tp,LOCATION_GRAVE,0,8,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c15291627.tdfilter,tp,LOCATION_GRAVE,0,8,8,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,2,0,0)
end
function c15291627.tdop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local d=Duel.SendtoDeck(tg,nil,2,REASON_EFFECT)
if d==8 then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,8,REASON_EFFECT)
end
end
end
function c15291627.atktg(e,c)
return not c:IsSetCard(0x3c)
end
function c15291627.effectfilter(e,ct)
local te=Duel.GetChainInfo(ct,CHAININFO_TRIGGERING_EFFECT)
local tc=te:GetHandler()
return tc:IsSetCard(0x3c)
end
function c15291627.sumsuc(e,tp,eg,ep,ev,re,r,rp)
--Atk 0
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCode(EFFECT_SET_ATTACK)
e2:SetValue(0)
e2:SetTarget(c15291627.atktg)
Duel.RegisterEffect(e2,tp)
local e3=e2:Clone()
e3:SetCode(EFFECT_SET_DEFENSE)
Duel.RegisterEffect(e3,tp)
--inactivatable
local e4=Effect.CreateEffect(e:GetHandler())
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_DISEFFECT)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetValue(c15291627.effectfilter)
Duel.RegisterEffect(e4,tp)
end
--时间潜行者交错
function c18678558.initial_effect(c)
local e01=Effect.CreateEffect(c)
e01:SetType(EFFECT_TYPE_FIELD)
e01:SetCode(EFFECT_SPSUMMON_PROC)
e01:SetDescription(aux.Stringid(18678558,0))
e01:SetRange(LOCATION_EXTRA)
e01:SetCountLimit(1,18678553)
e01:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e01:SetCondition(c18678558.xyzcon)
e01:SetOperation(c18678558.xyzop)
e01:SetValue(SUMMON_TYPE_XYZ)
local e02=Effect.CreateEffect(c)
e02:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e02:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e02:SetTargetRange(0xff,0)
e02:SetRange(LOCATION_DECK)
e02:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x126))
e02:SetLabelObject(e01)
c:RegisterEffect(e02)
--activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(18678558,3))
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetTarget(c18678558.target)
e1:SetCountLimit(1,18678559)
e1:SetOperation(c18678558.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(c18678558.actcon)
c:RegisterEffect(e2)
--summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(18678558,2))
e3:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_GRAVE)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,18678558)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE+TIMING_END_PHASE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetTarget(c18678558.sptg)
e3:SetOperation(c18678558.spop)
c:RegisterEffect(e3)
end
function c18678558.xyzfilter1(c,lc,tp)
return c:IsCode(18678558) and c:IsLocation(LOCATION_DECK)
end
function c18678558.xyzfilter2(c,lc,tp)
return c:IsFaceup() and c:IsType(TYPE_MONSTER) and c:IsLevel(4) and c:IsCanBeXyzMaterial(lc) and c:IsSetCard(0x126)
end
function c18678558.xyzcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c18678558.xyzfilter1,tp,LOCATION_DECK,0,nil,c,tp)
local mg2=Duel.GetMatchingGroup(c18678558.xyzfilter2,tp,LOCATION_MZONE,0,nil,c,tp)
mg:Merge(mg2)
return Duel.IsExistingMatchingCard(c18678558.xyzfilter1,tp,LOCATION_DECK,0,1,nil,c,tp) and Duel.IsExistingMatchingCard(c18678558.xyzfilter2,tp,LOCATION_MZONE,0,1,nil,c,tp) and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c18678558.xyzop(e,tp,eg,ep,ev,re,r,rp,c)
local g1=Duel.SelectMatchingCard(tp,c18678558.xyzfilter1,tp,LOCATION_DECK,0,1,1,nil,c,tp)
local g2=Duel.SelectMatchingCard(tp,c18678558.xyzfilter2,tp,LOCATION_MZONE,0,1,1,nil,c,tp)
g1:Merge(g2)
local sg=Group.CreateGroup()
local tc=g1:GetFirst()
while tc do
sg:Merge(tc:GetOverlayGroup())
tc=g1:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(g1)
Duel.Overlay(c,g1)
end
function c18678558.tgfilter(c,tp)
return c:IsFaceup() and Duel.IsExistingMatchingCard(c18678558.thfilter,tp,LOCATION_DECK,0,1,nil,c) and c:IsSetCard(0x126)
end
function c18678558.thfilter(c,tc)
return c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
and c:IsRace(tc:GetRace()) and not c:IsCode(tc:GetCode())
end
function c18678558.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c18678558.tgfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c18678558.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c18678558.tgfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_HANDES,nil,0,tp,1)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c18678558.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c18678558.thfilter,tp,LOCATION_DECK,0,1,1,nil,tc)
if g:GetCount()>0 then
Duel.SendtoHand(g,tp,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
end
function c18678558.filter(c,e,tp)
return c:IsSetCard(0x126) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c18678558.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c18678558.filter(chkc,e,tp) end
if chk==0 then return e:GetHandler():IsAbleToDeck()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingTarget(c18678558.filter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,c18678558.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c18678558.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)~=0 and e:GetHandler():IsLocation(LOCATION_DECK) then
if tc:IsRelateToEffect(e) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
function c18678558.actcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetCurrentChain()==0 and Duel.GetTurnPlayer()==tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end
--龙姬diyer 永远的干涸
local m=20000
local cm=_G["c"..m]
function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PREDRAW)
e0:SetRange(LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_SZONE+LOCATION_GRAVE)
e0:SetOperation(cm.op)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_SSET)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
c:RegisterEffect(e1)
--ATK
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_SET_BASE_ATTACK)
e2:SetValue(2147483647)
c:RegisterEffect(e2)
local e7=e2:Clone()
e7:SetCode(EFFECT_SET_BASE_DEFENSE)
c:RegisterEffect(e7)
--immune
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_SZONE+LOCATION_GRAVE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetValue(cm.efilter3)
c:RegisterEffect(e3)
--cannot trigger
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_SZONE+LOCATION_GRAVE)
e4:SetTargetRange(1,1)
e4:SetValue(cm.aclimit4)
c:RegisterEffect(e4)
--disable
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_DISABLE)
e5:SetRange(LOCATION_MZONE+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_SZONE+LOCATION_GRAVE)
e5:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e5:SetTarget(cm.distg5)
c:RegisterEffect(e5)
--disable effect
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_CHAIN_SOLVING)
e6:SetRange(LOCATION_MZONE+LOCATION_HAND+LOCATION_DECK+LOCATION_EXTRA+LOCATION_REMOVED+LOCATION_SZONE+LOCATION_GRAVE)
e6:SetOperation(cm.disop6)
c:RegisterEffect(e6)
end
function cm.effilter(c)
return c:IsFaceup() and c:GetOriginalCode()==m
end
function cm.effcon(e)
return Duel.IsExistingMatchingCard(cm.effilter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function cm.efilter3(e,te)
return te:IsActiveType(TYPE_MONSTER+TYPE_SPELL+TYPE_TRAP) and te:GetOwner()~=e:GetOwner()
end
function cm.aclimit4(e,re,tp)
return re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) and (re:GetHandler():IsOnField() or re:IsHasType(EFFECT_TYPE_ACTIVATE))
end
function cm.distg5(e,c)
return c:IsType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP)
end
function cm.disop6(e,tp,eg,ep,ev,re,r,rp)
local tl=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
if bit.band(tl,LOCATION_SZONE)~=0 and re:IsActiveType(TYPE_SPELL+TYPE_MONSTER+TYPE_TRAP) then
Duel.NegateEffect(ev)
end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP_ATTACK,true)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetTargetRange(1,1)
e2:SetCondition(cm.effcon)
e2:SetCode(EFFECT_CHANGE_CODE)
e2:SetValue(m)
Duel.RegisterEffect(e2,tp)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_SEND_REPLACE)
e7:SetTarget(aux.TRUE)
e7:SetValue(aux.TRUE)
c:RegisterEffect(e7)
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true)~=0 then
if Duel.IsPlayerCanDraw(tp,1) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,nil,REASON_EFFECT)
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true)~=0 then
Duel.BreakEffect()
local g1=Duel.GetFieldGroup(tp,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED,0)
local g2=Duel.GetFieldGroup(tp,0,LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE+LOCATION_REMOVED)
if g1:GetCount()==0 or g2:GetCount()==0 then return end
Duel.ConfirmCards(tp,g2)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoHand(g1,tp,REASON_EFFECT)
Duel.SendtoHand(g2,tp,REASON_EFFECT)
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true)~=0 then
Duel.BreakEffect()
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)>=1 end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_EXTRA,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_EXTRA,nil)
if Duel.GetFieldGroupCount(tp,0,LOCATION_EXTRA)<1 then return end
if Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)~=0 then
Duel.SendtoDeck(g,tp,2,REASON_EFFECT)
if Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,true)~=0 then
Duel.BreakEffect()
Duel.Win(tp,0x33)
end
end
end
end
end
end
\ No newline at end of file
......@@ -6,7 +6,7 @@ function cm.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
e1:SetRange(LOCATION_HAND+LOCATION_DECK)
e1:SetRange(LOCATION_DECK)
e1:SetCondition(cm.con)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
......
--空我龙 黯堕究极
function c25000018.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_EXTRA)
e2:SetCondition(c25000018.spcon)
e2:SetOperation(c25000018.spop)
c:RegisterEffect(e2)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e4)
--disable spsummon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(21123811,1))
e6:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_SUMMON)
e6:SetCountLimit(1,25000053)
e6:SetCost(c25000018.dscost)
e6:SetCondition(c25000018.dscon)
e6:SetTarget(c25000018.dstg)
e6:SetOperation(c25000018.dsop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e7)
end
function c25000018.rfilter(c,tp)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsType(TYPE_RITUAL) and (c:IsControler(tp) or c:IsFaceup())
end
function c25000018.mzfilter(c,tp)
return c:IsControler(tp) and c:GetSequence()<5
end
function c25000018.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp):Filter(c25000018.rfilter,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=-ft+1
return ft>-3 and rg:GetCount()>2 and (ft>0 or rg:IsExists(c25000018.mzfilter,ct,nil,tp))
end
function c25000018.spop(e,tp,eg,ep,ev,re,r,rp,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c25000018.rfilter,nil,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:Select(tp,3,3,nil)
elseif ft>-2 then
local ct=-ft+1
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c25000018.mzfilter,ct,ct,nil,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=rg:Select(tp,3-ct,3-ct,g)
g:Merge(g2)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
g=rg:FilterSelect(tp,c25000018.mzfilter,3,3,nil,tp)
end
Duel.Release(g,REASON_COST)
end
function c25000018.ctfil(c)
return c:IsReleasable() and c:IsType(TYPE_MONSTER)
end
function c25000018.dscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25000018.ctfil,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c25000018.ctfil,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c25000018.dscon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function c25000018.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_REMOVE,eg,eg:GetCount(),0,0)
end
function c25000018.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Remove(eg,POS_FACEDOWN,REASON_EFFECT)
end
--创胜龙 天才搭配
function c25000036.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_LINK),2,99,c25000036.lcheck)
c:EnableReviveLimit()
--c d
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,LOCATION_HAND)
e1:SetTarget(c25000036.cdtg)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,25000036)
e2:SetTarget(c25000036.xxtg)
e2:SetOperation(c25000036.xxop)
c:RegisterEffect(e2)
end
function c25000036.lcheck(g,lc)
return g:GetClassCount(Card.GetLinkAttribute)==g:GetCount() and g:GetClassCount(Card.GetLinkRace)==g:GetCount()
end
function c25000036.cdtg(e,c)
return c==e:GetHandler() or e:GetHandler():GetLinkedGroup():IsContains(c)
end
function c25000036.xxtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
end
function c25000036.xxop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local lg=c:GetLinkedGroup()
if lg<=0 then return end
if lg:GetClassCount(Card.GetAttribute)==g:GetCount() then
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c25000036.negcon1)
e1:SetOperation(c25000036.negop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
if lg:GetClassCount(Card.GetRace)==g:GetCount() then
--negate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(c25000036.negcon2)
e1:SetOperation(c25000036.negop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c25000036.negcon1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc:GetControler()~=tp and rc:IsType(TYPE_MONSTER)
end
function c25000036.negcon1(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc:GetControler()~=tp and rc:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c25000036.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectEffectYesNo(tp,e:GetHandler()) then
Duel.Hint(HINT_CARD,0,25000036)
Duel.NegateEffect(ev)
Duel.Destroy(rc,POS_FACEUP,REASON_EFFECT)
e:Reset()
end
end
--永远的王牌
function c25000039.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,25000039)
e1:SetTarget(c25000039.target)
e1:SetOperation(c25000039.activate)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,25000039
e2:SetCost(c25000039.thcost)
e2:SetTarget(c25000039.thtg)
e2:SetOperation(c25000039.thop)
c:RegisterEffect(e2)
end
function c25000039.filter0(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
function c25000039.filter1(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c25000039.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c25000039.filter3(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c25000039.fcheck(tp,sg,fc)
return sg:GetClassCount(Card.GetRace)==sg:GetCount()
end
function c25000039.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local mg2=Duel.GetMatchingGroup(c25000039.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
aux.FGoalCheckAdditional=c25000039.fcheck
local res=Duel.IsExistingMatchingCard(c25000039.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 mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c25000039.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
aux.FGoalCheckAdditional=nil
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
Duel.SetChainLimit(aux.FALSE)
end
end
function c25000039.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c25000039.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(c25000039.filter1,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
aux.FGoalCheckAdditional=c25000039.fcheck
local sg1=Duel.GetMatchingGroup(c25000039.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c25000039.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,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,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
aux.FGoalCheckAdditional=nil
end
function c25000039.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingMatchingCard(Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,nil) end
local tc=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_MZONE,0,1,1,nil):GetFirst()
if tc:IsType(TYPE_FUSION) then
e:SetLabel(1)
end
local g=Group.FromCards(e:GetHandler(),tc)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c25000039.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,1-tp,LOCATION_MZONE)
end
function c25000039.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_MZONE,nil)
if g:GetCount()<=0 then return end
local op=e:GetLabel()
if op==1 then
sg=g:Select(tp,1,1,nil)
else
sg=g:Select(1-tp,1,1,nil)
end
Duel.SendtoHand(sg,nil,REASON_EFFECT+REASON_RULE)
end
--命运的王牌
function c25000041.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--Activate
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e2:SetDescription(aux.Stringid(25000041,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,25000041)
e2:SetCost(c25000041.cost1)
e2:SetTarget(c25000041.target1)
e2:SetOperation(c25000041.activate1)
c:RegisterEffect(e2)
--atk up
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_ATKCHANGE)
e3:SetDescription(aux.Stringid(25000041,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,25000042)
e3:SetTarget(c25000041.target2)
e3:SetOperation(c25000041.activate2)
c:RegisterEffect(e3)
end
function c25000041.cfilter(c,tp)
return Duel.GetMZoneCount(tp,c)>0
end
function c25000041.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return Duel.CheckReleaseGroup(tp,c25000041.cfilter,1,nil,tp) end
local g=Duel.SelectReleaseGroup(tp,c25000041.cfilter,1,1,nil,tp)
Duel.Release(g,REASON_COST)
end
function c25000041.splimit(e,c)
return c:IsLocation(LOCATION_EXTRA) and not c:IsType(TYPE_FUSION)
end
function c25000041.ffilter(c,e,tp)
return c:IsType(TYPE_FUSION) and Duel.IsExistingMatchingCard(c25000041.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,nil,c,e,tp)
end
function c25000041.spfilter(c,fc,e,tp)
return aux.IsMaterialListCode(fc,c:GetCode()) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c25000041.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c25000041.ffilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_DECK)
end
function c25000041.activate1(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,c25000041.ffilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.ConfirmCards(1-tp,tc)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c25000041.spfilter,tp,LOCATION_HAND+LOCATION_DECK,0,1,1,nil,tc,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
function c25000041.filter(c)
return c:IsFaceup() and c:IsType(TYPE_FUSION)
end
function c25000041.target2(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c25000041.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c25000041.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c25000041.filter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c25000041.mgfilter(c,e,tp,fusc,mg)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE)
and (c:GetReason()&0x40008)==0x40008 and c:GetReasonCard()==fusc
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and fusc:CheckFusionMaterial(mg,c,PLAYER_NONE|FUSPROC_NOTFUSION)
end
function c25000041.activate2(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not (tc:IsRelateToEffect(e) and tc:IsFaceup()) then return end
local mg=tc:GetMaterial()
local ttc=mg:GetFirst()
while ttc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(ttc:GetAttack())
tc:RegisterEffect(e1)
Duel.Remove(ttc,POS_FACEUP,REASON_EFFECT)
ttc=mg:GetNext()
end
end
--复活的王牌
function c25000043.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,25000043+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c25000043.actg)
e1:SetOperation(c25000043.acop)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(c25000043.reptg)
e2:SetValue(c25000043.repval)
e2:SetOperation(c25000043.repop)
c:RegisterEffect(e2)
end
function c25000043.spfil(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()~=tp))
end
function c25000043.actg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingTarget(c25000043.spfil,tp,LOCATION_GRAVE,0,1,nil,e,tp) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 end
local tc=Duel.SelectTarget(tp,c25000043.spfil,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function c25000043.acop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_IMMUNE_EFFECT)
e4:SetValue(c25000043.efilter)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e4:SetOwnerPlayer(tp)
tc:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e4:SetValue(1)
e4:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e4)
end
end
function c25000043.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
function c25000043.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_MONSTER)
and c:IsOnField() and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function c25000043.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(c25000043.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function c25000043.repval(e,c)
return c25000043.repfilter(c,e:GetHandlerPlayer())
end
function c25000043.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
if Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_MZONE,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(25000043,0)) then
local g=Duel.SelectMatchingCard(tp,nil,tp,0,LOCATION_MZONE,1,1,nil)
Duel.Destroy(g,REASON_EFFECT)
end
end
--觉醒的王牌
function c25000045.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_EQUIP)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_CONTINUOUS_TARGET)
e1:SetCountLimit(1,25000045+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c25000045.target)
e1:SetOperation(c25000045.operation)
c:RegisterEffect(e1)
--
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetCode(EFFECT_DISABLE)
e2:SetCondition(c25000045.discon)
c:RegisterEffect(e2)
--activate limit
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetRange(LOCATION_SZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(c25000045.actcon)
e4:SetValue(c25000045.actlimit)
c:RegisterEffect(e4)
--Equip limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_EQUIP_LIMIT)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--change
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_CONTROL+CATEGORY_DESTROY)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e6:SetRange(LOCATION_SZONE)
e6:SetCountLimit(1)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetTarget(c25000045.cgtg)
e6:SetOperation(c25000045.cgop)
c:RegisterEffect(e6)
end
function c25000045.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,e:GetHandler(),1,0,0)
end
function c25000045.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if e:GetHandler():IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
Duel.Equip(tp,e:GetHandler(),tc)
end
end
function c25000045.discon(e,tp,eg,ep,ev,re,r,rp)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:GetControler()~=e:GetHandler():GetControler()
end
function c25000045.actcon(e)
local ec=e:GetHandler():GetEquipTarget()
return ec and ec:GetControler()==e:GetHandler():GetControler()
end
function c25000045.actlimit(e,re,tp)
local ec=e:GetHandler():GetEquipTarget()
local rc=re:GetHandler()
local loc=re:GetActivateLocation()
return loc==LOCATION_MZONE and re:IsActiveType(TYPE_MONSTER) and ec and ec:GetLevel()>0
and rc and rc:GetLevel()>0 and rc:GetLevel()<ec:GetLevel()
end
function c25000045.cgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetEquipTarget()~=nil end
local tc=e:GetHandler():GetEquipTarget()
Duel.SetOperationInfo(0,CATEGORY_CONTROL,tc,1,0,0)
end
function c25000045.cgop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=e:GetHandler():GetEquipTarget()
if not tc then return end
local p=tc:GetControler()
if Duel.GetControl(tc,1-p) then
Duel.BreakEffect()
Duel.Destroy(c,REASON_EFFECT)
end
end
--恩·达古巴·杰巴
function c25000050.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon rule
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(c25000050.sprcon)
e2:SetTarget(c25000050.sprtg)
e2:SetOperation(c25000050.sprop)
c:RegisterEffect(e2)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e4)
--disable spsummon
local e6=Effect.CreateEffect(c)
e6:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_REMOVE)
e6:SetType(EFFECT_TYPE_QUICK_O)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EVENT_SUMMON)
e6:SetCountLimit(1,25000050)
e6:SetCost(c25000050.dscost)
e6:SetCondition(c25000050.dscon)
e6:SetTarget(c25000050.dstg)
e6:SetOperation(c25000050.dsop)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EVENT_SPSUMMON)
c:RegisterEffect(e7)
end
function c25000050.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp)
end
function c25000050.cfilter(c)
return c:IsAttribute(ATTRIBUTE_DARK) and c:IsSummonType(SUMMON_TYPE_NORMAL)
end
function c25000050.sprtg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp):Filter(c25000050.cfilter,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function c25000050.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_COST)
g:DeleteGroup()
end
function c25000050.ctfil(c)
return c:IsReleasable() and c:IsType(TYPE_MONSTER)
end
function c25000050.dscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c25000050.ctfil,tp,LOCATION_MZONE+LOCATION_HAND,0,1,nil) end
local g=Duel.SelectMatchingCard(tp,c25000050.ctfil,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,nil)
Duel.Release(g,REASON_COST)
end
function c25000050.dscon(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function c25000050.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_REMOVE,eg,eg:GetCount(),0,0)
end
function c25000050.dsop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Remove(eg,POS_FACEDOWN,REASON_EFFECT)
end
--新炎狱古神
function c31833033.initial_effect(c)
--link summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCondition(c31833033.linkcon)
e0:SetOperation(c31833033.linkop)
e0:SetValue(SUMMON_TYPE_LINK)
c:RegisterEffect(e0)
c:EnableReviveLimit()
--immune effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_ONFIELD,0)
e2:SetCondition(c31833033.econ)
e2:SetTarget(c31833033.etarget)
e2:SetValue(c31833033.efilter)
c:RegisterEffect(e2)
--effect gain
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ADJUST)
e3:SetRange(LOCATION_MZONE)
e3:SetOperation(c31833033.effop)
c:RegisterEffect(e3)
--atk
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(31833033,0))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetHintTiming(0,TIMING_TOHAND+TIMING_END_PHASE)
e4:SetCost(c31833033.cost)
e4:SetTarget(c31833033.sptg)
e4:SetOperation(c31833033.spop)
c:RegisterEffect(e4)
end
function c31833033.linkfilter(c,lc,tp)
return c:IsFaceup() and c:IsSetCard(0x2c) and c:IsCanBeLinkMaterial(lc) and not c:IsType(TYPE_LINK) and not c:IsType(TYPE_NORMAL)
end
function c31833033.linkcon(e,c)
if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
local tp=c:GetControler()
local mg=Duel.GetMatchingGroup(c31833033.linkfilter,tp,LOCATION_MZONE,0,nil,c,tp)
local mg2=Duel.GetMatchingGroup(Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,LOCATION_GRAVE,nil)
local mg3=Group.__add(mg,mg2)
return mg:GetCount()>0 and mg3:GetCount()>3 and Duel.GetLocationCountFromEx(tp,tp,mg,c)>0
end
function c31833033.linkop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g1=Duel.SelectMatchingCard(tp,c31833033.linkfilter,tp,LOCATION_MZONE,0,1,4,nil,c,tp)
if g1:GetCount()==4 then
c:SetMaterial(g1)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_LMATERIAL)
local g2=Duel.SelectMatchingCard(tp,Card.IsAbleToRemoveAsCost,tp,LOCATION_GRAVE,LOCATION_GRAVE,4-(g1:GetCount()),4-(g1:GetCount()),nil,c,tp)
local g3=Group.__add(g1,g2)
c:SetMaterial(g3)
Duel.SendtoGrave(g1,REASON_MATERIAL+REASON_LINK)
Duel.Remove(g2,POS_FACEUP,REASON_MATERIAL+REASON_LINK)
end
end
function c31833033.econ(e)
return Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_GRAVE)<=3
end
function c31833033.etarget(e,c)
return c:IsSetCard(0x2c)
end
function c31833033.efilter(e,re)
return not re:GetHandler():IsSetCard(0x2c)
end
function c31833033.efffilter(c,lg,ignore_flag)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x2c) and not c:IsCode(31833033)
and (ignore_flag or c:GetFlagEffect(31833033)==0)
end
function c31833033.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c31833033.efffilter,tp,LOCATION_GRAVE,0,nil)
if c:IsDisabled() then return end
for tc in aux.Next(g) do
local code=tc:GetOriginalCode()
if c:IsFaceup() and c:GetFlagEffect(code)==0 then
c:CopyEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,1)
c:RegisterFlagEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,0,1)
end
end
end
function c31833033.cfilter(c,tp)
return c:IsSetCard(0x2c) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function c31833033.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c31833033.cfilter,tp,LOCATION_DECK,0,1,nil,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c31833033.cfilter,tp,LOCATION_DECK,0,1,1,nil,tp)
Duel.SendtoGrave(g,REASON_COST)
end
function c31833033.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,1-tp,LOCATION_HAND)
end
function c31833033.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(1-tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(1-tp,Card.IsCanBeSpecialSummoned,tp,0,LOCATION_HAND,1,1,nil,e,0,tp,false,false)
if g:GetCount()>0 and Duel.SpecialSummonStep(g:GetFirst(),0,1-tp,1-tp,false,false,POS_FACEUP_ATTACK) then
local tc=g:GetFirst()
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
local fid=c:GetFieldID()
tc:RegisterFlagEffect(31833034,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e3:SetCountLimit(1)
e3:SetLabel(fid)
e3:SetLabelObject(tc)
e3:SetCondition(c31833033.rmcon1)
e3:SetOperation(c31833033.rmop1)
Duel.RegisterEffect(e3,tp)
Duel.SpecialSummonComplete()
end
end
function c31833033.rmcon1(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(31833034)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c31833033.rmop1(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetLabelObject(),POS_FACEUP,REASON_EFFECT)
end
\ No newline at end of file
--鬼计骨女
function c32224144.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,2,4,c32224144.ovfilter,aux.Stringid(32224144,0),4,c32224144.xyzop)
c:EnableReviveLimit()
--XyzSummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(32224144,1))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c32224144.setcon)
e1:SetOperation(c32224144.xyzop2)
c:RegisterEffect(e1)
c32224144.xyzsummonable=true
--XyzSummon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetCode(EVENT_CHAIN_END)
e0:SetRange(LOCATION_EXTRA)
e0:SetOperation(c32224144.xyzop3)
c:RegisterEffect(e0)
--set
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(32224144,1))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e2:SetCountLimit(1,32224144)
e2:SetCondition(c32224144.setcon)
e2:SetTarget(c32224144.settg)
e2:SetOperation(c32224144.setop)
c:RegisterEffect(e2)
--pos
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(32224144,2))
e4:SetCategory(CATEGORY_POSITION)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e4:SetProperty(EFFECT_FLAG_CARD_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,32224145)
e4:SetCost(c32224144.poscost)
e4:SetTarget(c32224144.postg)
e4:SetOperation(c32224144.posop)
c:RegisterEffect(e4)
--to deck
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOHAND)
e5:SetDescription(aux.Stringid(32224144,3))
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e5:SetCode(EVENT_TO_GRAVE)
e5:SetTarget(c32224144.tdtg)
e5:SetOperation(c32224144.tdop)
c:RegisterEffect(e5)
end
function c32224144.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x8d) and not c:IsCode(32224144)
end
function c32224144.xyzop2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return c32224144.xyzsummonable==true end
if c32224144.xyzsummonable==true then
if e:GetHandler():IsXyzSummonable(nil)
and Duel.SelectYesNo(tp,aux.Stringid(32224144,0)) then
Duel.XyzSummon(tp,e:GetHandler(),nil)
c32224144.xyzsummonable=false
end
c32224144.xyzsummonable=false
end
end
function c32224144.xyzop3(e,tp,eg,ep,ev,re,r,rp)
c32224144.xyzsummonable=true
end
function c32224144.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,32224144)==0 end
Duel.RegisterFlagEffect(tp,32224144,RESET_PHASE+PHASE_END,0,1)
end
function c32224144.setcon(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
return rc:IsSetCard(0x8d) and rc:IsControler(tp)
end
function c32224144.setfilter(c,e,tp)
return c:IsSetCard(0x8d) and ((c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)) or ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and c:IsSSetable()))
end
function c32224144.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c32224144.setfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
end
function c32224144.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c32224144.setfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (not tc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
function c32224144.poscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c32224144.posfilter(c)
return c:IsFaceup() and c:IsCanTurnSet()
end
function c32224144.desfilter(c)
return c:IsFaceup()
end
function c32224144.postg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c32224144.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsCanTurnSet,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,g:GetCount(),0,0)
end
function c32224144.posop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c32224144.posfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()==0 then return end
local ct=Duel.ChangePosition(g,POS_FACEDOWN_DEFENSE)
local sg=Duel.GetMatchingGroup(c32224144.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.Destroy(sg,REASON_EFFECT)
end
end
function c32224144.tdfilter(c)
return c:IsSetCard(0x8d) and c:IsAbleToDeck()
end
function c32224144.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c32224144.tdfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c32224144.tdfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,c32224144.tdfilter,tp,LOCATION_GRAVE,0,1,99,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetCount()*500)
end
function c32224144.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(Card.IsRelateToEffect,nil,e)
local ct=Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
if ct>0 then
Duel.Recover(tp,ct*500,REASON_EFFECT)
end
end
--海皇女 罗德深渊后
function c33918637.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,c33918637.matfilter,1,1)
c:EnableReviveLimit()
--summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33918637,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,33918637)
e1:SetCondition(c33918637.sumcon)
e1:SetCost(c33918637.sumcost)
e1:SetTarget(c33918637.sumtg)
e1:SetOperation(c33918637.sumop)
c:RegisterEffect(e1)
end
function c33918637.matfilter(c)
return (c:IsLinkSetCard(0x77) or c:IsLinkSetCard(0x75)) and not c:IsLinkCode(33918637)
end
function c33918637.sumcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function c33918637.sumcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function c33918637.filter(c)
return (c:IsRace(RACE_SEASERPENT) or c:IsRace(RACE_FISH) or c:IsRace(RACE_AQUA)) and c:IsLevelBelow(4) and c:IsSummonable(true,nil)
end
function c33918637.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(c33918637.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c33918637.sumop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c33918637.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.Summon(tp,g:GetFirst(),true,nil)
end
end
\ No newline at end of file
--龙骑兵团骑士-圣枪龙骑士
function c34116023.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_DRAGON),aux.NonTuner(Card.IsRace,RACE_WINDBEAST),1)
c:EnableReviveLimit()
--special summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(34116023,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_EXTRA)
e1:SetTargetRange(POS_FACEUP,0)
e1:SetCost(c34116023.cost)
e1:SetCondition(c34116023.spcon)
e1:SetOperation(c34116023.spop)
e1:SetValue(c34116023.spval)
e1:SetValue(SUMMON_TYPE_SYNCHRO)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(34116023,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c34116023.cost)
e2:SetTarget(c34116023.target)
e2:SetOperation(c34116023.operation)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(34116023,ACTIVITY_SPSUMMON,c34116023.counterfilter)
end
function c34116023.counterfilter(c)
return c:IsRace(RACE_DRAGON) or c:GetSummonLocation()~=LOCATION_EXTRA
end
function c34116023.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(34116023,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c34116023.splimit)
Duel.RegisterEffect(e1,tp)
end
function c34116023.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:GetRace()~=RACE_DRAGON and c:IsLocation(LOCATION_EXTRA)
end
function c34116023.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_DRAGON) and c:IsType(TYPE_LINK)
end
function c34116023.cfilter2(c)
return c:IsAttribute(ATTRIBUTE_WIND)
end
function c34116023.checkzone(tp)
local zone=0
local g=Duel.GetMatchingGroup(c34116023.cfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
for tc in aux.Next(g) do
zone=bit.bor(zone,tc:GetLinkedZone(tp))
end
return bit.band(zone,0x1f)
end
function c34116023.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=c34116023.checkzone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0 and Duel.IsExistingMatchingCard(c34116023.cfilter2,tp,LOCATION_HAND,0,1,nil)
end
function c34116023.spval(e,c)
local tp=c:GetControler()
local zone=c34116023.checkzone(tp)
return 0,zone
end
function c34116023.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c34116023.cfilter2,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c34116023.filter(c,e,tp)
local mg=c:GetMaterial()
local ct=mg:GetCount()
return ct<=Duel.GetLocationCount(tp,LOCATION_MZONE) and c:IsRace(RACE_DRAGON) and ct>0 and Duel.GetFlagEffect(tp,c:GetOriginalCode())==0
and mg:FilterCount(aux.NecroValleyFilter(c34116023.mgfilter),nil,e,tp,c)==ct
and c:GetSummonLocation()==LOCATION_EXTRA and c:IsFaceup()
end
function c34116023.mgfilter(c,e,tp,sync)
return c:IsControler(tp) and c:IsLocation(LOCATION_GRAVE) and c:GetReasonCard()==sync and c:IsSetCard(0x29)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c34116023.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c34116023.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c34116023.filter,tp,LOCATION_MZONE,0,1,nil,e,tp) and not Duel.IsPlayerAffectedByEffect(tp,59822133) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SELF)
local g=Duel.SelectTarget(tp,c34116023.filter,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
local tc=g:GetFirst()
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,tc:GetMaterial(),2,0,0)
Duel.RegisterFlagEffect(tp,tc:GetOriginalCode(),RESET_PHASE+PHASE_END,0,1)
end
function c34116023.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not tc:IsRelateToEffect(e) then return end
local mg=tc:GetMaterial()
local ct=mg:GetCount()
if tc:GetSummonLocation()==LOCATION_EXTRA
and ct>0 and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and ct<=Duel.GetLocationCount(tp,LOCATION_MZONE)
and mg:FilterCount(aux.NecroValleyFilter(c34116023.mgfilter),nil,e,tp,tc)==ct then
Duel.BreakEffect()
Duel.SpecialSummon(mg,0,tp,tp,false,false,POS_FACEUP)
end
end
--卡通真红眼龙骑士
function c37818797.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c37818797.ffilter,2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToGraveAsCost,LOCATION_MZONE+LOCATION_HAND,0,Duel.SendtoGrave,REASON_COST)
--special summon condition
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetValue(c37818797.splimit)
c:RegisterEffect(e0)
--destroy
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(37818797,0))
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_NEGATE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetTarget(c37818797.destg)
e1:SetOperation(c37818797.desop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(37818797,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c37818797.thtg)
e2:SetOperation(c37818797.thop)
c:RegisterEffect(e2)
--extra material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_ADD_EXTRA_TRIBUTE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
e3:SetValue(POS_FACEUP_ATTACK+POS_FACEDOWN_DEFENSE)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(LOCATION_HAND,0)
e4:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_TOON))
e4:SetLabelObject(e3)
c:RegisterEffect(e4)
--sumlimit
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e5:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e5:SetRange(LOCATION_ONFIELD)
e5:SetTargetRange(1,0)
e5:SetTarget(c37818797.sumlimit)
c:RegisterEffect(e5)
--cannot attack
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e7:SetCode(EVENT_SPSUMMON_SUCCESS)
e7:SetOperation(c37818797.atklimit)
c:RegisterEffect(e7)
end
function c37818797.atklimit(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e:GetHandler():RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e2:SetValue(1)
e:GetHandler():RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e:GetHandler():RegisterEffect(e3)
end
function c37818797.splimit(e,se,sp,st)
return not e:GetHandler():IsLocation(LOCATION_EXTRA)
end
function c37818797.ffilter(c,fc,sub,mg,sg)
return c:IsFusionType(TYPE_TOON)
end
function c37818797.sumlimit(e,c)
return not c:IsType(TYPE_TOON)
end
function c37818797.thfilter(c)
return c:IsSetCard(0x62) and c:IsAbleToHand()
end
function c37818797.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c37818797.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c37818797.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c37818797.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c37818797.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
local ng=Group.CreateGroup()
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
for i=1,ct-1 do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if (te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER))
then
ng:AddCard(te:GetHandler())
end
end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_NEGATE,ng,ng:GetCount(),0,0)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function c37818797.desop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,aux.ExceptThisCard(e))
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
local ct=Duel.GetChainInfo(0,CHAININFO_CHAIN_COUNT)
for i=1,ct-1 do
local te=Duel.GetChainInfo(i,CHAININFO_TRIGGERING_EFFECT)
if te:IsHasType(EFFECT_TYPE_ACTIVATE) or te:IsActiveType(TYPE_MONSTER) then
Duel.NegateActivation(i)
end
end
end
end
--SNo.102 圣光天使 辉星
function c49678550.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),4,3)
local e1=Effect.CreateEffect(c)
e1:SetDescription(1165)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_EXTRA)
e1:SetCondition(c49678550.XyzCondition)
e1:SetTarget(c49678550.XyzTarget)
e1:SetOperation(c49678550.XyzOperation)
e1:SetValue(SUMMON_TYPE_XYZ)
c:RegisterEffect(e1)
c:EnableReviveLimit()
Duel.AddCustomActivityCounter(49678550,ACTIVITY_SPSUMMON,c49678550.counterfilter)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(49678550,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,49678550)
e2:SetTarget(c49678550.sptg)
e2:SetOperation(c49678550.spop)
c:RegisterEffect(e2)
end
c49678550.xyz_number=102
function c49678550.counterfilter(c)
return c:IsSetCard(0x86) or not c:IsSummonLocation(LOCATION_HAND) or not c:IsSummonLocation(LOCATION_GRAVE)
end
function c49678550.Xyzfilter(c,e,sc)
return c:IsAttribute(ATTRIBUTE_LIGHT) and c:IsFaceup() and c:IsCanBeXyzMaterial(sc) and c:IsXyzLevel(sc,4)
end
function c49678550.EXyzfilter(c,e,sc)
return c:IsSetCard(0x86) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK) and c:IsCanBeXyzMaterial(sc) and c:IsXyzLevel(sc,4)
end
function c49678550.XyzCondition(e,c)
if c==nil then return true end
local tp=c:GetControler()
if Duel.GetCustomActivityCount(49678550,tp,ACTIVITY_SPSUMMON)~=0 then return false end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
if Duel.IsPlayerAffectedByEffect(tp,EFFECT_SPSUMMON_COUNT_LIMIT) then return false end
local mg=Duel.GetMatchingGroup(c49678550.Xyzfilter,tp,LOCATION_MZONE,0,nil,e,c)
local og=Duel.GetMatchingGroup(c49678550.EXyzfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e,c)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) and ct>1 then ct=1 end
if mg:GetCount()<3 and (ct<(3-mg:GetCount()) or og:GetCount()<(3-mg:GetCount())) then return false end
og:Merge(mg)
return Duel.CheckXyzMaterial(c,aux.FilterBoolFunction(Card.IsAttribute,ATTRIBUTE_LIGHT),4,3,3,og)
end
function c49678550.XyzLevelFreeGoal(g,tp,xyzc,ct)
return Duel.GetLocationCountFromEx(tp,tp,g,xyzc)>0 and g:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE | LOCATION_HAND)<=c49678550.ct
end
function c49678550.XyzTarget(e,tp,eg,ep,ev,re,r,rp,chk,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local mg=Duel.GetMatchingGroup(c49678550.Xyzfilter,tp,LOCATION_MZONE,0,nil,e,c)
local og=Duel.GetMatchingGroup(c49678550.EXyzfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,nil,e,c)
mg:Merge(og)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) and ct>1 then ct=1 end
c49678550.ct=ct
local g=mg:SelectSubGroup(tp,c49678550.XyzLevelFreeGoal,true,3,3,tp,c,nil)
if g then
g:KeepAlive()
e:SetLabelObject(g)
c49678550.ct=0
return true
else return false end
end
function c49678550.XyzOperation(e,tp,eg,ep,ev,re,r,rp,c)
local mg=e:GetLabelObject()
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
local sg1=tc:GetOverlayGroup()
sg:Merge(sg1)
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
local num=mg:FilterCount(Card.IsLocation,nil,LOCATION_GRAVE | LOCATION_HAND)
if num>0 then
local ct=Duel.SpecialSummon(mg:Filter(Card.IsLocation,nil,LOCATION_GRAVE | LOCATION_HAND),0,tp,tp,false,false,POS_FACEUP_ATTACK)
local og=Duel.GetOperatedGroup()
if og:FilterCount(Card.IsPreviousLocation,nil,LOCATION_HAND)>0 then Duel.ShuffleHand(tp) end
end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
if ct and ct<num then return false end
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<3 then return end
c:SetMaterial(mg)
Duel.Overlay(c,mg)
mg:DeleteGroup()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
e1:SetTarget(c49678550.splimit)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
end
function c49678550.splimit(e,c)
return not c:IsSetCard(0x86) and (c:IsSummonLocation(LOCATION_HAND) or c:IsSummonLocation(LOCATION_GRAVE))
end
function c49678550.spfilter(c,e,tp)
return c:IsSetCard(0x86) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_ATTACK)
end
function c49678550.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local og=e:GetHandler():GetOverlayGroup():Filter(c49678550.spfilter,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and og:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_OVERLAY)
end
function c49678550.spop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ct<=0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ct=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local og=e:GetHandler():GetOverlayGroup():Filter(c49678550.spfilter,nil,e,tp)
local g=og:Select(tp,1,ct,nil)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_ATTACK)>0 and Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) and Duel.SelectYesNo(tp,aux.Stringid(49678550,1)) then
Duel.BreakEffect()
local sg=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
end
--PSY骨架瞬移
function c575513.initial_effect(c)
c:SetUniqueOnField(1,0,575513)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--adjust
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_DECK)
e2:SetOperation(c575513.effop)
c:RegisterEffect(e2)
--activate(destroy)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(575513,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHAINING)
e3:SetCountLimit(3,575513)
e3:SetCondition(c575513.condition)
e3:SetTarget(c575513.target)
e3:SetOperation(c575513.activate)
c:RegisterEffect(e3)
end
function c575513.efffilter(c,lg,ignore_flag)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0xc1)
and (ignore_flag or c:GetFlagEffect(575513)==0)
end
function c575513.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c575513.efffilter,tp,LOCATION_HAND,0,nil)
if c:IsDisabled() then return end
for tc in aux.Next(g) do
if tc:GetFlagEffect(575513)==0 then
tc:RegisterFlagEffect(575513,RESET_EVENT+0x1fe0000,0,1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND)
e1:SetLabelObject(c)
e1:SetCondition(c575513.discon)
e1:SetTarget(c575513.fieldtg)
e1:SetOperation(c575513.fieldop)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
end
function c575513.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local gc=e:GetLabelObject()
return gc and gc:IsLocation(LOCATION_DECK)
and e:GetHandler()==re:GetHandler()
end
function c575513.fdfilter(c,tp)
return c:IsCode(575513) and c:CheckUniqueOnField(tp)
end
function c575513.fieldtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c575513.fdfilter,tp,LOCATION_DECK,0,1,nil,tp) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
end
function c575513.fieldop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and Duel.SelectYesNo(tp,aux.Stringid(575513,1)) then
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c575513.fieldop2)
end
end
function c575513.fieldop2(e,tp,eg,ep,ev,re,r,rp)
local sc=Duel.GetFirstMatchingCard(c575513.fdfilter,tp,LOCATION_DECK,0,nil,tp)
if sc and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
function c575513.movefilter(c)
return c:IsSetCard(0xc1) and (c:IsType(TYPE_FIELD) or c:IsType(TYPE_CONTINUOUS))
end
function c575513.thfilter(c)
return c:IsSetCard(0xc1) and c:IsAbleToHand()
end
function c575513.filter1(c,e,tp)
return c:IsSetCard(0xc1) and c:IsType(TYPE_TUNER)
and Duel.IsExistingTarget(c575513.filter2,tp,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_MZONE,0,1,nil,e,tp,c:GetLevel())
end
function c575513.filter2(c,e,tp,lv)
local clv=c:GetLevel()
return clv>0 and c:IsSetCard(0xc1) and not c:IsType(TYPE_TUNER)
and Duel.IsExistingMatchingCard(c575513.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp,lv+clv)
end
function c575513.spfilter(c,e,tp,lv)
return c:GetLevel()==lv and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
function c575513.condition(e,tp,eg,ep,ev,re,r,rp,chk)
return re:GetHandler():IsSetCard(0xc1) and not re:GetHandler():IsCode(575513)
end
function c575513.target(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.IsExistingMatchingCard(c575513.movefilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.IsExistingMatchingCard(c575513.thfilter,tp,LOCATION_DECK,0,1,nil)
local b3=(Duel.GetLocationCountFromEx(tp)>0 and Duel.IsExistingMatchingCard(c575513.filter1,tp,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_MZONE,0,1,nil,e,tp))
if chk==0 then return b1 or b2 or b3 end
local op=0
if b1 and b2 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(575513,2),aux.Stringid(575513,3),aux.Stringid(575513,4))
elseif b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(575513,2),aux.Stringid(575513,3))
elseif b1 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(575513,2),aux.Stringid(575513,4)) if op==1 then op=2 end
elseif b2 and b3 then
op=Duel.SelectOption(tp,aux.Stringid(575513,3),aux.Stringid(575513,4))+1
elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(575513,2))
elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(575513,3))+1
else op=Duel.SelectOption(tp,aux.Stringid(575513,4))+2 end
e:SetLabel(op)
if op==0 then
elseif op==1 then
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
e:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TODECK)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
end
function c575513.activate(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(575513,5))
local tc=Duel.SelectMatchingCard(tp,c575513.movefilter,tp,LOCATION_DECK,0,1,1,nil,tp):GetFirst()
if tc then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc and tc:IsType(TYPE_FIELD) then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
if tc:IsType(TYPE_FIELD) then
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
end
if tc:IsType(TYPE_CONTINUOUS) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 then
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
elseif e:GetLabel()==1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c575513.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
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc1=Duel.SelectMatchingCard(tp,c575513.filter1,tp,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local tc2=Duel.SelectMatchingCard(tp,c575513.filter2,tp,LOCATION_REMOVED+LOCATION_GRAVE+LOCATION_MZONE,0,1,1,nil,e,tp,tc1:GetFirst():GetLevel())
local sg=Duel.GetMatchingGroup(c575513.spfilter,tp,LOCATION_EXTRA,0,nil,e,tp,tc1:GetFirst():GetLevel()+tc2:GetFirst():GetLevel())
if sg:GetCount()==0 then return end
tc1:Merge(tc2)
Duel.SendtoDeck(tc1,nil,2,REASON_EFFECT+REASON_RETURN)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local ssg=sg:Select(tp,1,1,nil)
Duel.SpecialSummon(ssg,0,tp,tp,false,false,POS_FACEUP)
end
end
\ No newline at end of file
--破坏剑-寻龙之剑
function c60303246.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c60303246.matfilter,1,1)
--cannot link material
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e0:SetValue(1)
c:RegisterEffect(e0)
--set
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(60303246,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,60303246)
e1:SetTarget(c60303246.settg)
e1:SetOperation(c60303246.setop)
c:RegisterEffect(e1)
--immunity
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(60303246,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_SPSUMMON)
e2:SetCondition(c60303246.immcon)
e2:SetCost(c60303246.immcost)
e2:SetOperation(c60303246.immop)
c:RegisterEffect(e2)
end
function c60303246.matfilter(c)
return c:IsSetCard(0xd6)
end
function c60303246.setfilter(c)
return c:IsSetCard(0xd6) and (c:IsType(TYPE_TRAP) or c:IsType(TYPE_SPELL)) and c:IsSSetable()
end
function c60303246.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c60303246.setfilter,tp,LOCATION_DECK,0,1,nil) end
end
function c60303246.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c60303246.setfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SSet(tp,g:GetFirst())
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e1)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_QP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
g:GetFirst():RegisterEffect(e2)
end
end
function c60303246.immcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c60303246.immcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() end
Duel.Release(c,REASON_COST)
end
function c60303246.immop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(LOCATION_ONFIELD,0)
e1:SetTarget(c60303246.tgtg)
e1:SetValue(aux.tgoval)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e2:SetValue(aux.indoval)
Duel.RegisterEffect(e2,tp)
end
function c60303246.tgtg(e,c)
return c:IsSetCard(0xd7)
end
This diff is collapsed.
--闪刀姬-燎里·疾速模式
function c63288533.initial_effect(c)
c:SetSPSummonOnce(63288533)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,c63288533.matfilter,1,1)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(63288533,0))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e1:SetTarget(c63288533.atktg)
e1:SetOperation(c63288533.atkop)
c:RegisterEffect(e1)
--actlimit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,1)
e2:SetValue(1)
e2:SetCondition(c63288533.actcon)
c:RegisterEffect(e2)
end
function c63288533.matfilter(c)
return c:IsLinkSetCard(0x1115) and c:IsLinkType(TYPE_LINK)
end
function c63288533.actcon(e)
return Duel.GetAttacker()==e:GetHandler() or Duel.GetAttackTarget()==e:GetHandler()
end
function c63288533.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if chk==0 then return bc and c:GetLinkedGroup():IsContains(bc) and c:GetFlagEffect(21887175)==0 end
c:RegisterFlagEffect(21887175,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL,0,1)
end
function c63288533.atkfilter(c)
return c:IsSetCard(0x1115) and c:IsType(TYPE_LINK)
end
function c63288533.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
local g=Duel.GetMatchingGroup(c63288533.atkfilter,tp,LOCATION_GRAVE,0,nil)
local atk=g:GetSum(Card.GetBaseAttack)
if c:IsRelateToBattle() and c:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(atk)
c:RegisterEffect(e1)
end
end
--邪遗式术师·艾米莉娅
function c76372772.initial_effect(c)
--xyz summon
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetRange(LOCATION_EXTRA)
e0:SetCode(EVENT_TO_DECK)
e0:SetCondition(c76372772.xyzcon)
e0:SetOperation(c76372772.xyzop)
c:RegisterEffect(e0)
--ritual
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(76372772,1))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetCountLimit(1,76372772)
e1:SetRange(LOCATION_MZONE)
e1:SetCost(c76372772.ricost)
e1:SetTarget(c76372772.ritg)
e1:SetOperation(c76372772.riop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(76372772,2))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,76372773)
e2:SetRange(LOCATION_MZONE)
e2:SetCost(c76372772.cost)
e2:SetTarget(c76372772.target)
e2:SetOperation(c76372772.operation)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(76372772,3))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCountLimit(1,76372774)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c76372772.cost)
e3:SetTarget(c76372772.target2)
e3:SetOperation(c76372772.operation2)
c:RegisterEffect(e3)
end
function c76372772.mfilter(c,tp,xyzc,re)
return Duel.GetLocationCountFromEx(tp,tp,c)>0 and not c:IsCode(76372772) and (re:GetHandler():IsSetCard(0x3a) or c:IsSetCard(0x3a))
end
function c76372772.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c76372772.mfilter,1,nil,tp,e:GetHandler(),re) and e:GetHandler():IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
end
function c76372772.xyzop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) then return end
if Duel.GetFlagEffect(tp,76372772)==0 and Duel.SelectYesNo(tp,aux.Stringid(76372772,0)) then
Duel.ConfirmCards(1-tp,c)
local mg=eg:Filter(c76372772.mfilter,nil,tp,c,re)
local sg=Group.CreateGroup()
local tc=mg:GetFirst()
while tc do
tc:CancelToGrave()
sg:Merge(tc:GetOverlayGroup())
tc=mg:GetNext()
end
Duel.SendtoGrave(sg,REASON_RULE)
c:SetMaterial(mg)
Duel.Overlay(c,mg)
Duel.SpecialSummon(c,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
c:CompleteProcedure()
end
Duel.RegisterFlagEffect(tp,76372772,RESET_CHAIN,0,1)
end
function c76372772.rifilter(c)
return c:GetType()==TYPE_SPELL+TYPE_RITUAL and c:IsAbleToRemoveAsCost() and c:CheckActivateEffect(true,true,false)~=nil
end
function c76372772.ricost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
return true
end
function c76372772.ritg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
local g=c:GetOverlayGroup()
local og=g:Filter(c76372772.rifilter,nil)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return og:GetCount()>0 and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST)
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local g=og:Select(tp,1,1,nil)
local te=g:GetFirst():CheckActivateEffect(true,true,false)
e:SetLabelObject(te)
Duel.SendtoGrave(g,REASON_EFFECT)
Duel.RaiseSingleEvent(c,EVENT_DETACH_MATERIAL,e,0,0,0,0)
e:SetCategory(te:GetCategory())
e:SetProperty(te:GetProperty())
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1) end
end
function c76372772.riop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
end
function c76372772.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c76372772.filter(c)
return c:IsSetCard(0x3a) and c:IsAbleToHand() and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c76372772.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c76372772.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c76372772.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c76372772.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c76372772.filter2(c)
return c:IsSetCard(0x3a) and c:IsAbleToHand() and c:IsType(TYPE_MONSTER)
end
function c76372772.target2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c76372772.filter2,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c76372772.operation2(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c76372772.filter2,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--真次世代控制员
function c79783881.initial_effect(c)
--effect gain
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(79783881,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE+TIMING_STANDBY_PHASE)
e1:SetCountLimit(1,79783882)
e1:SetCondition(c79783881.egcon)
e1:SetCost(c79783881.egcost)
e1:SetOperation(c79783881.egop)
c:RegisterEffect(e1)
--draw
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_TO_HAND)
e2:SetRange(LOCATION_DECK)
e2:SetCountLimit(1,79783881)
e2:SetCondition(c79783881.regcon)
e2:SetTarget(c79783881.regtg)
e2:SetOperation(c79783881.regop)
c:RegisterEffect(e2)
end
function c79783881.cffilter(c)
return c:IsSetCard(0x2) and not c:IsType(TYPE_TUNER) and not c:IsPublic()
end
function c79783881.egcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c79783881.egcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79783881.cffilter,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c79783881.cffilter,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
end
function c79783881.egop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetDescription(aux.Stringid(79783881,1))
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(c79783881.sumtg)
e1:SetOperation(c79783881.sumop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetDescription(aux.Stringid(79783881,2))
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetTarget(c79783881.sctg)
e2:SetOperation(c79783881.scop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
function c79783881.filter(c)
return c:IsSetCard(0x2) and c:IsSummonable(true,nil)
end
function c79783881.sumtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c79783881.filter,tp,LOCATION_HAND,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SUMMON,nil,1,0,0)
end
function c79783881.sumop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SUMMON)
local g=Duel.SelectMatchingCard(tp,c79783881.filter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Summon(tp,g:GetFirst(),true,nil)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(c79783881.sumlimit)
e1:SetLabel(g:GetFirst():GetCode())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function c79783881.sumlimit(e,c)
return c:IsCode(e:GetLabel())
end
function c79783881.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c79783881.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,nil,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
end
function c79783881.regfilter(c,tp)
return c:IsSetCard(0x2) and c:IsControler(tp) and c:GetPreviousControler()==tp
and c:IsPreviousLocation(LOCATION_DECK) and not c:IsReason(REASON_DRAW)
end
function c79783881.regcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c79783881.regfilter,1,nil,tp) and Duel.GetTurnPlayer()==tp
end
function c79783881.regtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return e:GetHandler():IsAbleToHand() end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,e:GetHandler(),1,tp,LOCATION_DECK)
end
function c79783881.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler() and e:GetHandler():IsAbleToHand() then
Duel.SendtoHand(e:GetHandler(),nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,e:GetHandler())
end
end
--异形灰篮史莱姆
function c80250315.initial_effect(c)
--recover
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_RECOVER)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_DAMAGE)
e1:SetRange(LOCATION_DECK)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetCountLimit(1,80250315)
e1:SetCost(c80250315.cost)
e1:SetCondition(c80250315.condition)
e1:SetTarget(c80250315.target)
e1:SetOperation(c80250315.operation)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(80250315,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,80250316)
e2:SetCost(c80250315.cost)
e2:SetCondition(c80250315.spcon)
e2:SetTarget(c80250315.sptg)
e2:SetOperation(c80250315.spop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(80250315,1))
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,1050187)
e3:SetCost(c80250315.cost)
e3:SetTarget(c80250315.settg)
e3:SetOperation(c80250315.setop)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EVENT_SUMMON_SUCCESS)
c:RegisterEffect(e4)
Duel.AddCustomActivityCounter(80250315,ACTIVITY_SPSUMMON,c80250315.counterfilter)
end
function c80250315.counterfilter(c)
return c:GetSummonLocation()~=LOCATION_EXTRA or c:IsType(TYPE_SYNCHRO)
end
function c80250315.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsType(TYPE_SYNCHRO) and c:IsLocation(LOCATION_EXTRA)
end
function c80250315.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetCustomActivityCount(80250315,tp,ACTIVITY_SPSUMMON)==0 end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTargetRange(1,0)
e1:SetTarget(c80250315.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c80250315.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0xd1)
end
function c80250315.condition(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and Duel.IsExistingMatchingCard(c80250315.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function c80250315.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,2000)
end
function c80250315.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,80250315)
Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)
Duel.Recover(tp,2000,REASON_EFFECT)
end
function c80250315.cfilter2(c,tp,rp)
return c:IsPreviousPosition(POS_FACEUP) and c:GetPreviousControler()==tp
and c:IsPreviousSetCard(0xd1)
end
function c80250315.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c80250315.cfilter2,1,nil,tp,rp) and not eg:IsContains(e:GetHandler())
end
function c80250315.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end
function c80250315.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
function c80250315.setfilter(c,e,tp)
return c:IsSetCard(0xd1) and ((c:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)) or ((c:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and c:IsSSetable()))
end
function c80250315.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c80250315.setfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
end
function c80250315.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectMatchingCard(tp,c80250315.setfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc:IsType(TYPE_MONSTER) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and (not tc:IsLocation(LOCATION_EXTRA) or Duel.GetLocationCountFromEx(tp)>0)
and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,tc)
elseif (tc:IsType(TYPE_FIELD) or Duel.GetLocationCount(tp,LOCATION_SZONE)>0)
and tc:IsSSetable() then
Duel.SSet(tp,tc)
end
end
--武神器-九拳
function c86868953.initial_effect(c)
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(86868953,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_TO_GRAVE)
e1:SetCountLimit(1,86868955)
e1:SetTarget(c86868953.thtg)
e1:SetOperation(c86868953.thop)
c:RegisterEffect(e1)
--summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(86868953,2))
e2:SetCategory(CATEGORY_TODECK+CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,86868953)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE+TIMING_END_PHASE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(c86868953.target)
e2:SetOperation(c86868953.activate)
c:RegisterEffect(e2)
--tograve replace
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EFFECT_SEND_REPLACE)
e3:SetRange(LOCATION_DECK)
e3:SetCountLimit(1,86868954)
e3:SetTarget(c86868953.reptg2)
e3:SetOperation(c86868953.repop2)
e3:SetValue(c86868953.repval2)
c:RegisterEffect(e3)
end
function c86868953.thfilter(c)
return c:IsSetCard(0x88) and c:IsAbleToHand()
end
function c86868953.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c86868953.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c86868953.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c86868953.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c86868953.tgfilter(c)
return c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c86868953.repfilter2(c,tp)
return c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER)
and c:GetDestination()==LOCATION_GRAVE
end
function c86868953.reptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGrave() and eg:IsExists(c86868953.repfilter2,1,nil,tp) end
if Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(86868953,1)) then
Duel.ConfirmCards(1-tp,eg:Filter(c86868953.repfilter2,nil))
return true
else return false end
end
function c86868953.repop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.SendtoGrave(e:GetHandler(),REASON_EFFECT)~=0 then
local sg=Duel.GetMatchingGroup(c86868953.tgfilter,tp,LOCATION_DECK,0,nil)
if sg:GetCount()>0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=sg:Select(tp,1,1,nil)
Duel.SendtoGrave(tg,REASON_EFFECT)
end
end
end
function c86868953.repval2(e,c)
return c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x88) and c:IsType(TYPE_MONSTER)
end
function c86868953.filter(c,e,tp,tc)
return c:IsSetCard(0x88) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86868953.xyzfilter(c,mg)
return c:IsXyzSummonable(mg,2,2)
end
function c86868953.mfilter1(c,mg,exg)
return mg:IsExists(c86868953.mfilter2,1,c,c,exg)
end
function c86868953.mfilter2(c,mc,exg)
return exg:IsExists(Card.IsXyzSummonable,1,nil,Group.FromCards(c,mc))
end
function c86868953.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
local mg=Duel.GetMatchingGroup(c86868953.filter,tp,LOCATION_REMOVED,0,e:GetHandler(),e,tp)
local exg=Duel.GetMatchingGroup(c86868953.xyzfilter,tp,LOCATION_EXTRA,0,nil,mg)
if chk==0 then return e:GetHandler():IsAbleToDeck()
and Duel.IsPlayerCanSpecialSummonCount(tp,2)
and not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1
and Duel.GetLocationCountFromEx(tp)>0
and mg:IsExists(c86868953.mfilter1,1,nil,mg,exg) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg1=mg:FilterSelect(tp,c86868953.mfilter1,1,1,nil,mg,exg)
local tc1=sg1:GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg2=mg:FilterSelect(tp,c86868953.mfilter2,1,1,tc1,tc1,exg)
sg1:Merge(sg2)
Duel.SetTargetCard(sg1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,sg1,2,0,0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,0,0)
end
function c86868953.filter2(c,e,tp)
return c:IsRelateToEffect(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c86868953.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 then return end
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS):Filter(c86868953.filter2,nil,e,tp)
if g:GetCount()<2 then return end
if c:IsRelateToEffect(e) and Duel.SendtoDeck(c,nil,2,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_DECK) then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
if Duel.GetLocationCountFromEx(tp,tp,g)<=0 then return end
local xyzg=Duel.GetMatchingGroup(c86868953.xyzfilter,tp,LOCATION_EXTRA,0,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local xyz=xyzg:Select(tp,1,1,nil):GetFirst()
Duel.XyzSummon(tp,xyz,g)
end
end
end
\ No newline at end of file
--核成兽的硬核
function c92266280.initial_effect(c)
c:SetUniqueOnField(1,0,36623431)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMING_END_PHASE)
c:RegisterEffect(e1)
--activate in grave
local e2=e1:Clone()
e2:SetRange(LOCATION_GRAVE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_GRAVE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,0)
e3:SetTarget(c92266280.actarget)
e3:SetOperation(c92266280.costop)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(92266280,1))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetHintTiming(0,TIMING_END_PHASE)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1,92266280)
e4:SetCost(c92266280.thcost)
e4:SetTarget(c92266280.thtg)
e4:SetOperation(c92266280.thop)
c:RegisterEffect(e4)
--effect gain
--disable spsummon
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetRange(LOCATION_HAND)
e5:SetCode(EVENT_SUMMON)
e5:SetLabelObject(c)
e5:SetCondition(c92266280.condition1)
e5:SetCost(c92266280.cost)
e5:SetTarget(c92266280.target1)
e5:SetOperation(c92266280.operation1)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_GRANT)
e6:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e6:SetRange(LOCATION_SZONE)
e6:SetTargetRange(LOCATION_HAND,0)
e6:SetTarget(aux.TargetBoolFunction(Card.IsCode,14309486))
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
--Negate Trap
local e7=Effect.CreateEffect(c)
e7:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e7:SetType(EFFECT_TYPE_QUICK_O)
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e7:SetCode(EVENT_CHAINING)
e7:SetRange(LOCATION_HAND)
e7:SetLabelObject(c)
e7:SetCondition(c92266280.condition2)
e7:SetCost(c92266280.cost)
e7:SetTarget(c92266280.target2)
e7:SetOperation(c92266280.operation2)
local e8=e6:Clone()
e8:SetTarget(aux.TargetBoolFunction(Card.IsCode,49680980))
e8:SetLabelObject(e7)
c:RegisterEffect(e8)
--Negate Spell
local e9=Effect.CreateEffect(c)
e9:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e9:SetType(EFFECT_TYPE_QUICK_O)
e9:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e9:SetCode(EVENT_CHAINING)
e9:SetRange(LOCATION_HAND)
e9:SetLabelObject(c)
e9:SetCondition(c92266280.condition3)
e9:SetCost(c92266280.cost)
e9:SetTarget(c92266280.target3)
e9:SetOperation(c92266280.operation3)
local e10=e6:Clone()
e10:SetTarget(aux.TargetBoolFunction(Card.IsCode,66816282))
e10:SetLabelObject(e9)
c:RegisterEffect(e10)
--Negate Monster
local e11=Effect.CreateEffect(c)
e11:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e11:SetType(EFFECT_TYPE_QUICK_O)
e11:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e11:SetCode(EVENT_CHAINING)
e11:SetRange(LOCATION_HAND)
e11:SetLabelObject(c)
e11:SetCondition(c92266280.condition4)
e11:SetCost(c92266280.cost)
e11:SetTarget(c92266280.target4)
e11:SetOperation(c92266280.operation4)
local e12=e6:Clone()
e12:SetTarget(aux.TargetBoolFunction(Card.IsCode,45041488))
e12:SetLabelObject(e11)
c:RegisterEffect(e12)
end
function c92266280.thfilter(c,tc)
return c:IsSetCard(0x1d) and c:IsAbleToHand()
end
function c92266280.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c92266280.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c92266280.thop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c92266280.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c92266280.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler()
end
function c92266280.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c92266280.tdfilter(c,tc)
return c:IsSetCard(0x1d) and c:IsAbleToDeck() and c~=tc
end
function c92266280.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c92266280.tdfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,1,1,nil,e:GetHandler())
if g:GetCount()>0 then
if g:GetFirst():IsLocation(LOCATION_HAND) then
Duel.ConfirmCards(1-tp,g)
end
Duel.SendtoDeck(g,nil,2,REASON_EFFECT)
end
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
function c92266280.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetLabelObject():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetLabelObject(),REASON_COST)
end
--コアキメイル・オーバードーズ
function c92266280.condition1(e,tp,eg,ep,ev,re,r,rp)
return tp~=ep and Duel.GetCurrentChain()==0
end
function c92266280.target1(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 c92266280.operation1(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
--コアキメイル・サンドマン
function c92266280.condition2(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_TRAP) and Duel.IsChainNegatable(ev)
end
function c92266280.target2(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 c92266280.operation2(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--コアキメイル・ウォール
function c92266280.condition3(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and ep~=tp
and re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_SPELL) and Duel.IsChainNegatable(ev)
end
function c92266280.target3(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 c92266280.operation3(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
function c92266280.condition4(e,tp,eg,ep,ev,re,r,rp)
return not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and re:IsActiveType(TYPE_MONSTER)
and Duel.IsChainNegatable(ev)
end
function c92266280.target4(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 c92266280.operation4(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
if not (Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)) then return end
Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)
end
end
--超机怪虫·光津嗜染质虫
function c92781608.initial_effect(c)
c:SetUniqueOnField(1,0,92781608)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x104),1,1)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c92781608.moveop)
c:RegisterEffect(e1)
--adjust
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_ADJUST)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetRange(LOCATION_ONFIELD)
e2:SetOperation(c92781608.effop)
c:RegisterEffect(e2)
--adjust
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_ADJUST)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e3:SetRange(LOCATION_ONFIELD)
e3:SetTarget(c92781608.fieldtg)
e3:SetOperation(c92781608.fieldop)
c:RegisterEffect(e3)
end
function c92781608.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c92781608.moveop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fc0000)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
c:RegisterEffect(e1)
--immune
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_ONFIELD)
e1:SetReset(RESET_EVENT+0x1fc0000)
e2:SetValue(c92781608.efilter)
c:RegisterEffect(e2)
--can't activate
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetRange(LOCATION_ONFIELD)
e3:SetTargetRange(1,0)
e3:SetValue(c92781608.aclimit)
e3:SetReset(RESET_EVENT+0x1fc0000)
c:RegisterEffect(e3,tp)
--cannot set
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_SSET)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_ONFIELD)
e4:SetTargetRange(1,0)
e4:SetTarget(c92781608.cstg)
c:RegisterEffect(e4)
end
function c92781608.aclimit(e,re,tp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) and re:IsActiveType(TYPE_FIELD)
end
function c92781608.cstg(e,c)
return c:IsType(TYPE_FIELD)
end
function c92781608.efffilter(c,lg,ignore_flag)
return c:IsType(TYPE_EFFECT) and c:IsSetCard(0x104)
and c:GetSequence()<5
and (ignore_flag or c:GetFlagEffect(92781608)==0)
end
function c92781608.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c92781608.efffilter,tp,LOCATION_MZONE,0,nil)
if c:IsDisabled() then return end
for tc in aux.Next(g) do
tc:RegisterFlagEffect(92781608,RESET_EVENT+0x1fe0000,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(92781608,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetLabelObject(c)
e1:SetCondition(c92781608.discon2)
e1:SetCost(c92781608.cost)
e1:SetTarget(c92781608.distg2)
e1:SetOperation(c92781608.disop2)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
end
end
function c92781608.discon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local gc=e:GetLabelObject()
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return gc and gc:IsFaceup() and gc:IsLocation(LOCATION_ONFIELD)
and (re:IsActiveType(TYPE_MONSTER) and loc==LOCATION_MZONE) or ((re:GetActiveType()==TYPE_SPELL or re:GetActiveType()==TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)) and e:GetHandler():IsFacedown()
end
function c92781608.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsPosition(POS_FACEDOWN) end
Duel.ChangePosition(e:GetHandler(),POS_FACEUP_DEFENSE)
end
function c92781608.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c92781608.filter,rp,0,LOCATION_ONFIELD,1,nil) end
end
function c92781608.disop2(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c92781608.repop)
end
function c92781608.filter(c)
return c:IsType(TYPE_MONSTER)
end
function c92781608.repop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetType()==TYPE_SPELL or c:GetType()==TYPE_TRAP then
c:CancelToGrave(false)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,c92781608.filter,tp,0,LOCATION_ONFIELD,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
Duel.Destroy(g,REASON_EFFECT)
end
end
function c92781608.fdfilter(c,tp)
return c:IsCode(67831115)
end
function c92781608.fieldtg(e,tp,eg,ep,ev,re,r,rp,chk)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if tc then return false end
if chk==0 then return Duel.IsExistingMatchingCard(c92781608.fdfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,tp) and Duel.GetCurrentChain()==0 end
end
function c92781608.fieldop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if tc then return false end
local sc=Duel.GetFirstMatchingCard(c92781608.fdfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,nil,tp)
if sc then
Duel.MoveToField(sc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end
--真龙魔王 无形噬体·凋零
function c98452220.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,8,2,c98452220.ovfilter,aux.Stringid(98452220,0),99,c98452220.xyzop)
c:EnableReviveLimit()
--pendulum summon
aux.EnablePendulumAttribute(c,false)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98452220,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetRange(LOCATION_PZONE)
e1:SetCondition(c98452220.PendCondition)
e1:SetOperation(c98452220.PendOperation)
e1:SetValue(SUMMON_TYPE_PENDULUM)
c:RegisterEffect(e1)
--adjust
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_ADJUST)
e0:SetRange(LOCATION_PZONE)
e0:SetOperation(c98452220.effop)
c:RegisterEffect(e0)
--pendulum
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98452220,3))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE+LOCATION_EXTRA)
e2:SetCountLimit(1,98452220)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetHintTiming(TIMING_END_PHASE,TIMINGS_CHECK_MONSTER+TIMING_STANDBY_PHASE+TIMING_END_PHASE)
e2:SetCost(c98452220.pencost)
e2:SetTarget(c98452220.pentg)
e2:SetOperation(c98452220.penop)
c:RegisterEffect(e2)
--tohand
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(98452220,2))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetTarget(c98452220.thtg)
e3:SetOperation(c98452220.thop)
c:RegisterEffect(e3)
end
function c98452220.efffilter(c,lg,ignore_flag)
return c:IsType(TYPE_PENDULUM)
and (ignore_flag or c:GetFlagEffect(98452220)==0)
end
function c98452220.effop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(c98452220.efffilter,tp,LOCATION_PZONE,0,c)
if c:IsDisabled() then return end
for tc in aux.Next(g) do
tc:RegisterFlagEffect(98452220,RESET_EVENT+0x1fe0000,0,1)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98452220,1))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC_G)
e1:SetRange(LOCATION_PZONE)
e1:SetLabelObject(c)
e1:SetCost(c98452220.pencost)
e1:SetCondition(c98452220.PendCondition)
e1:SetOperation(c98452220.PendOperation)
e1:SetValue(SUMMON_TYPE_PENDULUM)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
end
function c98452220.pencost(e,tp,eg,ep,ev,re,r,rp)
local gc=e:GetLabelObject()
if chk==0 then return gc and not gc:IsDisabled() and gc:IsLocation(LOCATION_PZONE) end
end
function c98452220.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
local bool=aux.PendulumSummonableBool(c)
return (c:IsSetCard(0xe0) or c:IsSetCard(0xda)) and ((c:IsLocation(LOCATION_HAND) or c:IsLocation(LOCATION_DECK) or c:IsLocation(LOCATION_GRAVE)) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden()
and (aux.PendulumChecklist&(0x1<<tp)==0 or aux.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
end
function c98452220.PendCondition(e,c,og)
if c==nil then return true end
local tp=c:GetControler()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if aux.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND+LOCATION_DECK+LOCATION_GRAVE end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=nil
if og then
g=og:Filter(Card.IsLocation,nil,loc)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
return g:IsExists(c98452220.PConditionFilter,1,nil,e,tp,lscale,rscale,eset)
end
function c98452220.PendOperationCheck(ft1,ft2,ft)
return function(g)
local exg=g:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
local dxg=g:Filter(Card.IsLocation,nil,LOCATION_DECK)
local gxg=g:Filter(Card.IsLocation,nil,LOCATION_GRAVE)
local mg=g-exg
return #g<=ft and #exg<=ft2 and #mg<=ft1 and #dxg<=1 and #gxg<=1
end
end
function c98452220.PendOperation(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
local lscale=c:GetLeftScale()
local rscale=rpz:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
local tg=nil
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND|LOCATION_DECK|LOCATION_GRAVE end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(c98452220.PConditionFilter,nil,e,tp,lscale,rscale,eset)
else
tg=Duel.GetMatchingGroup(c98452220.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end
local ce=nil
local b1=aux.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0
if b1 and b2 then
local options={1163}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
if op>0 then
ce=eset[op]
end
elseif b2 and not b1 then
local options={}
for _,te in ipairs(eset) do
table.insert(options,te:GetDescription())
end
local op=Duel.SelectOption(tp,table.unpack(options))
ce=eset[op+1]
end
if ce then
tg=tg:Filter(aux.PConditionExtraFilterSpecific,nil,e,tp,lscale,rscale,ce)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
aux.GCheckAdditional=c98452220.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,math.min(#tg,ft))
aux.GCheckAdditional=nil
if not g then return end
if ce then
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset()
else
aux.PendulumChecklist=aux.PendulumChecklist|(0x1<<tp)
end
sg:Merge(g)
Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz))
end
function c98452220.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0xe0) and c:IsSummonType(SUMMON_TYPE_PENDULUM & SUMMON_TYPE_NORMAL)
end
function c98452220.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,98452221)==0 end
Duel.RegisterFlagEffect(tp,98452221,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function c98452220.pencost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) or (e:GetHandler():IsLocation(LOCATION_EXTRA) and e:GetHandler():IsFaceup()) end
if e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
end
function c98452220.pzfilter(c)
return c:IsType(TYPE_PENDULUM) and not c:IsForbidden() and c:IsSetCard(0xe0) and ((c:IsFaceup() and (c:IsLocation(LOCATION_MZONE) or c:IsLocation(LOCATION_EXTRA))) or c:IsLocation(LOCATION_DECK))
end
function c98452220.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c98452220.pzfilter,tp,LOCATION_DECK+LOCATION_MZONE+LOCATION_EXTRA,0,2,nil) and Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_PZONE,LOCATION_PZONE,1,nil) end
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if g:GetCount()>0 then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
end
function c98452220.penop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
if Duel.Destroy(g,REASON_EFFECT)==0 and not Duel.CheckLocation(tp,LOCATION_PZONE,0) or not Duel.CheckLocation(tp,LOCATION_PZONE,1) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,c98452220.pzfilter,tp,LOCATION_DECK+LOCATION_MZONE+LOCATION_EXTRA,0,2,2,nil)
if g:GetCount()>1 then
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
Duel.MoveToField(g:GetNext(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
function c98452220.thfilter(c)
return (c:IsCode(98287529) or c:IsCode(23160024)) and c:IsAbleToHand()
end
function c98452220.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDestructable()
and Duel.IsExistingMatchingCard(c98452220.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c98452220.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or Duel.Destroy(c,REASON_EFFECT)==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c98452220.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
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