Commit b941c970 authored by Nemo Ma's avatar Nemo Ma

221009 wild

parent 52c7f08d
......@@ -18,6 +18,24 @@
700023 0
700024 0
700025 0
4865004 0
4865007 0
4865008 0
4865010 0
4865013 0
4865015 0
4865017 0
4865018 0
4865019 0
4865022 0
4865025 0
4865027 0
4865029 0
4865032 0
4865035 0
4865037 0
4865039 0
4865040 0
9981625 0
10736541 0
11163044 0
......@@ -27,6 +45,8 @@
11451012 0
11451013 0
11451014 0
11451015 0
11451016 0
12678871 0
14012021 0
14824018 0
......@@ -49,6 +69,7 @@
16200008 0
18678558 0
20220679 0
22348028 0
25000000 0
25000001 0
25000049 0
......@@ -122,6 +143,35 @@
31400083 0
31833033 0
32224144 0
33203001 0
33203002 0
33203003 0
33203004 0
33203005 0
33203006 0
33203007 0
33203008 0
33203009 0
33203010 0
33203011 0
33203012 0
33203013 0
33203014 0
33203015 0
33203016 0
33203017 0
33203018 0
33203019 0
33203020 0
33203021 0
33203022 0
33203023 0
33203024 0
33203025 0
33203026 0
33203027 0
33203028 0
33203029 0
33403521 0
33403522 0
33403523 0
......@@ -664,6 +714,7 @@
86510004 0
86510079 0
86868953 0
90351999 0
90700001 0
90700002 0
90700003 0
......@@ -990,6 +1041,9 @@
30015045 0
30015080 0
30015100 0
#221009
11451015 0
11451016 0
#221005
31400081 0
31400083 0
......@@ -1003,7 +1057,6 @@
33720056 0
31400133 0
33331607 0
40008715 0
40009249 0
40009459 0
......
No preview for this file type
expansions/pics/11451011.jpg

56.4 KB | W: | H:

expansions/pics/11451011.jpg

139 KB | W: | H:

expansions/pics/11451011.jpg
expansions/pics/11451011.jpg
expansions/pics/11451011.jpg
expansions/pics/11451011.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451012.jpg

57 KB | W: | H:

expansions/pics/11451012.jpg

139 KB | W: | H:

expansions/pics/11451012.jpg
expansions/pics/11451012.jpg
expansions/pics/11451012.jpg
expansions/pics/11451012.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451013.jpg

61.2 KB | W: | H:

expansions/pics/11451013.jpg

150 KB | W: | H:

expansions/pics/11451013.jpg
expansions/pics/11451013.jpg
expansions/pics/11451013.jpg
expansions/pics/11451013.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451014.jpg

61.2 KB | W: | H:

expansions/pics/11451014.jpg

151 KB | W: | H:

expansions/pics/11451014.jpg
expansions/pics/11451014.jpg
expansions/pics/11451014.jpg
expansions/pics/11451014.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/25000000.jpg

165 KB | W: | H:

expansions/pics/25000000.jpg

164 KB | W: | H:

expansions/pics/25000000.jpg
expansions/pics/25000000.jpg
expansions/pics/25000000.jpg
expansions/pics/25000000.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/25000001.jpg

168 KB | W: | H:

expansions/pics/25000001.jpg

168 KB | W: | H:

expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
expansions/pics/25000001.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/25000104.jpg

229 KB | W: | H:

expansions/pics/25000104.jpg

229 KB | W: | H:

expansions/pics/25000104.jpg
expansions/pics/25000104.jpg
expansions/pics/25000104.jpg
expansions/pics/25000104.jpg
  • 2-up
  • Swipe
  • Onion skin
--雾色弹珠使·泡影
local m=11451011
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
......@@ -12,6 +11,7 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
......@@ -67,7 +67,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
......@@ -79,13 +79,28 @@ function cm.ngfilter(c)
return aux.NegateAnyFilter(c) and c:GetOriginalType()&TYPE_MONSTER>0
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) and c:GetFlagEffect(m)==0 end
local fid=c:GetFieldID()
local e1=Card.RegisterFlagEffect(c,m,RESET_EVENT+0x43e0000+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,2))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_DECK)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetOperation(cm.tdop)
Duel.RegisterEffect(e2,tp)
local g=Duel.GetMatchingGroup(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.tdfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():Reset()
e:Reset()
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetStatus(STATUS_EFFECT_ENABLED,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
local tc=g:GetFirst()
......@@ -188,8 +203,11 @@ end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local te2=e:GetLabelObject()
re:Reset()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
if KOISHI_CHECK then
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
......@@ -204,6 +222,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterEffect(e2)
end
end
re:Reset()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
......
--茜色弹珠使·红莲
local m=11451012
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
......@@ -12,6 +11,7 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DRAW_PHASE,TIMING_DRAW_PHASE+TIMING_TOHAND)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
......@@ -76,7 +76,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
......@@ -85,12 +85,31 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) end
local c=e:GetHandler()
if chk==0 then return Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)~=0 and Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_HAND,1,nil) and c:GetFlagEffect(m)==0 end
local fid=c:GetFieldID()
local e1=Card.RegisterFlagEffect(c,m,RESET_EVENT+0x43e0000+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,2))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_DECK)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetOperation(cm.tdop)
Duel.RegisterEffect(e2,tp)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,1-tp,LOCATION_HAND)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.tdfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():Reset()
e:Reset()
end
end
function cm.tdfilter(c,lab)
local fid=c:GetFlagEffectLabel(m)
return c:IsLocation(LOCATION_DECK) and fid and fid==lab
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetStatus(STATUS_EFFECT_ENABLED,true)
local g0=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g0)
local e1=Effect.CreateEffect(e:GetHandler())
......@@ -172,8 +191,11 @@ end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local te2=e:GetLabelObject()
re:Reset()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
if KOISHI_CHECK then
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
......@@ -188,6 +210,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterEffect(e2)
end
end
re:Reset()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
......
--焰色弹珠使·业炎
local m=11451013
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
......@@ -12,6 +11,7 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
......@@ -66,7 +66,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
......@@ -75,14 +75,29 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) end
local g=Duel.GetMatchingGroup(Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil) and c:GetFlagEffect(m)==0 end
local fid=c:GetFieldID()
local e1=Card.RegisterFlagEffect(c,m,RESET_EVENT+0x43e0000+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,2))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_DECK)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetOperation(cm.tdop)
Duel.RegisterEffect(e2,tp)
local g=Duel.GetMatchingGroup(cm.ngfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,PLAYER_ALL,0)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.tdfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():Reset()
e:Reset()
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetStatus(STATUS_EFFECT_ENABLED,true)
local g=Duel.GetMatchingGroup(Card.IsAttackPos,tp,LOCATION_MZONE,LOCATION_MZONE,aux.ExceptThisCard(e))
if #g>0 then
Duel.Destroy(g,REASON_EFFECT)
......@@ -134,8 +149,11 @@ end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local te2=e:GetLabelObject()
re:Reset()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
if KOISHI_CHECK then
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
......@@ -150,6 +168,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterEffect(e2)
end
end
re:Reset()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
......
--风色弹珠使·雪狱
local m=11451014
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--pendulum summon
aux.EnablePendulumAttribute(c)
......@@ -12,6 +11,7 @@ function cm.initial_effect(c)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMINGS_CHECK_MONSTER)
--e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
......@@ -68,7 +68,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
......@@ -81,14 +81,29 @@ function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) end
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,0,LOCATION_GRAVE,1,nil,e,tp) and c:GetFlagEffect(m)==0 end
local fid=c:GetFieldID()
local e1=Card.RegisterFlagEffect(c,m,RESET_EVENT+0x43e0000+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,fid,aux.Stringid(m,2))
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_TO_DECK)
e2:SetLabel(fid)
e2:SetLabelObject(e1)
e2:SetOperation(cm.tdop)
Duel.RegisterEffect(e2,tp)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,0,LOCATION_GRAVE,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,1-tp,LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,0,PLAYER_ALL,LOCATION_ONFIELD)
end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.tdfilter,1,nil,e:GetLabel()) then
e:GetLabelObject():Reset()
e:Reset()
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
c:SetStatus(STATUS_EFFECT_ENABLED,true)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,0,LOCATION_GRAVE,1,1,nil,e,tp)
local tc=g:GetFirst()
......@@ -140,8 +155,11 @@ end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local te2=e:GetLabelObject()
re:Reset()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
if KOISHI_CHECK then
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
......@@ -156,6 +174,7 @@ function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
rc:RegisterEffect(e2)
end
end
re:Reset()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
......
--双月弹珠使·舞踊
local cm,m=GetID()
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkType,TYPE_PENDULUM),2,2)
--psuedo Activate
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetRange(LOCATION_EXTRA)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetHintTiming(TIMING_DESTROY)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_ACTIVATE_COST)
e3:SetRange(LOCATION_HAND+LOCATION_EXTRA)
e3:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e3:SetLabelObject(e1)
e3:SetTargetRange(1,0)
e3:SetTarget(cm.actarget)
e3:SetOperation(cm.costop)
c:RegisterEffect(e3)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_DRAW)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCondition(cm.drcon)
e2:SetCost(cm.drcost)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_DESTROYED)
ge1:SetCondition(cm.regcon)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,0)
end
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
function cm.cfilter(c,tp)
return c:IsReason(REASON_BATTLE+REASON_EFFECT) and c:IsPreviousLocation(LOCATION_ONFIELD) and c:IsPreviousControler(tp)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
local v=0
if eg:IsExists(cm.cfilter,1,nil,0) then v=v+1 end
if eg:IsExists(cm.cfilter,1,nil,1) then v=v+2 end
if v==0 then return false end
e:SetLabel(({0,1,PLAYER_ALL})[v])
return true
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetCurrentChain()==0 then
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,e:GetLabel())
elseif Duel.GetCurrentChain()>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_END)
e1:SetCountLimit(1)
e1:SetOperation(function()
Duel.RaiseEvent(eg,EVENT_CUSTOM+m,re,r,rp,ep,e:GetLabel())
e:Reset()
end)
Duel.RegisterEffect(e1,0)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
local chk,eg,ep,ev=Duel.CheckEvent(EVENT_CUSTOM+m,true)
return chk and (ev==tp or ev==PLAYER_ALL)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local res=true
if KOISHI_CHECK then
Duel.DisableActionCheck(true)
local dc=Duel.CreateToken(tp,m)
Duel.DisableActionCheck(false)
dc:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
res=dc:GetActivateEffect():IsActivatable(tp,true)
dc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_PENDULUM+TYPE_EFFECT)
else
res=(c:CheckActivateEffect(false,false,false)~=nil)
end
return res and Duel.CheckReleaseGroup(tp,cm.rfilter,2,nil) and Duel.CheckReleaseGroup(tp,cm.rfilter2,1,nil,tp,c)
end
end
function cm.rfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_PENDULUM)
end
function cm.rfilter2(c,tp,sc)
return c:IsLocation(LOCATION_MZONE) and c:IsType(TYPE_PENDULUM) and Duel.GetLocationCountFromEx(tp,tp,c,sc)>0
end
function cm.fselect(g,tp,sc)
return g:IsExists(cm.rfilter2,1,nil,tp,sc)
end
function cm.thfilter(c)
return c:IsSetCard(0x5977) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,2,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.GetReleaseGroup(tp):Filter(cm.rfilter,nil)
local sg=g:SelectSubGroup(tp,cm.fselect,false,2,2,tp,c)
Duel.Release(sg,REASON_COST)
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
e0:SetValue(TYPE_TRAP)
e0:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
c:RegisterEffect(e0,true)
local te2=te:Clone()
e:SetLabelObject(te2)
te:SetType(26)
c:RegisterEffect(te2,true)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVED)
e1:SetCountLimit(1)
e1:SetLabelObject(te2)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return re==te end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EVENT_CHAIN_NEGATED)
Duel.RegisterEffect(e2,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
local te2=e:GetLabelObject()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
if KOISHI_CHECK then
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT)
local e2=Effect.CreateEffect(rc)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_MOVE)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(function(e)
rc:SetCardData(CARDDATA_TYPE,TYPE_MONSTER+TYPE_EFFECT+TYPE_PENDULUM)
e:Reset()
end)
rc:RegisterEffect(e2)
end
end
re:Reset()
end
function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToDeckOrExtraAsCost() end
Duel.SendtoDeck(c,nil,2,REASON_COST)
end
function cm.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(1)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
\ No newline at end of file
--幽世幻-弹珠世界
local cm,m=GetID()
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DRAW_PHASE)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--atk
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetRange(LOCATION_SZONE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetCondition(cm.fcon)
e2:SetTarget(cm.atktg)
e2:SetValue(cm.atkval)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DELAY)
e3:SetRange(LOCATION_SZONE)
e3:SetCode(EVENT_CHAINING)
e3:SetCondition(cm.descon)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
--remain field
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e4:SetCode(EFFECT_REMAIN_FIELD)
--c:RegisterEffect(e4)
--act in hand
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_TRAP_ACT_IN_HAND)
e5:SetCondition(cm.hand)
c:RegisterEffect(e5)
end
function cm.hand(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentChain()==0
end
function cm.thfilter(c)
return c:IsSetCard(0x5977) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
local fc=Duel.GetFieldCard(tp,LOCATION_SZONE,5)
if fc then
Duel.SendtoGrave(fc,REASON_RULE)
Duel.BreakEffect()
end
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_FIELD+TYPE_TRAP)
c:RegisterEffect(e1)
Duel.MoveSequence(c,5)
c:SetStatus(STATUS_LEAVE_CONFIRMED,false)
c:SetStatus(STATUS_EFFECT_ENABLED,true)
if c:IsLocation(LOCATION_FZONE) then
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if #g>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
end
end
function cm.atkfilter(c)
return c:IsType(TYPE_FUSION) or c:IsSetCard(0x6977)
end
function cm.fcon(e)
return e:GetHandler():GetSequence()==5
end
function cm.atktg(e,c)
return cm.atkfilter(c)
end
function cm.atkval(e,c)
return 500*Duel.GetMatchingGroupCount(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
end
function cm.descon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE) and e:GetHandler():GetSequence()==5
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
if chk==0 then return Duel.IsExistingTarget(nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,nil,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
\ No newline at end of file
--星·泪·兽
local m=22348028
local cm=_G["c"..m]
function cm.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(22348028,0))
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,22348028+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c22348028.spcon1)
c:RegisterEffect(e1)
--get effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(22348028,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_XMATERIAL+EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1)
e2:SetCondition(c22348028.spcon2)
e2:SetCost(c22348028.spcost)
e2:SetTarget(c22348028.sptg)
e2:SetOperation(c22348028.spop)
c:RegisterEffect(e2)
--fusion
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(22348028,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCountLimit(1,22348028)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(c22348028.condition)
e3:SetTarget(c22348028.target)
e3:SetOperation(c22348028.activate)
c:RegisterEffect(e3)
end
function c22348028.filter(c)
return (c:IsLevel(4) or (c:IsLink(4) or c:Isrank(4))) and c:IsFaceup()
end
function c22348028.spcon1(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22348028.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function c22348028.spcon2(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOriginalRace()==RACE_BEASTWARRIOR or (e:GetHandler():GetOriginalRace()==RACE_THUNDER or e:GetHandler():GetOriginalRace()==RACE_AQUA)
end
function c22348028.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c22348028.spfilter(c,e,tp)
return c:IsCode(22348028) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c22348028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c22348028.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_HAND)
end
function c22348028.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c22348028.spfilter,tp,LOCATION_DECK+LOCATION_HAND,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c22348028.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c22348028.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local res=c:CheckFusionMaterial(m,e:GetHandler(),chkf)
return res
end
function c22348028.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT)
end
function c22348028.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c22348028.filter0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(c22348028.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c22348028.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c22348028.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToChain() or c:IsImmuneToEffect(e) then return end
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c22348028.filter0),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c22348028.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c22348028.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,e:GetHandler(),chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(c22348028.fdfilter,1,nil) then
local cg=mat1:Filter(c22348028.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat1,nil,SEQ_DECKTOP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
local p=tp
for i=1,2 do
local dg=mat1:Filter(c22348028.seqfilter,nil,p)
if #dg>1 then
Duel.SortDecktop(tp,p,#dg)
end
for i=1,#dg do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
p=1-tp
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,e:GetHandler(),chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c22348028.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function c22348028.seqfilter(c,tp)
return c:IsLocation(LOCATION_DECK) and c:IsControler(tp)
end
--缝合僵尸 血魔-D
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--cannot special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.FALSE)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetRange(LOCATION_HAND)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--equip
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_EQUIP)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(s.eqcon)
e3:SetTarget(s.eqtg)
e3:SetOperation(s.eqop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,LOCATION_MZONE)
e4:SetCode(EFFECT_DISABLE)
c:RegisterEffect(e4)
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local rg=Duel.GetReleaseGroup(tp)
return rg:CheckSubGroup(aux.mzctcheckrel,3,3,tp)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,c)
local rg=Duel.GetReleaseGroup(tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local sg=rg:SelectSubGroup(tp,aux.mzctcheckrel,true,3,3,tp)
if sg then
sg:KeepAlive()
e:SetLabelObject(sg)
return true
else return false end
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
local g=e:GetLabelObject()
Duel.Release(g,REASON_COST)
g:DeleteGroup()
end
function s.cfilter(c)
return c:GetFlagEffect(id)>0
end
function s.eqcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local eqg=c:GetEquipGroup()
return eqg==nil or not eqg:IsExists(s.cfilter,1,nil)
end
function s.eqtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(1-tp) and chkc:IsAbleToChangeControler() end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EQUIP)
local g=Duel.SelectTarget(tp,Card.IsAbleToChangeControler,tp,0,LOCATION_MZONE,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_EQUIP,g,1,0,0)
end
function s.eqlimit(e,c)
return e:GetOwner()==c
end
function s.eqop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
local atk=math.ceil(tc:GetTextAttack()/2)
if tc:IsFacedown() then atk=0 end
if atk<0 then atk=0 end
if not Duel.Equip(tp,tc,c,false) then return end
--Add Equip limit
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,0)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_COPY_INHERIT+EFFECT_FLAG_OWNER_RELATE)
e1:SetCode(EFFECT_EQUIP_LIMIT)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
e1:SetValue(s.eqlimit)
tc:RegisterEffect(e1)
if atk>0 then
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_EQUIP)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_OWNER_RELATE)
e2:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
e2:SetValue(atk)
tc:RegisterEffect(e2)
end
end
end
--缝合僵尸的羽毛吹雪
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(s.condition)
e1:SetOperation(s.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(s.handcon)
c:RegisterEffect(e2)
--search
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_DESTROYED)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCondition(s.thcon)
e3:SetTarget(s.thtg)
e3:SetOperation(s.thop)
c:RegisterEffect(e3)
end
function s.disfilter(c)
return c:IsFaceup() and c:IsSetCard(0x332b)
end
function s.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(s.disfilter,tp,LOCATION_MZONE,0,1,nil)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCondition(s.discon)
e1:SetOperation(s.disop)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function s.discon(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER) and rp==1-tp
end
function s.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.NegateEffect(ev)
end
function s.filter(c)
return c:IsFaceup() and c:IsSetCard(0x332b)
end
function s.handcon(e)
return Duel.IsExistingMatchingCard(s.filter,e:GetHandlerPlayer(),LOCATION_MZONE,0,1,nil)
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsReason(REASON_EFFECT)
and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_SZONE)
end
function s.thfilter(c)
return c:IsCode(18144506) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(s.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--缝合僵尸 狗环
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,s.ovfilter,aux.Stringid(id,0),99,s.xyzop)
c:EnableReviveLimit()
--atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(s.atkval)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(s.defval)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(s.spcost)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x332b) and not c:IsCode(id)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
end
function s.atkfilter(c)
return c:IsSetCard(0x332b) and c:GetAttack()>=0
end
function s.atkval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(s.atkfilter,nil)
return g:GetSum(Card.GetAttack)
end
function s.deffilter(c)
return c:IsSetCard(0x332b) and c:GetDefense()>=0
end
function s.defval(e,c)
local g=e:GetHandler():GetOverlayGroup():Filter(s.deffilter,nil)
return g:GetSum(Card.GetDefense)
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and s.spfilter(chkc,e,tp) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.IsExistingTarget(s.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectTarget(tp,s.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
tc:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EFFECT_CANNOT_BE_XYZ_MATERIAL)
e3:SetValue(1)
tc:RegisterEffect(e3)
end
Duel.SpecialSummonComplete()
end
--缝合僵尸 积木龙
local s,id,o=GetID()
function s.initial_effect(c)
c:EnableReviveLimit()
--special summon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
c:RegisterEffect(e1)
--special summon
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_HAND+LOCATION_GRAVE)
e2:SetCondition(s.spcon)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--indes
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_INDESTRUCTABLE)
e3:SetRange(LOCATION_MZONE)
e3:SetTargetRange(LOCATION_MZONE,0)
e3:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x332b))
e3:SetValue(s.indesval)
c:RegisterEffect(e3)
--to hand
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,0))
e4:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e4:SetProperty(EFFECT_FLAG_DELAY)
e4:SetCode(EVENT_TO_GRAVE)
e4:SetCountLimit(1,id)
e4:SetCondition(s.thcon)
e4:SetTarget(s.thtg)
e4:SetOperation(s.thop)
c:RegisterEffect(e4)
end
function s.spfilter(c)
return c:IsSetCard(0x332b) and c:IsAbleToRemoveAsCost()
end
function s.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,3,c)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_GRAVE+LOCATION_HAND,0,3,3,c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function s.indesval(e,re,r,rp)
return bit.band(r,REASON_RULE+REASON_BATTLE)==0
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function s.thfilter(c)
return c:IsSetCard(0x332b) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
if chk==0 then return g:CheckWithSumEqual(Card.GetLevel,8,1,3) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(s.thfilter,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectWithSumEqual(tp,Card.GetLevel,8,1,3)
if sg and sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
--缝合僵尸·喷流僵尸
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(s.spcon)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetCountLimit(1,id+10000)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
end
function s.filter(c)
return c:IsSetCard(0x332b) and c:IsFaceup()
end
function s.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.filter,c:GetControler(),LOCATION_MZONE,0,1,nil)
end
function s.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--缝合僵尸 圆武
local s,id,o=GetID()
function s.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,id)
e1:SetCost(s.spcost)
e1:SetTarget(s.sptg)
e1:SetOperation(s.spop)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetRange(LOCATION_MZONE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,id+10000)
e2:SetCondition(s.thcon)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function s.costfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_MONSTER) and not c:IsCode(id) and c:IsAbleToGraveAsCost()
end
function s.spcost(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 g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoGrave(g,REASON_COST)
end
function s.sptg(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
function s.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--check
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetOperation(s.checkop)
Duel.RegisterEffect(e1,tp)
--cannot announce
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ATTACK_ANNOUNCE)
e2:SetTargetRange(LOCATION_MZONE,0)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetCondition(s.atkcon)
e2:SetTarget(s.atktg)
e1:SetLabelObject(e2)
Duel.RegisterEffect(e2,tp)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetFlagEffect(tp,id)~=0 then return end
local fid=eg:GetFirst():GetFieldID()
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_END,0,1)
e:GetLabelObject():SetLabel(fid)
end
function s.atkcon(e)
return Duel.GetFlagEffect(e:GetHandlerPlayer(),id)>0
end
function s.atktg(e,c)
return c:GetFieldID()~=e:GetLabel()
end
function s.cfilter(c,tp)
return c:IsSetCard(0x332b) and c:IsControler(tp) and c:IsFaceup()
end
function s.thcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp) and not eg:IsContains(e:GetHandler())
end
function s.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function s.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
--缝合僵尸 贝阿特丽切
local s,id,o=GetID()
function s.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,6,2,s.ovfilter,aux.Stringid(id,0),2,s.xyzop)
c:EnableReviveLimit()
--to grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,1))
e1:SetCategory(CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetRange(LOCATION_MZONE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e1:SetCountLimit(1)
e1:SetCost(s.tgcost)
e1:SetTarget(s.tgtg)
e1:SetOperation(s.tgop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,2))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCondition(s.spcon)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.cfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_MONSTER) and c:IsAbleToGraveAsCost()
end
function s.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x332b)
end
function s.xyzop(e,tp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,s.cfilter,1,1,REASON_COST,nil)
e:GetHandler():RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD+RESET_PHASE+PHASE_END,0,1)
end
function s.tgcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function s.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(id)==0
and Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function s.tgop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToGrave,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousControler(tp) and rp==1-tp and c:IsReason(REASON_DESTROY)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,true,false,POS_FACEUP)
end
end
--明亮融合
function c33203008.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33203008+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(c33203008.target)
e1:SetOperation(c33203008.activate)
c:RegisterEffect(e1)
--Destroy
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_LEAVE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetOperation(c33203008.desop)
c:RegisterEffect(e2)
--atk
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1)
e3:SetCondition(c33203008.atkcon)
e3:SetCost(c33203008.atkcost)
e3:SetTarget(c33203008.atktg)
e3:SetOperation(c33203008.atkop)
c:RegisterEffect(e3)
end
function c33203008.filter0(c)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave()
end
function c33203008.filter1(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToGrave() and not c:IsImmuneToEffect(e)
end
function c33203008.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x332b) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c33203008.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg1=Duel.GetMatchingGroup(c33203008.filter0,tp,LOCATION_DECK,0,nil)
local res=Duel.IsExistingMatchingCard(c33203008.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c33203008.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203008.activate(e,tp,eg,ep,ev,re,r,rp)
local chkf=tp
local mg1=Duel.GetMatchingGroup(c33203008.filter1,tp,LOCATION_DECK,0,nil,e)
local sg1=Duel.GetMatchingGroup(c33203008.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c33203008.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_SET_ATTACK_FINAL)
e1:SetValue(0)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TOFIELD)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_SET_DEFENSE_FINAL)
tc:RegisterEffect(e2)
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
e:GetHandler():SetCardTarget(tc)
end
end
function c33203008.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if tc and tc:IsLocation(LOCATION_MZONE) then
Duel.Destroy(tc,REASON_EFFECT)
end
end
function c33203008.atkcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetFirstCardTarget()
end
function c33203008.cfilter(c)
return c:IsType(TYPE_SPELL) and c:IsDiscardable()
end
function c33203008.atkcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203008.cfilter,tp,LOCATION_HAND,0,1,nil) end
Duel.DiscardHand(tp,c33203008.cfilter,1,1,REASON_COST+REASON_DISCARD,nil)
end
function c33203008.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFirstCardTarget() end
end
function c33203008.atkop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetHandler():GetFirstCardTarget()
if not tc then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(tc:GetBaseAttack())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END+RESET_OPPO_TURN)
tc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
e2:SetValue(tc:GetBaseDefense())
tc:RegisterEffect(e2)
end
--幻创之缝合僵尸
local s,id,o=GetID()
function s.initial_effect(c)
--immune
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.immcon)
e1:SetCost(s.immcost)
e1:SetTarget(s.immtg)
e1:SetOperation(s.immop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetCountLimit(1,id)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.immcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function s.immcost(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.immtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,id)==0 end
end
function s.immop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_IMMUNE_EFFECT)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x332b))
e1:SetValue(s.efilter)
if Duel.GetCurrentPhase()==PHASE_MAIN1 then
e1:SetReset(RESET_PHASE+PHASE_MAIN1)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_MAIN1,0,1)
else
e1:SetReset(RESET_PHASE+PHASE_MAIN2)
Duel.RegisterFlagEffect(tp,id,RESET_PHASE+PHASE_MAIN2,0,1)
end
Duel.RegisterEffect(e1,tp)
end
function s.efilter(e,re)
return e:GetOwnerPlayer()~=re:GetOwnerPlayer() and re:IsActivated()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
return true
end
function s.cfilter(c)
return c:IsSetCard(0x332b) and c:IsAbleToRemoveAsCost()
end
function s.spfilter(c,e,tp,lv)
return c:IsSetCard(0x332b) and c:IsLevelBelow(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
local cg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil)
return c:IsAbleToRemoveAsCost()
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,cg:GetCount())
end
local cg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_GRAVE,0,nil)
local tg=Duel.GetMatchingGroup(s.spfilter,tp,LOCATION_DECK,0,nil,e,tp,cg:GetCount())
local lvt={}
local tc=tg:GetFirst()
while tc do
local tlv=0
tlv=tlv+tc:GetLevel()
lvt[tlv]=tlv
tc=tg:GetNext()
end
local pc=1
for i=1,12 do
if lvt[i] then lvt[i]=nil lvt[pc]=i pc=pc+1 end
end
lvt[pc]=nil
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,2))
local lv=Duel.AnnounceNumber(tp,table.unpack(lvt))
local rg1=Group.CreateGroup()
if lv>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local rg2=cg:Select(tp,lv-1,lv-1,c)
rg1:Merge(rg2)
end
rg1:AddCard(c)
Duel.Remove(rg1,POS_FACEUP,REASON_COST)
e:SetLabel(lv)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.sfilter(c,e,tp,lv)
return c:IsSetCard(0x332b) and c:IsLevel(lv) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local lv=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.sfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv)
local tc=g:GetFirst()
if tc and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)~=0 then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(s.descon)
e1:SetOperation(s.desop)
Duel.RegisterEffect(e1,tp)
end
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(id)==e:GetLabel() then
return true
else
e:Reset()
return false
end
end
function s.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.Destroy(tc,REASON_EFFECT)
end
--沼地的缝合僵尸
function c33203010.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c33203010.ffilter,2,true)
--cannot be target
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e1:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetValue(aux.tgoval)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e2:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(c33203010.tglimit)
e2:SetValue(aux.tgoval)
c:RegisterEffect(e2)
--att change
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203010,0))
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c33203010.atttg)
e3:SetOperation(c33203010.attop)
c:RegisterEffect(e3)
end
function c33203010.ffilter(c,fc,sub,mg,sg)
return not sg or sg:FilterCount(aux.TRUE,c)==0
or (sg:IsExists(Card.IsFusionAttribute,1,c,c:GetFusionAttribute())
and not sg:IsExists(Card.IsRace,1,c,c:GetRace()))
end
function c33203010.tglimit(e,c)
return c:IsAttribute(e:GetHandler():GetAttribute())
end
function c33203010.atttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATTRIBUTE)
local aat=Duel.AnnounceAttribute(tp,1,ATTRIBUTE_ALL-e:GetHandler():GetAttribute())
e:SetLabel(aat)
end
function c33203010.attop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and c:IsFaceup() then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CHANGE_ATTRIBUTE)
e1:SetValue(e:GetLabel())
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
end
end
--缝合僵尸总监 主斗
function c33203011.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,c33203011.matfilter,2,true)
aux.AddContactFusionProcedure(c,Card.IsAbleToDeckOrExtraAsCost,LOCATION_MZONE,0,aux.tdcfop(c))
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(c33203011.splimit)
c:RegisterEffect(e1)
--cannot be fusion material
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_CANNOT_BE_FUSION_MATERIAL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetValue(1)
c:RegisterEffect(e3)
--special summon (extra)
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(33203011,3))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetTarget(c33203011.esptg)
e4:SetOperation(c33203011.espop)
c:RegisterEffect(e4)
--special summon
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(33203011,4))
e6:SetCategory(CATEGORY_SPECIAL_SUMMON)
e6:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e6:SetCode(EVENT_PHASE+PHASE_BATTLE)
e6:SetRange(LOCATION_MZONE)
e6:SetCountLimit(1)
e6:SetCost(c33203011.spcost)
e6:SetTarget(c33203011.sptg)
e6:SetOperation(c33203011.spop)
c:RegisterEffect(e6)
end
function c33203011.matfilter(c)
return c:IsLevelAbove(5) and c:IsFusionSetCard(0x332b)
end
function c33203011.splimit(e,se,sp,st)
return e:GetHandler():GetLocation()~=LOCATION_EXTRA
end
function c33203011.espfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsType(TYPE_FUSION) and not c:IsCode(33203011)
and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,true,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function c33203011.esptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203011.espfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203011.espop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203011.espfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,SUMMON_VALUE_GLADIATOR,tp,tp,true,false,POS_FACEUP)
end
end
function c33203011.spcfilter(c,ft)
return c:IsFaceup() and c:IsSetCard(0x332b) and c:GetBattledGroupCount()>0
and c:IsAbleToDeckOrExtraAsCost() and (ft>0 or c:GetSequence()<5)
end
function c33203011.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if chk==0 then return ft>-1 and Duel.IsExistingMatchingCard(c33203011.spcfilter,tp,LOCATION_MZONE,0,1,nil,ft) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,c33203011.spcfilter,tp,LOCATION_MZONE,0,1,1,nil,ft)
Duel.ConfirmCards(1-tp,g)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function c33203011.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,SUMMON_VALUE_GLADIATOR,tp,false,false)
end
function c33203011.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203011.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33203011.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203011.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g:GetFirst()
if tc then
Duel.SpecialSummonStep(tc,SUMMON_VALUE_GLADIATOR,tp,tp,false,false,POS_FACEUP)
tc:RegisterFlagEffect(tc:GetOriginalCode(),RESET_EVENT+RESETS_STANDARD+RESET_DISABLE,0,0)
Duel.SpecialSummonComplete()
end
end
--霸王缝合僵尸 扎克
function c33203012.initial_effect(c)
c:EnableReviveLimit()
aux.AddFusionProcMix(c,false,true,c33203012.fusfilter1,c33203012.fusfilter2,c33203012.fusfilter3,c33203012.fusfilter4)
aux.EnablePendulumAttribute(c,false)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--act limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_ACTIVATE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_PZONE)
e2:SetTargetRange(0,1)
e2:SetValue(c33203012.limval)
c:RegisterEffect(e2)
--destroy drawn
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203012,0))
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_TO_HAND)
e3:SetRange(LOCATION_PZONE)
e3:SetCountLimit(1)
e3:SetCondition(c33203012.ddcon)
e3:SetTarget(c33203012.ddtg)
e3:SetOperation(c33203012.ddop)
c:RegisterEffect(e3)
--destroy all
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(33203012,1))
e4:SetCategory(CATEGORY_DESTROY)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e4:SetCode(EVENT_SPSUMMON_SUCCESS)
e4:SetTarget(c33203012.destg)
e4:SetOperation(c33203012.desop)
c:RegisterEffect(e4)
--Immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_CANNOT_BE_EFFECT_TARGET)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetValue(aux.tgoval)
c:RegisterEffect(e5)
local e6=e5:Clone()
e6:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
e6:SetValue(aux.indoval)
c:RegisterEffect(e6)
--special summon
local e7=Effect.CreateEffect(c)
e7:SetDescription(aux.Stringid(33203012,2))
e7:SetCategory(CATEGORY_SPECIAL_SUMMON)
e7:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e7:SetCode(EVENT_BATTLE_DESTROYING)
e7:SetCondition(aux.bdocon)
e7:SetTarget(c33203012.sptg)
e7:SetOperation(c33203012.spop)
c:RegisterEffect(e7)
--pendulum
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(33203012,3))
e8:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e8:SetCode(EVENT_DESTROYED)
e8:SetProperty(EFFECT_FLAG_DELAY)
e8:SetCondition(c33203012.pencon)
e8:SetTarget(c33203012.pentg)
e8:SetOperation(c33203012.penop)
c:RegisterEffect(e8)
end
c33203012.material_type=TYPE_SYNCHRO
function c33203012.fusfilter1(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_FUSION)
end
function c33203012.fusfilter2(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_SYNCHRO)
end
function c33203012.fusfilter3(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_XYZ)
end
function c33203012.fusfilter4(c)
return c:IsRace(RACE_DRAGON) and c:IsFusionType(TYPE_PENDULUM)
end
function c33203012.limval(e,re,rp)
local rc=re:GetHandler()
return rc:IsLocation(LOCATION_MZONE) and re:IsActiveType(TYPE_MONSTER)
and rc:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ)
end
function c33203012.ddcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()~=PHASE_DRAW
end
function c33203012.ddfilter(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)
end
function c33203012.ddtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(c33203012.ddfilter,nil,tp)
if chk==0 then return g:GetCount()>0 end
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c33203012.ddop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(c33203012.ddfilter,nil,tp)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c33203012.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c33203012.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetFieldGroup(tp,0,LOCATION_ONFIELD)
if g:GetCount()>0 then
Duel.Destroy(g,REASON_EFFECT)
end
end
function c33203012.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and (c:IsLocation(LOCATION_DECK) and Duel.GetMZoneCount(tp)>0
or c:IsLocation(LOCATION_EXTRA) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0)
end
function c33203012.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203012.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
end
function c33203012.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203012.spfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c33203012.pencon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsFaceup()
end
function c33203012.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLocation(tp,LOCATION_PZONE,0) or Duel.CheckLocation(tp,LOCATION_PZONE,1) end
end
function c33203012.penop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) then
Duel.MoveToField(c,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
end
--缝合僵尸-天青石鹡鸰
function c33203013.initial_effect(c)
--to hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203013,0))
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:SetCountLimit(1,33203013)
e1:SetTarget(c33203013.thtg)
e1:SetOperation(c33203013.thop)
c:RegisterEffect(e1)
--overlay
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203013,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,33213013)
e2:SetTarget(c33203013.ovtg)
e2:SetOperation(c33203013.ovop)
c:RegisterEffect(e2)
end
function c33203013.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c33203013.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203013.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c33203013.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c33203013.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c33203013.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x332b) and c:IsType(TYPE_XYZ)
end
function c33203013.ovtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and c33203013.ovfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33203013.ovfilter,tp,LOCATION_MZONE,0,1,nil)
and e:GetHandler():IsCanOverlay() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,c33203013.ovfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,e:GetHandler(),1,0,0)
end
function c33203013.ovop(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 not c:IsImmuneToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Overlay(tc,Group.FromCards(c))
end
end
--缝合僵尸惰天使
function c33203014.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,2,c33203014.ovfilter,aux.Stringid(33203014,0))
c:EnableReviveLimit()
--win
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EVENT_ADJUST)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(c33203014.winop)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203014,1))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetCost(c33203014.thcost)
e2:SetTarget(c33203014.thtg)
e2:SetOperation(c33203014.thop)
c:RegisterEffect(e2)
--material
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203014,2))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetTarget(c33203014.mttg)
e3:SetOperation(c33203014.mtop)
c:RegisterEffect(e3)
end
function c33203014.ovfilter(c)
return c:IsFaceup() and c:IsSetCard(0x332b) and c:IsType(TYPE_XYZ) and not c:IsCode(33203014)
end
function c33203014.winop(e,tp,eg,ep,ev,re,r,rp)
local WIN_REASON_GHOSTRICK_SPOILEDANGEL=0x1b
if e:GetHandler():GetOverlayCount()==10 then
Duel.Win(tp,WIN_REASON_GHOSTRICK_SPOILEDANGEL)
end
end
function c33203014.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c33203014.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function c33203014.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203014.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function c33203014.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,c33203014.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c33203014.mtfilter(c)
return c:IsSetCard(0x332b) and c:IsCanOverlay()
end
function c33203014.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsType(TYPE_XYZ)
and Duel.IsExistingMatchingCard(c33203014.mtfilter,tp,LOCATION_HAND,0,1,nil) end
end
function c33203014.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,c33203014.mtfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(c,g)
end
end
--缝合僵尸跳越!?
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
c:RegisterEffect(e1)
--Effect 2
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetTarget(s.tdtg)
e2:SetOperation(s.tdop)
c:RegisterEffect(e2)
end
function s.filter1(c,e,tp)
return c:IsFaceup() and c:IsSetCard(0x332b) and c:IsType(TYPE_XYZ)
and aux.MustMaterialCheck(c,tp,EFFECT_MUST_BE_XMATERIAL)
and Duel.IsExistingMatchingCard(s.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,c,c:GetRank())
end
function s.filter2(c,e,tp,mc,rk)
return not c:IsRank(rk) and c:IsSetCard(0x332b) and c:IsType(TYPE_XYZ) and mc:IsCanBeXyzMaterial(c)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,mc,c)>0
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.filter1(chkc,e,tp) end
if chk==0 then return Duel.IsExistingTarget(s.filter1,tp,LOCATION_MZONE,0,1,nil,e,tp)end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,s.filter1,tp,LOCATION_MZONE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if not aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL)
or tc:IsFacedown() or not tc:IsRelateToEffect(e) or tc:IsControler(1-tp)
or tc:IsImmuneToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.filter2,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))
if Duel.SpecialSummon(sc,SUMMON_TYPE_XYZ,tp,tp,false,false,POS_FACEUP)>0 then
sc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,2)
sc:CompleteProcedure()
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(Duel.GetTurnCount())
e1:SetLabelObject(sc)
e1:SetCondition(s.tdcon3)
e1:SetOperation(s.tdop3)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function s.tdcon3(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
return Duel.GetTurnCount()~=e:GetLabel() and tc:GetFlagEffect(id)~=0
end
function s.tdop3(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
function s.drfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
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.drfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(s.drfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectTarget(tp,s.drfilter,tp,LOCATION_GRAVE,0,1,3,nil)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function s.tdop(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if not tg or tg:FilterCount(Card.IsRelateToEffect,nil,e)==0 then return end
Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--缝合僵尸86号 击灭枪王
function c33203016.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x332b),4,2,nil,nil,5)
c:EnableReviveLimit()
--remove material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203016,0))
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_F)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetCondition(c33203016.rmcon)
e1:SetOperation(c33203016.rmop)
c:RegisterEffect(e1)
--battle indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e2:SetValue(1)
e2:SetCondition(c33203016.effcon)
e2:SetLabel(1)
c:RegisterEffect(e2)
--atk/def
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetValue(1500)
e3:SetCondition(c33203016.effcon)
e3:SetLabel(2)
c:RegisterEffect(e3)
local e4=e3:Clone()
e4:SetCode(EFFECT_UPDATE_DEFENSE)
c:RegisterEffect(e4)
--immune
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e5:SetRange(LOCATION_MZONE)
e5:SetCode(EFFECT_IMMUNE_EFFECT)
e5:SetValue(c33203016.efilter)
e5:SetCondition(c33203016.effcon)
e5:SetLabel(3)
c:RegisterEffect(e5)
--disable spsummon
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_FIELD)
e6:SetRange(LOCATION_MZONE)
e6:SetCode(EFFECT_CANNOT_SUMMON)
e6:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e6:SetTargetRange(0,1)
e6:SetCondition(c33203016.effcon)
e6:SetLabel(4)
c:RegisterEffect(e6)
local e7=e6:Clone()
e7:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
c:RegisterEffect(e7)
--destroy
local e8=Effect.CreateEffect(c)
e8:SetDescription(aux.Stringid(33203016,1))
e8:SetCategory(CATEGORY_DESTROY)
e8:SetType(EFFECT_TYPE_IGNITION)
e8:SetCountLimit(1)
e8:SetRange(LOCATION_MZONE)
e8:SetCondition(c33203016.effcon)
e8:SetTarget(c33203016.destg)
e8:SetOperation(c33203016.desop)
e8:SetLabel(5)
c:RegisterEffect(e8)
end
function c33203016.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c33203016.rmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:GetOverlayCount()>0 then
c:RemoveOverlayCard(tp,1,1,REASON_EFFECT)
end
end
function c33203016.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():GetOverlayCount()>=e:GetLabel()
end
function c33203016.efilter(e,te)
return te:GetOwner()~=e:GetOwner()
end
function c33203016.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c33203016.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(aux.TRUE,tp,0,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
--缝合僵尸曲线球
function c33203017.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203017,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_POSITION)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33203017)
e1:SetTarget(c33203017.sptg)
e1:SetOperation(c33203017.spop)
c:RegisterEffect(e1)
--grave
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203017,1))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_GRAVE)
e2:SetCountLimit(1,33213017)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c33203017.mattg)
e2:SetOperation(c33203017.matop)
c:RegisterEffect(e2)
end
function c33203017.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33203017.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33203017.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
end
function c33203017.cfilter(c)
return c:IsSetCard(0x332b) and c:IsFacedown() and c:IsCanChangePosition()
end
function c33203017.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33203017.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0
and Duel.IsExistingMatchingCard(c33203017.cfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(33203017,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_POSCHANGE)
local sg=Duel.SelectMatchingCard(tp,c33203017.cfilter,tp,LOCATION_MZONE,0,1,1,nil)
Duel.ChangePosition(sg,POS_FACEUP_ATTACK)
end
end
function c33203017.xyzfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(0x332b)
end
function c33203017.mfilter(c)
return c:IsSetCard(0x332b) and c:IsCanOverlay()
end
function c33203017.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsPosition(LOCATION_MZONE) and c33203017.xyzfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33203017.xyzfilter,tp,LOCATION_MZONE,0,1,nil)
and Duel.IsExistingMatchingCard(c33203017.mfilter,tp,LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,c33203017.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil)
end
function c33203017.matop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsFaceup() and tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_XMATERIAL)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33203017.mfilter),tp,LOCATION_GRAVE,0,1,1,nil)
if g:GetCount()>0 then
Duel.Overlay(tc,g)
end
end
end
--缝合僵尸·塞壬人鱼
function c33203018.initial_effect(c)
--sp summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203018,0))
e1:SetCategory(CATEGORY_DECKDES+CATEGORY_SPECIAL_SUMMON+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,33203018)
e1:SetTarget(c33203018.tgtg)
e1:SetOperation(c33203018.tgop)
c:RegisterEffect(e1)
--fusion
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203018,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_GRAVE_ACTION)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_TO_GRAVE)
e2:SetCountLimit(1,33213018)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCondition(c33203018.condition)
e2:SetTarget(c33203018.target)
e2:SetOperation(c33203018.activate)
c:RegisterEffect(e2)
end
function c33203018.tgfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c33203018.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsPlayerCanDiscardDeck(tp,3)
and Duel.IsExistingMatchingCard(c33203018.tgfilter,tp,LOCATION_HAND,0,1,c) end
Duel.SetOperationInfo(0,CATEGORY_DECKDES,nil,0,tp,3)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_HAND)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c33203018.tgop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsRelateToEffect(e) and Duel.SpecialSummon(e:GetHandler(),0,tp,tp,false,false,POS_FACEUP)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c33203018.tgfilter,tp,LOCATION_HAND,0,1,1,nil)
if #g>0 and Duel.SendtoGrave(g,REASON_EFFECT)>0 and g:GetFirst():IsLocation(LOCATION_GRAVE)
and Duel.IsPlayerCanDiscardDeck(tp,1) then
Duel.BreakEffect()
Duel.DiscardDeck(tp,3,REASON_EFFECT)
end
end
end
function c33203018.filter0(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeFusionMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function c33203018.filter1(c,e,tp,m,f,chkf)
if not (c:IsType(TYPE_FUSION) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false)) then return false end
local res=c:CheckFusionMaterial(m,e:GetHandler(),chkf)
return res
end
function c33203018.condition(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL and e:GetHandler():IsReason(REASON_EFFECT)
end
function c33203018.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local chkf=tp
local mg=Duel.GetMatchingGroup(c33203018.filter0,tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local res=Duel.IsExistingMatchingCard(c33203018.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c33203018.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203018.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToChain() or c:IsImmuneToEffect(e) then return end
local mg=Duel.GetMatchingGroup(aux.NecroValleyFilter(c33203018.filter0),tp,LOCATION_HAND+LOCATION_MZONE+LOCATION_GRAVE,0,nil,e)
local sg1=Duel.GetMatchingGroup(c33203018.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg,nil,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c33203018.filter1,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg,e:GetHandler(),chkf)
tc:SetMaterial(mat1)
if mat1:IsExists(c33203018.fdfilter,1,nil) then
local cg=mat1:Filter(c33203018.fdfilter,nil)
Duel.ConfirmCards(1-tp,cg)
end
Duel.SendtoDeck(mat1,nil,SEQ_DECKTOP,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
local p=tp
for i=1,2 do
local dg=mat1:Filter(c33203018.seqfilter,nil,p)
if #dg>1 then
Duel.SortDecktop(tp,p,#dg)
end
for i=1,#dg do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
p=1-tp
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,e:GetHandler(),chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
function c33203018.fdfilter(c)
return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND)
end
function c33203018.seqfilter(c,tp)
return c:IsLocation(LOCATION_DECK) and c:IsControler(tp)
end
--缝合僵尸转换-幻影之力
function c33203019.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203019,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,33203019)
e1:SetHintTiming(0,TIMING_MAIN_END)
e1:SetCondition(c33203019.condition)
e1:SetCost(c33203019.cost)
e1:SetTarget(c33203019.target)
e1:SetOperation(c33203019.activate)
c:RegisterEffect(e1)
end
function c33203019.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2
end
function c33203019.cgfilter(c)
return c:IsSetCard(0x332b) and c:IsAbleToRemoveAsCost()
end
function c33203019.cefilter(c,tc,ct,e,tp)
if not c:IsType(TYPE_XYZ) then return false end
local r=c:GetRank()-tc:GetRank()
return c:IsSetCard(0x332b)
and tc:IsCanBeXyzMaterial(c) and r>0 and ct>=r
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function c33203019.cfilter(c,e,tp)
local ct=Duel.GetMatchingGroupCount(c33203019.cgfilter,tp,LOCATION_GRAVE,0,nil)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x332b) and c:IsFaceup()
and c:IsCanBeEffectTarget(e)
and Duel.IsExistingMatchingCard(c33203019.cefilter,tp,LOCATION_EXTRA,0,1,nil,c,ct,e,tp)
end
function c33203019.cost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(1)
if chk==0 then return true end
end
function c33203019.tgefilter(c,tc,e,tp,rank)
if not c:IsType(TYPE_XYZ) then return false end
local r=c:GetRank()-tc:GetRank()
return c:IsSetCard(0x332b)
and tc:IsCanBeXyzMaterial(c) and r==rank
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_XYZ,tp,false,false)
and Duel.GetLocationCountFromEx(tp,tp,tc,c)>0
end
function c33203019.tgfilter(c,e,tp,rank)
return c:IsType(TYPE_XYZ) and c:IsSetCard(0x332b)
and Duel.IsExistingMatchingCard(c33203019.tgefilter,tp,LOCATION_EXTRA,0,1,nil,c,e,tp,rank)
end
function c33203019.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c33203019.cfilter(chkc,e,tp) end
if chk==0 then
if e:GetLabel()==0 then return false end
e:SetLabel(0)
return Duel.IsExistingTarget(c33203019.cfilter,tp,LOCATION_MZONE,0,1,nil,e,tp)
end
e:SetLabel(0)
local avail={}
local availbool={}
local ct=Duel.GetMatchingGroupCount(c33203019.cgfilter,tp,LOCATION_GRAVE,0,nil)
local gfield=Duel.GetMatchingGroup(c33203019.cfilter,tp,LOCATION_MZONE,0,nil,e,tp)
for tc in aux.Next(gfield) do
local gextra=Duel.GetMatchingGroup(c33203019.cefilter,tp,LOCATION_EXTRA,0,nil,tc,ct,e,tp)
for ex in aux.Next(gextra) do
local r=ex:GetRank()-tc:GetRank()
if not availbool[r] then
availbool[r]=true
table.insert(avail,r)
end
end
end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(33203019,1))
local num=Duel.AnnounceNumber(tp,table.unpack(avail))
e:SetLabel(num)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local cost=Duel.SelectMatchingCard(tp,c33203019.cgfilter,tp,LOCATION_GRAVE,0,num,num,nil)
Duel.Remove(cost,POS_FACEUP,REASON_COST)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33203019.tgfilter,tp,LOCATION_MZONE,0,1,1,nil,e,tp,num)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203019.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if aux.MustMaterialCheck(tc,tp,EFFECT_MUST_BE_XMATERIAL) and tc:IsFaceup()
and tc:IsRelateToEffect(e) and tc:IsControler(tp) and not tc:IsImmuneToEffect(e) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203019.tgefilter,tp,LOCATION_EXTRA,0,1,1,nil,tc,e,tp,e:GetLabel())
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
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTarget(c33203019.splimit)
Duel.RegisterEffect(e1,tp)
end
function c33203019.splimit(e,c)
return not c:IsType(TYPE_XYZ) and c:IsLocation(LOCATION_EXTRA)
end
--堕天使 伊希塔布
function c33203020.initial_effect(c)
c:SetSPSummonOnce(33203020)
--cannot spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203020,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,33203020)
e1:SetCost(c33203020.drcost)
e1:SetTarget(c33203020.drtg)
e1:SetOperation(c33203020.drop)
c:RegisterEffect(e1)
--copy effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203020,1))
e2:SetCategory(CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetCountLimit(1,33213020)
e2:SetCost(c33203020.cpcost)
e2:SetTarget(c33203020.cptg)
e2:SetOperation(c33203020.cpop)
c:RegisterEffect(e2)
end
function c33203020.cfilter(c)
return c:IsSetCard(0x32b) and c:IsDiscardable()
end
function c33203020.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable()
and Duel.IsExistingMatchingCard(c33203020.cfilter,tp,LOCATION_HAND,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,c33203020.cfilter,tp,LOCATION_HAND,0,1,1,e:GetHandler())
g:AddCard(e:GetHandler())
Duel.SendtoGrave(g,REASON_DISCARD+REASON_COST)
end
function c33203020.drtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsPlayerCanDraw(tp,2) end
Duel.SetTargetPlayer(tp)
Duel.SetTargetParam(2)
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,2)
end
function c33203020.drop(e,tp,eg,ep,ev,re,r,rp)
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT)
end
function c33203020.cpcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,1000) end
Duel.PayLPCost(tp,1000)
end
function c33203020.cpfilter(c)
return c:IsSetCard(0x32b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToDeck() and c:CheckActivateEffect(false,true,false)~=nil
end
function c33203020.cptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then
local te=e:GetLabelObject()
local tg=te:GetTarget()
return tg and tg(e,tp,eg,ep,ev,re,r,rp,0,chkc)
end
if chk==0 then return Duel.IsExistingTarget(c33203020.cpfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g=Duel.SelectTarget(tp,c33203020.cpfilter,tp,LOCATION_GRAVE,0,1,1,nil)
local te,ceg,cep,cev,cre,cr,crp=g:GetFirst():CheckActivateEffect(false,true,true)
Duel.ClearTargetCard()
g:GetFirst():CreateEffectRelation(e)
local tg=te:GetTarget()
if tg then tg(e,tp,ceg,cep,cev,cre,cr,crp,1) end
te:SetLabelObject(e:GetLabelObject())
e:SetLabelObject(te)
Duel.ClearOperationInfo(0)
Duel.SetOperationInfo(0,CATEGORY_TODECK,g,1,0,0)
end
function c33203020.cpop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
if not te then return end
if not te:GetHandler():IsRelateToEffect(e) then return end
e:SetLabelObject(te:GetLabelObject())
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
Duel.SendtoDeck(te:GetHandler(),nil,SEQ_DECKSHUFFLE,REASON_EFFECT)
end
--缝合僵尸 双晓王 末法神
function c33203021.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x332b),8,2)
c:EnableReviveLimit()
--summon success
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetOperation(c33203021.sumsuc)
c:RegisterEffect(e1)
--destroy
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203021,0))
e2:SetCategory(CATEGORY_DESTROY)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1)
e2:SetCost(c33203021.cost)
e2:SetTarget(c33203021.destg)
e2:SetOperation(c33203021.desop)
c:RegisterEffect(e2)
--set
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203021,1))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCost(c33203021.cost)
e3:SetTarget(c33203021.settg)
e3:SetOperation(c33203021.setop)
c:RegisterEffect(e3)
end
function c33203021.sumsuc(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsSummonType(SUMMON_TYPE_XYZ) then return end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,1)
e1:SetValue(c33203021.aclimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabel(c:GetFieldID())
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_DISABLE)
e2:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e2:SetTarget(c33203021.disable)
e2:SetReset(RESET_PHASE+PHASE_END)
e2:SetLabel(c:GetFieldID())
Duel.RegisterEffect(e2,tp)
c:RegisterFlagEffect(33203021,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,c:GetFieldID())
end
function c33203021.aclimit(e,re,tp)
local rc=re:GetHandler()
return rc:IsOnField() and rc:GetFlagEffectLabel(33203021)~=e:GetLabel()
end
function c33203021.disable(e,c)
return c:GetFlagEffectLabel(33203021)~=e:GetLabel() and (not c:IsType(TYPE_MONSTER) or (c:IsType(TYPE_EFFECT) or bit.band(c:GetOriginalType(),TYPE_EFFECT)==TYPE_EFFECT))
end
function c33203021.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():CheckRemoveOverlayCard(tp,1,REASON_COST) end
e:GetHandler():RemoveOverlayCard(tp,1,1,REASON_COST)
end
function c33203021.desfilter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function c33203021.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203021.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
local g=Duel.GetMatchingGroup(c33203021.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,g:GetCount(),0,0)
end
function c33203021.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33203021.desfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
Duel.Destroy(g,REASON_EFFECT)
end
function c33203021.setfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsSSetable()
end
function c33203021.settg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_GRAVE) and c33203021.setfilter(chkc) end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0
and Duel.IsExistingTarget(c33203021.setfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SET)
local g=Duel.SelectTarget(tp,c33203021.setfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,g,1,0,0)
end
function c33203021.setop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SSet(tp,tc)
end
end
--缝合僵尸 混沌侠
function c33203022.initial_effect(c)
--fusion material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x332b),2,true)
--spsummon condition
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_SPSUMMON_CONDITION)
e1:SetValue(aux.fuslimit)
c:RegisterEffect(e1)
--attribute
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EFFECT_ADD_ATTRIBUTE)
e2:SetValue(ATTRIBUTE_LIGHT)
c:RegisterEffect(e2)
--negate
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203022,0))
e3:SetCategory(CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1)
e3:SetTarget(c33203022.target)
e3:SetOperation(c33203022.operation)
c:RegisterEffect(e3)
end
function c33203022.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and aux.NegateAnyFilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectTarget(tp,aux.NegateAnyFilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,1,0,0)
end
function c33203022.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if ((tc:IsFaceup() and not tc:IsDisabled()) or tc:IsType(TYPE_TRAPMONSTER)) and tc:IsRelateToEffect(e) then
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)
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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
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+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3)
end
end
end
--星辰之缝合僵尸
function c33203023.initial_effect(c)
--special summon
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SPSUM_PARAM)
e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetRange(LOCATION_HAND)
e1:SetTargetRange(POS_FACEUP_DEFENSE,0)
e1:SetCountLimit(1,33203023+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(c33203023.spcon)
e1:SetValue(c33203023.spval)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203023,0))
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_CARD_TARGET)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetCountLimit(1,33213023)
e2:SetCondition(c33203023.thcon)
e2:SetTarget(c33203023.thtg)
e2:SetOperation(c33203023.thop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
end
function c33203023.spcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local zone=Duel.GetLinkedZone(tp)
return Duel.GetLocationCount(tp,LOCATION_MZONE,tp,LOCATION_REASON_TOFIELD,zone)>0
end
function c33203023.spval(e,c)
return 0,Duel.GetLinkedZone(c:GetControler())
end
function c33203023.thcon(e,tp,eg,ep,ev,re,r,rp)
local lg1=Duel.GetLinkedGroup(tp,1,1)
local lg2=Duel.GetLinkedGroup(1-tp,1,1)
lg1:Merge(lg2)
return lg1 and lg1:IsContains(e:GetHandler())
end
function c33203023.thfilter(c)
return c:IsSetCard(0x332b) and not c:IsCode(33203023) and c:IsAbleToHand()
end
function c33203023.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c33203023.thfilter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33203023.thfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c33203023.thfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c33203023.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
--缝合僵尸的歌姬 索普拉诺
function c33203024.initial_effect(c)
--tohand
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_DAMAGE_STEP)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,33203024)
e1:SetTarget(c33203024.thtg)
e1:SetOperation(c33203024.thop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(c33203024.target)
e2:SetOperation(c33203024.operation)
c:RegisterEffect(e2)
end
function c33203024.filter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_MONSTER) and not c:IsCode(33203024) and c:IsAbleToHand()
end
function c33203024.thtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsControler(tp) and c33203024.filter(chkc) end
if chk==0 then return Duel.IsExistingTarget(c33203024.filter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectTarget(tp,c33203024.filter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,g,1,0,0)
end
function c33203024.thop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc and tc:IsRelateToEffect(e) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
end
end
function c33203024.filter1(c,e)
return c:IsOnField() and not c:IsImmuneToEffect(e)
end
function c33203024.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x332b) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
function c33203024.target(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(Card.IsOnField,nil)
local res=Duel.IsExistingMatchingCard(c33203024.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c33203024.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203024.operation(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(c33203024.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(c33203024.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c33203024.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,c,chkf)
tc:SetMaterial(mat1)
Duel.SendtoGrave(mat1,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION)
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg2,c,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
end
--缝合僵尸 凤梨食虫谷精游走鲸
function c33203025.initial_effect(c)
--Fusion Material
c:EnableReviveLimit()
aux.AddFusionProcFunRep(c,aux.FilterBoolFunction(Card.IsFusionSetCard,0x332b),2,true)
--To Hand
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203025,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,33203025)
e1:SetCondition(c33203025.thcon)
e1:SetTarget(c33203025.thtg)
e1:SetOperation(c33203025.thop)
c:RegisterEffect(e1)
--Special Summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203025,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RELEASE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,33213025)
e2:SetTarget(c33203025.sptg)
e2:SetOperation(c33203025.spop)
c:RegisterEffect(e2)
end
function c33203025.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_FUSION)
end
function c33203025.thfilter(c)
return c:IsAbleToHand() and c:IsSetCard(0x332b) and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA))
end
function c33203025.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203025.thfilter,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA)
end
function c33203025.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33203025.thfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_EXTRA,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c33203025.relfilter(c,tp)
return c:IsReleasableByEffect() and (c:GetCounter(0x132b)>0 or c:IsControler(tp)) and Duel.GetMZoneCount(tp,c)>0
end
function c33203025.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33203025.sptg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and c33203025.relfilter(chkc,tp) end
if chk==0 then return Duel.IsExistingTarget(c33203025.relfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,nil,tp)
and Duel.IsExistingMatchingCard(c33203025.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectTarget(tp,c33203025.relfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33203025.spop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and not tc:IsImmuneToEffect(e)
and Duel.Release(tc,REASON_EFFECT)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203025.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--缝合僵尸 脉冲灭火员
local s,id,o=GetID()
function s.initial_effect(c)
--cannot activate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(id,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,id)
e1:SetTarget(s.ntg)
e1:SetOperation(s.nop)
c:RegisterEffect(e1)
--special summon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_HAND+LOCATION_MZONE)
e2:SetCountLimit(1,id+10000)
e2:SetCondition(s.spcon)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
end
function s.nfilter(c)
return c:IsFaceup() and c:IsType(TYPE_EFFECT)
end
function s.ntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.nfilter,tp,0,LOCATION_MZONE,1,nil) end
end
function s.nop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(s.nfilter,tp,0,LOCATION_MZONE,nil)
if g:GetCount()>0 then
local tg=g:GetMaxGroup(Card.GetAttack)
local tc
if tg:GetCount()>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
local sg=tg:Select(tp,1,1,nil)
Duel.HintSelection(sg)
tc=sg:GetFirst()
else
Duel.HintSelection(tg)
tc=tg:GetFirst()
end
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TRIGGER)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1,true)
end
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsActiveType(TYPE_MONSTER) and re:GetActivateLocation()==LOCATION_MZONE
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsReleasable() and Duel.GetMZoneCount(tp,c)>0 end
Duel.Release(c,REASON_COST)
end
function s.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsRace(RACE_MACHINE)
and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function s.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function s.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetMZoneCount(tp)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,s.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
--缝合僵尸的预言者 梅林
function c33203027.initial_effect(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,33203027)
e1:SetCost(c33203027.spcost)
e1:SetTarget(c33203027.sptg)
e1:SetOperation(c33203027.spop)
c:RegisterEffect(e1)
--synchro effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203027,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_GRAVE)
e2:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e2:SetCountLimit(1,33213027)
e2:SetCost(aux.bfgcost)
e2:SetTarget(c33203027.sctg)
e2:SetOperation(c33203027.scop)
c:RegisterEffect(e2)
--xyz effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(33203027,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_GRAVE)
e3:SetHintTiming(0,TIMING_END_PHASE+TIMINGS_CHECK_MONSTER)
e3:SetCountLimit(1,33220327)
e3:SetCost(aux.bfgcost)
e3:SetTarget(c33203027.xyztg)
e3:SetOperation(c33203027.xyzop)
c:RegisterEffect(e3)
Duel.AddCustomActivityCounter(33203027,ACTIVITY_SPSUMMON,c33203027.counterfilter)
end
function c33203027.counterfilter(c)
return c:IsSetCard(0x332b)
end
function c33203027.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable()
and Duel.GetCustomActivityCount(33203027,tp,ACTIVITY_SPSUMMON)==0 end
Duel.Release(e:GetHandler(),REASON_COST)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
e1:SetTargetRange(1,0)
e1:SetTarget(c33203027.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function c33203027.splimit(e,c,sump,sumtype,sumpos,targetp,se)
return not c:IsSetCard(0x332b)
end
function c33203027.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c33203027.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>-1
and Duel.IsExistingMatchingCard(c33203027.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33203027.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c33203027.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
function c33203027.scfilter(c)
return c:IsSetCard(0x332b) and c:IsSynchroSummonable(nil)
end
function c33203027.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203027.scfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203027.scop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33203027.scfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.SynchroSummon(tp,sg:GetFirst(),nil)
end
end
function c33203027.xyzfilter(c)
return c:IsSetCard(0x332b) and c:IsXyzSummonable(nil)
end
function c33203027.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203027.xyzfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c33203027.xyzop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(c33203027.xyzfilter,tp,LOCATION_EXTRA,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,tg:GetFirst(),nil)
end
end
--雷兽龙-缝合僵尸
function c33203028.initial_effect(c)
--recycle
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203028,0))
e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,33203028)
e1:SetCost(c33203028.cost)
e1:SetTarget(c33203028.target)
e1:SetOperation(c33203028.operation)
c:RegisterEffect(e1)
c33203028.discard_effect=e1
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203028,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,33203028)
e2:SetTarget(c33203028.sptg)
e2:SetOperation(c33203028.spop)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EVENT_TO_GRAVE)
e3:SetCondition(c33203028.spcon)
c:RegisterEffect(e3)
end
function c33203028.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 c33203028.filter(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsSetCard(0x332b) and not c:IsCode(33203028) and c:IsAbleToHand()
end
function c33203028.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chk==0 then return Duel.IsExistingMatchingCard(c33203028.filter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
end
function c33203028.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(c33203028.filter),tp,LOCATION_GRAVE+LOCATION_REMOVED,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function c33203028.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
end
function c33203028.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function c33203028.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(c33203028.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c33203028.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,c33203028.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp):GetFirst()
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(33203028,RESET_EVENT+RESETS_STANDARD,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetLabel(fid)
e1:SetLabelObject(tc)
e1:SetCondition(c33203028.thcon)
e1:SetOperation(c33203028.thop)
Duel.RegisterEffect(e1,tp)
end
end
function c33203028.thcon(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
if tc:GetFlagEffectLabel(33203028)~=e:GetLabel() then
e:Reset()
return false
else return true end
end
function c33203028.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoHand(e:GetLabelObject(),nil,REASON_EFFECT)
end
--缝合僵尸骑士-毒枪龙骑士
function c33203029.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsSetCard,0x332b),aux.NonTuner(nil),1)
c:EnableReviveLimit()
--negate
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(33203029,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_CHAINING)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,33203029)
e1:SetCondition(c33203029.negcon)
e1:SetCost(c33203029.negcost)
e1:SetTarget(aux.nbtg)
e1:SetOperation(c33203029.negop)
c:RegisterEffect(e1)
--remove
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(33203029,1))
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCategory(CATEGORY_REMOVE)
e2:SetCode(EVENT_BATTLED)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,88234822)
e2:SetCondition(c33203029.rmcon)
e2:SetTarget(c33203029.rmtg)
e2:SetOperation(c33203029.rmop)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCode(EVENT_DESTROYED)
e3:SetCountLimit(1,88234823)
e3:SetCondition(c33203029.descon)
e3:SetTarget(c33203029.destg)
e3:SetOperation(c33203029.desop)
c:RegisterEffect(e3)
end
function c33203029.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x332b) and c:IsAbleToRemoveAsCost()
end
function c33203029.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED) and Duel.IsChainNegatable(ev) and re:IsActiveType(TYPE_MONSTER)
end
function c33203029.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c33203029.cfilter,tp,LOCATION_GRAVE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c33203029.cfilter,tp,LOCATION_GRAVE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c33203029.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) and re:GetHandler():IsRelateToEffect(re) then
Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)
end
end
function c33203029.rmcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
e:SetLabelObject(bc)
return bc and bc:IsStatus(STATUS_BATTLE_DESTROYED) and c:IsStatus(STATUS_OPPO_BATTLE) and bc:IsControler(1-tp) and bc:IsRelateToBattle()
end
function c33203029.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local bc=e:GetLabelObject()
if chk==0 then return bc:IsAbleToRemove() end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,bc,1,0,0)
end
function c33203029.rmop(e,tp,eg,ep,ev,re,r,rp)
local bc=e:GetLabelObject()
if bc:IsRelateToBattle() and bc:IsControler(1-tp) then
Duel.Remove(bc,POS_FACEUP,REASON_EFFECT)
end
end
function c33203029.descon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return rp==1-tp and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE) and c:IsSummonType(SUMMON_TYPE_SYNCHRO)
end
function c33203029.destg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsType,tp,0,LOCATION_ONFIELD,1,nil,TYPE_SPELL+TYPE_TRAP) end
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
end
function c33203029.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
Duel.Destroy(g,REASON_EFFECT)
end
local m=4865004
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,cm.mfilter,1,1)
c:EnableReviveLimit()
--search
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.thcon)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_MATERIAL_CHECK)
e2:SetValue(cm.valcheck)
e2:SetLabelObject(e1)
c:RegisterEffect(e2)
--cannot be battle traget
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetCode(EFFECT_IGNORE_BATTLE_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(1)
c:RegisterEffect(e3)
--spsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_RECOVER)
e4:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e4:SetCode(EVENT_DAMAGE)
e4:SetProperty(EFFECT_FLAG_DELAY+EFFECT_FLAG_DAMAGE_STEP)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1)
e4:SetCondition(cm.spcon)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
c:RegisterEffect(e4)
end
function cm.mfilter(c)
return c:IsLevelBelow(4) and c:IsLinkSetCard(0x332b)
end
function cm.valcheck(e,c)
local g=c:GetMaterial()
if g:IsExists(Card.IsLinkSetCard,1,nil,0x332b) then
e:GetLabelObject():SetLabel(1)
else
e:GetLabelObject():SetLabel(0)
end
end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsSummonType(SUMMON_TYPE_LINK) and c:GetSequence()>4 and e:GetLabel()==1
end
function cm.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return ep==tp and bit.band(r,REASON_BATTLE+REASON_EFFECT)~=0
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.Recover(tp,ev,REASON_EFFECT)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
if #g>0 then
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)
end
end
end
local m=4865007
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DAMAGE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--destroy replace
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EFFECT_DESTROY_REPLACE)
e2:SetRange(LOCATION_GRAVE)
e2:SetTarget(cm.reptg)
e2:SetValue(cm.repval)
e2:SetOperation(cm.repop)
c:RegisterEffect(e2)
end
function cm.spfilter(c,e,tp,check)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and (check or c:IsCode(4865010))
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x332b)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local check=Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,check) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_DAMAGE,nil,0,tp,1000)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then
local check=Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,check)
local tc=g:GetFirst()
if tc and Duel.SpecialSummonStep(tc,0,tp,tp,false,false,POS_FACEUP) then
Duel.Damage(tp,1000,REASON_EFFECT)
end
Duel.SpecialSummonComplete()
end
if not e:IsHasType(EFFECT_TYPE_ACTIVATE) then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsSetCard(0x332b) and c:IsLocation(LOCATION_EXTRA)
end
function cm.repfilter(c,tp)
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE) and c:IsControler(tp) and c:IsRace(RACE_PLANT) and c:IsType(TYPE_LINK)
and (c:IsReason(REASON_BATTLE) or (c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp)) 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=4865008
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
c:EnableReviveLimit()
aux.AddLinkProcedure(c,cm.matfilter,1,1)
--effect
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.effcon)
e1:SetTarget(cm.efftg)
e1:SetOperation(cm.effop)
c:RegisterEffect(e1)
--activate from hand
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_QP_ACT_IN_NTPHAND)
e2:SetRange(LOCATION_MZONE)
e2:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x332b))
e2:SetTargetRange(LOCATION_HAND,0)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e3)
end
function cm.matfilter(c)
return c:IsLevelBelow(8) and c:IsLinkSetCard(0x332b)
end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.thfilter(c)
return c:IsSetCard(0x332b) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.efftg(e,tp,eg,ep,ev,re,r,rp,chk)
local b1=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
local b2=Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp)
if chk==0 then return b1 or b2 end
local op=0
if b1 and b2 then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b1 then op=Duel.SelectOption(tp,aux.Stringid(m,0))
else op=Duel.SelectOption(tp,aux.Stringid(m,1))+1 end
e:SetLabel(op)
if op==0 then
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,0))
e:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
else
Duel.Hint(HINT_OPSELECTED,1-tp,aux.Stringid(m,1))
e:SetCategory(CATEGORY_SPECIAL_SUMMON)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
end
function cm.effop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabel()==0 then
local ct=Duel.GetFieldGroupCount(tp,0,LOCATION_MZONE)
local g=Duel.GetMatchingGroup(cm.thfilter,tp,LOCATION_DECK,0,nil)
if ct<=0 or g:GetCount()==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,ct)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
else
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ct=Duel.GetMatchingGroupCount(Card.IsType,tp,0,LOCATION_ONFIELD,nil,TYPE_SPELL+TYPE_TRAP)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
if ft<=0 or ct<=0 or g:GetCount()==0 then return end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:SelectSubGroup(tp,aux.dncheck,false,1,math.min(ft,ct))
Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP)
end
end
local m=4865010
local cm=_G["c"..m]
function cm.initial_effect(c)
--to hand or grave
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_TOGRAVE)
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SUMMON_SUCCESS)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e2)
--destroy
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetCategory(CATEGORY_DESTROY+CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1)
e3:SetTarget(cm.destg)
e3:SetOperation(cm.desop)
c:RegisterEffect(e3)
end
function cm.cfilter(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x332b) and (c:IsAbleToHand() or c:IsAbleToGrave())
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
local tc=g:GetFirst()
if tc and tc:IsAbleToHand() and (not tc:IsAbleToGrave() or Duel.SelectOption(tp,1190,1191)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,tc)
else
Duel.SendtoGrave(tc,REASON_EFFECT)
end
end
end
function cm.desfilter(c)
return c:IsFaceup() and c:IsLevelBelow(4) and c:IsSetCard(0x332b)
end
function cm.spfilter(c,e,tp)
return c:IsSetCard(0x332b) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP_DEFENSE)
end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE) and cm.desfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(cm.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,c)
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectTarget(tp,cm.desfilter,tp,LOCATION_MZONE,LOCATION_MZONE,1,1,c)
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,1,0,0)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_GRAVE)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.Destroy(tc,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP_DEFENSE)
end
end
end
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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