Commit 4a4406ae authored by TanakaKotoha's avatar TanakaKotoha

fix lua

parent f1babad2
......@@ -9,12 +9,25 @@ function cm.initial_effect(c)
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,2,99)
c:EnableReviveLimit()
--effect gian
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_ADJUST)
e1:SetRange(LOCATION_MZONE)
e1:SetOperation(cm.efop)
c:RegisterEffect(e1)
local ef_1=Effect.CreateEffect(c)
ef_1:SetType(EFFECT_TYPE_SINGLE)
ef_1:SetCode(m)
ef_1:SetRange(LOCATION_MZONE)
ef_1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_SINGLE_RANGE)
c:RegisterEffect(ef_1)
local ef_2=Effect.CreateEffect(c)
ef_2:SetType(EFFECT_TYPE_SINGLE)
ef_2:SetCode(m+1000)
ef_2:SetRange(LOCATION_MZONE)
ef_2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
c:RegisterEffect(ef_2)
local ef_3=Effect.CreateEffect(c)
ef_3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ef_3:SetCode(EVENT_ADJUST)
ef_3:SetRange(LOCATION_MZONE)
ef_3:SetOperation(cm.op)
c:RegisterEffect(ef_3)
cm[ef_3]={}
end
function cm.mfilter(c)
return chrb.CHRB(c)
......@@ -22,20 +35,54 @@ end
function cm.xyzcheck(g)
return g:GetClassCount(Card.GetCode)==#g
end
function cm.effilter(c)
return c:IsType(TYPE_MONSTER) and chrb.CHRB(c)
end
function cm.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ct=c:GetOverlayGroup(tp,1,0)
local wg=ct:Filter(cm.effilter,nil,tp)
local wbc=wg:GetFirst()
while wbc do
local code=wbc:GetOriginalCode()
if c:IsFaceup() and c:GetFlagEffect(code)==0 then
c:CopyEffect(code, RESET_EVENT+0x1fe0000+EVENT_CHAINING, 1)
c:RegisterFlagEffect(code,RESET_EVENT+0x1fe0000+EVENT_CHAINING,0,1)
end
wbc=wg:GetNext()
end
function cm.copyfilter(c,ec)
return c:IsType(TYPE_MONSTER) and chrb.CHRB(c) and c:IsType(TYPE_EFFECT) and not c:IsType(TYPE_TRAPMONSTER) and not c:IsHasEffect(m) and ec:GetOverlayCount()>0
end
function cm.gfilter(c,g)
if not g then return true end
return not g:IsContains(c)
end
function cm.gfilter1(c,g)
if not g then return true end
return not g:IsExists(cm.gfilter2,1,nil,c:GetOriginalCode())
end
function cm.gfilter2(c,code)
return c:GetOriginalCode()==code
end
function cm.op(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local copyt=cm[e]
local exg=Group.CreateGroup()
for tc,cid in pairs(copyt) do
if tc and cid then exg:AddCard(tc) end
end
local g=c:GetOverlayGroup():Filter(cm.copyfilter,nil,c)
local dg=exg:Filter(cm.gfilter,nil,g)
for tc in aux.Next(dg) do
c:ResetEffect(copyt[tc],RESET_COPY)
exg:RemoveCard(tc)
copyt[tc]=nil
end
local cg=g:Filter(cm.gfilter1,nil,exg)
local f=Card.RegisterEffect
Card.RegisterEffect=function(tc,e,forced)
e:SetCondition(cm.rcon(e:GetCondition(),tc,copyt))
f(tc,e,forced)
end
for tc in aux.Next(cg) do
copyt[tc]=c:CopyEffect(tc:GetOriginalCode(),RESET_EVENT+0x1fe0000,1)
end
Card.RegisterEffect=f
end
function cm.rcon(con,tc,copyt)
return function(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if not c:IsHasEffect(m+1000) then
c:ResetEffect(c,copyt[tc],RESET_COPY)
copyt[tc]=nil
return false
end
if not con or con(e,tp,eg,ep,ev,re,r,rp) then return true end
return e:IsHasType(0x7e0) and c:GetFlagEffect(m)>0
end
end
\ No newline at end of file
......@@ -64,13 +64,10 @@ function c14801019.efop(e,tp,eg,ep,ev,re,r,rp)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetRange(LOCATION_MZONE)
e1:SetLabel(ep)
e1:SetValue(c14801019.tgval)
e1:SetValue(1)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
rc:RegisterEffect(e1,true)
end
function c14801019.tgval(e,re,rp)
return rp==1-e:GetLabel()
end
function c14801019.thcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsReason(REASON_EFFECT)
end
......
......@@ -96,9 +96,10 @@ end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g1=Duel.GetMatchingGroup(cm.filter1,tp,LOCATION_MZONE,0,nil)
if chkc then return chkc:IsLocation(LOCATION_MZONE) and chkc:IsControler(tp) and cm.filter2(chkc,tp) end
if chk==0 then return iCount(0,tp,m,1) and Duel.IsExistingTarget(cm.filter2,tp,LOCATION_MZONE,0,1,nil,tp) and g1:GetClassCount(Card.GetLevel)>1 end
if chk==0 then return Duel.GetFlagEffect(tp,17060818)==0 and Duel.IsExistingTarget(cm.filter2,tp,LOCATION_MZONE,0,1,nil,tp) and g1:GetClassCount(Card.GetLevel)>1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
Duel.SelectTarget(tp,cm.filter2,tp,LOCATION_MZONE,0,1,1,nil,tp)
Duel.RegisterFlagEffect(tp,17060818,RESET_PHASE+PHASE_END,0,1)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
......@@ -110,9 +111,9 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_LEVEL_FINAL)
e1:SetCode(EFFECT_CHANGE_LEVEL)
e1:SetValue(lv)
e1:SetReset(RESET_EVENT+0x1fe0000)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
lc:RegisterEffect(e1)
lc=g:GetNext()
end
......
......@@ -22,16 +22,15 @@ function cm.initial_effect(c)
e2:SetProperty(EFFECT_FLAG_UNCOPYABLE)
e2:SetCode(EFFECT_SPSUMMON_PROC)
e2:SetRange(LOCATION_HAND+LOCATION_GRAVE)
e2:SetCountLimit(1,17060820)
e2:SetCondition(cm.hspcon)
e2:SetOperation(cm.hspop)
c:RegisterEffect(e2)
--special summon
--fusion summon
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(17060820,0))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetCondition(cm.fpcon)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,17060820)
e3:SetTarget(cm.fptg)
e3:SetOperation(cm.fpop)
c:RegisterEffect(e3)
......@@ -51,13 +50,6 @@ function cm.IsDark_Degenerate(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Dark_Degenerate
end
function iCount(name,tp,m,id)
return ((name=="get" or name=="set")
and {(name=="get"
and {tonumber(((Duel.GetFlagEffect(tp,m)==nil) and {0} or {Duel.GetFlagEffect(tp,m)})[1])}
or { Debug.Message("","请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)") })[1]}
or {(bit.band(iCount("get",tp,m,id),math.pow(2,id-1))==0 and {true} or {false})[1]})[1]
end
function cm.epcon(e,tp,eg,ep,ev,re,r,rp)
return Duel.GetTurnPlayer()==tp
end
......@@ -79,21 +71,18 @@ function cm.hspcon(e,c)
if c==nil then return true end
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return ft>-1 and Duel.CheckReleaseGroup(tp,cm.hspfilter,1,nil,ft,tp)
return ft>-1 and Duel.GetFlagEffect(tp,17060820)==0 and Duel.CheckReleaseGroup(tp,cm.hspfilter,1,nil,ft,tp)
end
function cm.hspop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.SelectReleaseGroup(tp,cm.hspfilter,1,1,nil,ft,tp)
Duel.Release(g,REASON_COST)
Duel.RegisterFlagEffect(tp,17060820,RESET_PHASE+PHASE_END,0,1)
end
function cm.fpcon(e,tp,eg,ep,ev,re,r,rp)
local ph=Duel.GetCurrentPhase()
return ph~=PHASE_DAMAGE and ph~=PHASE_DAMAGE_CAL
end
function cm.spfilter1(c,e)
function cm.filter1(c,e)
return not c:IsImmuneToEffect(e)
end
function cm.spfilter2(c,e,tp,m,f,gc,chkf)
function cm.filter2(c,e,tp,m,f,gc,chkf)
return c:IsType(TYPE_FUSION) and c:IsRace(RACE_WARRIOR) and (not f or f(c))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_FUSION,tp,false,false) and c:CheckFusionMaterial(m,gc,chkf)
end
......@@ -101,18 +90,18 @@ function cm.fptg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then
local chkf=tp
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.spfilter1,nil,e)
local res=Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
local mg1=Duel.GetFusionMaterial(tp)
local res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg1,nil,c,chkf)
if not res then
local ce=Duel.GetChainMaterial(tp)
if ce~=nil then
local fgroup=ce:GetTarget()
local mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
res=Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
res=Duel.IsExistingMatchingCard(cm.filter2,tp,LOCATION_EXTRA,0,1,nil,e,tp,mg2,mf,c,chkf)
end
end
return res and iCount(0,tp,m,1)
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
......@@ -120,8 +109,8 @@ function cm.fpop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local chkf=tp
if c:IsFacedown() or not c:IsRelateToEffect(e) or c:IsImmuneToEffect(e) then return end
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.spfilter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg1=Duel.GetFusionMaterial(tp):Filter(cm.filter1,nil,e)
local sg1=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg1,nil,c,chkf)
local mg2=nil
local sg2=nil
local ce=Duel.GetChainMaterial(tp)
......@@ -129,7 +118,7 @@ function cm.fpop(e,tp,eg,ep,ev,re,r,rp)
local fgroup=ce:GetTarget()
mg2=fgroup(ce,e,tp)
local mf=ce:GetValue()
sg2=Duel.GetMatchingGroup(cm.spfilter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
sg2=Duel.GetMatchingGroup(cm.filter2,tp,LOCATION_EXTRA,0,nil,e,tp,mg2,mf,c,chkf)
end
if sg1:GetCount()>0 or (sg2~=nil and sg2:GetCount()>0) then
local sg=sg1:Clone()
......
......@@ -6,18 +6,18 @@ function cm.initial_effect(c)
aux.EnablePendulumAttribute(c)
--spsummon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetDescription(aux.Stringid(17060914,0))
e1:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_PZONE)
e1:SetCountLimit(1,m+EFFECT_COUNT_CODE_DUEL)
e1:SetCountLimit(1,17060914)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
--search
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetDescription(aux.Stringid(17060914,1))
e2:SetCategory(CATEGORY_TOGRAVE+CATEGORY_SEARCH+CATEGORY_TOHAND)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_SUMMON_SUCCESS)
......@@ -33,18 +33,7 @@ end
cm.is_named_with_Ma_Elf=1
function cm.IsMa_Elf(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Ma_Elf
end
function cm.IsMillion_Arthur(c)
local m=_G["c"..c:GetCode()]
return m and m.is_named_with_Million_Arthur
end
function iCount(name,tp,m,id)
return ((name=="get" or name=="set")
and {(name=="get"
and {tonumber(((Duel.GetFlagEffect(tp,m)==nil) and {0} or {Duel.GetFlagEffect(tp,m)})[1])}
or { Debug.Message("","请使用Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)") })[1]}
or {(bit.band(iCount("get",tp,m,id),math.pow(2,id-1))==0 and {true} or {false})[1]})[1]
return m and m.is_named_with_Ma_Elf
end
function cm.cfilter(c)
return c:IsFacedown() or not c:IsType(TYPE_PENDULUM)
......@@ -52,41 +41,38 @@ end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_MZONE,0,1,nil)
end
function cm.filter(c)
return c:IsFaceup() and c:IsType(TYPE_PENDULUM) and c:IsAbleToGrave()
function cm.tgfilter(c)
return c:IsSetCard(0x7f0) and (c:IsFaceup() or not c:IsLocation(LOCATION_EXTRA)) and c:IsAbleToHand()
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.filter,tp,LOCATION_EXTRA,0,1,nil)end
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and e:GetHandler():IsCanBeSpecialSummoned(e,0,tp,false,false)
and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
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 not c:IsRelateToEffect(e) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local g=Duel.SelectMatchingCard(tp,cm.filter,tp,LOCATION_EXTRA,0,1,1,nil)
local tc=g:GetFirst()
if Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) and c:IsRelateToEffect(e) then
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tgfilter),tp,LOCATION_EXTRA,0,1,1,nil)
local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.SpecialSummon(c,0,tp,tp,false,false,POS_FACEUP)
end
end
function cm.tgfilter(c)
return (c:IsType(TYPE_PENDULUM) and cm.IsMillion_Arthur or not c:IsLocation(LOCATION_DECK)) and c:IsAbleToGrave()
and (c:IsFaceup() and c:IsType(TYPE_PENDULUM) or not c:IsLocation(LOCATION_EXTRA)) and c:IsAbleToGrave()
end
function cm.thfilter(c)
return c:IsType(TYPE_PENDULUM) and cm.IsMa_Elf(c) and c:IsAbleToHand() and not c:IsCode(17060914)
end
function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return iCount(0,tp,m,1) and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_DECK+LOCATION_EXTRA,0,1,nil)
if chk==0 then return Duel.GetFlagEffect(tp,17060914)==0 and Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,nil)
and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_DECK+LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,nil,1,tp,LOCATION_EXTRA)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
Duel.RegisterFlagEffect(tp,17060914,RESET_PHASE+PHASE_END,0,1)
end
function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local tg=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.tgfilter),tp,LOCATION_DECK+LOCATION_EXTRA,0,1,1,nil)
local tg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_EXTRA+LOCATION_DECK,0,1,1,nil)
local tc=tg:GetFirst()
if tc and Duel.SendtoGrave(tc,REASON_EFFECT)~=0 and tc:IsLocation(LOCATION_GRAVE) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
......@@ -96,4 +82,4 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
\ No newline at end of file
......@@ -50,15 +50,17 @@ function cm.con(e,c)
if c==nil then return true end
return Duel.GetMatchingGroupCount(aux.TRUE,c:GetControler(),LOCATION_MZONE,0,nil)==1
end
function cm.spfilter(c,ft,tp)
return c:IsControler(tp)
end
function cm.spcon(e,c)
if c==nil then return true end
return Duel.GetLocationCount(c:GetControler(),LOCATION_MZONE)>0 and
Duel.GetMatchingGroupCount(aux.TRUE,c:GetControler(),LOCATION_MZONE,0,nil)==1
and Duel.CheckReleaseGroup(tp,Card.IsReleasable,1,nil)
local tp=c:GetControler()
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
return Duel.GetMatchingGroupCount(aux.TRUE,c:GetControler(),LOCATION_MZONE,0,nil)==1 and Duel.CheckReleaseGroup(tp,cm.spfilter,1,nil,ft,tp)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
local g=Duel.GetFirstMatchingCard(Card.IsReleasable,tp,LOCATION_MZONE,1,nil)
local g=Duel.GetFirstMatchingCard(Card.IsReleasable,tp,LOCATION_MZONE,0,nil)
Duel.Release(g,REASON_COST)
end
function cm.atkfilter(c)
......@@ -77,7 +79,7 @@ function cm.sumsuc(e,tp,eg,ep,ev,re,r,rp)
e1:SetCountLimit(1)
e1:SetCondition(cm.epcon)
e1:SetOperation(cm.activate)
Duel.RegisterEffect(e1,tp)
Duel.RegisterEffect(e1,c:GetControler())
end
end
function cm.epcon(e,tp,eg,ep,ev,re,r,rp)
......@@ -96,14 +98,14 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
g:RegisterEffect(e2)
end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local cg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if cg:GetCount()<1 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local cg=Duel.SelectMatchingCard(tp,aux.TRUE,tp,0,LOCATION_MZONE,1,1,nil)
if cg:GetCount()<1 then
Duel.Damage(1-tp,1000,REASON_EFFECT)
else
Duel.HintSelection(cg)
Duel.Destroy(cg,REASON_EFFECT)
Duel.Damage(1-tp,1000,REASON_EFFECT)
Duel.HintSelection(cg)
Duel.Destroy(cg,REASON_EFFECT)
Duel.Damage(1-tp,1000,REASON_EFFECT)
end
end
end
......@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--Activate
local e1=Effect.CreateEffect(c)
e1:SetCategory(CATEGORY_DRAW)
e1:SetCategory(CATEGORY_REMOVE)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetCode(EVENT_FREE_CHAIN)
......@@ -21,8 +21,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.SelectTarget(tp,Card.IsAbleToRemove,tp,0,LOCATION_ONFIELD,1,1,nil)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,g,1,0,0)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp,chk)
if not e:GetHandler():IsRelateToEffect(e) then return end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) then
Duel.Remove(tc,POS_FACEDOWN,REASON_EFFECT)
......
......@@ -19,9 +19,9 @@ function c47570004.initial_effect(c)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,47570005)
e2:SetCondition(c47570004.descon)
e2:SetTarget(c47570004.destg)
e2:SetOperation(c47570004.desop)
e2:SetCondition(c47570004.ctmcon)
e2:SetTarget(c47570004.ctmtg)
e2:SetOperation(c47570004.ctmop)
c:RegisterEffect(e2)
end
function c47570004.condition(e,tp,eg,ep,ev,re,r,rp)
......@@ -51,7 +51,7 @@ function c47570004.ctmtg(e,tp,eg,ep,ev,re,r,rp,chk)
end
function c47570004.ctmop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,0,aux.ExceptThisCard(e))
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,aux.ExceptThisCard(e))
if g:GetCount()>0 and Duel.Destroy(g,REASON_EFFECT)~=0 then
Duel.BreakEffect()
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(47570004,0))
......
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