Commit 1029c59e authored by POLYMER's avatar POLYMER

update plus

parent ad3c8748
......@@ -5191,6 +5191,20 @@
67200553 0
67200600 0
88881036 0
98920127 0
98920156 0
98920210 0
98920308 0
98920310 0
98920348 0
98920384 0
98920473 0
98920645 0
98920659 0
98920673 0
98940045 0
98941043 0
98941048 0
#limit
33403513 1
82204250 1
......
No preview for this file type
expansions/pics/11451475.jpg

11.8 KB | W: | H:

expansions/pics/11451475.jpg

49.9 KB | W: | H:

expansions/pics/11451475.jpg
expansions/pics/11451475.jpg
expansions/pics/11451475.jpg
expansions/pics/11451475.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451521.jpg

48 KB | W: | H:

expansions/pics/11451521.jpg

194 KB | W: | H:

expansions/pics/11451521.jpg
expansions/pics/11451521.jpg
expansions/pics/11451521.jpg
expansions/pics/11451521.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451522.jpg

62.4 KB | W: | H:

expansions/pics/11451522.jpg

237 KB | W: | H:

expansions/pics/11451522.jpg
expansions/pics/11451522.jpg
expansions/pics/11451522.jpg
expansions/pics/11451522.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451523.jpg

47.4 KB | W: | H:

expansions/pics/11451523.jpg

182 KB | W: | H:

expansions/pics/11451523.jpg
expansions/pics/11451523.jpg
expansions/pics/11451523.jpg
expansions/pics/11451523.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451524.jpg

49.6 KB | W: | H:

expansions/pics/11451524.jpg

189 KB | W: | H:

expansions/pics/11451524.jpg
expansions/pics/11451524.jpg
expansions/pics/11451524.jpg
expansions/pics/11451524.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451525.jpg

59.3 KB | W: | H:

expansions/pics/11451525.jpg

239 KB | W: | H:

expansions/pics/11451525.jpg
expansions/pics/11451525.jpg
expansions/pics/11451525.jpg
expansions/pics/11451525.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451526.jpg

65.2 KB | W: | H:

expansions/pics/11451526.jpg

242 KB | W: | H:

expansions/pics/11451526.jpg
expansions/pics/11451526.jpg
expansions/pics/11451526.jpg
expansions/pics/11451526.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451527.jpg

64.7 KB | W: | H:

expansions/pics/11451527.jpg

233 KB | W: | H:

expansions/pics/11451527.jpg
expansions/pics/11451527.jpg
expansions/pics/11451527.jpg
expansions/pics/11451527.jpg
  • 2-up
  • Swipe
  • Onion skin
expansions/pics/11451605.jpg

50.6 KB | W: | H:

expansions/pics/11451605.jpg

264 KB | W: | H:

expansions/pics/11451605.jpg
expansions/pics/11451605.jpg
expansions/pics/11451605.jpg
expansions/pics/11451605.jpg
  • 2-up
  • Swipe
  • Onion skin
--无名绝路
local cm,m=GetID()
function cm.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetTarget(cm.target)
e1:SetOperation(cm.op)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_DECK)
e2:SetCondition(cm.condition)
e2:SetCost(cm.cost)
c:RegisterEffect(e2)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_ACTIVATE_COST)
e4:SetRange(LOCATION_DECK)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetTargetRange(1,0)
e4:SetTarget(cm.actarget)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_FIELD)
e5:SetCode(EFFECT_SPSUMMON_PROC_G)
e5:SetRange(LOCATION_DECK)
e5:SetCondition(cm.condition)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
e1:SetReset(RESET_CHAIN)
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()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetCurrentPhase()==PHASE_MAIN1 and not Duel.CheckPhaseActivity()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
g:RemoveCard(e:GetHandler())
return #g>0 and g:FilterCount(Card.IsAbleToDeckAsCost,nil)==#g
end
local g=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
Duel.SendtoDeck(g,nil,2,REASON_COST)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then Duel.SetChainLimit(aux.FALSE) end
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local e0=Effect.CreateEffect(e:GetHandler())
e0:SetDescription(aux.Stringid(m,0))
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_PHASE+PHASE_END)
e0:SetCountLimit(1)
e0:SetReset(RESET_PHASE+PHASE_END)
e0:SetOperation(cm.spop)
Duel.RegisterEffect(e0,tp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetLabelObject(e0)
e1:SetCondition(function(e,tp) return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)==0 end)
e1:SetOperation(cm.drop)
Duel.RegisterEffect(e1,tp)
end
function cm.drop(e,tp,eg,ep,ev,re,r,rp)
local phase=Duel.GetCurrentPhase()
local c=e:GetHandler()
if (phase==PHASE_DAMAGE and not Duel.IsDamageCalculated()) or phase==PHASE_DAMAGE_CAL then return end
Duel.Draw(tp,1,REASON_EFFECT)
local lab=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(lab+1)
Duel.Readjust()
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SetLP(tp,Duel.GetLP(tp)-2000*e:GetLabel())
end
\ No newline at end of file
......@@ -57,6 +57,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -65,9 +66,12 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge0,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
local _NegateActivation=Duel.NegateActivation
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -76,7 +80,55 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
function Duel.NegateActivation(ev)
local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
--tograve
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
return _NegateActivation(ev)
end
end
return _NegateActivation(ev)
end
end
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
......@@ -155,7 +207,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_DISABLE)
e4:SetRange(LOCATION_ONFIELD)
e4:SetTargetRange(LOCATION_SZONE,LOCATION_SZONE)
e4:SetTargetRange(LOCATION_ONFIELD,LOCATION_ONFIELD)
e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetTarget(cm.distg)
e4:SetReset(RESET_PHASE+PHASE_END+RESET_EVENT+RESETS_STANDARD)
......@@ -181,11 +233,11 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end
function cm.distg(e,c)
local tp=e:GetHandlerPlayer()
return c:IsType(TYPE_SPELL+TYPE_TRAP) and aux.GetColumn(c,tp)==aux.GetColumn(e:GetHandler(),tp)
return c:IsType(TYPE_SPELL+TYPE_TRAP) and not c:IsType(TYPE_TRAPMONSTER) and aux.GetColumn(c,tp)==aux.GetColumn(e:GetHandler(),tp)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local loc,seq=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SEQUENCE)
if loc&LOCATION_SZONE~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and seq==aux.GetColumn(e:GetHandler(),rp) then
if loc&LOCATION_ONFIELD~=0 and seq<=4 and re:IsActiveType(TYPE_SPELL+TYPE_TRAP) and seq==aux.GetColumn(e:GetHandler(),rp) and not re:GetHandler():IsType(TYPE_TRAPMONSTER) then
Duel.NegateEffect(ev)
end
end
......@@ -196,7 +248,8 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
c:CreateEffectRelation(te)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetCode(EFFECT_ADD_TYPE)
......@@ -211,7 +264,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -222,38 +275,24 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) 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
......@@ -277,7 +316,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,cm.desfilter,tp,LOCATION_DECK+LOCATION_ONFIELD,0,1,1,nil)
if #g>0 then
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
Duel.Destroy(g,REASON_EFFECT)
end
end
......@@ -298,7 +337,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
......@@ -67,6 +67,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -75,9 +76,12 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge0,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
local _NegateActivation=Duel.NegateActivation
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -86,6 +90,54 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
function Duel.NegateActivation(ev)
local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
--tograve
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
return _NegateActivation(ev)
end
end
return _NegateActivation(ev)
end
end
end
local KOISHI_CHECK=false
......@@ -127,6 +179,8 @@ function cm.tdfilter(c,lab)
return c:IsLocation(LOCATION_DECK) and fid and fid==lab
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
--Debug.Message(Duel.GetChainInfo(0,CHAININFO_EXTTYPE))
--Debug.Message(Duel.GetChainInfo(0,CHAININFO_TRIGGERING_LOCATION))
local c=e:GetHandler()
local g0=Duel.GetFieldGroup(tp,0,LOCATION_HAND)
Duel.ConfirmCards(tp,g0)
......@@ -195,6 +249,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -210,7 +265,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -221,38 +276,24 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) 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
......@@ -302,7 +343,10 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
--Duel.SendtoHand(cm[1],0,REASON_EFFECT)
e:Reset()
end
\ No newline at end of file
......@@ -56,6 +56,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -64,9 +65,12 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge0,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
local _NegateActivation=Duel.NegateActivation
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -75,6 +79,54 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
function Duel.NegateActivation(ev)
local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
--tograve
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
return _NegateActivation(ev)
end
end
return _NegateActivation(ev)
end
end
end
local KOISHI_CHECK=false
......@@ -142,6 +194,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -157,7 +210,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -168,38 +221,24 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) 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
......@@ -240,7 +279,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
......@@ -58,6 +58,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -66,9 +67,12 @@ function cm.initial_effect(c)
Duel.RegisterEffect(ge0,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
local _NegateActivation=Duel.NegateActivation
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -77,6 +81,54 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
function Duel.NegateActivation(ev)
local re=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
--tograve
local e1=Effect.CreateEffect(rc)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_CANNOT_TO_DECK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1)
return _NegateActivation(ev)
end
end
return _NegateActivation(ev)
end
end
end
local KOISHI_CHECK=false
......@@ -148,6 +200,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -163,7 +216,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -174,38 +227,24 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) 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
......@@ -258,7 +297,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(0)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -45,8 +46,15 @@ function cm.initial_effect(c)
e2:SetTarget(cm.drtg)
e2:SetOperation(cm.drop)
c:RegisterEffect(e2)
--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)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -61,9 +69,11 @@ function cm.initial_effect(c)
--Duel.RegisterEffect(ge1,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -72,6 +82,38 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
end
end
local KOISHI_CHECK=false
......@@ -134,8 +176,19 @@ function cm.thfilter(c)
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
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAINING)
e2:SetOperation(cm.rsop111)
e2:SetReset(RESET_CHAIN)
--Duel.RegisterEffect(e2,tp)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.rsop111(e,tp,eg,ep,ev,re,r,rp)
Debug.Message(e:GetHandler():IsAbleToHand())
e:GetHandler():SetStatus(STATUS_LEAVE_CONFIRMED,false)
e:Reset()
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -157,6 +210,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.Release(sg,REASON_COST)
Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -172,7 +226,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -183,26 +237,24 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
rc:SetStatus(STATUS_LEAVE_CONFIRMED,false)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
......@@ -228,7 +280,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
......@@ -5,6 +5,7 @@ function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetRange(0)
c:RegisterEffect(e0)
--Activate
local e1=Effect.CreateEffect(c)
......@@ -39,19 +40,33 @@ function cm.initial_effect(c)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
--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)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local ge0=Effect.CreateEffect(c)
ge0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
ge0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge0:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge0:SetOperation(cm.geop)
Duel.RegisterEffect(ge0,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_MOVE)
ge1:SetOperation(cm.regop)
Duel.RegisterEffect(ge1,0)
local _IsActiveType=Effect.IsActiveType
local _GetActiveType=Effect.GetActiveType
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
function Effect.GetActiveType(e)
local cost=e:GetCost()
if cost and cost==cm.cost then
if e:GetDescription()==aux.Stringid(m,0) then
return TYPE_TRAP
end
return _GetActiveType(e)
......@@ -60,8 +75,47 @@ function cm.initial_effect(c)
local typ2=e:GetActiveType()
return typ&typ2~=0
end
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_MZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_TRAP
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
end
end
function cm.etofilter(c)
return c:IsPreviousLocation(LOCATION_EXTRA) and c:IsOnField()
end
function cm.regop(e,tp,eg,ep,ev,re,r,rp)
local g=eg:Filter(cm.etofilter,nil)
g:ForEach(Card.RegisterFlagEffect,m-2,RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET,0,1)
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -78,7 +132,7 @@ function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
function cm.tdfilter(c)
return c:GetPreviousLocation()==LOCATION_EXTRA and c:IsAbleToHand()
return c:GetFlagEffect(m-2)>0 and c:IsAbleToHand()
end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and Duel.GetMZoneCount(tp)>0
......@@ -115,6 +169,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_MZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
......@@ -130,7 +185,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -141,31 +196,28 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e2,tp)
--control
local e3=Effect.CreateEffect(c)
e3:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_CHAIN)
c:RegisterEffect(e3,true)
local e4=e2:Clone()
e4:SetCode(EVENT_CHAINING)
e4:SetLabelObject(e2)
e4:SetOperation(function(e) e:GetLabelObject():Reset() end)
Duel.RegisterEffect(e4,tp)
e3:SetType(EFFECT_TYPE_FIELD)
e3:SetCode(EFFECT_SET_CONTROL)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_IGNORE_IMMUNE+EFFECT_FLAG_SET_AVAILABLE)
e3:SetLabel(c:GetFieldID())
e3:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e3:SetTarget(function(se,sc) return se:GetLabel()==sc:GetFieldID() end)
e3:SetValue(tp)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
Duel.RegisterEffect(e3,tp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
rc:SetStatus(STATUS_LEAVE_CONFIRMED,false)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
rc:CancelToGrave(false)
end
re:Reset()
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
Debug.Message(re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE))
return re:IsActiveType(TYPE_TRAP) and re:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.mvfilter(c,tp)
......@@ -209,7 +261,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
......@@ -12,11 +12,16 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_EXTRA+LOCATION_SZONE)
e1:SetRange(LOCATION_SZONE)
e1:SetLabelObject(e0)
--e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_EXTRA)
c:RegisterEffect(e3)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_ACTIVATE_COST)
......@@ -35,6 +40,24 @@ function cm.initial_effect(c)
e5:SetRange(0xff)
e5:SetValue(TYPE_FUSION)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.valcheck(e,c)
local g=c:GetMaterial()
......@@ -58,14 +81,16 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
if #cg>0 then Duel.ConfirmCards(1-c:GetControler(),cg) end
c:SetMaterial(g)
Duel.SendtoDeck(g,nil,2,REASON_COST+REASON_MATERIAL)
Duel.BreakEffect()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -77,7 +102,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......@@ -87,6 +112,15 @@ end
function cm.spfilter(c,e,tp)
return c:IsCode(11451406) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>0 or not e:GetHandler():IsLocation(LOCATION_EXTRA) end
local c=e:GetHandler()
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_ONFIELD+LOCATION_GRAVE,0,3,3,nil)
local cg=g:Filter(Card.IsFacedown,nil)
if #cg>0 then Duel.ConfirmCards(1-c:GetControler(),cg) end
c:SetMaterial(g)
Duel.SendtoDeck(g,nil,2,REASON_COST+REASON_MATERIAL)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.spfilter,tp,LOCATION_DECK,0,nil,e,tp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and #g>0
......
This diff is collapsed.
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DRAW)
......@@ -50,7 +50,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -77,7 +77,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -98,7 +108,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -114,7 +134,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -125,8 +145,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -147,11 +171,16 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
......@@ -43,14 +43,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -77,7 +77,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -98,7 +108,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -114,7 +134,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -125,8 +145,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -147,14 +171,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_DESTROY)
......@@ -44,14 +44,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -78,7 +78,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -99,7 +109,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -115,7 +135,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -126,8 +146,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -148,14 +172,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
......@@ -43,14 +43,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -77,7 +77,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -98,7 +108,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -114,7 +134,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -125,8 +145,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -147,14 +171,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -42,14 +42,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -76,7 +76,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -97,7 +107,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -113,7 +133,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -124,8 +144,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -146,14 +170,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -23,7 +23,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--only
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
......@@ -42,14 +42,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -76,7 +76,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -97,7 +107,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -113,7 +133,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -124,8 +144,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -146,14 +170,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -47,7 +47,7 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
c:RegisterEffect(e2)
--c:RegisterEffect(e2)
--setname
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
......@@ -116,14 +116,14 @@ function cm.seqfilter(c)
end
function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil)
local tg=Duel.GetMatchingGroup(cm.seqfilter,tp,LOCATION_SZONE,0,nil,tp)
local num=0
if Duel.CheckLocation(tp,LOCATION_PZONE,0) then num=num+1 end
if Duel.CheckLocation(tp,LOCATION_PZONE,1) then num=num+1 end
if chk==0 then return (#Group.__band(tg,eg)>0 or num>0) and eg:IsExists(cm.repfilter,1,c,tp) end
local g=eg:Filter(cm.repfilter,c,tp)
if Duel.GetFlagEffect(tp,m)~=0 then return false end
Duel.HintSelection(g)
if g:IsExists(Card.IsOnField,1,nil) then Duel.HintSelection(g) end
if not Duel.SelectYesNo(tp,aux.Stringid(m,0)) then return false end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
if #g>1 then
......@@ -150,7 +150,17 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,3))
......@@ -171,7 +181,17 @@ function cm.adjustop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
Duel.MoveToField(tc,tp,tp,LOCATION_PZONE,POS_FACEUP,true)
end
Duel.RaiseSingleEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_CUSTOM+m)
e2:SetLabel(fid)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetTarget(cm.psptg)
e2:SetOperation(cm.pspop)
e2:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e2,tp)
Duel.RaiseEvent(c,EVENT_CUSTOM+m,e,fid,0,0,0)
end
function cm.PConditionFilter(c,e,tp,lscale,rscale,eset)
local lv=0
......@@ -187,7 +207,7 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c=e:GetHandler()
local ph=Duel.GetCurrentPhase()
if not r or r~=c:GetFieldID() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
if not r or r~=e:GetLabel() or ph==PHASE_DAMAGE or ph==PHASE_DAMAGE_CAL then return false end
local lpz=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or lpz==nil then return false end
......@@ -198,8 +218,12 @@ function cm.psptg(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
local g=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
local res=g:IsExists(aux.PConditionFilter,1,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
......@@ -220,14 +244,25 @@ function cm.pspop(e,tp,eg,ep,ev,re,r,rp)
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
if loc==0 then return false end
local tg=Duel.GetMatchingGroup(Card.IsSetCard,tp,loc,0,nil,0x97c)
tg=tg:Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale,nil)
local tg=Duel.GetMatchingGroup(nil,tp,loc,0,nil)
local _PendulumChecklist=aux.PendulumChecklist
aux.PendulumChecklist=0
tg=tg:Filter(aux.PConditionFilter,nil,e,tp,lscale,rscale,nil)
aux.PendulumChecklist=_PendulumChecklist
if #tg==0 then return false end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:SelectSubGroup(tp,aux.PendOperationCheck,false,1,1,ft1,ft2,ft)
aux.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,aux.TRUE,true,1,1)
aux.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(lpz))
Duel.HintSelection(Group.FromCards(rpz))
--[[for tc in aux.Next(g) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(g) do tc:CompleteProcedure() end--]]
local tc=g:GetFirst()
if not tc.pendulum_rule then
local e1=Effect.CreateEffect(tc)
......
......@@ -67,6 +67,24 @@ function cm.initial_effect(c)
e11:SetTarget(cm.actarget)
e11:SetOperation(cm.costop)
c:RegisterEffect(e11)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.filter(c,event)
if not (c:IsCanOverlay(tp) and c:GetType()&0x100004==0x100004) then return false end
......@@ -131,6 +149,7 @@ function cm.efop(e,tp,eg,ep,ev,re,r,rp)
local tg=te:GetTarget()
local op=te:GetOperation()
local e1=Effect.CreateEffect(oc)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(te:GetCategory())
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
......@@ -161,6 +180,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
local tc=te:GetHandler()
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=tc:GetSequence()
e:GetHandler():RegisterFlagEffect(m+1,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
tc:CreateEffectRelation(te)
local c=e:GetHandler()
......@@ -168,7 +188,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -180,7 +200,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -15,6 +15,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCondition(cm.condition2)
e2:SetCost(cm.cost)
......@@ -51,8 +52,45 @@ function cm.initial_effect(c)
ge0:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge0:SetOperation(cm.geop)
Duel.RegisterEffect(ge0,0)
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
local _GetChainInfo=Duel.GetChainInfo
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
function Duel.GetChainInfo(ev,...)
local ext_params={...}
if #ext_params==0 then return _GetChainInfo(ev,...) end
local re=_GetChainInfo(ev,CHAININFO_TRIGGERING_EFFECT)
if aux.GetValueType(re)=="Effect" then
local rc=re:GetHandler()
if re:GetDescription()==aux.Stringid(m,0) then
local res={}
for _,ci in ipairs(ext_params) do
if ci==CHAININFO_TYPE or ci==CHAININFO_EXTTYPE then
res[#res+1]=TYPE_SPELL
else
res[#res+1]=_GetChainInfo(ev,ci)
end
end
return table.unpack(res)
end
end
return _GetChainInfo(ev,...)
end
end
end
local KOISHI_CHECK=false
if Card.SetCardData then KOISHI_CHECK=true end
function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te==e:GetLabelObject()
end
......@@ -60,6 +98,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
e:GetHandler():CreateEffectRelation(te)
c:CancelToGrave(false)
local te2=te:Clone()
......@@ -70,7 +109,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -82,7 +121,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......@@ -156,7 +195,9 @@ function cm.geop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm[0]=Duel.CreateToken(0,m)
cm[1]=Duel.CreateToken(1,m)
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
if KOISHI_CHECK then
cm[0]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
cm[1]:SetCardData(CARDDATA_TYPE,TYPE_TRAP)
end
e:Reset()
end
\ No newline at end of file
--块斩机 算子汉密尔顿
--21.08.08
local m=11451605
local cm=_G["c"..m]
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,nil,4,1,nil,nil,99)
......@@ -67,6 +66,7 @@ function cm.effop(e,tp,eg,ep,ev,re,r,rp)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetTarget(aux.xyzlimit)
e1:SetReset(RESET_PHASE+PHASE_END)
e1:SetTargetRange(1,0)
Duel.RegisterEffect(e1,tp)
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -18,6 +18,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e3=e1:Clone()
e3:SetDescription(aux.Stringid(m,0))
e3:SetRange(LOCATION_DECK)
e3:SetCondition(cm.condition)
e3:SetCost(cm.cost)
......@@ -32,6 +33,7 @@ function cm.initial_effect(c)
e4:SetOperation(cm.costop)
c:RegisterEffect(e4)
local e5=e1:Clone()
e5:SetDescription(aux.Stringid(m,0))
e5:SetRange(LOCATION_GRAVE)
e5:SetCost(cm.cost2)
c:RegisterEffect(e5)
......@@ -48,6 +50,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.actg)
e2:SetOperation(cm.actop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.handcon(e)
local tp=e:GetHandlerPlayer()
......@@ -78,16 +98,17 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler() and te:IsHasType(EFFECT_TYPE_ACTIVATE)
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.DisableShuffleCheck()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
local te=e:GetLabelObject()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -99,7 +120,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -81,11 +81,11 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(g) do
tc:CancelToGrave()
if (tc:IsType(TYPE_MONSTER) and Duel.ChangePosition(tc,POS_FACEDOWN_DEFENSE)>0) or Duel.ChangePosition(tc,POS_FACEDOWN)>0 then flag=1 end
local loc=0
--[[local loc=0
if tc:IsType(TYPE_FIELD) then loc=LOCATION_FZONE
elseif tc:IsType(TYPE_SPELL+TYPE_TRAP) then loc=LOCATION_SZONE end
if tc:GetOriginalType()&TYPE_MONSTER==0 and tc:IsLocation(LOCATION_MZONE) then Duel.MoveToField(tc,tp,tp,loc,POS_FACEDOWN,false) end
if tc:IsType(TYPE_SPELL+TYPE_TRAP) then setg:AddCard(tc) end
if tc:GetOriginalType()&TYPE_MONSTER==0 and tc:IsLocation(LOCATION_MZONE) then Duel.MoveToField(tc,tp,tp,loc,POS_FACEDOWN,false) end--]]
if tc:IsType(TYPE_SPELL+TYPE_TRAP) and tc:IsFacedown() then setg:AddCard(tc) end
end
if #setg>0 then
setg:KeepAlive()
......
......@@ -11,6 +11,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetDescription(aux.Stringid(m,0))
e2:SetRange(LOCATION_DECK)
e2:SetCost(cm.cost)
c:RegisterEffect(e2)
......@@ -42,6 +43,21 @@ function cm.initial_effect(c)
c:RegisterEffect(e5)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD)
ge1:SetCode(EFFECT_TRAP_ACT_IN_HAND)
......@@ -55,15 +71,16 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -75,7 +92,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -11,6 +11,7 @@ function cm.initial_effect(c)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
......@@ -49,21 +50,40 @@ function cm.initial_effect(c)
if not CONVIATRESS_BUFF then
CONVIATRESS_BUFF={}
end
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -73,6 +93,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.costcon(e)
cm[0]=false
return true
......@@ -178,15 +207,6 @@ function cm.imfilter(e,re)
end
return false
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
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) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.filter(c,tp)
return (c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()) or (c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp))
end
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
......@@ -54,21 +55,40 @@ function cm.initial_effect(c)
if not CONVIATRESS_BUFF then
CONVIATRESS_BUFF={}
end
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -78,6 +98,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.costcon(e)
cm[0]=false
return true
......@@ -183,15 +212,6 @@ function cm.imfilter(e,re)
end
return false
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
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) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.filter(c,tp)
return (c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()) or (c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp))
end
......
......@@ -8,6 +8,7 @@ function cm.initial_effect(c)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
......@@ -54,21 +55,40 @@ function cm.initial_effect(c)
if not CONVIATRESS_BUFF then
CONVIATRESS_BUFF={}
end
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.actarget(e,te,tp)
e:SetLabelObject(te)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -78,6 +98,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.costcon(e)
cm[0]=false
return true
......@@ -183,15 +212,6 @@ function cm.imfilter(e,re)
end
return false
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
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) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.filter(c,tp)
return (c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()) or (c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp))
end
......
......@@ -9,6 +9,7 @@ function cm.initial_effect(c)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_ACTIVATE)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
......@@ -54,6 +55,21 @@ function cm.initial_effect(c)
c:RegisterEffect(e6)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_CHAINING)
......@@ -83,15 +99,16 @@ function cm.actarget(e,te,tp)
return te:GetHandler()==e:GetHandler()
end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local te=e:GetLabelObject()
Duel.MoveToField(c,tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=c:GetSequence()
c:CreateEffectRelation(te)
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -101,6 +118,15 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
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()
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.check(e,tp,eg,ep,ev,re,r,rp)
local tf=re:GetHandler():IsRelateToEffect(re)
local cid=re:GetHandler():GetRealFieldID()
......@@ -227,15 +253,6 @@ function cm.imfilter(e,re)
end
return false
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
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) and not (rc:IsOnField() and rc:IsFacedown()) then
rc:SetStatus(STATUS_ACTIVATE_DISABLED,true)
end
end
function cm.filter(c,tp)
return (c:IsRace(RACE_WARRIOR) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()) or (c:IsCode(m+1) and c:GetActivateEffect():IsActivatable(tp))
end
......@@ -252,11 +269,14 @@ function cm.condition2(e,tp,eg,ep,ev,re,r,rp)
return ep~=tp
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter1,tp,LOCATION_DECK,0,1,nil) or Duel.IsExistingMatchingCard(cm.rthfilter,tp,0,LOCATION_ONFIELD,1,nil) end
end
function cm.rthfilter(c)
return c:IsAbleToHand() and not c:IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_DECK,0,nil)
local g2=Duel.GetMatchingGroup(Card.IsAbleToHand,tp,0,LOCATION_ONFIELD,nil)
local g2=Duel.GetMatchingGroup(cm.rthfilter,tp,0,LOCATION_ONFIELD,nil)
if not e:GetHandler():IsRelateToEffect(e) then return end
if #g1>0 and (#g2==0 or Duel.SelectOption(tp,aux.Stringid(11451779,0),aux.Stringid(m,1))==0) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......
......@@ -84,7 +84,7 @@ function cm.reptg(e,tp,eg,ep,ev,re,r,rp,chk)
e2:SetAbsoluteRange(tp,1,0)
e2:SetTarget(function(e,c) return not c:IsRace(RACE_INSECT) end)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2,true)
--tc:RegisterEffect(e2,true)
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
tc=g:GetNext()
end
......
......@@ -21,6 +21,24 @@ function cm.initial_effect(c)
e2:SetTarget(cm.thtg)
e2:SetOperation(cm.thop)
c:RegisterEffect(e2)
if not cm.global_check then
cm.global_check=true
cm.activate_sequence={}
local _GetActivateLocation=Effect.GetActivateLocation
local _GetActivateSequence=Effect.GetActivateSequence
function Effect.GetActivateLocation(e)
if e:GetDescription()==aux.Stringid(m,0) then
return LOCATION_SZONE
end
return _GetActivateLocation(e)
end
function Effect.GetActivateSequence(e)
if e:GetDescription()==aux.Stringid(m,0) then
return cm.activate_sequence[e]
end
return _GetActivateSequence(e)
end
end
end
function cm.matfilter(c)
return c:IsRace(RACE_FAIRY) and c:IsLevelAbove(5)
......@@ -72,13 +90,14 @@ end
function cm.costop(e,tp,eg,ep,ev,re,r,rp)
local te=e:GetLabelObject()
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,false)
cm.activate_sequence[te]=tc:GetSequence()
e:GetHandler():CreateEffectRelation(te)
local c=e:GetHandler()
local ev0=Duel.GetCurrentChain()+1
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:SetCode(EVENT_CHAIN_SOLVING)
e1:SetCountLimit(1)
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return ev==ev0 end)
e1:SetOperation(cm.rsop)
......@@ -90,7 +109,7 @@ function cm.costop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.rsop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if e:GetCode()==EVENT_CHAIN_SOLVED and rc:IsRelateToEffect(re) then
if e:GetCode()==EVENT_CHAIN_SOLVING and rc:IsRelateToEffect(re) then
rc:SetStatus(STATUS_EFFECT_ENABLED,true)
end
if e:GetCode()==EVENT_CHAIN_NEGATED and rc:IsRelateToEffect(re) and not (rc:IsOnField() and rc:IsFacedown()) then
......
......@@ -51,7 +51,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.MoveToField(ac,tp,1-ac:GetControler(),LOCATION_FZONE,ac:GetPosition(),true)
elseif acs and bcs then
local acpos=ac:GetPosition()
local bcpos=ac:GetPosition()
local bcpos=bc:GetPosition()
Duel.Overlay(ac,bc)
Duel.MoveToField(ac,tp,1-ac:GetControler(),LOCATION_FZONE,acpos,true)
Duel.MoveToField(bc,tp,1-ac:GetControler(),LOCATION_FZONE,bcpos,true)
......
--战械人形·UMP45
--Diy&Script by kinkuaoi
--If you find a bug, please contact me on QQ:2906557145
function c29065613.initial_effect(c)
--splimit
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_SINGLE)
e0:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e0:SetCode(EFFECT_SPSUMMON_CONDITION)
e0:SetValue(c29065613.splimit)
c:RegisterEffect(e0)
--draw
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(29065613,0))
e1:SetCategory(CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetRange(LOCATION_HAND)
e1:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e1:SetCountLimit(1,29065613)
e1:SetCost(c29065613.drcost)
e1:SetTarget(c29065613.drtg)
e1:SetOperation(c29065613.drop)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(29065613,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_REMOVED)
e2:SetCountLimit(1,29065613)
e2:SetCondition(c29065613.spcon)
e2:SetTarget(c29065613.sptg)
e2:SetOperation(c29065613.spop)
c:RegisterEffect(e2)
local e3=e1:Clone()
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
c:RegisterEffect(e3)
--xyzsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(29065613,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e4:SetCountLimit(1)
e4:SetCondition(c29065613.xyzcon)
e4:SetTarget(c29065613.xyztg)
e4:SetOperation(c29065613.xyzop)
c:RegisterEffect(e4)
end
--xyzsummon
function c29065613.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function c29065613.mfilter(c)
return c:IsSetCard(0x87ad)
end
function c29065613.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(c29065613.mfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c29065613.xyzop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(c29065613.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,sg:GetFirst(),nil,mg)
end
end
--spsummon
function c29065613.filter1(c)
return c:IsControler(Duel.GetTurnPlayer())
end
function c29065613.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c29065613.filter1,1,nil,tp)
end
function c29065613.sptg(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) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,c,1,0,0)
end
function c29065613.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
end
--draw
function c29065613.filter(c)
return c:IsSetCard(0x87ad) and c:IsAbleToRemoveAsCost()
end
function c29065613.drcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c29065613.filter,tp,LOCATION_HAND,0,1,c) and c:IsAbleToRemoveAsCost() end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,c29065613.filter,tp,LOCATION_HAND,0,1,1,c)
g:AddCard(c)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
function c29065613.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 c29065613.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
--splimit
function c29065613.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
\ No newline at end of file
--Diy&script by kinkuaoi
local s,id,o=GetID()
function s.initial_effect(c)
--splimit
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(s.splimit)
c:RegisterEffect(e1)
--to hand
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsummon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetRange(LOCATION_REMOVED)
e3:SetCode(EVENT_TO_HAND)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop)
c:RegisterEffect(e3)
--xyzsummon
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(id,2))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_FREE_CHAIN)
e4:SetRange(LOCATION_MZONE)
e4:SetHintTiming(0,TIMING_BATTLE_START+TIMING_BATTLE_END)
e4:SetCountLimit(1)
e4:SetCondition(s.xyzcon)
e4:SetTarget(s.xyztg)
e4:SetOperation(s.xyzop)
c:RegisterEffect(e4)
end
--xyzsummon
function s.xyzcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()~=tp
end
function s.mfilter(c)
return c:IsSetCard(0x87ad)
end
function s.xyztg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,0,nil)
return Duel.IsExistingMatchingCard(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,1,nil,nil,mg)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function s.xyzop(e,tp,eg,ep,ev,re,r,rp)
local mg=Duel.GetMatchingGroup(s.mfilter,tp,LOCATION_MZONE,0,nil)
local g=Duel.GetMatchingGroup(Card.IsXyzSummonable,tp,LOCATION_EXTRA,0,nil,nil,mg)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sg=g:Select(tp,1,1,nil)
Duel.XyzSummon(tp,sg:GetFirst(),nil,mg)
end
end
--spsummon
function s.cfilter(c,tp)
return c:IsControler(Duel.GetTurnPlayer()) and not c:IsReason(REASON_DRAW)
end
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(s.cfilter,1,nil,tp)
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 not c:IsRelateToEffect(e) then return end
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
--to hand
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function s.thfilter(c)
return c:IsSetCard(0x87ad) and c:IsType(TYPE_MONSTER) 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_GRAVE+LOCATION_REMOVED,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_GRAVE+LOCATION_REMOVED)
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_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
--splimit
function s.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
--G11
local s,id,o=GetID()
function s.initial_effect(c)
--splimit
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(s.splimit)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(s.thcost)
e2:SetTarget(s.thtg)
e2:SetOperation(s.thop)
c:RegisterEffect(e2)
--spsu
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DESTROY)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop1)
c:RegisterEffect(e3)
end
--spsu
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
return rp==tp and re:IsActiveType(TYPE_SPELL+TYPE_TRAP)
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.filter(c)
return c:IsType(TYPE_SPELL+TYPE_TRAP)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0 then
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
if g:GetCount()>0 and Duel.SelectYesNo(tp,aux.Stringid(56619314,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg)
Duel.Destroy(dg,REASON_EFFECT)
end
end
end
--splimit
function s.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
--search
function s.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return c:IsAbleToRemoveAsCost() end
Duel.Remove(c,POS_FACEUP,REASON_COST)
end
function s.filter1(c)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x87ad) and c:IsAbleToHand() and c:IsType(TYPE_SPSUMMON)
end
function s.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(s.filter1,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.filter1,tp,LOCATION_DECK,0,1,1,nil)
if #g>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
\ No newline at end of file
--HK416
--Diy&script by kinkuaoi
local s,id,o=GetID()
function s.initial_effect(c)
--splimit
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(s.splimit)
c:RegisterEffect(e1)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(id,0))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_FREE_CHAIN)
e2:SetRange(LOCATION_HAND)
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER+TIMING_END_PHASE)
e2:SetCountLimit(1,id)
e2:SetCost(s.spcost)
e2:SetTarget(s.sptg)
e2:SetOperation(s.spop)
c:RegisterEffect(e2)
--spsu
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(id,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_DISABLE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_REMOVED)
e3:SetCountLimit(1,id)
e3:SetCondition(s.spcon)
e3:SetTarget(s.sptg)
e3:SetOperation(s.spop1)
c:RegisterEffect(e3)
end
--spsu
function s.spcon(e,tp,eg,ep,ev,re,r,rp)
local tp=Duel.GetTurnPlayer()
return rp==tp and re:IsActiveType(TYPE_MONSTER)
end
function s.spop1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsRelateToEffect(e) and Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)~=0
and Duel.IsExistingMatchingCard(aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(id,2)) then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g=Duel.SelectMatchingCard(tp,aux.NegateMonsterFilter,tp,0,LOCATION_MZONE,1,1,nil)
Duel.HintSelection(g)
local tc=g:GetFirst()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e2)
end
end
--splimit
function s.splimit(e,se,sp,st)
return se:IsHasType(EFFECT_TYPE_ACTIONS)
end
--spsummon
function s.costfilter(c)
return c:IsSetCard(0x87ad) and c:IsType(TYPE_MONSTER) and c:IsAbleToRemoveAsCost()
end
function s.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(s.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,c) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,s.costfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,c)
Duel.Remove(g,POS_FACEUP,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
end
\ No newline at end of file
--战械人形·隐匿者
local m=29065618
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
c:SetSPSummonOnce(m)
aux.AddXyzProcedureLevelFree(c,cm.mfilter,aux.TRUE,2,2)
--atk&def down
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_ATTACK_ANNOUNCE)
e1:SetRange(LOCATION_MZONE)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ)
end
function cm.refilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEUP,REASON_EFFECT)
end
function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local og=Group.CreateGroup()
for tc in aux.Next(g) do
local tg=tc:GetOverlayGroup()
og:Merge(tg)
end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsFaceup,tp,0,LOCATION_MZONE,1,nil) and og:FilterCount(cm.refilter,nil,tp)>1 end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local og=Group.CreateGroup()
for tc in aux.Next(g) do
local tg=tc:GetOverlayGroup()
og:Merge(tg)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg=og:FilterSelect(tp,cm.refilter,2,2,nil,tp)
if Duel.Remove(sg,POS_FACEUP,REASON_EFFECT)==2 then
local g1=Duel.GetMatchingGroup(Card.IsFaceup,tp,0,LOCATION_MZONE,nil)
if g1:GetCount()>0 then
local sc=g1:GetFirst()
while sc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(-1000)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc:RegisterEffect(e2)
sc=g1:GetNext()
end
end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(aux.TargetBoolFunction(Card.IsSetCard,0x87ad))
e1:SetValue(1)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
local e2=e1:Clone()
e2:SetCode(EFFECT_INDESTRUCTABLE_EFFECT)
Duel.RegisterEffect(e2,tp)
end
end
function cm.mfilter(c,xyzc)
return c:IsSetCard(0x87ad) and not c:IsSummonableCard()
end
\ No newline at end of file
--战械人形·粉碎者
local m=29065620
local cm=_G["c"..m]
function cm.initial_effect(c)
c:EnableReviveLimit()
c:SetSPSummonOnce(m)
aux.AddXyzProcedureLevelFree(c,cm.mfilter,aux.TRUE,2,2)
--remove
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_REMOVE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1)
e3:SetCondition(cm.rmcon)
e3:SetTarget(cm.rmtg)
e3:SetOperation(cm.rmop)
c:RegisterEffect(e3)
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_REMOVE)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
local ge2=ge1:Clone()
ge2:SetCode(EVENT_CHAINING)
ge2:SetLabelObject(ge1)
ge2:SetOperation(cm.reset)
Duel.RegisterEffect(ge2,0)
end
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
for tc in aux.Next(eg) do
if tc:IsReason(REASON_COST) and re:IsActivated() then
Duel.RegisterFlagEffect(0,m,0,0,0)
local loc,p=tc:GetPreviousLocation(),tc:GetPreviousControler()
local i=Duel.GetFlagEffect(0,m)*2-2
cm[i]=loc
cm[i+1]=p
cm[i+2]=114
e:SetLabelObject(re)
end
end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
local ace=e:GetLabelObject():GetLabelObject()
if ace and re~=ace then Duel.ResetFlagEffect(0,m) end
end
--
function cm.rmcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFlagEffect(0,m)>0
end
function cm.cfilter(c,tp)
return c:IsFaceup() and c:IsRace(RACE_MACHINE) and c:IsType(TYPE_XYZ)
end
function cm.refilter(c,tp)
return c:IsAbleToRemove(tp,POS_FACEUP,REASON_EFFECT)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local og=Group.CreateGroup()
for tc in aux.Next(g) do
local tg=tc:GetOverlayGroup()
og:Merge(tg)
end
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,nil) and og:FilterCount(cm.refilter,nil,tp)>1 end
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,1-tp,LOCATION_ONFIELD)
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.cfilter,tp,LOCATION_MZONE,0,nil)
local og=Group.CreateGroup()
for tc in aux.Next(g) do
local tg=tc:GetOverlayGroup()
og:Merge(tg)
end
local g1=Duel.GetMatchingGroup(Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,nil)
if g1:GetCount()>0 and og:FilterCount(cm.refilter,nil,tp)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local sg1=og:FilterSelect(tp,cm.refilter,2,2,nil,tp)
local sg=g1:Select(tp,1,1,nil)
local sg2=sg+sg1
Duel.HintSelection(sg)
Duel.Remove(sg2,POS_FACEUP,REASON_EFFECT)
end
end
--
function cm.mfilter(c,xyzc)
return c:IsSetCard(0x87ad) and not c:IsSummonableCard()
end
\ No newline at end of file
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