Commit 2003b4f7 authored by IamIpanda's avatar IamIpanda

2025 cards

parent 7845af2c
Pipeline #37968 passed with stages
in 19 seconds
# 岩融冰结:科学
# 白夜苦行:婆罗门
# 荒风救门:伊斯兰
# 因果王法:佛
# 格物究礼:儒
# 往日犹追:基督
往日犹追(172016008) 光 3星 魔法使/调整 0 1800 (Custom)
①:自己·对方回合,自己场上没有效果怪兽存在的场合,把这张卡从手卡送去墓地才能发动。直到下个自己的回合,那些回合中发动过效果的卡及其同名卡在本次决斗中不能再把效果发动。
# 标核中难以做到的事项:额外卡组的卡洗切入卡组。
格物究礼(172016010) 地 3星 幻想魔/调整 0 1800 (Custom)
①:对方用少于1只的场上的怪兽为素材的怪兽从额外卡组特殊召唤成功时,自己场上没有从额外卡组特殊召唤的怪兽存在的场合,把手卡的这张卡送去墓地才能发动。那只怪兽和双方的额外卡组获得「展示手卡的这张卡才能发动。这张卡送去额外卡组。」并当作效果怪兽洗切入卡组。只要因这个效果洗切入卡组的怪兽在自己卡组存在,自己不能把墓地的魔法·陷阱卡的效果发动。
(受核心机能限制,洗入卡组的是同名的「代币卡」,在那期间额外卡组的卡里侧表示除外,实际效果请以具体处理为准。逆天机制遇到Bug请反馈。)
竹子(172016110=>44910027) 无 0星 幻想魔/通常 ? ?
这是一棵竹子。它象征很多东西,但是总之不是熊猫喜欢的那种。
由「格物究礼」的效果创建。
团团圆圆欢聚友伴(172016030) 光 4星 天使 100 600 (Custom)
这张卡的效果发动的回合,自己只能有1次把这张卡以外的「欢聚友伴」怪兽的效果发动。
①:自己·对方回合,自己场上没卡存在的场合,把这张卡从手卡丢弃才能发动。双方各自从卡组选任意数量的「团团圆圆欢聚友伴」以外的「欢聚友伴」怪兽(各自同名卡至多1张)加入手卡,以下效果适用。
●结束阶段,自己手卡比对方场上卡的数量+6张要多的场合,那个相差数量的自己手卡随机回到卡组。
突变的G(172016031) 地 10星 昆虫 2000 3000 (Custom)
这个卡名的效果1回合只能使用1次。
①:对方回合,自己场上没有特殊召唤的怪兽存在的场合,把这张卡和1张通常魔法卡从手卡送去墓地才能发动。这个回合中,以下效果适用。
●每次对方把怪兽特殊召唤成功时发动。这个效果变成那张魔法卡发动时的效果(仍需满足发动条件)。
禁采令地巨魔(172016032) 地 1星 恶魔 1000 0 (Custom)
这个卡名的效果1回合只能使用1次。
①:自己场上没有卡存在,对方对怪兽的特殊召唤成功的场合,把这张卡从手卡丢弃才能发动。直到下个自己回合结束,以下效果适用。
●发动过效果的怪兽不能解放,也不能作为融合·同调·超量·连接召唤的素材。
持戒僧 道昭(172016033) 地 4星 无种族 100 1800 (Custom)
①:从手卡把这张卡送去墓地才能发动。选择任意项。直到回合结束,这张卡放置的卡让对方的卡除外的场合,抽1张卡。这个效果对方回合也能发动。
●从卡组选1张「转生断绝」在场上表侧表示放置。
●从卡组选1张「大火葬」在场上盖放。这个效果盖放的卡可以在盖放的回合发动。
(受核心机能限制,可能会有不应抽卡的场景发生抽卡。)
提示文本:是否要放置「转生断绝」?、是否要盖放「大火葬」?
异次元吸引者(172016034) 暗 6星 魔法使 2200 1200 (Custom)
①:对方回合,自己场上没有卡表侧表示存在的场合,把自己墓地1张卡除外,这张卡从手卡送去墓地才能发动。直到下个回合的结束时,被送去墓地的卡不去墓地而除外。被这个效果除外的卡在回合结束时返回墓地。
(受核心机能限制,可能有不应返回墓地的卡片在结束阶段返回墓地。)
变换防护罩 -梦幻之力-(172016035) 通常陷阱 (Custom)
①:对方怪兽的攻击宣言时,从卡组把1张「变换防护罩 -梦幻之力-」以外的只在攻击宣言时才能作卡的发动的通常陷阱卡,以及任意数量的属性各不相同的怪兽各1只送去墓地才能发动。送去墓地的怪兽包含与攻击宣言的怪兽属性相同的怪兽的场合,直到战斗阶段的开始步骤结束,不能把卡的效果发动。根据送去墓地的怪兽的属性,以下效果适用。
●光:可以选对方场上最多2只攻击表示怪兽破坏。
●暗:可以选对方场上最多2只守备表示怪兽除外。
●风:可以选对方场上最多2只攻击表示怪兽返回手卡。
●水:可以选对方场上最多2只攻击表示怪兽返回卡组。
●炎:可以选对方场上最多2只攻击表示怪兽,互相受到那些怪兽攻击力合计数值的伤害。
●地:可以选对方场上最多2只攻击表示怪兽变成里侧表示。那些怪兽不能把表示形式变更。
●神:可以选对方场上最多2只攻击表示怪兽,对方必须把那些怪兽解放。
②:盖放的这张卡因对方从场上离开的场合才能发动。从卡组·手卡·墓地选任意数量的「变换防护罩 -梦幻之力-」以外的「防护罩(バリア)」通常陷阱卡(同名卡至多1张)盖放。这个效果盖放的卡在盖放的回合也能发动。
连锁归还(172016036) 通常陷阱 (Custom)
①:攻击力1000以上2000以下的怪兽特殊召唤成功时才能发动。那些怪兽以及和那些怪兽同名的卡从手卡·场上·墓地·除外的卡中回到卡组。
②:把这个回合没有送去墓地的这张卡从墓地除外,以自己墓地1张魔法卡为对象才能发动。那张卡回到卡组。那之后,可以从卡组把「连锁爆破」「连锁归还」「连锁除外」的任意张(同名卡至多1张)在自己场上盖放。
提示文本:是否要选卡盖放?
次元禁闭(172016037) 通常陷阱 (Custom)
①:怪兽攻击宣言时,把场上攻击力低于那只怪兽的怪兽尽可能全部除外才能发动。本次决斗中,与那些怪兽同名的卡不能使用,回合结束。
诱饵人形(172016038) 通常魔法 (Custom)
被无效·被效果破坏的这张卡结算完毕时返回手卡。
①:以对方场上1张表侧表示的卡为对象才能发动。那张卡有可以发动的效果的场合,必须对应这个效果的发动把其中1个发动。这张卡回到卡组洗切,抽1张卡。这个效果也当作怪兽效果和陷阱效果使用。
(逆天机制,遇到Bug请反馈。)
斯克兰顿稳定锚(172016039) 地 3星 幻想魔 0 0 (Custom)
①:对方的主要阶段,卡因为对方从对方的卡组·额外卡组离开的场合,把手卡的这张卡送去墓地才能发动。记录对方卡组·额外卡组卡的数量。这个回合的结束阶段,对方卡组·额外卡组卡的数量比记录的数值少的场合,对方必须从双方场上把那个差值的卡送去墓地。数量不足的场合,自己再从对方墓地把剩余数量的卡里侧表示除外。有卡因为这个效果除外的场合,对方直到下个回合结束受到的伤害变成0,其可以把墓地·除外的这张卡加入手卡。
提示文本:是否要将「斯克兰顿稳定锚」加入手卡?
幽世歌(172016040) 永续陷阱 (Custom)
①:场上的怪兽效果发动时发动。那张卡破坏。
神之预告(172016041) 反击陷阱 (Custom)
(仅能在服务器上使用)
自己没有把怪兽·魔法卡的效果发动过的回合,这张卡可以从手卡发动。
①:对方把怪兽特殊召唤之际,支付一半基本分才能发动。互相秘密宣言1个那之外的卡名。双方宣言的卡名不同的场合,这个阶段中,对方把自己宣言的名称的怪兽从额外卡组特殊召唤之际,那个特殊召唤无效并破坏,对方把全部宣言的卡名的卡从额外卡组里侧表示除外,自己回复为这张卡的发动而支付的数值的基本分。那之后,可以把墓地的这张卡加入手卡。
提示文本:是否要将「神之预告」加入手卡?
强制捕获装置(172016042) 通常陷阱 (Custom)
①:丢弃1张手卡,以对方场上1只怪兽为对象才能发动。那只怪兽加入自己手卡。
看到这张卡在卡池里应该反省的是你不是我(172016099) 通常魔法 (Custom)
决斗开始时,从以下效果中选择两项并公示。这场决斗中,这个卡名的卡具有选择的效果。那之后,可以随机选自己1张手卡返回卡组,卡组中1张这个卡名的卡加入手卡。
①:原本控制者是对方的卡的包含对自己效果伤害的效果发动时,可以把手卡的这张卡丢弃。那次伤害变成对方受到这个效果10倍的伤害。这个效果每适用过1次,游戏每进行过1回合,这个倍数下降3(最多下降至0)。
②:这张卡被对方的卡的效果除外时发动。自己除外的卡全部返回卡组洗切,从对方卡组上方选那个数量3倍的卡里侧表示除外,那之后,可以把对方的场地魔法卡除外。
③:鸽了
④:对方的卡的效果让手卡的这张卡从手卡离开的场合发动。直到手卡变成5张为止从卡组抽卡,变成这个回合的结束阶段。
提示文本:防止效果伤害、防止被除外、防止被无效(鸽了)、防止离开手卡、是否要把1张加入手卡?、是否要防止伤害?、是否要把对方的场地魔法除外?
--往日犹追
local s,id=GetID()
s.banlist={}
s.operationlist={}
s.activitate=false
function s.initial_effect(c)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(23434538,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
ge1:SetOperation(s.counter)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge2:SetCode(EVENT_PREDRAW)
ge2:SetOperation(s.reset)
Duel.RegisterEffect(ge2,0)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsSummonType,tp,LOCATION_MZONE,0,nil,SUMMON_TYPE_SPECIAL)==0
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
for k,_ in pairs(s.operationlist) do
s.banlist[k] = 1
end
if not s.activitated then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(1,1)
e1:SetValue(s.aclimit)
Duel.RegisterEffect(e1,tp)
s.activitate=true
end
--Tell listener to ban
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(id)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetReset(RESET_PHASE+PHASE_STANDBY+RESET_SELF_TURN,2)
Duel.RegisterEffect(e2,tp)
end
function s.aclimit(e,re,tp)
return s.banlist[re:GetCode()]~=nil
end
function s.counter(e,tp,eg,ep,ev,re,r,rp)
s.operationlist[re:GetHandler():GetCode()]=1
if Duel.IsPlayerAffectedByEffect(tp,id) then
s.banlist[re:GetHandler():GetCode()]=1
end
end
function s.reset(e,tp,eg,ep,ev,re,r,rp)
s.operationlist={}
end
--格物究礼
local s,id=GetID()
local tid=172016110
function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.discon)
e1:SetCost(s.discost)
e1:SetTarget(s.distg)
e1:SetOperation(s.disop)
c:RegisterEffect(e1)
--not influenced
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_IMMUNE_EFFECT)
e2:SetValue(aux.TRUE)
c:RegisterEffect(e2)
end
function s.efilter(e,te)
return true
--return not te:GetHandler():IsSpecialSummonableCard()
end
function s.cfilter(c,tp)
if not c:IsPreviousLocation(LOCATION_EXTRA) then return false end
if c:GetControler()==tp then return false end
local g=c:GetMaterial()
if g==nil then return true end
return g:FilterCount(Card.IsPreviousLocation,nil,LOCATION_ONFIELD)<=1
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and Duel.GetMatchingGroupCount(Card.IsSummonLocation,tp,LOCATION_MZONE,0,nil,LOCATION_EXTRA)==0
end
function s.discost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.distg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return true end
local tg=eg:Filter(s.cfilter,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_TODECK,tg,#tg,0,0)
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
local tg=eg:Filter(s.cfilter,nil,tp)
local tg2=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_EXTRA,LOCATION_EXTRA,nil)
Duel.SendtoDeck(tg2,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp)
tg:Merge(tg2)
Duel.Remove(tg,POS_FACEDOWN,REASON_EFFECT+REASON_TEMPORARY,tp)
rg=Duel.GetOperatedGroup()
local tg=Group.CreateGroup()
for rc in aux.Next(rg) do
local tc=Duel.CreateToken(rc:GetControler(),tid)
getmetatable(tc).register(tc,rc)
tg:AddCard(tc)
end
Duel.SendtoHand(tg,nil,REASON_EFFECT,tp)
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp)
for rc in aux.Next(tg) do
getmetatable(rc).register2(rc)
end
--cannot activitate spell/trap
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetCondition(s.accon)
e3:SetValue(s.aclimit)
Duel.RegisterEffect(e3,tp)
end
function s.accon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsCode,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil,tid)>0
end
function s.aclimit(e,re,tp)
local c=re:GetHandler()
return c:IsLocation(LOCATION_GRAVE) and c:IsType(TYPE_SPELL+TYPE_TRAP)
end
--团团圆圆欢聚友伴
local s,id,o=GetID()
function s.initial_effect(c)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.thcon)
e1:SetCost(s.thcost)
e1:SetOperation(s.thop)
c:RegisterEffect(e1)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)==0 and Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)<2
end
function s.thcost(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)
local e3=Effect.CreateEffect(e:GetHandler())
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e3:SetCode(EFFECT_CANNOT_ACTIVATE)
e3:SetTargetRange(1,0)
e3:SetCondition(s.actcon)
e3:SetValue(s.aclimit)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
end
function s.chainfilter(re,tp,cid)
return not (re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x1b2))
end
function s.actcon(e)
local tp=e:GetHandlerPlayer()
return Duel.GetCustomActivityCount(id,tp,ACTIVITY_CHAIN)>1
end
function s.aclimit(e,re,tp)
return re:IsActiveType(TYPE_MONSTER) and re:GetHandler():IsSetCard(0x1b2)
end
function s.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x1b2) and c:IsType(TYPE_MONSTER) and not c:IsCode(id)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local h1=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
local h2=Duel.GetMatchingGroup(s.thfilter,tp,0,LOCATION_DECK,nil)
aux.GCheckAdditional=aux.dncheck
local g1=h1:SelectSubGroup(tp,aux.TRUE,false,1,h1:GetClassCount(Card.GetCode))
Duel.SendtoHand(g1,nil,REASON_EFFECT)
local g2=h2:SelectSubGroup(1-tp,aux.TRUE,false,1,h2:GetClassCount(Card.GetCode))
Duel.SendtoHand(g2,nil,REASON_EFFECT)
local e6=Effect.CreateEffect(e:GetHandler())
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e6:SetCode(EVENT_PHASE+PHASE_END)
e6:SetCountLimit(1)
e6:SetCondition(s.tdcon)
e6:SetOperation(s.tdop)
e6:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e6,tp)
end
function s.tdcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(e:GetOwnerPlayer(),LOCATION_HAND,0)>Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_ONFIELD)+6
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(e:GetOwnerPlayer(),LOCATION_HAND,0)
local d=Duel.GetFieldGroupCount(e:GetOwnerPlayer(),LOCATION_HAND,0)-(Duel.GetFieldGroupCount(e:GetOwnerPlayer(),0,LOCATION_ONFIELD)+6)
local sg=g:RandomSelect(e:GetOwnerPlayer(),d)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--突变的G
local s,id=GetID()
function s.initial_effect(c)
--cosplay
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.disfilter(c)
return c:IsType(TYPE_SPELL) and not c:IsType(TYPE_CONTINUOUS+TYPE_EQUIP+TYPE_QUICKPLAY+TYPE_RITUAL+TYPE_FIELD) and c:IsAbleToGraveAsCost()
end
function s.confilter(c)
return c:GetSummonType()==SUMMON_TYPE_SPECIAL
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(s.confilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() and Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_HAND,0,1,c) end
local g=Duel.SelectMatchingCard(tp,s.disfilter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.SendtoGrave(g,REASON_COST)
e:SetLabelObject(g:GetFirst())
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL+EFFECT_FLAG_SET_AVAILABLE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(s.coscon)
e1:SetTarget(s.costg)
e1:SetOperation(s.cosop)
e1:SetLabelObject(c)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.filter(c,sp)
return c:IsSummonPlayer(sp)
end
function s.coscon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
return eg:IsExists(s.filter,1,nil,1-tp) and te:IsActivatable(tp,true,false)
end
function s.costg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
if not te then return false end
return te:GetTarget()(te,tp,eg,ep,ev,re,r,rp,chk)
end
function s.cosop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetLabelObject()
local te=c:GetActivateEffect()
if not te then return end
return te:GetOperation()(te,tp,eg,ep,ev,re,r,rp)
end
--禁采令地巨魔
local s,id,o=GetID()
function s.initial_effect(c)
--disable
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetRange(LOCATION_HAND)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,id)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
if not s.global_check then
s.global_check=true
local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_CHAINING)
ge:SetCondition(s.gecon)
ge:SetOperation(s.geop)
Duel.RegisterEffect(ge,0)
end
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsSummonPlayer,1,nil,1-tp) and Duel.GetLocationCount(tp,LOCATION_ONFIELD)==0
end
function s.cost(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 s.operation(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UNRELEASABLE_SUM)
e1:SetProperty(EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTarget(s.bantg)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_END+RESET_SELF_TURN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UNRELEASABLE_NONSUM)
Duel.RegisterEffect(e2,tp)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetValue(s.fuslimit)
Duel.RegisterEffect(e3,tp)
local e4=e1:Clone()
e4:SetCode(EFFECT_CANNOT_BE_SYNCHRO_MATERIAL)
Duel.RegisterEffect(e4,tp)
local e5=e1:Clone()
e5:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
Duel.RegisterEffect(e5,tp)
local e6=e1:Clone()
e6:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
Duel.RegisterEffect(e6,tp)
end
function s.bantg(e,c)
return c:GetFlagEffect(id)>0
end
function s.fuslimit(e,c,sumtype)
return sumtype==SUMMON_TYPE_FUSION
end
function s.gecon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(Card.IsType,1,nil,TYPE_MONSTER)
end
function s.geop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:IsType(TYPE_MONSTER) and c:GetFlagEffect(id)==0 then
c:RegisterFlagEffect(id,RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD,0,1)
end
end
end
--持戒僧 道昭
local s,id=GetID()
function s.initial_effect(c)
--to field
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e1:SetRange(LOCATION_HAND)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.filter1(c)
return c:IsCode(66100045)
end
function s.filter2(c)
return c:IsCode(95472621)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToGraveAsCost() end
Duel.SendtoGrave(c,REASON_COST)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.OR(s.filter1,s.filter2),tp,LOCATION_DECK,0,1,nil) end
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(s.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(s.filter2,tp,LOCATION_DECK,0,nil)
local g=Group.CreateGroup()
if #g1>0 and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g1:Select(tp,1,1,nil)
g:Merge(sg)
Duel.MoveToField(sg:GetFirst(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
--remove trigger
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(s.removeop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
end
if #g2>0 and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g2:Select(tp,1,1,nil)
g:Merge(sg)
Duel.SSet(tp,sg)
local tc=g:GetFirst()
local e1=Effect.CreateEffect(tc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
end
if #g>0 then
for tc in aux.Next(g) do
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.removeop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:GetReason()&REASON_REDIRECT==REASON_REDIRECT and c:GetFlagEffect(66100045)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
break
end
end
end
-- magic is always dirty
s.originRegisterEffect = Card.RegisterEffect
function Card.RegisterEffect(c,e,...)
if c:IsCode(95472621) then
e:SetOperation(s.wrap_op(e:GetOperation()))
end
if c:IsCode(66100045) and e:GetType()&EFFECT_TYPE_FIELD==EFFECT_TYPE_FIELD then
e:SetTarget(s.extra_tg)
end
return s.originRegisterEffect(c,e,...)
end
function s.wrap_op(f)
return function(e,tp,eg,ep,ev,re,r,rp)
f(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():GetFlagEffect(id)>0 then
Duel.Draw(tp,1,REASON_EFFECT)
end
end
end
function s.extra_tg(e,c)
if e:GetHandler():GetFlagEffect(id)>0 and c:GetFlagEffect(66100045)==0 then
c:RegisterFlagEffect(66100045,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END-RESET_REMOVE,0,1)
end
return true
end
--异次元吸引者
--所有 REASON_REDIRECT 的卡都会返回墓地,不论它是因为何种原因除外的。
local s,id=GetID()
function s.initial_effect(c)
--redirect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.redcon)
e1:SetCost(s.redcost)
e1:SetTarget(s.redtg)
e1:SetOperation(s.redop)
c:RegisterEffect(e1)
end
function s.redcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,nil)==0
end
function s.rmfilter(c)
return c:IsAbleToRemove()
end
function s.redcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() and Duel.GetMatchingGroupCount(Card.IsAbleToRemove,tp,LOCATION_GRAVE,0,nil)>0 end
local tg=Duel.SelectMatchingCard(tp,s.rmfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
Duel.Remove(tg,POS_FACEUP,REASON_COST)
end
function s.redtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.redop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EFFECT_TO_GRAVE_REDIRECT)
e1:SetTargetRange(LOCATION_DECK,LOCATION_DECK)
e1:SetValue(LOCATION_REMOVED)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_REMOVE)
e2:SetOperation(s.removeop)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetCountLimit(1)
e3:SetOperation(s.retop)
e3:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e3,tp)
end
function s.removeop(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(eg) do
if c:GetReason()&REASON_REDIRECT==REASON_REDIRECT then
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
end
function s.retfilter(c)
return c:GetFlagEffect(id)>0 and c:IsAbleToGrave()
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.retfilter,tp,LOCATION_REMOVED,LOCATION_REMOVED,nil)
if #g==0 then return end
Duel.SendtoGrave(g,REASON_EFFECT)
end
--变换防护罩 -梦幻之力-
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY+CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_TODECK+CATEGORY_DAMAGE+CATEGORY_POSITION+CATEGORY_RELEASE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCondition(s.condition)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Destroyed
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetCondition(s.setcon)
e2:SetTarget(s.settg)
e2:SetOperation(s.setop)
c:RegisterEffect(e2)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.filter(c)
return c:IsAttackPos()
end
function s.costfilter(c)
local te=c:GetActivateEffect()
return c:GetType()==TYPE_TRAP and c:IsAbleToGraveAsCost()
end
function s.costfilter2(c)
return c:IsAbleToGraveAsCost() and c:IsType(TYPE_MONSTER)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local c1=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local g=Duel.GetMatchingGroup(s.costfilter2,tp,LOCATION_DECK,0,nil)
aux.GCheckAdditional=aux.dabcheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetAttribute))
aux.GCheckAdditional=nil
sg:AddCard(c1)
Duel.SendtoGrave(sg,REASON_COST)
sg:KeepAlive()
e:SetLabelObject(sg)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local attr=s.getattr(e)
-- if attr&ATTRIBUTE_LIGHT>0 then
-- Duel.SetOperationInfo(0,CATEGORY_DESTROY,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_DARK>0 then
-- Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_WIND>0 then
-- Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_WATER>0 then
-- Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_FIRE>0 then
-- Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_EARTH>0 then
-- Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
-- end
-- if attr&ATTRIBUTE_DIVINE>0 then
-- Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
-- end
if Duel.GetAttacker():GetAttribute()&attr>0 then
Duel.SetChainLimit(aux.FALSE)
-- Prevent activation of any card effects in the Battle Start Step
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(aux.TRUE)
e1:SetReset(RESET_PHASE+PHASE_BATTLE_START)
Duel.RegisterEffect(e1,tp)
end
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local attr=s.getattr(e)
if attr&ATTRIBUTE_LIGHT>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
if attr&ATTRIBUTE_DARK>0 then Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_DEFENSE)
Duel.HintSelection(dg)
Duel.Remove(dg,POS_FACEUP,REASON_EFFECT)
end
if attr&ATTRIBUTE_WIND>0 then Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.SendtoHand(dg,REASON_EFFECT)
end
if attr&ATTRIBUTE_WATER>0 then Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.SendtoDeck(dg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
if attr&ATTRIBUTE_FIRE>0 then Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RESOLVECARD)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
local atk=dg:GetSum(Card.GetAttack)
Duel.Damage(tp,atk,REASON_EFFECT,true)
Duel.Damage(1-tp,atk,REASON_EFFECT,true)
Duel.RDComplete()
end
if attr&ATTRIBUTE_EARTH>0 then Duel.SetOperationInfo(0,CATEGORY_POSITION,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
if Duel.ChangePosition(dg,POS_FACEDOWN_DEFENSE)~=0 then
local og=Duel.GetOperatedGroup()
local tc=og:GetFirst()
while tc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_CHANGE_POSITION)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
tc=og:GetNext()
end
end
end
if attr&ATTRIBUTE_DIVINE>0 then Duel.SetOperationInfo(0,CATEGORY_RELEASE,nil,1,0,0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local dg=Duel.SelectMatchingCard(tp,Card.IsPosition,tp,0,LOCATION_ONFIELD,0,2,nil,POS_ATTACK)
Duel.HintSelection(dg)
Duel.Release(dg,REASON_RULE,1-tp)
end
end
function s.getattr(e)
local g=e:GetLabelObject()
local attr=0
for tc in aux.Next(g) do
attr=attr|tc:GetAttribute()
end
return attr
end
s.setc={
[44095762]=1, --圣防
[20522190]=1, --暗防
[5650082]=1, --风防
[75249652]=1, --火防
[40838625]=1, --沙防
[47475363]=1, --水防
--妖艳贱货们
[21481146]=1, --光防
[89563150]=1, --银防
[52607696]=1, --幻防
[59016454]=1, --黑魔防
--更妖艳的贱货们
[53239672]=1, --灵魂障壁
[88789641]=1, --神圣生命防护罩
[37053871]=1, --星光体障壁
[44676200]=1, --英雄障壁
[34351849]=1, --蛙类防护罩
[22201234]=1, --光道防护罩
[77229910]=1, --变形斗士防护罩
[21879581]=1, --同调障壁
[5609226]=1, --调整防护罩
[78621186]=1, --野蛮人之吼
[95081386]=1, --三振障壁
[96004535]=1 --超量不破障壁
}
function s.setcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsPreviousControler(tp)
and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousPosition(POS_FACEDOWN)
end
function s.setfilter(c)
return s.setc[c:GetCode()]~=nil
end
function s.settg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,1,nil) end
end
function s.setop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.GetMatchingGroup(s.setfilter,tp,LOCATION_DECK+LOCATION_HAND+LOCATION_GRAVE,0,nil)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetCode))
aux.GCheckAdditional=nil
if sg:GetCount()>0 then
if Duel.SSet(tp,sg,tp)>0 then
sg=Duel.GetOperatedGroup()
for c in aux.Next(sg) do
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
c:RegisterEffect(e1)
end
end
end
end
--連鎖归还
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--set
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCondition(aux.exccon)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsFaceup() and c:GetAttack()>=1000 and c:GetAttack()<=2000 and c:IsAbleToRemove()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return eg:IsExists(s.filter,1,nil) end
local g=eg:Filter(s.filter,nil)
Duel.SetTargetCard(g)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,g:GetCount(),0,0)
end
function s.efilter(c,e)
return c:IsFaceup() and c:GetAttack()>=1000 and c:GetAttack()<=2000 and c:IsRelateToEffect(e)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local sg=g:Filter(s.efilter,nil,e)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
local rg=Group.CreateGroup()
local tc=sg:GetFirst()
while tc do
if tc:IsLocation(LOCATION_DECK) then
local tpe=tc:GetType()
if bit.band(tpe,TYPE_TOKEN)==0 then
local g1=Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE+LOCATION_REMOVED,nil,tc:GetCode())
rg:Merge(g1)
end
end
tc=sg:GetNext()
end
if rg:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
end
function s.rfilter(c)
return c:IsType(TYPE_SPELL) and c:IsAbleToDeck()
end
function s.stfilter(c)
return c:IsCode(1248895,57139487,id) and not c:IsForbidden() and c:IsSSetable()
end
function s.tdtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.rfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.rfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.rfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local rc=Duel.GetFirstTarget()
if rc:IsRelateToEffect(e) and Duel.SendtoDeck(rc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)~=0 and rc:IsLocation(LOCATION_DECK+LOCATION_EXTRA) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(s.stfilter,tp,LOCATION_DECK,0,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(id,0))then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
aux.GCheckAdditional=aux.dncheck
local sg=g:SelectSubGroup(tp,aux.TRUE,false,1,g:GetClassCount(Card.GetCode))
aux.GCheckAdditional=nil
Duel.SSet(tp,sg)
end
end
end
--次元禁闭
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetCost(s.cost)
e1:SetCondition(s.condition)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return tp~=Duel.GetTurnPlayer()
end
function s.filter(c,atk)
return c:IsAbleToRemove() and c:IsAttackBelow(atk)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,Duel.GetAttacker():GetAttack())>0 end
local tg=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,LOCATION_MZONE,nil,Duel.GetAttacker():GetAttack())
Duel.Remove(tg,POS_FACEUP,REASON_COST)
local cg=Duel.GetOperatedGroup()
cg:KeepAlive()
e:SetLabelObject(cg)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
for c in aux.Next(e:GetLabelObject()) do
local e=Effect.CreateEffect(c)
e:SetType(EFFECT_TYPE_FIELD)
e:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e:SetCode(EFFECT_FORBIDDEN)
e:SetRange(LOCATION_SZONE)
e:SetTargetRange(0xff,0xff)
e:SetTarget(function(e,c) return Card.IsOriginalCodeRule(c,e:GetLabel()) end)
e:SetLabel(c:GetCode())
e:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e,tp)
end
-- override effect
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_FZONE)
e2:SetReset(RESET_CHAIN)
e2:SetOperation(s.chop)
Duel.RegisterEffect(e2,tp)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_END,RESET_PHASE+PHASE_END,1)
end
function s.chop(e,tp,eg,ep,ev,re,r,rp)
Duel.ChangeChainOperation(ev,s.realop)
end
function s.realop()
end
--诱饵人形
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--negated
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetOperation(s.flagop)
c:RegisterEffect(e2)
--disabled
local e3=e2:Clone()
e3:SetCode(EVENT_CHAIN_DISABLED)
c:RegisterEffect(e3)
--destroyed
local e4=e2:Clone()
e4:SetCode(EVENT_DESTROYED)
c:RegisterEffect(e4)
--redirect
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_CHAIN_SOLVED)
e5:SetRange(LOCATION_SZONE+LOCATION_GRAVE+LOCATION_REMOVED)
e5:SetOperation(s.retop)
c:RegisterEffect(e5)
end
function s.filter(c)
return c:IsFaceup()
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_ONFIELD) and s.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,e:GetHandler()) end
e:SetProperty(EFFECT_FLAG_CARD_TARGET)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
Duel.SelectTarget(tp,Card.IsFaceup,tp,0,LOCATION_ONFIELD,1,1,e:GetHandler())
local tc=Duel.GetFirstTarget()
local label=tc:GetFlagEffectLabel(id)
if label==nil then
--print("No quick effects registered for this card.")
return
end
local tep=tc:GetControler()
local options={}
local tes=s.register[label]
if #tes==0 then return end
for _,te in ipairs(tes) do
table.insert(options,{s.can_trigger(te,tep,eg,ep,ev,e,r,rp),te:GetDescription(),te})
end
local te=aux.SelectFromOptions(1-tp,table.unpack(options))
if te~=nil then
s.force_effect(te,tep)
Duel.Readjust()
end
end
function s.can_trigger(te,tep,eg,ep,ev,re,r,rp)
local condition=te:GetCondition()
local cost=te:GetCost()
local target=te:GetTarget()
return (condition==nil or condition(te,tep,eg,ep,ev,re,r,rp))
and (cost==nil or cost(te,tep,eg,ep,ev,re,r,rp,0))
and (target==nil or target(te,tep,eg,ep,ev,re,r,rp,0))
end
function s.force_effect(e,tp)
local te=e:Clone()
local tet=e:GetType()
if tet&EFFECT_TYPE_QUICK_O>0 then
tet=tet&~EFFECT_TYPE_QUICK_O|EFFECT_TYPE_QUICK_F
end
if tet&EFFECT_TYPE_TRIGGER_O>0 then
tet=tet&~EFFECT_TYPE_TRIGGER_O|EFFECT_TYPE_TRIGGER_F
end
te:SetType(tet)
local target=te:GetTarget()
te:SetTarget(function(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 or chkc then
if target==nil then return true else return target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) end
end
if target~=nil then
target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end
e:UseCountLimit(tp,1)
te:Reset()
end)
s.originRegisterEffect(e:GetHandler(),te,true)
Duel.SetChainLimit(function(e,ep,tp) return e==te end)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SendtoDeck(c,nil,SEQ_DECKSHUFFLE,REASON_EFFECT,tp,true)
Duel.Draw(tp,1,REASON_EFFECT)
end
end
function s.flagop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:RegisterFlagEffect(id,RESET_EVENT+RESET_CHAIN,0,1)
end
function s.retop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetFlagEffect(id)==0 then return end
Duel.SendtoHand(e:GetHandler(),tp,REASON_REDIRECT)
end
s.originRegisterEffect = Card.RegisterEffect
s.register={}
s.register_counter=0
function Card.RegisterEffect(c,e)
if e:GetType()&EFFECT_TYPE_QUICK_O>0 or e:GetType()&EFFECT_TYPE_TRIGGER_O>0 then
local label=c:GetFlagEffectLabel(id)
if label==nil then
s.register_counter=s.register_counter+1
label=s.register_counter
c:RegisterFlagEffect(id,0,0,0,label)
s.register[label]={}
end
table.insert(s.register[label],e)
--print("Effect registered for card " .. c:GetCode() .. " with label: " .. label)
end
return s.originRegisterEffect(c,e)
end
s.originIsActiveType = Effect.IsActiveType
function Effect.IsActiveType(e,typ)
if e:GetTarget()==s.target and typ&(TYPE_TRAP+TYPE_SPELL+TYPE_MONSTER)>0 then
return true
end
return s.originIsActiveType(e,typ)
end
--斯克兰顿稳定锚
--补测伤害变0
local s,id=GetID()
function s.initial_effect(c)
--record
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_LEAVE_DECK)
e1:SetRange(LOCATION_HAND)
e1:SetCondition(s.recordcon)
e1:SetCost(s.recordcost)
e1:SetTarget(s.recordtg)
e1:SetOperation(s.recordop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_DRAW)
c:RegisterEffect(e2)
end
function s.recordcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
and Duel.GetTurnPlayer()==1-tp
and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
and eg:IsExists(function(c) return c:GetOwner()==1-tp end,1,nil)
end
function s.recordcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsDiscardable() end
Duel.SendtoGrave(c,REASON_COST+REASON_DISCARD)
end
function s.recordtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_GRAVE)
end
function s.recordop(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK+LOCATION_EXTRA,0)
e:SetLabel(ct)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_PHASE+PHASE_END)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1)
e2:SetOperation(s.resolveop)
e2:SetLabel(ct)
e2:SetLabelObject(c)
Duel.RegisterEffect(e2,tp)
end
function s.resolveop(e,tp,eg,ep,ev,re,r,rp)
local ct1=e:GetLabel()
local ct2=Duel.GetFieldGroupCount(1-tp,LOCATION_DECK+LOCATION_EXTRA,0)
if ct2>=ct1 then return end
local ct=ct1-ct2
local g1=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if #g1==0 then return end
if ct<#g1 then
Duel.Hint(HINT_SELECTMSG,1-tp,HINTMSG_TOGRAVE)
Duel.SendtoGrave(g1:Select(1-tp,ct,ct,nil),REASON_EFFECT,1-tp)
return
end
Duel.SendtoGrave(g1,REASON_EFFECT,1-tp)
ct=ct-#g1
if ct<=0 then return end
local g2=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_GRAVE,nil)
if #g2==0 then return end
if ct>=#g2 then ct=#g2 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
Duel.Remove(g2:Select(tp,ct,ct,nil),POS_FACEUP,REASON_EFFECT)
if Duel.GetOperatedGroup():GetCount()>0 then
local c=e:GetLabelObject()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CHANGE_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(0,1)
e1:SetValue(0)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_NO_EFFECT_DAMAGE)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_AVOID_BATTLE_DAMAGE)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetTargetRange(0,1)
e3:SetValue(1)
e3:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e3,tp)
if Duel.SelectYesNo(1-tp,aux.Stringid(id,0)) and c:IsLocation(LOCATION_GRAVE+LOCATION_REMOVED) then
Duel.SendtoHand(c,1-tp,REASON_EFFECT)
end
end
end
--幽世歌
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--double
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_QUICK_F)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_SZONE)
e1:SetCondition(s.condition)
e1:SetTarget(s.target)
e1:SetOperation(s.operation)
c:RegisterEffect(e1)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,eg,1,0,0)
end
function s.operation(e,tp,eg,ep,ev,re,r,rp)
if re:GetHandler():IsRelateToEffect(re) then
Duel.Destroy(eg,REASON_EFFECT)
end
end
--神之预告
local s,id=GetID()
function s.initial_effect(c)
--Activate(summon)
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCost(s.cost1)
e1:SetTarget(s.target1)
e1:SetOperation(s.activate1)
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(s.handcon)
c:RegisterEffect(e2)
Duel.AddCustomActivityCounter(id,ACTIVITY_CHAIN,s.chainfilter)
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local lp=math.floor(Duel.GetLP(tp)/2)
Duel.PayLPCost(tp,lp)
e:SetLabel(lp)
end
function s.target1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_ANNOUNCE,nil,2,0,0)
end
function s.activate1(e,tp,eg,ep,ev,re,r,rp)
local c1=Duel.AnnounceCard(tp)
local c2=Duel.AnnounceCard(1-tp)
if c1~=c2 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_DESTROY)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON)
e1:SetCondition(s.ngcon)
e1:SetOperation(s.ngop)
e1:SetLabel(c1)
e1:SetLabelObject(e)
Duel.RegisterEffect(e1,tp)
end
end
function s.ngcon(e,tp,eg,ep,ev,re,r,rp)
return aux.NegateSummonCondition(e,tp,eg,ep,ev,re,r,rp) and eg:IsExists(Card.IsCode,1,nil,e:GetLabel())
end
function s.ngop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateSummon(eg)
Duel.Destroy(eg,REASON_EFFECT)
Duel.Remove(Duel.GetMatchingGroup(Card.IsCode,tp,0,LOCATION_EXTRA,nil,e:GetLabel()),POS_FACEDOWN,REASON_EFFECT)
Duel.Recover(tp,e:GetLabelObject():GetLabel(),REASON_EFFECT)
local c=e:GetLabelObject():GetHandler()
if c:IsLocation(LOCATION_GRAVE) and Duel.SelectYesNo(tp,aux.Stringid(id,0)) then
Duel.BreakEffect()
Duel.SendtoHand(c,nil,REASON_EFFECT)
end
end
function s.handcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCustomActivityCount(id,e:GetHandlerPlayer(),ACTIVITY_CHAIN)==0 --and ep~=tp
end
function s.chainfilter(re,tp,cid)
local rc=re:GetHandler()
if rc==nil then return true end
return not rc:IsType(TYPE_MONSTER+TYPE_SPELL)
end
--强制捕获装置
local s,id=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_SZONE)
e1:SetHintTiming(TIMING_ATTACK,0x11e0)
e1:SetCost(s.cost)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
end
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsDiscardable,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.DiscardHand(tp,Card.IsDiscardable,1,1,REASON_COST+REASON_DISCARD)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc~=e:GetHandler() end
if chk==0 then return Duel.IsExistingTarget(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RTOHAND)
local g=Duel.SelectTarget(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,tp,REASON_EFFECT)
end
end
--看到这张卡在卡池里应该反省的是你不是我
local s,id=GetID()
s.enabled={0,0}
function s.initial_effect(c)
--reflect
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
e1:SetRange(LOCATION_HAND)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(s.reflectcon)
e1:SetOperation(s.reflectop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY+EFFECT_FLAG_SET_AVAILABLE)
e2:SetCondition(s.rmcon)
e2:SetTarget(s.rmtg)
e2:SetOperation(s.rmop)
c:RegisterEffect(e2)
--draw
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,3))
e4:SetCategory(CATEGORY_DRAW)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_DELAY)
e4:SetCondition(s.drawcon)
e4:SetTarget(s.drawtg)
e4:SetOperation(s.drawop)
c:RegisterEffect(e4)
local e4p=e4:Clone()
e4p:SetCode(EVENT_TO_DECK)
c:RegisterEffect(e4p)
local e4q=e4:Clone()
e4q:SetCode(EVENT_REMOVE)
c:RegisterEffect(e4q)
--Choose
if not s.global_check then
local ge=Effect.CreateEffect(c)
ge:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge:SetCode(EVENT_PREDRAW)
ge:SetReset(RESET_PHASE+PHASE_END)
ge:SetOperation(s.selectop)
Duel.RegisterEffect(ge,0)
s.global_check=true
end
end
function s.reflectcon(e,tp,eg,ep,ev,re,r,rp)
if s.enabled[tp]&1==0 then return false end
if re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and not re:IsHasType(EFFECT_TYPE_ACTIVATE) then return false end
local ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_DAMAGE)
if ex and (cp==tp or cp==PLAYER_ALL) then return true end
ex,cg,ct,cp,cv=Duel.GetOperationInfo(ev,CATEGORY_RECOVER)
return ex and (cp==tp or cp==PLAYER_ALL) and Duel.IsPlayerAffectedByEffect(tp,EFFECT_REVERSE_RECOVER)
end
function s.reflectop(e,tp,eg,ep,ev,re,r,rp)
if Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
else
return
end
local cid=Duel.GetChainInfo(ev,CHAININFO_CHAIN_ID)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_REFLECT_DAMAGE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetLabel(cid)
e1:SetValue(s.refcon)
e1:SetReset(RESET_CHAIN)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_DAMAGE)
e2:SetTargetRange(0,1)
e2:SetValue(s.damval)
Duel.RegisterEffect(e2,tp)
end
function s.refcon(e,re,val,r,rp,rc)
local cc=Duel.GetCurrentChain()
if cc==0 or bit.band(r,REASON_EFFECT)==0 then return end
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
return cid==e:GetLabel()
end
function s.damval(e,re,val,r,rp,rc)
local cid=Duel.GetChainInfo(0,CHAININFO_CHAIN_ID)
if cid~=e:GetLabel() then return val end
local v=val*math.max(0,13-Duel.GetTurnCount()*3)
return v
end
function s.rmcon(e,tp,eg,ep,ev,re,r,rp)
--print("rmcon",s.enabled[tp],rp,r)
return s.enabled[tp]&2>0 and rp~=tp and r&REASON_EFFECT>0
end
function s.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local ct=Duel.GetMatchingGroupCount(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,nil,ct,1-tp,0)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,ct*3,0,0)
end
function s.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_REMOVED,0,nil)
if #g==0 then return end
Duel.SendtoDeck(g,tp,SEQ_DECKSHUFFLE,REASON_EFFECT)
local tg=Duel.GetDecktopGroup(tp,#g*3)
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0)
if fc~=nil and Duel.SelectYesNo(tp,aux.Stringid(id,5)) then
Duel.Remove(fc,POS_FACEUP,REASON_EFFECT)
end
end
function s.drawcon(e,tp,eg,ep,ev,re,r,rp)
return s.enabled[tp]&8>0 and rp~=tp and e:GetHandler():IsPreviousLocation(LOCATION_HAND) and r&REASON_EFFECT>0
end
function s.drawtg(e,tp,eg,ep,ev,re,r,rp,chk)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if chk==0 then return ct>0 and Duel.IsPlayerCanDraw(tp,ct) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(ct)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,ct)
end
function s.drawop(e,tp,eg,ep,ev,re,r,rp)
local p=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER)
local ct=5-Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)
if ct==0 then return end
if Duel.Draw(p,ct,REASON_EFFECT)>0 then
Duel.SkipPhase(1-tp,PHASE_DRAW,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_STANDBY,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_MAIN1,RESET_PHASE+PHASE_END,1)
Duel.SkipPhase(1-tp,PHASE_BATTLE,RESET_PHASE+PHASE_END,1,1)
Duel.SkipPhase(1-tp,PHASE_MAIN2,RESET_PHASE+PHASE_END,1)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BP)
e1:SetTargetRange(0,1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.selectop(e,tp)
e:Reset()
for tp=0,1 do
if Duel.IsExistingMatchingCard(Card.IsCode,tp,~0,0,1,nil,id) then
Duel.Hint(HINT_CARD,0,id)
local option1=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1),aux.Stringid(id,2),aux.Stringid(id,3))
local option2=aux.SelectFromOptions(tp,{option1~=0,aux.Stringid(id,0),0},{option1~=1,aux.Stringid(id,1),1},{option1~=2,aux.Stringid(id,2),2},{option1~=3,aux.Stringid(id,3),3})
s.enabled[tp]=(1<<option1)+(1<<option2)
--print("Enabled options: " .. s.enabled[tp])
if Duel.SelectYesNo(tp,aux.Stringid(id,4)) then
local c=Duel.GetMatchingGroup(Card.IsCode,tp,LOCATION_DECK,0,nil,id):GetFirst()
if c then
local h=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_HAND,0,nil):RandomSelect(tp,1):GetFirst()
Duel.SendtoDeck(h,tp,SEQ_DECKSHUFFLE,REASON_RULE)
Duel.SendtoHand(c,nil,REASON_RULE)
end
end
end
end
end
--竹子
local s,id=GetID()
function s.initial_effect(c)
end
function s.register(c,rc)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_RANGE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetRange(~LOCATION_REMOVED)
e1:SetValue(rc:GetOriginalCodeRule())
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e2:SetValue(rc:GetAttribute())
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CHANGE_RACE)
e3:SetValue(rc:GetRace())
c:RegisterEffect(e3)
local e4=e1:Clone()
e4:SetCode(EFFECT_SET_BASE_ATTACK_FINAL)
e4:SetValue(rc:GetBaseAttack())
c:RegisterEffect(e4)
local e4p=e4:Clone()
e4p:SetCode(EFFECT_SET_ATTACK_FINAL)
c:RegisterEffect(e4p)
local e5=e1:Clone()
e5:SetCode(EFFECT_SET_BASE_DEFENSE_FINAL)
e5:SetValue(rc:GetBaseDefense())
c:RegisterEffect(e5)
local e5p=e5:Clone()
e5p:SetCode(EFFECT_SET_DEFENSE_FINAL)
c:RegisterEffect(e5p)
local e6=e1:Clone()
e6:SetCode(EFFECT_CHANGE_LEVEL)
e6:SetValue(rc:GetLevel())
c:RegisterEffect(e6)
if rc:IsType(TYPE_XYZ) then
local e6p=e1:Clone()
e6p:SetCode(EFFECT_CHANGE_RANK)
e6p:SetValue(rc:GetRank())
end
-- ocg don't have effects change link number.
-- if rc:IsType(TYPE_LINK) then
-- local e6p=e1:Clone()
-- e6p:SetCode(EFFECT_CHANGE_LINK)
-- e6p:SetValue(rc:GetLink())
-- c:RegisterEffect(e6p)
-- end
local e7=e1:Clone()
e7:SetCode(EFFECT_CANNOT_SUMMON)
c:RegisterEffect(e7)
local e8=e1:Clone()
e8:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e8)
local e9=e1:Clone()
e9:SetCode(EFFECT_CANNOT_MSET)
c:RegisterEffect(e9)
c:RegisterFlagEffect(id,RESET_EVENT+RESET_REMOVE,0,1,rc:GetOriginalCodeRule())
end
function s.register2(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_TO_HAND)
e1:SetOperation(s.op)
c:RegisterEffect(e1)
end
function s.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tid=c:GetFlagEffectLabel(id)
Duel.Remove(c,POS_FACEDOWN,REASON_RULE)
local g=Duel.GetMatchingGroup(s.refilter,tp,LOCATION_REMOVED,0,nil,tid)
if #g==1 then
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_RULE)
elseif #g>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=g:Select(tp,1,1,nil)
Duel.SendtoDeck(sg,nil,SEQ_DECKSHUFFLE,REASON_RULE)
end
end
function s.refilter(c,tid)
return not c:IsFaceup() and c:IsOriginalCodeRule(tid)
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