Commit 93c89f18 authored by Nemo Ma's avatar Nemo Ma

250209 wd

parent 65bc7272
...@@ -558,16 +558,6 @@ ...@@ -558,16 +558,6 @@
33203027 0 33203027 0
33203028 0 33203028 0
33203029 0 33203029 0
33403521 0
33403522 0
33403523 0
33403524 0
33403525 0
33403526 0
33403527 0
33403528 0
33403529 0
33403530 0
33502101 0 33502101 0
33502102 0 33502102 0
33502103 0 33502103 0
...@@ -992,6 +982,11 @@ ...@@ -992,6 +982,11 @@
67200827 0 67200827 0
67200829 0 67200829 0
67200832 0 67200832 0
70000900 0
70000902 0
70000904 0
70000905 0
70000906 0
70002010 0 70002010 0
70002012 0 70002012 0
70002024 0 70002024 0
...@@ -1776,6 +1771,7 @@ ...@@ -1776,6 +1771,7 @@
98920620 0 98920620 0
98920630 0 98920630 0
98920645 0 98920645 0
98920657 0
98920659 0 98920659 0
98920671 0 98920671 0
98920672 0 98920672 0
...@@ -1837,6 +1833,7 @@ ...@@ -1837,6 +1833,7 @@
98941053 0 98941053 0
98941054 0 98941054 0
98941055 0 98941055 0
98941056 0
98942059 0 98942059 0
99550610 0 99550610 0
99700125 0 99700125 0
......
No preview for this file type
...@@ -9,12 +9,14 @@ function cm.initial_effect(c) ...@@ -9,12 +9,14 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) --e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con) e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -29,23 +31,42 @@ function cm.initial_effect(c) ...@@ -29,23 +31,42 @@ function cm.initial_effect(c)
e3:SetTarget(cm.drtg) e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e4)
end end
function cm.ARC(c) function cm.ARC(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Arcalling return m and m.named_with_Arcalling
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,e:GetHandler())==0 and Duel.IsChainNegatable(ev) and rp==1-tp return Duel.IsChainNegatable(ev) and rp==1-tp
end end
function cm.disfilter(c) function cm.disfilter(c)
return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable() return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) if chk==0 then
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) local b1=not c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) local b2=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) local b3=Duel.GetFlagEffect(tp,m)==0 or c:IsLocation(LOCATION_GRAVE)
return b1 or (b2 and b3)
end
if c:IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.nbcon(tp,re) end if chk==0 then return aux.nbcon(tp,re) end
......
...@@ -6,16 +6,18 @@ function cm.initial_effect(c) ...@@ -6,16 +6,18 @@ function cm.initial_effect(c)
--negate --negate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) e1:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) --e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con) e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -30,23 +32,42 @@ function cm.initial_effect(c) ...@@ -30,23 +32,42 @@ function cm.initial_effect(c)
e3:SetTarget(cm.drtg) e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e4)
end end
function cm.ARC(c) function cm.ARC(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Arcalling return m and m.named_with_Arcalling
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,e:GetHandler())==0 and Duel.IsChainNegatable(ev) and rp==1-tp return Duel.IsChainNegatable(ev) and rp==1-tp
end end
function cm.disfilter(c) function cm.disfilter(c)
return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable() return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) if chk==0 then
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) local b1=not c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) local b2=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) local b3=Duel.GetFlagEffect(tp,m)==0 or c:IsLocation(LOCATION_GRAVE)
return b1 or (b2 and b3)
end
if c:IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end if chkc then return chkc:IsLocation(LOCATION_GRAVE) and chkc:IsAbleToDeck() end
......
...@@ -9,12 +9,14 @@ function cm.initial_effect(c) ...@@ -9,12 +9,14 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TODECK) e1:SetCategory(CATEGORY_DISABLE_SUMMON+CATEGORY_TODECK)
e1:SetCode(EVENT_SUMMON) e1:SetCode(EVENT_SUMMON)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) --e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con) e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -35,23 +37,42 @@ function cm.initial_effect(c) ...@@ -35,23 +37,42 @@ function cm.initial_effect(c)
e5:SetTarget(cm.drtg) e5:SetTarget(cm.drtg)
e5:SetOperation(cm.drop) e5:SetOperation(cm.drop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
--act in hand
local e6=Effect.CreateEffect(c)
e6:SetType(EFFECT_TYPE_SINGLE)
e6:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e6)
end end
function cm.ARC(c) function cm.ARC(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
return m and m.named_with_Arcalling return m and m.named_with_Arcalling
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,e:GetHandler())==0 and Duel.GetCurrentChain()==0 and rp==1-tp return Duel.GetCurrentChain()==0 and rp==1-tp
end end
function cm.disfilter(c) function cm.disfilter(c)
return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable() return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) if chk==0 then
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) local b1=not c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) local b2=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) local b3=Duel.GetFlagEffect(tp,m)==0 or c:IsLocation(LOCATION_GRAVE)
return b1 or (b2 and b3)
end
if c:IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true end
......
...@@ -9,12 +9,13 @@ function cm.initial_effect(c) ...@@ -9,12 +9,13 @@ function cm.initial_effect(c)
e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE) e1:SetCategory(CATEGORY_DRAW+CATEGORY_REMOVE)
e1:SetCode(EVENT_TO_HAND) e1:SetCode(EVENT_TO_HAND)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) --e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con) e1:SetCost(cm.cost)
e1:SetTarget(cm.tg) e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -29,6 +30,11 @@ function cm.initial_effect(c) ...@@ -29,6 +30,11 @@ function cm.initial_effect(c)
e3:SetTarget(cm.drtg) e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e4)
end end
function cm.ARC(c) function cm.ARC(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
...@@ -37,18 +43,29 @@ end ...@@ -37,18 +43,29 @@ end
function cm.cfilter(c,tp) function cm.cfilter(c,tp)
return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK) return c:IsControler(1-tp) and c:IsPreviousLocation(LOCATION_DECK)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,e:GetHandler())==0
end
function cm.disfilter(c) function cm.disfilter(c)
return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable() return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) if chk==0 then
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) local b1=not c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) local b2=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) local b3=Duel.GetFlagEffect(tp,m)==0 or c:IsLocation(LOCATION_GRAVE)
return b1 or (b2 and b3)
end
if c:IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end end
function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(cm.cfilter,nil,tp) local g=eg:Filter(cm.cfilter,nil,tp)
......
...@@ -6,14 +6,17 @@ function cm.initial_effect(c) ...@@ -6,14 +6,17 @@ function cm.initial_effect(c)
--negate --negate
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE) --e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetType(EFFECT_TYPE_ACTIVATE) e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH) --e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.con) e1:SetCondition(cm.con)
e1:SetCost(cm.cost)
e1:SetTarget(cm.tg)
e1:SetOperation(cm.op) e1:SetOperation(cm.op)
c:RegisterEffect(e1) c:RegisterEffect(e1)
local e2=e1:Clone() local e2=e1:Clone()
e2:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e2:SetRange(LOCATION_GRAVE) e2:SetRange(LOCATION_GRAVE)
e2:SetCost(cm.cost) e2:SetCost(cm.cost)
c:RegisterEffect(e2) c:RegisterEffect(e2)
...@@ -28,6 +31,11 @@ function cm.initial_effect(c) ...@@ -28,6 +31,11 @@ function cm.initial_effect(c)
e3:SetTarget(cm.drtg) e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--act in hand
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_TRAP_ACT_IN_HAND)
c:RegisterEffect(e4)
end end
function cm.ARC(c) function cm.ARC(c)
local m=_G["c"..c:GetCode()] local m=_G["c"..c:GetCode()]
...@@ -35,17 +43,31 @@ function cm.ARC(c) ...@@ -35,17 +43,31 @@ function cm.ARC(c)
end end
function cm.con(e,tp,eg,ep,ev,re,r,rp) function cm.con(e,tp,eg,ep,ev,re,r,rp)
local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION) local loc=Duel.GetChainInfo(ev,CHAININFO_TRIGGERING_LOCATION)
return loc==LOCATION_GRAVE and Duel.GetMatchingGroupCount(Card.IsFaceup,tp,LOCATION_ONFIELD,0,e:GetHandler())==0 and rp==1-tp return loc==LOCATION_GRAVE and rp==1-tp
end end
function cm.disfilter(c) function cm.disfilter(c)
return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable() return (cm.ARC(c) or (c:IsType(TYPE_COUNTER) and c:IsType(TYPE_TRAP))) and c:IsDiscardable()
end end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0 end local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD) if chk==0 then
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,nil) local b1=not c:IsLocation(LOCATION_HAND+LOCATION_GRAVE)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) local b2=Duel.IsExistingMatchingCard(cm.disfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>0
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true) local b3=Duel.GetFlagEffect(tp,m)==0 or c:IsLocation(LOCATION_GRAVE)
return b1 or (b2 and b3)
end
if c:IsStatus(STATUS_ACT_FROM_HAND) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
end
if e:GetHandler():IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISCARD)
local g=Duel.SelectMatchingCard(tp,cm.disfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD)
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
end
end end
function cm.op(e,tp,eg,ep,ev,re,r,rp) function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
......
--码丽丝<兵卒>疯帽子
local m=70000900
local cm=_G["c"..m]
function cm.initial_effect(c)
--N+S
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DAMAGE_CAL)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCondition(cm.condition)
e1:SetCost(cm.cost)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
--indestructable
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_CHANGE_CONTROL)
e2:SetValue(1)
e2:SetRange(LOCATION_MZONE)
e2:SetTargetRange(LOCATION_MZONE,LOCATION_MZONE)
e2:SetTarget(cm.immtg)
c:RegisterEffect(e2)
--special summon
local e5=Effect.CreateEffect(c)
e5:SetDescription(aux.Stringid(m,2))
e5:SetCategory(CATEGORY_SPECIAL_SUMMON)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e5:SetCode(EVENT_REMOVE)
e5:SetProperty(EFFECT_FLAG_DELAY)
e5:SetCountLimit(1,m+1)
e5:SetCost(cm.spcost)
e5:SetTarget(cm.sptg)
e5:SetOperation(cm.spop)
c:RegisterEffect(e5)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return re:IsActiveType(TYPE_MONSTER)
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost() end
Duel.Remove(e:GetHandler(),POS_FACEUP,REASON_COST)
end
function cm.filter(c)
return c:IsSetCard(0x1bf) and c:IsAbleToHand()
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
local ct=Duel.GetCurrentChain()
if ct<2 then return end
local te,tep=Duel.GetChainInfo(ct-1,CHAININFO_TRIGGERING_EFFECT,CHAININFO_TRIGGERING_PLAYER)
if tep==1-tp and te:IsActiveType(TYPE_MONSTER) then
Duel.NegateEffect(ct-1)
end
end
end
function cm.immtg(e,c)
local lg=c:GetLinkedGroup()
return c:IsFaceup() and c:IsType(TYPE_LINK) and c:IsSetCard(0x1bf)
and lg and lg:IsContains(e:GetHandler()) and not e:GetHandler():IsStatus(STATUS_BATTLE_DESTROYED)
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,300) end
Duel.PayLPCost(tp,300)
end
function cm.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 cm.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
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetTargetRange(1,0)
e1:SetTarget(cm.splimit)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
function cm.splimit(e,c)
return not c:IsType(TYPE_LINK) and c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
--码丽丝<龙>炸脖龙
local m=70000902
local cm=_G["c"..m]
function cm.initial_effect(c)
--link summon
aux.AddLinkProcedure(c,nil,2,99,cm.lcheck)
c:EnableReviveLimit()
--atk up
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e1:SetCondition(cm.atkcon)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(cm.atktg)
e1:SetValue(3000)
c:RegisterEffect(e1)
--Cost Change
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_LPCOST_CHANGE)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetRange(LOCATION_MZONE+LOCATION_GRAVE)
e2:SetTargetRange(1,0)
e2:SetValue(cm.costchange)
c:RegisterEffect(e2)
--special summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_REMOVE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m)
e3:SetCost(cm.spcost)
e3:SetTarget(cm.sptg)
e3:SetOperation(cm.spop)
c:RegisterEffect(e3)
--disable
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_DESTROY+CATEGORY_DISABLE)
e4:SetType(EFFECT_TYPE_QUICK_O)
e4:SetCode(EVENT_CHAINING)
e4:SetCountLimit(1,m+1)
e4:SetRange(LOCATION_MZONE)
e4:SetCost(cm.discost)
e4:SetTarget(cm.distg)
e4:SetOperation(cm.disop)
c:RegisterEffect(e4)
end
function cm.cfilter(c)
return c:IsSetCard(0x1bf) and c:IsType(TYPE_MONSTER) and c:IsFaceup()
end
function cm.atkcon(e)
local g=Duel.GetMatchingGroup(cm.cfilter,e:GetHandlerPlayer(),LOCATION_REMOVED,0,nil)
return g:GetClassCount(Card.GetCode)>=3
end
function cm.atktg(e,c)
return c:IsSetCard(0x1bf) and c:IsType(TYPE_LINK)
end
function cm.lcheck(g)
return g:IsExists(Card.IsLinkSetCard,1,nil,0x1bf)
end
function cm.costchange(e,re,rp,val)
if re and re:GetHandler():IsSetCard(0x1bf) then
return 0
else
return val
end
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckLPCost(tp,900) end
Duel.PayLPCost(tp,900)
end
function cm.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 cm.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
Duel.Recover(tp,1500,REASON_EFFECT)
end
function cm.cfilter(c)
return c:IsSetCard(0x1bf) and c:IsType(TYPE_MONSTER)
end
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,e:GetHandler()) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter,1,1,e:GetHandler())
Duel.Release(g,REASON_COST)
local tc=Duel.GetOperatedGroup():GetFirst()
e:SetLabelObject(tc)
end
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_DISABLE,eg,1,0,0)
end
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if Duel.NegateEffect(ev) and rc:IsRelateToEffect(re) and rc:IsDestructable() then
Duel.Destroy(rc,REASON_EFFECT)
end
end
\ No newline at end of file
--码丽丝<器>沃尔柏之剑
local m=70000904
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH+CATEGORY_DRAW)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCondition(cm.condition)
e1:SetTarget(cm.target)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsRace(RACE_CYBERSE) and c:IsAttribute(ATTRIBUTE_DARK)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
local ct=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)
return ct==0 or ct==Duel.GetMatchingGroupCount(cm.cfilter,tp,LOCATION_MZONE,0,nil)
end
function cm.filter(c)
return c:IsSetCard(0x1bf) and c:IsAbleToHand() and not c:IsCode(m)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
if Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3 then
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil)
if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
if Duel.IsPlayerCanDraw(tp,1)
and Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_GRAVE,0,nil,TYPE_SPELL)>=3
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.BreakEffect()
Duel.ShuffleDeck(tp)
Duel.Draw(tp,1,REASON_EFFECT)
Duel.Recover(tp,1500,REASON_EFFECT)
end
end
end
\ No newline at end of file
--码丽丝<代码>CT-EX
local m=70000905
local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_NEGATE+CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_CHAINING)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_OATH)
e1:SetCondition(cm.condition)
e1:SetTarget(aux.nbtg)
e1:SetOperation(cm.activate)
c:RegisterEffect(e1)
--act in set turn
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,2))
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_TRAP_ACT_IN_SET_TURN)
e2:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e2:SetCost(cm.cost)
c:RegisterEffect(e2)
end
function cm.cfilter(c)
return c:IsFaceup() and c:IsSetCard(0x1bf)
end
function cm.condition(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
and (re:IsActiveType(TYPE_MONSTER) or re:IsHasType(EFFECT_TYPE_ACTIVATE)) and Duel.IsChainNegatable(ev)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=re:GetHandler()
if Duel.NegateActivation(ev) and tc:IsRelateToEffect(re) and Duel.Remove(eg,POS_FACEUP,REASON_EFFECT)~=0
and tc:IsLocation(LOCATION_REMOVED) and not tc:IsReason(REASON_REDIRECT) then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e1:SetCode(EFFECT_CANNOT_ACTIVATE)
e1:SetTargetRange(0,1)
e1:SetValue(cm.aclimit)
e1:SetLabelObject(tc)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
end
end
function cm.aclimit(e,re,tp)
local c=re:GetHandler()
local tc=e:GetLabelObject()
return c:IsOriginalCodeRule(tc:GetOriginalCodeRule())
end
function cm.cfilter2(c)
return c:IsSetCard(0x1bf) and c:IsFaceup() and c:IsAbleToRemoveAsCost()
end
function cm.cost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter2,tp,LOCATION_MZONE,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.cfilter2,tp,LOCATION_MZONE,0,1,1,nil)
Duel.Remove(g,POS_FACEUP,REASON_COST)
end
\ No newline at end of file
--灵魂燃烧 连接
local m=70000906
local cm=_G["c"..m]
function cm.initial_effect(c)
local e0=Effect.CreateEffect(c)
e0:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
e0:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e0:SetCode(EVENT_FREE_CHAIN)
e0:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e0:SetRange(LOCATION_HAND+LOCATION_DECK+LOCATION_ONFIELD)
e0:SetOperation(cm.op)
c:RegisterEffect(e0)
end
function cm.filter(c)
return c:IsSetCard(0x119) and c:IsType(TYPE_MONSTER)
end
function cm.op(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Exile(e:GetHandler(),REASON_RULE)
local g=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND,0,nil)
if g:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg)
Duel.SendtoGrave(sg,REASON_RULE,tp)
--tohand
local tc1=Duel.CreateToken(tp,11962031)
local tc2=Duel.CreateToken(tp,28534130)
Duel.SendtoHand(tc1,tp,REASON_RULE)
Duel.SendtoHand(tc2,tp,REASON_RULE)
--toextra
for i=1,3 do
local tc3=Duel.CreateToken(tp,87871125)
Duel.SendtoDeck(tc3,tp,SEQ_DECKSHUFFLE,REASON_RULE)
local tc4=Duel.CreateToken(tp,14812471)
Duel.SendtoDeck(tc4,tp,SEQ_DECKSHUFFLE,REASON_RULE)
end
local c=e:GetHandler()
if not (Duel.GetFieldGroupCount(c:GetControler(),LOCATION_ONFIELD,0)==0
and Duel.GetFieldGroupCount(c:GetControler(),0,LOCATION_ONFIELD)>0)
then return end
local d=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_DECK,0,1,1,nil):GetFirst()
local th=Duel.GetFieldGroupCount(tp,LOCATION_MZONE,0)>0
local b2=th and d:IsAbleToHand()
if d and (b2 or Duel.SelectOption(tp,1153,1190)==0) then
Duel.MoveToField(d,tp,tp,LOCATION_MZONE,POS_FACEDOWN_DEFENSE,true)
else
Duel.SendtoHand(d,nil,REASON_RULE)
Duel.ConfirmCards(1-tp,d)
end
end
--limit
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCondition(cm.checkcon)
e1:SetOperation(cm.checkop)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(e:GetHandler())
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,0)
e2:SetTarget(cm.splimit)
Duel.RegisterEffect(e2,tp)
end
function cm.checkcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==e:GetHandlerPlayer()
end
function cm.chkfilter(c,tp)
return c:IsSummonPlayer(tp) and c:IsSummonType(SUMMON_TYPE_LINK) and c:GetMaterial():IsExists(Card.IsLink,1,nil,4)
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if eg:IsExists(cm.chkfilter,1,nil,tp) then
--cannot be used as material
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetProperty(EFFECT_FLAG_SET_AVAILABLE+EFFECT_FLAG_IGNORE_IMMUNE)
e1:SetTargetRange(0xff,0xff)
e1:SetCondition(cm.checkcon)
e1:SetTarget(aux.TargetBoolFunction(Card.IsLink,4))
e1:SetValue(cm.sumlimit)
Duel.RegisterEffect(e1,tp)
e:Reset()
end
end
function cm.sumlimit(e,c)
if not c then return false end
return c:IsControler(e:GetHandlerPlayer())
end
function cm.splimit(e,c)
return not c:IsSetCard(0x119) and not c:IsLocation(LOCATION_EXTRA)
end
\ No newline at end of file
...@@ -3,13 +3,6 @@ function c98920657.initial_effect(c) ...@@ -3,13 +3,6 @@ function c98920657.initial_effect(c)
--link summon --link summon
aux.AddLinkProcedure(c,nil,2,2,c98920657.lcheck) aux.AddLinkProcedure(c,nil,2,2,c98920657.lcheck)
c:EnableReviveLimit() c:EnableReviveLimit()
--linklimit
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e1:SetCode(EFFECT_CANNOT_BE_LINK_MATERIAL)
e1:SetValue(1)
c:RegisterEffect(e1)
--spsummon --spsummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(98920657,0)) e1:SetDescription(aux.Stringid(98920657,0))
......
--影之侵染
local s,id,o=GetID()
function c98941056.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetHintTiming(TIMING_DRAW_PHASE,TIMING_DRAW_PHASE+TIMING_END_PHASE)
e1:SetCost(s.cost1)
e1:SetTarget(s.target)
e1:SetOperation(s.activate)
e1:SetCountLimit(1,id)
c:RegisterEffect(e1)
local e0=e1:Clone()
e0:SetDescription(aux.Stringid(id,0))
e0:SetRange(LOCATION_DECK)
e0:SetCondition(s.descon)
e0:SetCost(s.cost2)
c:RegisterEffect(e0)
--change effect
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(98941056,0))
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCountLimit(1,id+o)
e2:SetTarget(c98941056.chtg)
e2:SetOperation(c98941056.chop)
c:RegisterEffect(e2)
end
function s.checkop(e,tp,eg,ep,ev,re,r,rp)
local rc=re:GetHandler()
if re:GetValue()~=id+1 then return end
if rc:IsLocation(LOCATION_MZONE) and rc:GetFlagEffect(id)==0 then
rc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
end
function s.actarget2(e,te,tp)
local tc=te:GetHandler()
e:SetLabelObject(te)
return tc:IsSetCard(0x171) and te:IsHasType(EFFECT_TYPE_QUICK_O) and tc:IsLocation(LOCATION_HAND) and tc:IsType(TYPE_SPELL)
end
function s.descon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_HAND)
and Duel.GetFieldGroupCount(tp,LOCATION_ONFIELD,0)<Duel.GetFieldGroupCount(tp,0,LOCATION_ONFIELD)
end
function c98941056.filter0(c)
return c:IsFaceup() and c:IsCanBeFusionMaterial()
end
function c98941056.filter1(c,e)
return c:IsFaceup() and c:IsCanBeFusionMaterial() and not c:IsImmuneToEffect(e)
end
function c98941056.filter2(c,e,tp,m,f,chkf)
return c:IsType(TYPE_FUSION) and c:IsSetCard(0x9d) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,nil,chkf)
end
function c98941056.filter3(c,e)
return not c:IsImmuneToEffect(e)
end
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
if Duel.GetFlagEffect(tp,id)~=0 then return end
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp)
local mg2=Duel.GetMatchingGroup(c98941056.filter0,tp,0,LOCATION_MZONE,nil)
mg1:Merge(mg2)
local res=Duel.IsExistingMatchingCard(c98941056.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(c98941056.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg3,mf,chkf)
end
end
return res
end
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function c98941056.activate(e,tp,eg,ep,ev,re,r,rp)
if not e:GetHandler():IsOnField() then return end
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(c98941056.filter3,nil,e)
local mg2=Duel.GetMatchingGroup(c98941056.filter1,tp,0,LOCATION_MZONE,nil,e)
mg1:Merge(mg2)
local sg1=Duel.GetMatchingGroup(c98941056.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,chkf)
local mg3=nil
local sg2=nil
local ct=0
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
mg3=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(c98941056.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg3,mf,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
if sg2 then sg:Merge(sg2) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tg=sg:Select(tp,1,1,nil)
local tc=tg:GetFirst()
if sg1:IsContains(tc) and (sg2==nil or not sg2:IsContains(tc) or not Duel.SelectYesNo(tp,ce:GetDescription())) then
local mat1=Duel.SelectFusionMaterial(tp,tc,mg1,nil,chkf)
ct=mat1:FilterCount(s.desfilter,nil,tp)
tc:SetMaterial(mat1)
local xc=mat1:GetFirst()
local hg=Group.CreateGroup()
while xc do
hg:AddCard(xc)
Duel.HintSelection(hg)
if xc:IsLocation(LOCATION_MZONE) and xc:IsCanChangePosition() and Duel.SelectYesNo(tp,aux.Stringid(id,1)) then Duel.ChangePosition(xc,POS_FACEUP_DEFENSE,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK,POS_FACEUP_ATTACK)
else Duel.SendtoGrave(xc,REASON_EFFECT+REASON_MATERIAL+REASON_FUSION) end
Duel.BreakEffect()
hg:RemoveCard(xc)
xc=mat1:GetNext()
end
Duel.SpecialSummon(tc,SUMMON_TYPE_FUSION,tp,1-tp,false,false,POS_FACEUP)
else
local mat2=Duel.SelectFusionMaterial(tp,tc,mg3,nil,chkf)
local fop=ce:GetOperation()
fop(ce,e,tp,tc,mat2)
end
tc:CompleteProcedure()
end
if ct>0 and Duel.IsExistingMatchingCard(s.tgfilter1,tp,LOCATION_DECK,0,1,nil) and Duel.SelectYesNo(tp,aux.Stringid(98941056,3)) then
Duel.BreakEffect()
local g=Duel.GetMatchingGroup(s.tgfilter1,tp,LOCATION_DECK,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=g:Select(tp,1,ct,nil)
Duel.SendtoGrave(sg,REASON_EFFECT)
end
end
function s.tgfilter1(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER) and c:IsAbleToGrave()
end
function c98941056.desfilter(c,tp)
return c:IsControler(tp)
end
function s.cost2(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>=1 end
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_SZONE,POS_FACEUP,true)
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,EFFECT_FLAG_OATH,1)
end
function s.cost1(e,tp,eg,ep,ev,re,r,rp,chk)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
if chk==0 then return ft>=1 end
end
function c98941056.yyfilter(c)
return c:IsSetCard(0x9d)
end
function c98941056.disfilter(c)
return c:IsCode(98941056) and c:IsFaceup()
end
function s.filterx(c)
return c:IsSetCard(0x9d) and c:IsType(TYPE_MONSTER)
end
function s.sfilter1(c,e,tp,g)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:IsExists(s.sfilter2,1,c,e,tp,c)
end
function s.sfilter2(c,e,tp,oc)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEDOWN_DEFENSE)
and Duel.GetLocationCount(1-tp,LOCATION_MZONE,tp)>0
end
function c98941056.chtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(s.filterx,tp,LOCATION_GRAVE,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(c98941056.yyfilter,tp,LOCATION_HAND,0,1,nil) and Duel.GetFlagEffect(tp,id)==0 and not Duel.IsPlayerAffectedByEffect(tp,59822133) and g:IsExists(s.sfilter1,1,nil,e,tp,g) end
Duel.RegisterFlagEffect(tp,id,RESET_CHAIN,0,1)
end
function c98941056.chop(e,tp,eg,ep,ev,re,r,rp)
local g=Group.CreateGroup()
Duel.ChangeTargetCard(ev,g)
Duel.ChangeChainOperation(ev,c98941056.repop)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,c98941056.yyfilter,tp,LOCATION_HAND,0,1,1,nil)
if g:GetCount()>0 then
Duel.BreakEffect()
Duel.SendtoGrave(g,REASON_EFFECT)
end
end
function c98941056.repop(e,tp,eg,ep,ev,re,r,rp)
local oog=Duel.GetMatchingGroup(s.filterx,tp,LOCATION_GRAVE,0,nil)
if oog:GetCount()==0 then
local g=Duel.GetMatchingGroup(s.filterx,1-tp,LOCATION_GRAVE,0,nil)
if not Duel.IsPlayerAffectedByEffect(1-tp,59822133) and g:IsExists(s.sfilter1,1,nil,e,1-tp,g) then
Duel.Hint(HINT_SELECTMSG,1-tp,aux.Stringid(id,4))
local sc=g:FilterSelect(1-tp,s.sfilter1,1,1,nil,e,1-tp,g):GetFirst()
Duel.Hint(HINT_SELECTMSG,lp,aux.Stringid(id,5))
local oc=g:FilterSelect(1-tp,s.sfilter2,1,1,sc,e,1-tp,sc):GetFirst()
Duel.SpecialSummonStep(sc,0,1-tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(tp,sc)
Duel.SpecialSummonStep(oc,0,1-tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(tp,oc)
Duel.SpecialSummonComplete()
end
else
local g=Duel.GetMatchingGroup(s.filterx,tp,LOCATION_GRAVE,0,nil)
if not Duel.IsPlayerAffectedByEffect(tp,59822133) and g:IsExists(s.sfilter1,1,nil,e,tp,g) then
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,4))
local sc=g:FilterSelect(tp,s.sfilter1,1,1,nil,e,tp,g):GetFirst()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(id,5))
local oc=g:FilterSelect(tp,s.sfilter2,1,1,sc,e,tp,sc):GetFirst()
Duel.SpecialSummonStep(sc,0,tp,tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,sc)
Duel.SpecialSummonStep(oc,0,tp,1-tp,false,false,POS_FACEDOWN_DEFENSE)
Duel.ConfirmCards(1-tp,oc)
Duel.SpecialSummonComplete()
end
end
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