Commit ffdceb30 authored by Tachibana's avatar Tachibana

ndyd

parent 6ab9d63c
......@@ -4,8 +4,8 @@ stages:
variables:
GIT_DEPTH: "1"
LAST_UPDATE_DATE: "2021.8.23"
CURRENT_UPDATE_DATE: "2021.9.6"
LAST_UPDATE_DATE: "2021.9.7"
CURRENT_UPDATE_DATE: "2021.9.8"
redtext:
stage: prepare
......
No preview for this file type
......@@ -324,6 +324,7 @@
#128
12800000 1 --提灯剑舞姬
12800006 1 --拳头
12808228 0 --A.O.T-阿尔敏
12847001 0 --魔术贤者的演示
#139
13959980 0 --2Pick技能-卡名变换
......@@ -468,6 +469,7 @@
16150008 1 --王命的集结
16150013 1 --大王具 大王龙机
16150015 1 --天命之骑士 大王命骑士
16150017 0 --圣王命之大王具
16150019 1 --大王咒使
16150020 0 --大王具 智慧的抱拥
16160004 1 --憎恶的狂战士 兰斯洛特
......@@ -566,10 +568,10 @@
20000119 1 --人工核心智能
20000120 1 --艾尔缇丝的选择
20000111 1 --终局核心 时核
20000162 0 --虚构素体 A001
20000162 2 --虚构素体 A001
20000163 0 --虚构素体 B001
20000164 0 --虚构素体 C001
20000165 0 --虚构素体 D001
20000164 2 --虚构素体 C001
20000165 2 --虚构素体 D001
#201
20100214 2 --御刀使-柳濑舞衣
20100233 2 --出阵!刻下一闪之灯火
......@@ -767,6 +769,8 @@
31300009 1 --处分
#328
32828002 2 --风卷浪
#332
33200251 0 --机略纵横 鲁子敬
#333
33300157 2 --源世导引
33300200 2 --魔王城的栖夜姬
......@@ -852,6 +856,7 @@
33340009 1 --热核污染病毒-Ø
33340014 1 --热核污染病毒-ш
33350015 0 --传说之魂 诚信
33388888 0 --箱庭的造物主 塞拉菲姆
#334
33400003 1 --时崎狂三 献身者
33400004 1 --时崎狂三 中二
......@@ -925,6 +930,7 @@
33501000 0 --星空下的投影
33501002 0 --海行 漫游
33501016 0 --救 赎 执 行
33501024 0 --高原的魔女大人
33501077 0 --神秘大魔法师
33501250 0 --银光之穹 月华
33501252 1 --银光之穹 珠泪
......@@ -1421,8 +1427,6 @@
77777765 0 --Orange
#810
81000006 2 --甜花无敌
81002002 1 --砂冢明音·流回
81002010 0 --玫瑰天堂·砂冢明音
81007002 0 --白雪安娜·泯灭
81007017 2 --白雪安娜·初恋
81011003 1 --大轮之华·桑山千雪
......@@ -1495,6 +1499,8 @@
82228630 0 --孑影之梦魇
#854
85400100 0 --一块布丁
#865
86500007 0 --核心舰队的复纵阵
#870
87090001 1 --端午节的萤草
87090002 1 --端午节的数珠
......
--透明碎片·浅仓透
local m=26822001
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--fusion substitute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_FUSION_SUBSTITUTE)
e0:SetCondition(cm.subcon)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
end
function cm.subcon(e)
return e:GetHandler():IsLocation(0x1e)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--透明碎片·樋口圆香
local m=26822002
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--fusion substitute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_FUSION_SUBSTITUTE)
e0:SetCondition(cm.subcon)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
end
function cm.subcon(e)
return e:GetHandler():IsLocation(0x1e)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--透明碎片·福丸小糸
local m=26822003
local cm=_G["c"..m]
Duel.LoadScript("c26800000.lua")
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--fusion substitute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_FUSION_SUBSTITUTE)
e0:SetCondition(cm.subcon)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
end
function cm.subcon(e)
return e:GetHandler():IsLocation(0x1e)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--透明碎片·市川雛菜
local m=26822004
local cm=_G["c"..m]
Duel.LoadScript("c26800000.lua")
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_EFFECT),2)
c:EnableReviveLimit()
--fusion substitute
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_FUSION_SUBSTITUTE)
e0:SetCondition(cm.subcon)
c:RegisterEffect(e0)
--destroy replace
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EFFECT_DESTROY_REPLACE)
e1:SetRange(LOCATION_GRAVE)
e1:SetTarget(cm.reptg)
e1:SetValue(cm.repval)
e1:SetOperation(cm.repop)
c:RegisterEffect(e1)
end
function cm.subcon(e)
return e:GetHandler():IsLocation(0x1e)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsType(TYPE_FUSION) and c:IsLocation(LOCATION_MZONE)
and c:IsControler(tp) and c:IsReason(REASON_EFFECT+REASON_BATTLE) and not c:IsReason(REASON_REPLACE)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove() and eg:IsExists(cm.repfilter,1,nil,tp) end
return Duel.SelectEffectYesNo(tp,e:GetHandler(),96)
end
function cm.repval(e,c)
return cm.repfilter(c,e:GetHandlerPlayer())
end
function cm.repop(e,tp,eg,ep,ev,re,r,rp)
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_EFFECT)
end
--放课后CLIMAX女孩
local m=26822010
local cm=_G["c"..m]
Duel.LoadScript("c26800000.lua")
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcMix(c,true,true,26822005,26822006,26822007,26822008,26822009)
end
\ No newline at end of file
--
local m=28303002
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e2:SetCondition(cm.handcon)
c:RegisterEffect(e2)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLP(tp)>Duel.GetLP(1-tp) end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local lp1=Duel.GetLP(tp)
local lp2=Duel.GetLP(1-tp)
if lp1>lp2 then
Duel.SetLP(1-tp,lp1)
end
end
function cm.handcon(e)
return Duel.GetCurrentChain()>0
end
--未确认小恶魔少女
local m=28303005
local cm=_G["c"..m]
function cm.initial_effect(c)
--pierce
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_PIERCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsType,TYPE_MONSTER))
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PRE_BATTLE_DAMAGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.damcon)
e2:SetOperation(cm.damop)
c:RegisterEffect(e2)
--attack target
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_PATRICIAN_OF_DARKNESS)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
c:RegisterEffect(e3)
end
function cm.damcon(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
return ep~=tp and tc:GetBattleTarget()~=nil and tc:GetBattleTarget():IsDefensePos()
end
function cm.damop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeBattleDamage(ep,ev*2)
end
......@@ -10,14 +10,23 @@ function c33701323.initial_effect(c)
e1:SetValue(SUMMON_TYPE_LINK)
e1:SetCondition(c33701323.spcon)
e1:SetOperation(c33701323.spop)
c:RegisterEffect(e1)
--
c:RegisterEffect(e1)
--cannot be material
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e2:SetValue(c33701323.synlimit)
c:RegisterEffect(e2)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e3)
local e4=e2:Clone()
e4:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e4)
local e5=e2:Clone()
e5:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
c:RegisterEffect(e5)
end
function c33701323.spfil(c)
return c:IsCanBeLinkMaterial(nil) and (c:IsType(TYPE_SPELL+TYPE_TRAP) or c:IsRace(RACE_CYBERSE))
......
......@@ -5,7 +5,6 @@ function cm.initial_effect(c)
--fusion summon
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,cm.ffilter,3,false)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
......@@ -74,7 +73,6 @@ function cm.initial_effect(c)
ge3:SetOperation(cm.clear)
Duel.RegisterEffect(ge3,0)
end
end
function cm.ffilter(c,fc,sub,mg,sg)
return not sg or not sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
......@@ -88,22 +86,28 @@ end
function cm.sprcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
if not Duel.CheckRemoveOverlayCard(c:GetControler(),1,1,3,REASON_COST) then return false end
if not Duel.CheckRemoveOverlayCard(tp,1,1,3,REASON_COST) then return false end
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local mg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
mg:Merge(tc:GetOverlayGroup())
tc:GetNext()
mg:Merge(tc:GetOverlayGroup():Filter(Card.IsCanBeFusionMaterial,nil))
tc=g:GetNext()
end
return g:CheckSubGroup(cm.fselect,3,3,tp,c)
return Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and mg:CheckSubGroup(cm.fselect,3,3,tp,c)
end
function cm.sprop(e,tp,eg,ep,ev,re,r,rp,c)
local g=Duel.GetMatchingGroup(cm.sprfilter,tp,LOCATION_MZONE,LOCATION_MZONE,0,nil)
local mg=Group.CreateGroup()
local tc=g:GetFirst()
while tc do
mg:Merge(tc:GetOverlayGroup():Filter(Card.IsCanBeFusionMaterial,nil))
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVEXYZ)
local mg=g:SelectSubGroup(tp,cm.fselect,false,3,3,tp,c)
c:SetMaterial(mg)
Duel.SendtoGrave(mg,REASON_MATERIAL)
local sg=mg:SelectSubGroup(tp,cm.fselect,false,3,mg:GetCount(),tp,c)
c:SetMaterial(sg)
Duel.SendtoGrave(sg,REASON_COST+REASON_MATERIAL)
end
function cm.atop(e,tp,eg,ep,ev,re,r,rp,c)
local c=e:GetHandler()
......
......@@ -15,15 +15,14 @@ function cm.initial_effect(c)
local e12=e1:Clone()
e12:SetType(EFFECT_TYPE_QUICK_O)
e12:SetRange(LOCATION_HAND)
e12:SetCode(EVENT_FREE_CHAIN)
e12:SetLabel(2)
e12:SetCost(cm.cost)
c:RegisterEffect(e12)
local e13=e1:Clone()
e13:SetType(EFFECT_TYPE_QUICK_O)
e13:SetRange(LOCATION_GRAVE)
e13:SetType(EFFECT_TYPE_ACTIVATE+EFFECT_TYPE_QUICK_O)
e13:SetCost(cm.cost)
e13:SetLabel(3)
e13:SetCost(cm.cost)
c:RegisterEffect(e13)
--disable
local e2=Effect.CreateEffect(c)
......@@ -33,6 +32,15 @@ function cm.initial_effect(c)
e2:SetTarget(cm.disable)
e2:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e2)
--act limit
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(1,1)
e3:SetValue(aux.TRUE)
c:RegisterEffect(e3)
--maintain
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -42,62 +50,63 @@ function cm.initial_effect(c)
e4:SetCountLimit(1)
e4:SetOperation(cm.mtop)
c:RegisterEffect(e4)
--leave
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD_P)
e5:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e5:SetOperation(cm.regop)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_LEAVE_FIELD)
e6:SetCondition(cm.leacon)
e6:SetOperation(cm.leaop)
e6:SetLabelObject(e5)
c:RegisterEffect(e6)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
if chk==0 then return c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
c:CreateEffectRelation(e)
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsCanRemoveCounter(tp,0x1442,1,REASON_COST) then
e:GetHandler():RemoveCounter(tp,1,1,REASON_COST)
e:GetHandler():RemoveCounter(tp,0x1442,1,REASON_COST)
else
Duel.Destroy(e:GetHandler(),REASON_COST)
if Duel.GetTurnPlayer()==1-tp then
local disg=Duel.GetMatchingGroup(cm.disfilter,1-tp,LOCATION_HAND,0,c)
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,31,nil,1-tp,POS_FACEDOWN,REASON_COST) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=0
if b1 and b2 and b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,2))+1
else return end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,1-tp,eg,ep,ev,re,r,rp) end
end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
end
function cm.disable(e,c)
return c~=e:GetHandler() and c:IsFaceup()
return c~=e:GetHandler() and c:IsFaceup()
end
function cm.disfilter(c)
return c:IsAbleToGrave()
return c:IsDiscardable()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_EFFECT) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
if chk==0 then
if el==1 then
return b1 or b2 or b3
if el==1 then
return true
elseif el==2 then
return ( b1 and b2 ) or ( b2 and b3 ) or ( b1 and b3 )
return b2 or b3
elseif el==3 then
return b1 and b2 and b3
return b2 and b3
end
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local el=e:GetLabel()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
local c=e:GetHandler()
local el=e:GetLabel()
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_DECK,0,31,nil,tp,POS_FACEDOWN,REASON_COST) )
......@@ -107,48 +116,69 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp,chk)
local op3=-1
local tt={aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3)}
if el==1 then
if b1 and b2 and b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b1 and b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b1 then op1=Duel.SelectOption(tp,aux.Stringid(m,1))
elseif b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,2))+1
else return end
if b2 and b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b2 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b3 then op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,3))*2
else op1=0 end
end
if el==2 then
if b1 and b2 and b3 then
if b2 and b3 then
op1=Duel.SelectOption(tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
table.remove(tt,op1+1)
op2=Duel.SelectOption(tp,table.unpack(tt))
if op1==0 then op2=op1+1 end
if op1==1 and op2==0 then op2=1 end
elseif b1 then op1=0
if b2 then op2=1
elseif b3 then op2=2
end
elseif b2 and b3 then op1=1 op2=2
end
if op1==0 then op2=op2+1 end
if op1==1 and op2==1 then op2=2 end
elseif b2 then op1=0 op2=1
elseif b3 then op1=0 op2=2
else return end
end
if el==3 and b1 and b2 and b3 then op1=0 op2=1 op3=2 end
if op1==0 or op2==0 or op3==0 then cm.selop1(e,tp,eg,ep,ev,re,r,rp) end
if op1==1 or op2==1 or op3==1 then cm.selop2(e,tp,eg,ep,ev,re,r,rp) end
if op1==2 or op2==2 or op3==2 then cm.selop3(e,tp,eg,ep,ev,re,r,rp) end
local ct=-1
if (op1==0 or op2==0 or op3==0) and cm.selop1(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if (op1==1 or op2==1 or op3==1) and cm.selop2(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if (op1==2 or op2==2 or op3==2) and cm.selop3(e,tp,eg,ep,ev,re,r,rp) then ct=ct+1 end
if ct>0 then c:AddCounter(0x1442,ct) end
end
function cm.selop3(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local disg=Duel.GetMatchingGroup(cm.disfilter,tp,LOCATION_HAND,0,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g1=disg:SelectSubGroup(tp,aux.dncheck,true,4,4)
local g1=disg:SelectSubGroup(tp,aux.dncheck,false,4,4)
Duel.ConfirmCards(1-tp,g1)
Duel.SendtoGrave(g1,REASON_EFFECT)
c:AddCounter(0x1442,1)
return Duel.SendtoGrave(g1,REASON_EFFECT+REASON_DISCARD)~=0
end
function cm.selop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Damage(tp,4200,REASON_EFFECT)
c:AddCounter(0x1442,1)
return Duel.Damage(tp,4200,REASON_EFFECT)~=0
end
function cm.selop2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local rm=Duel.GetDecktopGroup(tp,31)
Duel.Remove(rm,POS_FACEDOWN,REASON_EFFECT)
c:AddCounter(0x1442,1)
end
\ No newline at end of file
return Duel.Remove(rm,POS_FACEDOWN,REASON_EFFECT)~=0
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetCounter(0x1442)>0 then
e:SetLabel(1)
else
e:SetLabel(0)
end
end
function cm.leacon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return Duel.GetTurnPlayer()~=tp and e:GetLabelObject():GetLabel()==1
end
function cm.leaop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_CARD,0,m)
local disg=Duel.GetMatchingGroup(cm.disfilter,1-tp,LOCATION_HAND,0,c)
local b1=( true )
local b2=( Duel.IsExistingMatchingCard(Card.IsAbleToRemove,1-tp,LOCATION_DECK,0,31,nil,1-tp,POS_FACEDOWN,REASON_EFFECT) )
local b3=( disg:GetClassCount(Card.GetCode)>3 )
local op1=-1
if b2 and b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2),aux.Stringid(m,3))
elseif b2 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,2))
elseif b3 then op1=Duel.SelectOption(1-tp,aux.Stringid(m,1),aux.Stringid(m,3))*2
else op1=0 end
if op1==0 then cm.selop1(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==1 then cm.selop2(e,1-tp,eg,ep,ev,re,r,rp) end
if op1==2 then cm.selop3(e,1-tp,eg,ep,ev,re,r,rp) end
end
--营地运动会 最终一战
function c45746903.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(45746903,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,45746903+EFFECT_COUNT_CODE_OATH)
e1:SetOperation(c45746903.activate)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(45746903,1))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_SZONE)
e4:SetCountLimit(1)
e4:SetCost(c45746903.drcost)
e4:SetTarget(c45746903.drtg)
e4:SetOperation(c45746903.drop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(45746903,2))
e5:SetCategory(CATEGORY_TOGRAVE)
e5:SetType(EFFECT_TYPE_IGNITION)
e5:SetRange(LOCATION_SZONE)
e5:SetCost(c45746903.tgcost)
e5:SetTarget(c45746903.tgtg)
e5:SetOperation(c45746903.tgop)
c:RegisterEffect(e5)
end
--e1
function c45746903.thfilter(c)
return c:IsCode(45746818) and c:IsAbleToHand()
end
function c45746903.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c45746903.thfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(45746903,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--e2
function c45746903.costfilter1(c)
return ((c:IsSetCard(0x88f) and c:IsType(TYPE_MONSTER)) or c:IsSetCard(0x88e)) and c:IsDiscardable()
end
function c45746903.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c45746903.costfilter1,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.DiscardHand(tp,c45746903.costfilter1,1,1,REASON_DISCARD+REASON_COST)
end
function c45746903.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function c45746903.drop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
--e3
function c45746903.costfilter2(c)
return c:IsSetCard(0x88e) and c:IsType(TYPE_LINK) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToRemoveAsCost()
end
function c45746903.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(c45746903.costfilter2,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,nil)
if chk==0 then return g:GetClassCount(Card.GetCode)>=7 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
aux.GCheckAdditional=aux.dncheck
local rg=g:SelectSubGroup(tp,aux.TRUE,false,7,7)
aux.GCheckAdditional=nil
Duel.Remove(rg,POS_FACEUP,REASON_COST)
end
function c45746903.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,nil)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,g,g:GetCount(),0,0)
end
function c45746903.tgop(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsRelateToEffect(e) then return end
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,0,LOCATION_HAND+LOCATION_EXTRA,nil)
Duel.SendtoGrave(g,REASON_EFFECT)
end
--砂冢明音·流回
local m=81002002
local cm=_G["c"..m]
Duel.LoadScript("c81000000.lua")
function cm.initial_effect(c)
aux.AddCodeList(c,81002000)
c:EnableReviveLimit()
--special summon
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD)
e0:SetCode(EFFECT_SPSUMMON_PROC)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e0:SetRange(LOCATION_HAND)
e0:SetCondition(cm.spcon)
e0:SetOperation(cm.spop)
c:RegisterEffect(e0)
--code
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetValue(81002000)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_MZONE)
e2:SetHintTiming(0,TIMING_END_PHASE)
e2:SetCountLimit(1,m)
e2:SetCost(cm.cost)
e2:SetTarget(cm.tg)
e2:SetOperation(cm.op)
c:RegisterEffect(e2)
end
function cm.spfilter(c)
return (bit.band(c:GetOriginalType(),TYPE_SPELL)~=0 or bit.band(c:GetOriginalType(),TYPE_TRAP)~=0) and c:IsAbleToGraveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<-1 then return false end
if ft<=0 then
local ct=-ft+1
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_MZONE,0,ct,nil)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_ONFIELD,0,2,nil)
else
return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_ONFIELD,0,2,nil)
end
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if ft<=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_ONFIELD,0,nil)
local ct=-ft+1
local g1=sg:FilterSelect(tp,Card.IsLocation,ct,ct,nil,LOCATION_MZONE)
if ct<2 then
sg:Sub(g1)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g2=sg:Select(tp,2-ct,2-ct,nil)
g1:Merge(g2)
end
Duel.SendtoGrave(g1,REASON_COST)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_ONFIELD,0,2,2,nil)
Duel.SendtoGrave(g,REASON_COST)
end
end
function cm.actfilter(c)
return c:IsFaceup() and ((c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT) or c:IsType(TYPE_SPELL+TYPE_TRAP)) and c:IsStatus(STATUS_EFFECT_ENABLED)
end
function cm.ssfilter(c)
return (bit.band(c:GetOriginalType(),TYPE_SPELL)~=0 or bit.band(c:GetOriginalType(),TYPE_TRAP)~=0) and c:IsAbleToGraveAsCost()
and Duel.IsExistingTarget(cm.actfilter,c:GetControler(),LOCATION_ONFIELD,0,1,c) and c:GetFlagEffect(m)==0
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ssfilter,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.ssfilter,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.actfilter,tp,LOCATION_ONFIELD,0,1,nil) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local tc=Duel.SelectMatchingCard(tp,cm.actfilter,tp,LOCATION_ONFIELD,0,1,1,nil):GetFirst()
if tc then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetValue(cm.efilter)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetOwnerPlayer(tp)
tc:RegisterEffect(e1)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,0))
end
end
function cm.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer()
end
--玫瑰天堂·砂冢明音
local m=81002010
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddCodeList(c,81002000)
--xyz summon
aux.AddXyzProcedure(c,nil,3,2)
c:EnableReviveLimit()
--code
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e0:SetCode(EFFECT_CHANGE_CODE)
e0:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e0:SetValue(81002000)
c:RegisterEffect(e0)
--negate activate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCode(EVENT_CHAINING)
e2:SetCondition(cm.negcon)
e2:SetCost(cm.negcost)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
--material
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+900)
e4:SetTarget(cm.mttg)
e4:SetOperation(cm.mtop)
c:RegisterEffect(e4)
end
function cm.mtfilter(c,e)
return c:IsFaceup() and c:IsType(TYPE_SPELL+TYPE_TRAP) and (c:IsControler(tp) or c:IsAbleToChangeControler()) and not c:IsImmuneToEffect(e)
end
function cm.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(cm.mtfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,e) end
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) or c:IsFacedown() then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,cm.mtfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,e)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp,chk)
return ep~=tp
and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and Duel.IsChainDisablable(ev)
end
function cm.negcost(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)
local ct=Duel.GetOperatedGroup():GetFirst()
e:SetLabelObject(ct)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
if re:GetHandler():IsDestructable() and e:GetLabelObject():IsType(TYPE_CONTINUOUS) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,re:GetHandler(),1,0,0)
end
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateEffect(ev) and re:GetHandler():IsRelateToEffect(re) and e:GetLabelObject():IsType(TYPE_CONTINUOUS) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--Pure Ruby
local m=81004010
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.EnablePendulumAttribute(c)
--to hand
local e0=Effect.CreateEffect(c)
e0:SetCategory(CATEGORY_TOHAND+CATEGORY_DESTROY)
e0:SetType(EFFECT_TYPE_IGNITION)
e0:SetProperty(EFFECT_FLAG_CARD_TARGET)
e0:SetRange(LOCATION_PZONE)
e0:SetCountLimit(1,m)
e0:SetTarget(cm.thtg)
e0:SetOperation(cm.thop)
c:RegisterEffect(e0)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.ppcon)
e1:SetTarget(cm.pptg)
e1:SetOperation(cm.ppop)
c:RegisterEffect(e1)
--spsummon condition
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SPSUMMON_PROC)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1,m+800)
e3:SetRange(LOCATION_EXTRA+LOCATION_HAND)
e3:SetCondition(cm.spcon)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--Negate
local e4=Effect.CreateEffect(c)
e4:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+900)
e4:SetCondition(cm.discon)
e4:SetCost(cm.discost)
e4:SetTarget(cm.distg)
e4:SetOperation(cm.disop)
c:RegisterEffect(e4)
end
function cm.thfilter(c)
return c:IsFaceup() and c:IsType(TYPE_RITUAL) and c:IsAbleToHand() and (c:IsType(TYPE_PENDULUM) or c:IsType(TYPE_SPELL))
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_REMOVED) and chkc:IsControler(tp) and cm.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(cm.thfilter,tp,LOCATION_REMOVED,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,cm.thfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,e:GetHandler(),1,0,0)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)~=0 and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function cm.spfiltera(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_PENDULUM) and c:IsAbleToRemoveAsCost()
end
function cm.spfilterb(c)
return c:IsType(TYPE_RITUAL) and c:IsType(TYPE_SPELL) and c:IsAbleToRemoveAsCost()
end
function cm.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return ((c:IsLocation(LOCATION_HAND) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0) or
(c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp)>0))
and Duel.IsExistingMatchingCard(cm.spfiltera,tp,LOCATION_GRAVE,0,1,nil)
and Duel.IsExistingMatchingCard(cm.spfilterb,tp,LOCATION_GRAVE,0,1,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g1=Duel.SelectMatchingCard(tp,cm.spfiltera,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g2=Duel.SelectMatchingCard(tp,cm.spfilterb,tp,LOCATION_GRAVE,0,1,1,nil)
g1:Merge(g2)
Duel.Remove(g1,POS_FACEUP,REASON_COST)
end
function cm.ppcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL
end
function cm.qfilter(c,e,tp,m,ft)
if not c:IsType(TYPE_PENDULUM) or bit.band(c:GetType(),0x81)~=0x81
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true) then return false end
local mg=m:Filter(Card.IsCanBeRitualMaterial,c,c)
if ft>0 then
return mg:CheckWithSumGreater(Card.GetRitualLevel,c:GetLevel(),c)
else
return mg:IsExists(cm.qfilterF,1,nil,tp,mg,c)
end
end
function cm.qfilterF(c,tp,mg,rc)
if c:IsControler(tp) and c:IsLocation(LOCATION_MZONE) and c:GetSequence()<5 then
Duel.SetSelectedCard(c)
return mg:CheckWithSumGreater(Card.GetRitualLevel,rc:GetLevel(),rc)
else return false end
end
function cm.pptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.IsExistingMatchingCard(cm.qfilter,tp,LOCATION_HAND,0,1,nil,e,tp,mg,ft)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND)
end
function cm.ppop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetRitualMaterial(tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=Duel.SelectMatchingCard(tp,cm.qfilter,tp,LOCATION_HAND,0,1,1,nil,e,tp,mg,ft)
local tc=tg:GetFirst()
if tc then
mg=mg:Filter(Card.IsCanBeRitualMaterial,tc,tc)
local mat=nil
if ft>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
else
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
mat=mg:FilterSelect(tp,cm.qfilterF,1,1,nil,tp,mg,tc)
Duel.SetSelectedCard(mat)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local mat2=mg:SelectWithSumGreater(tp,Card.GetRitualLevel,tc:GetLevel(),tc)
mat:Merge(mat2)
end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,POS_FACEUP)
tc:CompleteProcedure()
end
end
function cm.discon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if ep==tp or c:IsStatus(STATUS_BATTLE_DESTROYED) then return false end
return (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function cm.costfilter(c)
return bit.band(c:GetType(),0x81)==0x81 and c:IsFaceup() and c:IsAbleToDeckAsCost()
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.costfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.costfilter,tp,LOCATION_EXTRA,0,1,1,nil)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
if re:GetHandler():IsDestructable() and re:GetHandler():IsRelateToEffect(re) then
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
......@@ -85,12 +85,12 @@ function c85401480.tgg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c85401480.opp(e,tp,eg,ep,ev,re,r,rp)
Duel.Damage(tp,800,REASON_EFFECT)
local e1=Effect.CreateEffect(c)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(1200)
e1:SetReset(RESET_EVENT+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
e:GetHandler():RegisterEffect(e1)
end
function c85401480.glq(c)
return c:IsAbleToHand() and c:IsCode(85401860)
......
--奇幻剑士·神山飞鸟
local m=86580000
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SPSUMMON)==0
and Duel.GetCustomActivityCount(m,tp,ACTIVITY_SUMMON)==0 and Duel.IsExistingMatchingCard(cm.tf1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) 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:SetLabelObject(e)
e1:SetTarget(function(e,c,sump,sumtype,sumpos,targetp,se)
return not (c:IsSetCard(0x3652) or c:IsSetCard(0x5652))
end)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CANNOT_SUMMON)
Duel.RegisterEffect(e2,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.tf1,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SPSUMMON,cm.kf1)
Duel.AddCustomActivityCounter(m,ACTIVITY_SUMMON,cm.kf1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
end
--e1
function cm.kf1(c)
return c:IsSetCard(0x3652) or c:IsSetCard(0x5652)
end
function cm.tf1(c,e,tp)
return c:IsCode(m+1) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
--奇幻剑·火炎剑烈火
local m=86580001
local cm=_G["c"..m]
function cm.initial_effect(c)
--e1
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE+LOCATION_REMOVED)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cf11,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
and Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,e:GetHandler(),1,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_DECKBOT)
c:RegisterEffect(e1,true)
end
end)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+24)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.t2(chkc,tp,c) end
if chk==0 then return Duel.IsPlayerCanSpecialSummonCount(tp,1) and Duel.IsExistingTarget(cm.t2,tp,LOCATION_MZONE,0,1,nil,tp,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.t2,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) or tc:IsFacedown() then return end
Duel.RaiseEvent(c,EVENT_ADJUST,nil,0,PLAYER_NONE,PLAYER_NONE,0)
local mg=Group.FromCards(c,tc)
if mg:FilterCount(Card.IsLocation,nil,LOCATION_MZONE)<2 then return end
local g=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,sg:GetFirst(),nil,mg)
end
end)
c:RegisterEffect(e2)
end
--e1
function cm.cf11(c)
return c:IsCode(m-1) and c:IsFaceup()
end
--e2
function cm.t2(c,tp,mc)
local mg=Group.FromCards(c,mc)
return c:IsFaceup() and Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,mg) and c:IsCode(m-1)
end
--奇幻剑·水势剑流水
local m=86580002
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return (Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and not Duel.IsExistingMatchingCard(cm.cf1,c:GetControler(),LOCATION_MZONE,0,1,nil))
or Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(function(e,c)
return c~=e:GetHandler()
end)
c:RegisterEffect(e2)
end
--e1
function cm.cf1(c)
return not (c:IsSetCard(0x3652) or c:IsSetCard(0x5652)) or c:IsFacedown()
end
\ No newline at end of file
--奇幻剑·雷鸣剑黄雷
local m=86580003
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return (Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and not Duel.IsExistingMatchingCard(cm.cf1,c:GetControler(),LOCATION_MZONE,0,1,nil))
or Duel.GetFieldGroupCount(c:GetControler(),LOCATION_MZONE,0)==0
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,0x3652) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,0x3652)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
--e1
function cm.cf1(c)
return not (c:IsSetCard(0x3652) or c:IsSetCard(0x5652)) or c:IsFacedown()
end
\ No newline at end of file
--奇幻剑·土豪剑激土
local m=86580004
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsSetCard,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil,0x3652,0x5652)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_BE_BATTLE_TARGET)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(c:GetDefense())
c:RegisterEffect(e1)
end)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCountLimit(1,m)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsFaceup() end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_MZONE,1,1,nil)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) then
c:SetCardTarget(tc)
end
end)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_TARGET)
e4:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(function(e,c)
return c~=e:GetHandler()
end)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_TARGET)
e5:SetCode(EFFECT_CANNOT_SELECT_EFFECT_TARGET)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(function(e,c)
return c~=e:GetHandler()
end)
c:RegisterEffect(e5)
end
\ No newline at end of file
--奇幻剑·风双剑翠风
local m=86580005
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsAttackAbove,tp,0,LOCATION_MZONE,1,nil,2000)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+21)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+17) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+20,nil,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,ATTRIBUTE_DARK) end
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,m+20,nil,TYPES_TOKEN_MONSTER,0,0,4,RACE_FIEND,ATTRIBUTE_DARK) then
local token=Duel.CreateToken(tp,m+20)
Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)
end
end)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+22)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsCode(m+20) end
if chk==0 then return Duel.IsExistingTarget(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,m+20) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,Card.IsCode,tp,LOCATION_MZONE,0,1,1,nil,m+20)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not c:IsRelateToEffect(e) or not tc:IsRelateToEffect(e) then return end
Duel.Destroy(tc,REASON_EFFECT)
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil,tp)
Duel.Destroy(g,REASON_EFFECT)
end
end)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+17) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
c:RegisterEffect(e4)
end
\ No newline at end of file
--奇幻剑·音铳剑锡音
local m=86580006
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsSetCard,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil,0x3652,0x5652)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,m-5,0x3652) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=4 end
Duel.DiscardDeck(tp,3,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,m-5,0x3652)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end)
c:RegisterEffect(e2)
end
\ No newline at end of file
--奇幻剑·暗黑剑月暗
local m=86580007
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(function(e,se,sp,st)
return se:GetHandler():IsCode(m)
end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.cf1,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_DAMAGE)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)>=3 end
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFieldGroupCount(tp,0,LOCATION_DECK)==0 then return end
Duel.ConfirmDecktop(1-tp,3)
local g1=Duel.GetDecktopGroup(1-tp,3)
local tc=g1:GetFirst()
local dam=0
while tc do
local lev=tc:GetLevel()
if lev<0 then lev=0 end
dam=dam+lev*500
tc=g1:GetNext()
end
Duel.Damage(1-tp,dam,REASON_EFFECT)
end)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+20)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+15)
end)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return e:GetHandler():IsReleasable() and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,1,nil) end
Duel.Release(e:GetHandler(),REASON_COST)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+15)
end)
c:RegisterEffect(e4)
end
function cm.cf1(c)
return c:IsSetCard(0x5652) and c:IsRankAbove(5)
end
\ No newline at end of file
--奇幻剑·光刚剑最光
local m=86580008
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(function(e,se,sp,st)
return se:GetHandler():IsCode(m)
end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.cf1,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,m)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and chkc:IsSetCard(0x3652) or chkc:IsSetCard(0x5652) end
if chk==0 then return Duel.IsExistingTarget(Card.IsSetCard,tp,LOCATION_MZONE,0,1,nil,0x3652,0x5652) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsSetCard,tp,LOCATION_MZONE,0,1,1,nil,0x3652,0x5652)
Duel.SetOperationInfo(0,CATEGORY_RECOVER,nil,0,tp,g:GetFirst():GetAttack())
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() and tc:GetAttack()>0 then
Duel.Recover(tp,tc:GetAttack(),REASON_EFFECT)
end
end)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_REMOVE)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetCountLimit(1,m+20)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cf4,tp,LOCATION_MZONE,0,1,nil) and not Duel.IsPlayerAffectedByEffect(tp,m+14)
end)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
if Duel.Remove(tc,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local ct=2
if Duel.GetCurrentPhase()==PHASE_END then ct=3 end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabelObject(tc)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetTurnCount()==e:GetValue() then return false end
return e:GetLabelObject():GetFlagEffect(m)~=0
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.ReturnToField(tc)
end)
if Duel.GetCurrentPhase()==PHASE_END then
e1:SetReset(RESET_PHASE+PHASE_END,3)
e1:SetValue(Duel.GetTurnCount())
else
e1:SetReset(RESET_PHASE+PHASE_END,2)
e1:SetValue(Duel.GetTurnCount())
end
Duel.RegisterEffect(e1,tp)
tc:RegisterFlagEffect(m,RESET_PHASE+PHASE_END,0,ct)
end
end
end)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetType(EFFECT_TYPE_QUICK_O)
e5:SetCode(EVENT_FREE_CHAIN)
e5:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cf4,tp,LOCATION_MZONE,0,1,nil) and Duel.IsPlayerAffectedByEffect(tp,m+14)
end)
c:RegisterEffect(e5)
end
function cm.cf1(c)
return c:IsSetCard(0x5652) and c:IsRankAbove(5)
end
function cm.cf4(c,tp)
return c:IsCode(m-1) and c:IsFaceup()
end
\ No newline at end of file
--奇幻剑·烟叡剑狼烟
local m=86580009
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(Card.IsSetCard,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil,0x3652,0x5652)
end)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_REMOVE+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+13) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1 and e:GetHandler():IsAbleToRemove()
and Duel.IsExistingMatchingCard(cm.t3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,e:GetHandler(),1,tp,0)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.Remove(c,POS_FACEUP,REASON_EFFECT+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(c)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()>e:GetLabel()
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.t3,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_SELF_DESTROY)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SINGLE_RANGE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.of3,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil)
end)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
Duel.SpecialSummonComplete()
end
end
end
end)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+13) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
c:RegisterEffect(e4)
end
function cm.t3(c,e,tp)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.of3(c)
return c:IsFaceup() and c:IsCode(m)
end
\ No newline at end of file
--奇幻剑·时国剑界时
local m=86580010
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.cf1,c:GetControler(),LOCATION_MZONE,LOCATION_MZONE,1,nil)
end)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+12)
end)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) end
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() and Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
if Duel.Remove(c,POS_FACEUP,REASON_COST+REASON_TEMPORARY)~=0 then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_STANDBY)
e1:SetCountLimit(1)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(c)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnCount()>e:GetLabel()
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.ReturnToField(e:GetLabelObject())
end)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,LOCATION_ONFIELD)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+12)
end)
c:RegisterEffect(e4)
end
function cm.cf1(c)
return c:IsSetCard(0x5652) and c:IsRankAbove(9)
end
\ No newline at end of file
--奇幻剑·无铭剑虚无
local m=86580011
local cm=_G["c"..m]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e1=Effect.CreateEffect(c)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(function(e,se,sp,st)
return se:GetHandler():IsCode(m)
end)
c:RegisterEffect(e1)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(function(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingMatchingCard(cm.cf1,tp,LOCATION_MZONE,0,1,nil)
end)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.GetControl(e:GetHandler(),1-tp)
end)
c:RegisterEffect(e3)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
c:RegisterEffect(e6)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetCode(EFFECT_UNRELEASABLE_SUM)
e11:SetRange(LOCATION_MZONE)
e11:SetValue(1)
c:RegisterEffect(e11)
local e12=e11:Clone()
e12:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e12)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetRange(LOCATION_MZONE)
e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetTargetRange(1,0)
e7:SetTarget(function(e,c)
return not (c:IsSetCard(0x3652) or c:IsSetCard(0x5652))
end)
c:RegisterEffect(e7)
end
function cm.cf1(c)
return c:IsCode(m-3) and c:IsFaceup()
end
\ No newline at end of file
--奇幻剑·真理之剑
local m=86580012
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m)
e2:SetRange(LOCATION_FZONE)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSetCard,tp,LOCATION_DECK,0,1,m-5,0x3652) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsSetCard,tp,LOCATION_DECK,0,1,1,m-5,0x3652)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_FZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x3652))
e3:SetValue(500)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
end
--奇幻剑开幕
local m=86580013
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.t1,tp,LOCATION_HAND,0,1,e:GetHandler()) and Duel.GetFieldGroupCount(tp,LOCATION_DECK,0)>=5
and Duel.IsPlayerCanDraw(tp,2) end
local g=Duel.SelectMatchingCard(tp,cm.t1,tp,LOCATION_HAND,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
Duel.DiscardDeck(tp,3,REASON_COST)
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end)
c:RegisterEffect(e1)
end
function cm.t1(c)
return c:IsSetCard(0x3652) and c:IsAbleToRemoveAsCost()
end
\ No newline at end of file
--奇幻剑增册
local m=86580014
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.t1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(cm.t1,tp,LOCATION_MZONE,0,1,nil,e,tp)
and e:GetHandler():IsCanOverlay() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,cm.t1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) then return end
if tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.t12,tp,LOCATION_EXTRA,0,1,1,nil,e,tp,tc,tc:GetRank())
local sc=g:GetFirst()
if sc then
local mg=tc:GetOverlayGroup()
if mg:GetCount()~=0 then
Duel.Overlay(sc,mg)
end
sc:SetMaterial(Group.FromCards(tc))
Duel.Overlay(sc,Group.FromCards(tc))
Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
end
end)
c:RegisterEffect(e1)
end
function cm.t1(c,e,tp)
local rk=c:GetRank()
return rk>0 and c:IsFaceup() and c:IsSetCard(0x5652) and c:GetOverlayCount()<=1
and Duel.IsExistingMatchingCard(cm.t12,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank())
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
end
function cm.t12(c,e,tp,mc,rk)
return c:GetRank()~=rk and c:IsSetCard(0x5652) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
\ No newline at end of file
--奇幻剑连携
local m=86580015
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cf,tp,LOCATION_MZONE,0,2,nil)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cf,tp,LOCATION_MZONE,0,1,nil) and Duel.IsExistingMatchingCard(nil,tp,0,LOCATION_ONFIELD,2,nil) end
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,3,0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cf,tp,LOCATION_MZONE,0,nil)
local g1=Duel.GetMatchingGroup(nil,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and g1:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
local sg1=g1:Select(tp,2,2,nil)
sg:Merge(sg1)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
end
function cm.cf(c)
return c:IsFaceup() and c:IsSetCard(0x3652)
end
\ No newline at end of file
--奇幻剑合击·银河友情蹴烈破
local m=86580016
local cm=_G["c"..m]
function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cf,tp,LOCATION_MZONE,0,3,nil) and rp~=tp
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end)
e1:SetTarget(function(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)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT) and re:GetHandler():IsSetCard(0x3652)
end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end
Duel.SetOperationInfo(0,CATEGORY_TODECK,e:GetHandler(),1,tp,LOCATION_GRAVE)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) then
Duel.SendtoDeck(e:GetHandler(),nil,2,REASON_EFFECT)
end
end)
c:RegisterEffect(e2)
end
function cm.cf(c)
return c:IsFaceup() and c:IsSetCard(0x3652) or c:IsSetCard(0x5652)
end
\ No newline at end of file
--圣刃·烈火一册
local m=86580017
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,1,2)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
end)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,m-3) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,Card.IsCode,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,m-3)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,4))
e2:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,m)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+5)
end)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsSetCard(0x3652) end
if chk==0 then return Duel.IsExistingTarget(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,0x3652)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,0x3652)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=tc:GetAttack()
local def=tc:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(atk)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def)
c:RegisterEffect(e2)
end
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+5)
end)
c:RegisterEffect(e3)
end
--圣刃·烈火三册
local m=86580018
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,3,4)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,4))
end)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,5))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_DESTROY)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end)
e1:SetTarget(function(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)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_REMOVE)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) or not Duel.IsChainNegatable(ev) then return false end
if re:IsHasCategory(CATEGORY_NEGATE)
and Duel.GetChainInfo(ev-1,CHAININFO_TRIGGERING_EFFECT):IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,tg,tc=Duel.GetOperationInfo(ev,CATEGORY_RELEASE)
return ex and tg~=nil and tc+tg:FilterCount(Card.IsOnField,nil)-tg:GetCount()>0
end)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,6))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.Destroy(tc,REASON_EFFECT)
end
end)
c:RegisterEffect(e4)
end
--圣刃·激昂合龙
local m=86580019
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,cm.xf1,3,3,cm.xf2,aux.Stringid(m,2),3,cm.xfo)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
end)
c:RegisterEffect(e0)
--e1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,4))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ts1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil)
or Duel.IsExistingMatchingCard(cm.tf1,tp,LOCATION_GRAVE,LOCATION_GRAVE,1,nil) end
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsRelateToEffect(e) then return end
local z1=Duel.GetLocationCount(tp,LOCATION_SZONE)
local g1=Duel.GetMatchingGroup(cm.ts1,tp,LOCATION_GRAVE,0,nil)
local z2=Duel.GetLocationCount(tp,LOCATION_FZONE)
local g2=Duel.GetMatchingGroup(cm.tf1,tp,LOCATION_GRAVE,0,nil)
local z3=Duel.GetLocationCount(1-tp,LOCATION_SZONE)
local g3=Duel.GetMatchingGroup(cm.ts1,1-tp,LOCATION_GRAVE,0,nil)
local z4=Duel.GetLocationCount(1-tp,LOCATION_FZONE)
local g4=Duel.GetMatchingGroup(cm.tf1,1-tp,LOCATION_GRAVE,0,nil)
if (z1>=0 and g1:GetCount()~=0) or (z2>=0 and g2:GetCount()~=0) or (z3>=0 and g3:GetCount()~=0) or (z4>=0 and g4:GetCount()~=0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(tp,cm.ts1,tp,LOCATION_GRAVE,0,z1,z1,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
tc=g:GetNext()
end
local g=Duel.SelectMatchingCard(tp,cm.tf1,tp,LOCATION_GRAVE,0,z2,z2,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,tp,tp,LOCATION_FZONE,POS_FACEUP,true)
tc=g:GetNext()
end
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOFIELD)
local g=Duel.SelectMatchingCard(1-tp,cm.ts1,1-tp,LOCATION_GRAVE,0,z3,z3,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,1-tp,1-tp,LOCATION_SZONE,POS_FACEUP,true)
tc=g:GetNext()
end
local g=Duel.SelectMatchingCard(1-tp,cm.tf1,1-tp,LOCATION_GRAVE,0,z4,z4,nil)
local tc=g:GetFirst()
while tc do
Duel.MoveToField(tc,1-tp,1-tp,LOCATION_FZONE,POS_FACEUP,true)
tc=g:GetNext()
end
end
end)
c:RegisterEffect(e1)
--e2
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(0,LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_CANNOT_NEGATE)
e2:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e2:SetValue(function(e,c)
return c~=e:GetHandler()
end)
c:RegisterEffect(e2)
--e3
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,5))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1,m)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+3)
end)
e3:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(cm.t3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local g=Duel.GetMatchingGroup(cm.t3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end)
e3:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.t3,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,3,nil)
Duel.HintSelection(sg)
local t=Duel.Destroy(sg,REASON_EFFECT)
local g1=Duel.GetMatchingGroup(nil,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g1:GetCount()>0 and t>0 and Duel.SelectYesNo(tp,aux.Stringid(m,6)) then
local sg=g1:Select(tp,1,t,nil)
Duel.HintSelection(sg)
Duel.Destroy(sg,REASON_EFFECT)
end
end
end)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+3)
end)
c:RegisterEffect(e4)
end
--e0
function cm.xf1(c,fc,sub,mg,sg)
return c:IsRace(RACE_DRAGON) and c:IsType(TYPE_EFFECT) and not sg or not sg:IsExists(Card.IsCode,1,c,c:GetCode())
end
function cm.xf2(c)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x5652) and Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil,m-8)
end
function cm.xfo(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
--e1
function cm.ts1(c)
return c:GetType()==0x20002 and Duel.GetLocationCount(c:GetControler(),LOCATION_SZONE)>0 and c:IsLocation(LOCATION_GRAVE)
end
function cm.tf1(c)
return c:IsType(TYPE_FIELD) and Duel.GetLocationCount(c:GetControler(),LOCATION_FZONE)>0 and c:IsLocation(LOCATION_GRAVE)
end
--e3
function cm.t3(c)
return c:GetType()==0x20002 or c:IsType(TYPE_FIELD)
end
\ No newline at end of file
--圣刃·龙纹骑士
local m=86580020
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,nil,5,3)
c:EnableReviveLimit()
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
end)
c:RegisterEffect(e0)
--e1
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,5))
e1:SetCategory(CATEGORY_DISABLE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local c=e:GetHandler()
local seq=c:GetSequence()
local g=Duel.GetMatchingGroup(cm.t1,tp,0,LOCATION_ONFIELD,nil,seq)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,g:GetCount(),0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local seq=c:GetSequence()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local g=Duel.GetMatchingGroup(cm.t1,tp,0,LOCATION_ONFIELD,nil,seq)
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
tc=g:GetNext()
end
end
end
end)
c:RegisterEffect(e1)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,6))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_TOKEN)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m)
e4:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsPlayerCanSpecialSummonMonster(tp,m+6,nil,TYPES_TOKEN_MONSTER,500,500,4,RACE_DRAGON,ATTRIBUTE_FIRE)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.SetOperationInfo(0,CATEGORY_TOKEN,nil,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end)
e4:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
if Duel.IsPlayerCanSpecialSummonMonster(tp,m+6,nil,TYPES_TOKEN_MONSTER,500,500,4,RACE_DRAGON,ATTRIBUTE_FIRE) then
local token=Duel.CreateToken(tp,m+6)
if Duel.SpecialSummon(token,0,tp,tp,false,false,POS_FACEUP)~=0 and Duel.GetLocationCount(tp,LOCATION_SZONE)>=0 then
Duel.BreakEffect()
if Duel.Equip(tp,token,c,true,true) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(function(e,c)
return e:GetOwner()==c
end)
token:RegisterEffect(e1)
end
end
Duel.EquipComplete()
end
end)
c:RegisterEffect(e4)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e4:SetValue(aux.tgoval)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(function(e)
return e:GetHandler():GetEquipGroup():IsExists(cm.e4,1,nil)
end)
c:RegisterEffect(e4)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(500)
e3:SetCondition(function(e)
return e:GetHandler():GetEquipGroup():IsExists(cm.e4,1,nil)
end)
c:RegisterEffect(e3)
local e5=e3:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e5)
end
--e1
function cm.t1(c,seq2)
local seq1=aux.GetColumn(c)
return c:IsFaceup() and (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT or not c:IsType(TYPE_MONSTER))
and math.abs(seq2-seq1)<=1
end
function cm.e4(c)
return c:IsFaceup() and c:IsCode(m+6)
end
\ No newline at end of file
--圣刃·远古幼龙
local m=86580021
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,cm.xf,7,5)
c:EnableReviveLimit()
c:SetUniqueOnField(1,0,m,LOCATION_MZONE)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
end)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,4))
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,e:GetHandler()) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,e:GetHandler())
if g:GetCount()>0 then
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.Destroy(tc,REASON_EFFECT)
tc=g:GetNext()
end
end
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,5))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m+10)
e2:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m+1)
end)
e2:SetTarget(function(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())
and e:GetHandler():CheckRemoveOverlayCard(tp,2,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,2,2,REASON_COST)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
local tc=g:GetFirst()
local og=tc:GetOverlayGroup()
if og:GetCount()>0 then
Duel.SendtoGrave(og,REASON_RULE)
end
Duel.Overlay(c,Group.FromCards(tc))
end
end)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m+1)
end)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(function(e,c)
local g=e:GetHandler():GetOverlayGroup()
return g:GetSum(Card.GetAttack)
end)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UPDATE_DEFENSE)
e5:SetValue(function(e,c)
local g=e:GetHandler():GetOverlayGroup()
return g:GetSum(Card.GetDefense)
end)
c:RegisterEffect(e5)
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(function(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_MONSTER)
end)
e6:SetValue(1)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_SINGLE)
e8:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e8:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e8:SetValue(aux.tgoval)
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(function(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_SPELL)
end)
c:RegisterEffect(e8)
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_UNRELEASABLE_SUM)
e9:SetRange(LOCATION_MZONE)
e9:SetCondition(function(e)
return e:GetHandler():GetOverlayGroup():IsExists(Card.IsType,1,nil,TYPE_TRAP)
end)
e9:SetValue(aux.tgoval)
c:RegisterEffect(e9)
local e10=e9:Clone()
e10:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e10)
end
--e0
function cm.xf(c,fc,sub,mg,sg)
return c:IsRace(RACE_DRAGON)
end
\ No newline at end of file
--圣刃·元素古龙
local m=86580022
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,cm.xf,9,3,cm.xf2,aux.Stringid(m,0),3,cm.xfo)
c:EnableReviveLimit()
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.xyzlimit)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_UNRELEASABLE_SUM)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(aux.tgoval)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e4)
local e5=e3:Clone()
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e5)
local e6=e3:Clone()
e6:SetCode(EFFECT_CANNOT_BE_BATTLE_TARGET)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_FIELD)
e7:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e7:SetCode(m)
e7:SetRange(LOCATION_MZONE)
e7:SetTargetRange(1,0)
c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(m,4))
e8:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetRange(LOCATION_MZONE)
e8:SetProperty(EFFECT_FLAG_CARD_TARGET)
e8:SetCountLimit(1,m)
e8:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m)
end)
e8:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
end)
e8:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if c:IsRelateToEffect(e) and tc:IsRelateToEffect(e) and tc:IsFaceup() then
local atk=c:GetAttack()
local def=c:GetDefense()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(atk)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(def)
tc:RegisterEffect(e2)
end
end)
c:RegisterEffect(e8)
local e9=e8:Clone()
e9:SetType(EFFECT_TYPE_QUICK_O)
e9:SetCode(EVENT_FREE_CHAIN)
e9:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m)
end)
c:RegisterEffect(e9)
end
--e0
function cm.xf(c,fc,sub,mg,sg)
return c:IsRace(RACE_DRAGON)
end
function cm.xf2(c)
return c:IsCode(m-1)
end
function cm.xfo(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m-1,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m-1,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
end
--刃王剑·十圣刃
local m=86580023
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep2(c,cm.cf,10,99,false)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_SPSUMMON_SUCCESS)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,4))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,5))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,6))
end)
c:RegisterEffect(e0)
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.fuslimit)
c:RegisterEffect(e1)
--e2
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+LOCATION_GRAVE)
e2:SetCondition(function(e,c)
if c==nil then return true end
local tp=c:GetControler()
local g=Duel.GetMatchingGroup(cm.cf,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
return g:CheckSubGroup(aux.dncheck,10,10)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.GetMatchingGroup(cm.cf,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,10,10)
if sg and sg:GetCount()==10 then
c:SetMaterial(sg)
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
end
end)
e2:SetValue(SUMMON_VALUE_SELF)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_DISABLE_SPSUMMON)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_UNRELEASABLE_SUM)
e4:SetRange(LOCATION_MZONE)
e4:SetValue(aux.tgoval)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e5)
local e6=e4:Clone()
e6:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
c:RegisterEffect(e6)
local e7=Effect.CreateEffect(c)
e7:SetType(EFFECT_TYPE_SINGLE)
e7:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e7:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e7:SetRange(LOCATION_MZONE)
e7:SetValue(1)
c:RegisterEffect(e7)
local e8=e7:Clone()
e8:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e8)
local e9=Effect.CreateEffect(c)
e9:SetCategory(CATEGORY_REMOVE)
e9:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e9:SetCode(EVENT_SPSUMMON_SUCCESS)
e9:SetProperty(EFFECT_FLAG_DELAY)
e9:SetCountLimit(1,m)
e9:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(function(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,1,nil) end
local g=Duel.GetMatchingGroup(function(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,g:GetCount(),0,0)
end)
e9:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(function(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToRemove()
end,tp,0,LOCATION_ONFIELD+LOCATION_GRAVE,nil)
if g:GetCount()>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
end)
c:RegisterEffect(e9)
local e10=Effect.CreateEffect(c)
e10:SetDescription(aux.Stringid(m,8))
e10:SetCategory(CATEGORY_TODECK)
e10:SetType(EFFECT_TYPE_IGNITION)
e10:SetRange(LOCATION_MZONE)
e10:SetCountLimit(1,m+9)
e10:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,m-1) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
e10:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.t3,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED,0,1,nil) end
local g=Duel.GetMatchingGroup(cm.t3,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end)
e10:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.t3,tp,LOCATION_GRAVE+LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,g:GetCount(),nil)
Duel.HintSelection(sg)
local z1=Duel.SendtoDeck(sg,nil,2,REASON_EFFECT)
if z1>=1 then
if z1>=3 then
if z1>=5 then
if z1>=7 then
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,12))
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()<=0 then return end
local tc=g:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
else
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,11))
end
local g=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
if g:GetCount()<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local sg=g:Select(tp,1,3,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
else
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,10))
end
local sg=nil
local hg=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_HAND,nil)
local b1=Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil)
if not b1 then return end
if b1 then
sg=hg:RandomSelect(tp,1)
end
Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)
else
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,9))
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE+EFFECT_FLAG_CANNOT_DISABLE)
e1:SetRange(LOCATION_MZONE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(1500)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(1500)
c:RegisterEffect(e2)
end
end
end)
c:RegisterEffect(e10)
local e11=e10:Clone()
e11:SetType(EFFECT_TYPE_QUICK_O)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,m-1) and Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end)
c:RegisterEffect(e11)
end
--fusion
function cm.cf(c)
return c:IsSetCard(0x3652) and c:IsAbleToRemoveAsCost() and (not c:IsLocation(LOCATION_MZONE) or c:IsFaceup()) and c:IsType(TYPE_MONSTER)
end
function cm.t3(c)
return c:IsAbleToDeck() and c:IsSetCard(0x3652,0x5652)
end
\ No newline at end of file
--剑锋·冰兽战记
local m=86580024
local cm=_G["c"..m]
function cm.initial_effect(c)
aux.AddXyzProcedure(c,cm.xf,6,4,cm.xf2,aux.Stringid(m,0),4,cm.xfo)
c:EnableReviveLimit()
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,5))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_XYZ)
end)
e1:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetCode(EFFECT_SKIP_BP)
if Duel.GetTurnPlayer()==1-tp then
e1:SetLabel(Duel.GetTurnCount())
e1:SetCondition(function(e)
return Duel.GetTurnCount()~=e:GetLabel()
end)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,2)
else
e1:SetReset(RESET_PHASE+PHASE_END+RESET_OPPO_TURN,1)
end
Duel.RegisterEffect(e1,tp)
end)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,6))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,m+9)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil)
and e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end)
e2:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
local tc=sg:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_TRAPMONSTER) then
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
e3:SetReset(RESET_EVENT+0x1fe0000)
tc:RegisterEffect(e3)
end
Duel.AdjustInstantly()
Duel.Destroy(tc,REASON_EFFECT)
end
end)
c:RegisterEffect(e2)
--1+
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(0,LOCATION_MZONE)
e3:SetCode(EFFECT_CANNOT_SELECT_BATTLE_TARGET)
e3:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=1 then return true end
return false
end)
e3:SetValue(function(e,c)
return c~=e:GetHandler()
end)
c:RegisterEffect(e3)
--3+
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e4:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=3 then return true end
return false
end)
e4:SetValue(1)
c:RegisterEffect(e4)
local e5=e4:Clone()
e5:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
c:RegisterEffect(e5)
--5+
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e6:SetCode(EFFECT_UNRELEASABLE_SUM)
e6:SetRange(LOCATION_MZONE)
e6:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=5 then return true end
return false
end)
e6:SetValue(aux.tgoval)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_UNRELEASABLE_NONSUM)
c:RegisterEffect(e7)
local e8=Effect.CreateEffect(c)
e8:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e8:SetCode(EVENT_PHASE+PHASE_END)
e8:SetRange(LOCATION_MZONE)
e8:SetCountLimit(1)
e8:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=5 then return true end
return false
end)
e8:SetOperation(function(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) then
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
end)
c:RegisterEffect(e8)
--6+
local e9=Effect.CreateEffect(c)
e9:SetType(EFFECT_TYPE_SINGLE)
e9:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e9:SetCode(EFFECT_UPDATE_ATTACK)
e9:SetRange(LOCATION_MZONE)
e9:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=7 then return true end
return false
end)
e9:SetValue(3000)
c:RegisterEffect(e9)
local e10=e9:Clone()
e10:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e10)
local e11=Effect.CreateEffect(c)
e11:SetType(EFFECT_TYPE_SINGLE)
e11:SetCode(EFFECT_IMMUNE_EFFECT)
e11:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e11:SetRange(LOCATION_MZONE)
e11:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=6 then return true end
return false
end)
e11:SetValue(function(e,te)
return te:GetOwner()~=e:GetOwner()
end)
c:RegisterEffect(e11)
--9+
local e12=Effect.CreateEffect(c)
e12:SetType(EFFECT_TYPE_FIELD)
e12:SetCode(EFFECT_DISABLE)
e12:SetTargetRange(0,LOCATION_ONFIELD)
e12:SetRange(LOCATION_MZONE)
e12:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=9 then return true end
return false
end)
e12:SetTarget(function(e,c)
return c:IsFaceup()
end)
c:RegisterEffect(e12)
local e13=Effect.CreateEffect(c)
e13:SetType(EFFECT_TYPE_FIELD)
e13:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e13:SetCode(EFFECT_CANNOT_ACTIVATE)
e13:SetTargetRange(0,1)
e13:SetCondition(function(e,tp,eg,ep,ev,re,r,rp)
local a=e:GetHandler():GetOverlayGroup():GetCount()
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,LOCATION_MZONE,nil,0x3652)
local b=g:GetCount()
if a+b>=9 then return true end
return false
end)
e13:SetValue(function(e,re,tp)
return re:GetActivateLocation()==LOCATION_GRAVE
end)
c:RegisterEffect(e13)
end
function cm.xf(c,fc,sub,mg,sg)
return c:IsRace(RACE_BEASTWARRIOR)
end
function cm.xf2(c)
return c:IsCode(m-22)
end
function cm.xfo(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,0))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,1))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,2))
Duel.Hint(HINT_MESSAGE,1-tp,aux.Stringid(m,3))
end
--深土之物 人身单调鸥
function c9310011.initial_effect(c)
c:EnableReviveLimit()
--ritual summon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,9310011)
e1:SetCondition(c9310011.spcon1)
e1:SetCost(c9310011.rscost)
e1:SetTarget(c9310011.tg)
e1:SetOperation(c9310011.op)
c:RegisterEffect(e1)
local e11=e1:Clone()
e11:SetType(EFFECT_TYPE_QUICK_O)
e11:SetCode(EVENT_FREE_CHAIN)
e11:SetHintTiming(0,TIMING_END_PHASE)
e11:SetCondition(c9310011.spcon2)
c:RegisterEffect(e11)
--flip
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_FLIP)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c9310011.flipop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(c9310011.indcon)
e3:SetValue(1)
c:RegisterEffect(e3)
--nontuner
local e4=e3:Clone()
e4:SetCode(EFFECT_NONTUNER)
c:RegisterEffect(e4)
--to change pos
local e5=Effect.CreateEffect(c)
e5:SetCategory(CATEGORY_TOHAND)
e5:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_FIELD)
e5:SetCode(EVENT_PHASE+PHASE_END)
e5:SetRange(LOCATION_GRAVE)
e5:SetCountLimit(1,9311011)
e5:SetCondition(c9310011.spcon1)
e5:SetCost(c9310011.thcost)
e5:SetTarget(c9310011.target)
e5:SetOperation(c9310011.operation)
c:RegisterEffect(e5)
local e51=e5:Clone()
e51:SetType(EFFECT_TYPE_QUICK_O)
e51:SetCode(EVENT_FREE_CHAIN)
e51:SetHintTiming(0,TIMING_END_PHASE)
e51:SetCondition(c9310011.spcon2)
c:RegisterEffect(e51)
end
function c9310011.spcon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsPlayerAffectedByEffect(tp,30013020)
end
function c9310011.spcon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsPlayerAffectedByEffect(tp,30013020)
end
function c9310011.rscost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function c9310011.matfilter(c,e,tp,chk)
return c:IsCanBeRitualMaterial(nil) and (not chk or c~=e:GetHandler())
end
function c9310011.RitualUltimateFilter(c,filter,e,tp,m1,m2,level_function,greater_or_equal,chk)
if bit.band(c:GetType(),0x81)~=0x81 or (filter and not filter(c,e,tp,chk))
or not c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_DEFENSE) then return false end
local mg=m1:Filter(c9310011.matfilter,c,c)
if m2 then
mg:Merge(m2)
end
if c.mat_filter then
mg=mg:Filter(c.mat_filter,c,tp)
else
mg:RemoveCard(c)
end
local lv=level_function(c)
aux.GCheckAdditional=aux.RitualCheckAdditional(c,lv,greater_or_equal)
local res=mg:CheckSubGroup(aux.RitualCheck,1,lv,tp,c,lv,greater_or_equal)
aux.GCheckAdditional=nil
return res
end
function c9310011.rfilter(c,e,tp)
return c:IsDefenseAbove(2200) and c:GetDefense()>=c:GetAttack()
end
function c9310011.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg1=Duel.GetRitualMaterial(tp)
return Duel.IsExistingMatchingCard(c9310011.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,c9310011.rfilter,e,tp,mg1,nil,Card.GetLevel,"Greater")
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c9310011.op(e,tp,eg,ep,ev,re,r,rp)
local mg1=Duel.GetRitualMaterial(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c9310011.RitualUltimateFilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,c9310011.rfilter,e,tp,mg1,nil,Card.GetLevel,"Greater")
local tc=g:GetFirst()
if tc then
local mg=mg1:Filter(Card.IsCanBeRitualMaterial,tc,tc)
if tc.mat_filter then
mg=mg:Filter(tc.mat_filter,tc,tp)
else
mg:RemoveCard(tc)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
aux.GCheckAdditional=aux.RitualCheckAdditional(tc,tc:GetLevel(),"Greater")
local mat=mg:SelectSubGroup(tp,aux.RitualCheck,false,1,tc:GetLevel(),tp,tc,tc:GetLevel(),"Greater")
aux.GCheckAdditional=nil
if not mat or mat:GetCount()==0 then return end
tc:SetMaterial(mat)
Duel.ReleaseRitualMaterial(mat)
Duel.BreakEffect()
local spos=0
if tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEUP_DEFENSE) then spos=spos+POS_FACEUP_DEFENSE end
if tc:IsCanBeSpecialSummoned(e,SUMMON_TYPE_RITUAL,tp,false,true,POS_FACEDOWN_DEFENSE) then spos=spos+POS_FACEDOWN_DEFENSE end
if spos~=0 then
Duel.SpecialSummon(tc,SUMMON_TYPE_RITUAL,tp,tp,false,true,spos)
if tc:IsFacedown() then
Duel.ConfirmCards(1-tp,tc)
end
tc:CompleteProcedure()
end
end
end
function c9310011.flipop(e,tp,eg,ep,ev,re,r,rp)
e:GetHandler():RegisterFlagEffect(9310011,RESET_EVENT+RESETS_STANDARD,0,1)
end
function c9310011.indcon(e)
local c=e:GetHandler()
return (c:GetFlagEffect(9310011)~=0 or c:IsSummonType(SUMMON_TYPE_RITUAL)) and c:IsDefensePos()
end
function c9310011.thcost(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 c9310011.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_POSITION,g,1,0,0)
end
function c9310011.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x93c,0x3f91) and c:IsAbleToHand()
end
function c9310011.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
if g:GetCount()>0 then
Duel.HintSelection(g)
sg=g:Select(tp,1,1,nil)
tc=sg:GetFirst()
if tc:IsDefensePos() and tc:IsCanChangePosition() then
if tc:IsCanTurnSet() and tc:IsFaceup() then
Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)
elseif tc:IsFacedown() then
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end
end
if tc:IsAttackPos() and tc:IsCanChangePosition() then
if tc:IsCanTurnSet() then
Duel.ChangePosition(tc,Duel.SelectPosition(tp,tc,POS_FACEDOWN_DEFENSE+POS_FACEUP_DEFENSE))
else
Duel.ChangePosition(tc,POS_FACEUP_DEFENSE) end
end
local kg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c9310011.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if kg:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(9310011,0)) then
Duel.BreakEffect()
Duel.SendtoHand(kg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,kg)
end
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