Commit 66ab69ac authored by POLYMER's avatar POLYMER

fix

parent d01fa012
......@@ -43,7 +43,7 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local tc=g:GetFirst()
if tc:IsSetCard(0xa450) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
......@@ -51,28 +51,91 @@ function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.scfilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_WIND)
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.scfilter,tp,LOCATION_EXTRA,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
function cm.symfil(c,e)
return c:IsType(TYPE_MONSTER) and c:IsCanBeSynchroMaterial() and c:IsAbleToDeck() and not c:IsImmuneToEffect(e)
end
function cm.espfil(c,e,tp,mg)
return mg:CheckWithSumEqual(Card.GetSynchroLevel,c:GetLevel(),#mg,#mg,c) and c:IsSynchroSummonable(nil,mg) --and mg:GetSum(Card.GetSynchroLevel,c)==c:GetLevel()
--false. GetSum(Card.GetSynchroLevel)~=c:GetLevel(). CheckWithSumEqual~=GetSum.
end
function cm.espfil2(g,c)
return g:CheckWithSumEqual(Card.GetSynchroLevel,c:GetLevel(),#g,#g,c) and c:IsSynchroSummonable(nil,g) and c:IsAttribute(ATTRIBUTE_WIND)
end
function cm.symgck(g,e,tp)
return Duel.IsExistingMatchingCard(cm.espfil,tp,LOCATION_EXTRA,0,1,nil,e,tp,g)
end
function cm.slfilter(c,sc,lv)
return c:GetSynchroLevel(sc)==lv
end
function cm.scop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.scfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
if not sc then return end
local mg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
local mat=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=mg:Select(tp,sc:GetLevel(),sc:GetLevel(),nil)
if #sg==sc:GetLevel() then
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
function Auxiliary.SynMixFilter4(c,f4,minc,maxc,syncard,mg1,smat,c1,c2,c3,gc,mgchk)
cm.fparams={f4,c1,c2,c3}
if f4 and not f4(c,syncard,c1,c2,c3) then return false end
local sg=Group.FromCards(c1,c)
sg:AddCard(c1)
if c2 then sg:AddCard(c2) end
if c3 then sg:AddCard(c3) end
local mg=mg1:Clone()
if f4 then
mg=mg:Filter(f4,sg,syncard,c1,c2,c3)
else
mg:Sub(sg)
end
return Auxiliary.SynMixCheck(mg,sg,minc-1,maxc-1,syncard,smat,gc,mgchk)
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
if chk==0 then
cm.SubGroupParams={nil,Card.GetLevel,nil,false,true}
--local res=Group.CheckSubGroup(g,cm.symgck,1,3,e,tp)
local res=Group.CheckSubGroup(g,cm.symgck,1,3,e,tp)
cm.SubGroupParams={}
return res
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.espfil3(c,g,e,tp)
cm.SubGroupParams={nil,Card.GetLevel,nil,false,true}
local res=Group.CheckSubGroup(g,cm.symgck,1,3,e,tp)
--local res=Group.SelectSubGroup(g,tp,cm.espfilr,false,1,3,e,tp,c)
cm.SubGroupParams={}
return res and c:IsType(TYPE_SYNCHRO)
--return c:IsSynchroSummonable(nil,g)
end
function cm.espfilr(mg,e,tp,c)
return mg:CheckWithSumEqual(Card.GetSynchroLevel,c:GetLevel(),#mg,#mg,c) and c:IsSynchroSummonable(nil,mg) --and mg:GetSum(Card.GetSynchroLevel,c)==c:GetLevel()
--false. GetSum(Card.GetSynchroLevel)~=c:GetLevel(). CheckWithSumEqual~=GetSum.
end
function cm.scop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
cm.fparams=nil
local g=Duel.GetMatchingGroup(cm.symfil,tp,LOCATION_MZONE+LOCATION_GRAVE+LOCATION_REMOVED,0,nil,e)
local tc=Duel.SelectMatchingCard(tp,cm.espfil3,tp,LOCATION_EXTRA,0,1,1,nil,g,e,tp):GetFirst()
cm.SubGroupParams={function(c,sc) return c:GetSynchroLevel(tc)==sc:GetSynchroLevel(tc) and (not cm.fparams or (cm.fparams[1](c,tc,table.unpack(cm.fparams,2))==cm.fparams[1](sc,tc,table.unpack(cm.fparams,2)))) end,Card.GetLevel,nil,false}
local mat1=g:SelectSubGroup(tp,cm.espfil2,false,1,3,tc)
cm.SubGroupParams={}
cm.fparams=nil
if mat1:IsExists(function(c) return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND) end,1,nil) then
local cg=mat1:Filter(function(c) return c:IsLocation(LOCATION_MZONE) and c:IsFacedown() or c:IsLocation(LOCATION_HAND) or c:IsLocation(LOCATION_DECK) end,nil)
Duel.ConfirmCards(1-tp,cg)
end
tc:SetMaterial(mat1)
Duel.SendtoDeck(mat1,nil,SEQ_DECKTOP,REASON_EFFECT+REASON_MATERIAL+REASON_SYNCHRO)
local p=tp
for i=1,2 do
local dg=mat1:Filter(function(c,tp) return c:IsLocation(LOCATION_DECK) and c:IsControler(tp) end,nil,p)
if #dg>1 then
Duel.SortDecktop(tp,p,#dg)
end
for i=1,#dg do
local mg=Duel.GetDecktopGroup(p,1)
Duel.MoveSequence(mg:GetFirst(),SEQ_DECKBOTTOM)
end
p=1-tp
end
Duel.BreakEffect()
Duel.SpecialSummon(tc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
tc:CompleteProcedure()
end
--鐳徳斯
local cm,m=GetID()
function cm.initial_effect(c)
--remove and search
--discard and banish
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_REMOVE+CATEGORY_TOHAND+CATEGORY_SEARCH)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,m)
e1:SetCost(cm.rmcost)
e1:SetTarget(cm.rmtg)
e1:SetOperation(cm.rmop)
e1:SetCost(cm.discost)
e1:SetTarget(cm.distg)
e1:SetOperation(cm.disop)
c:RegisterEffect(e1)
cm.discard_effect=e1
--synchro summon
--special summon xyz
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
e2:SetCode(EVENT_REMOVE)
e2:SetProperty(EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m+1)
e2:SetTarget(cm.sctg)
e2:SetOperation(cm.scop)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
end
function cm.rmcost(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.discost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.rmtg(e,tp,eg,ep,ev,re,r,rp,chk)
function cm.distg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE)
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.thfilter(c)
return c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
end
function cm.rmop(e,tp,eg,ep,ev,re,r,rp)
function cm.disop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,Card.IsAbleToRemove,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,nil)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
if g:GetCount()>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local tc=g:GetFirst()
if tc:IsSetCard(0xa450) and Duel.IsExistingMatchingCard(cm.thfilter,tp,LOCATION_DECK,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,2)) then
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.thfilter,tp,LOCATION_DECK,0,1,1,nil)
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
if sg:GetCount()>0 then
Duel.SendtoHand(sg,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,sg)
end
end
end
end
function cm.scfilter(c)
return c:IsType(TYPE_SYNCHRO) and c:IsAttribute(ATTRIBUTE_WIND)
function cm.thfilter(c)
return c:IsSetCard(0xa450) and c:IsType(TYPE_SPELL+TYPE_TRAP) and c:IsAbleToHand()
end
function cm.spfilter(c,g)
return c:IsAttribute(ATTRIBUTE_EARTH) and c:IsXyzSummonable(g)
end
function cm.matfilter(c)
return c:IsCanBeXyzMaterial(nil) and c:IsFaceup()
end
function cm.sctg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.scfilter,tp,LOCATION_EXTRA,0,1,nil) end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,g) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.scop(e,tp,eg,ep,ev,re,r,rp)
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.matfilter,tp,LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local sc=Duel.SelectMatchingCard(tp,cm.scfilter,tp,LOCATION_EXTRA,0,1,1,nil):GetFirst()
if not sc then return end
local mg=Duel.GetMatchingGroup(Card.IsAbleToDeck,tp,LOCATION_ONFIELD+LOCATION_REMOVED,0,nil)
local mat=Group.CreateGroup()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local sg=mg:Select(tp,sc:GetLevel(),sc:GetLevel(),nil)
if #sg==sc:GetLevel() then
Duel.SendtoDeck(sg,nil,SEQ_DECKBOTTOM,REASON_EFFECT)
Duel.SpecialSummon(sc,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
sc:CompleteProcedure()
local xyzg=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,g)
if xyzg:GetCount()>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Duel.XyzSummon(tp,xyzg:GetFirst(),g,1,99)
end
end
function cm.bnfilter(c)
return c:IsFaceup() and not c:IsSetCard(0xa450)
end
function cm.bncon(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(cm.bnfilter,tp,LOCATION_ONFIELD,0,1,nil)
end
function cm.bnop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(cm.bnfilter,tp,LOCATION_ONFIELD,0,nil)
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
......@@ -14,14 +14,12 @@ function cm.initial_effect(c)
--negate
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_NEGATE+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_QUICK_O)
e2:SetCode(EVENT_CHAINING)
e2:SetRange(LOCATION_SZONE)
e2:SetCategory(CATEGORY_DISABLE+CATEGORY_TODECK)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_CHAIN_SOLVING)
e2:SetRange(LOCATION_FZONE)
e2:SetCountLimit(1,m+1)
e2:SetCondition(cm.negcon)
e2:SetCost(cm.negcost)
e2:SetTarget(cm.negtg)
e2:SetOperation(cm.negop)
c:RegisterEffect(e2)
--atk/def
......@@ -30,8 +28,8 @@ function cm.initial_effect(c)
e3:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DEFCHANGE)
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
e3:SetRange(LOCATION_SZONE)
e3:SetCountLimit(1,m+2)
e3:SetRange(LOCATION_FZONE)
e3:SetCountLimit(1,m+50)
e3:SetTarget(cm.atktg)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
......@@ -52,45 +50,44 @@ function cm.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.SetOperationInfo(0,CATEGORY_REMOVE,nil,1,tp,LOCATION_DECK)
end
function cm.actop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local tc=g:GetFirst()
tc:CreateEffectRelation(e)
local te=tc.discard_effect
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1)
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
end
if Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoGrave(sg,REASON_RETURN)
if Duel.IsExistingMatchingCard(cm.rmfilter,tp,LOCATION_DECK,0,1,nil,e,tp,eg,ep,ev,re,r,rp) and Duel.SelectYesNo(tp,aux.Stringid(m,1)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.rmfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,eg,ep,ev,re,r,rp)
if #g>0 and Duel.Remove(g,POS_FACEUP,REASON_EFFECT)~=0 then
local tc=g:GetFirst()
tc:CreateEffectRelation(e)
local te=tc.discard_effect
local tg=te:GetTarget()
if tg then tg(e,tp,eg,ep,ev,re,r,rp,1)
local op=te:GetOperation()
if op then op(e,tp,eg,ep,ev,re,r,rp) end
Duel.BreakEffect()
end
if Duel.IsExistingMatchingCard(cm.tgfilter,tp,LOCATION_REMOVED,0,1,nil)
and Duel.SelectYesNo(tp,aux.Stringid(m,0)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
local sg=Duel.SelectMatchingCard(tp,cm.tgfilter,tp,LOCATION_REMOVED,0,1,1,nil)
Duel.SendtoGrave(sg,REASON_RETURN)
end
end
end
end
function cm.negcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp and re:IsHasType(EFFECT_TYPE_ACTIVATE) and Duel.IsChainNegatable(ev)
return rp==1-tp and (re:IsHasType(EFFECT_TYPE_ACTIVATE) or re:IsActiveType(TYPE_MONSTER)) and Duel.IsChainDisablable(ev) and Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,nil) and e:GetHandler():GetFlagEffect(m)<=0
end
function cm.cfilter(c)
return c:IsSetCard(0xa450) and (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup())
end
function cm.negcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,5,nil)
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.negtg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_NEGATE,eg,1,0,0)
return c:IsSetCard(0xa450) and c:IsAbleToDeck() and c:IsFaceup()
end
function cm.negop(e,tp,eg,ep,ev,re,r,rp)
if Duel.NegateActivation(ev) then
Duel.SendtoGrave(eg,REASON_EFFECT)
if Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(m,3)) then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DEATTACHFROM)
local tg=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_GRAVE+LOCATION_REMOVED,0,5,5,nil)
if #tg>0 and Duel.SendtoDeck(tg,nil,SEQ_DECKSHUFFLE,REASON_EFFECT) then
Duel.Hint(HINT_CARD,0,m)
Duel.NegateEffect(ev)
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,EFFECT_FLAG_CLIENT_HINT,1,0,aux.Stringid(m,4))
end
end
end
function cm.atkfilter(c)
......
......@@ -5,8 +5,8 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
......@@ -24,41 +24,40 @@ function cm.initial_effect(c)
e2:SetOperation(cm.setop)
c:RegisterEffect(e2)
end
function cm.spfilter(c)
return c:IsSetCard(0xa450) and c:IsLevelBelow(4) and c:IsAbleToDeck()
function cm.spfilter(c,e,tp)
return c:IsSetCard(0xa450) and c:IsLevelBelow(4) and c:IsAbleToDeckOrExtraAsCost() and Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,c:GetAttribute(),e,tp) and Duel.GetMZoneCount(tp,c)>0
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler()) end
if chk==0 then return Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,e:GetHandler(),e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TODECK)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler())
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,e:GetHandler(),e,tp)
e:SetLabel(g:GetFirst():GetAttribute())
Duel.SendtoDeck(g,nil,SEQ_DECKSHUFFLE,REASON_COST)
end
function cm.spfilter2(c,att)
return c:IsSetCard(0xa450) and c:IsAttribute(att) and c:IsType(TYPE_EXTRA) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
function cm.spfilter2(c,att,e,tp)
return c:IsSetCard(0xa450) and c:IsAttribute(att) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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 Duel.IsExistingMatchingCard(cm.spfilter2,tp,LOCATION_EXTRA,0,1,nil,e:GetLabel()) end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e:GetLabel())
local g=Duel.SelectMatchingCard(tp,cm.spfilter2,tp,LOCATION_EXTRA,0,1,1,nil,e:GetLabel(),e,tp)
if #g>0 and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_PHASE+PHASE_END)
e1:SetCountLimit(1)
e1:SetOperation(cm.atkop)
e1:SetLabelObject(g:GetFirst())
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsSetCard,tp,LOCATION_MZONE,0,nil,0xa450)
for tc in aux.Next(g) do
local tc=e:GetLabelObject()
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
......@@ -71,13 +70,12 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(-1000)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
end
end
function cm.setfilter(c)
return c:IsSetCard(0xa450) and c:IsAbleToRemove()
return c:IsSetCard(0xa450) and c:IsAbleToRemoveAsCost()
end
function cm.setcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToRemove()
if chk==0 then return e:GetHandler():IsAbleToRemoveAsCost()
and Duel.IsExistingMatchingCard(cm.setfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,e:GetHandler()) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_REMOVE)
local g=Duel.SelectMatchingCard(tp,cm.setfilter,tp,LOCATION_HAND+LOCATION_ONFIELD+LOCATION_GRAVE,0,1,1,e:GetHandler())
......
......@@ -5,10 +5,10 @@ function cm.initial_effect(c)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCountLimit(1,m)
e1:SetCost(cm.spcost)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
......@@ -27,10 +27,7 @@ end
function cm.spfilter(c)
return c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER) and c:IsAbleToDeck()
end
function cm.spcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsDiscardable() end
Duel.SendtoGrave(e:GetHandler(),REASON_COST+REASON_DISCARD)
end
function cm.spfilter2(c,e,tp)
return c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
......@@ -63,7 +60,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsDefenseBelow,tp,LOCATION_MZONE,0,nil,1)
local g=Duel.GetMatchingGroup(Card.IsDefense,tp,LOCATION_MZONE,0,nil,0)
if #g>0 then
Duel.Remove(g,POS_FACEDOWN,REASON_EFFECT)
end
......
--鳞病瘟疫
local cm,m=GetID()
function cm.initial_effect(c)
c:SetUniqueOnField(1,0,m)
--search
local e0=Effect.CreateEffect(c)
e0:SetType(EFFECT_TYPE_ACTIVATE)
e0:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e0)
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_SEARCH+CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetRange(LOCATION_SZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.srcost)
e1:SetTarget(cm.srtg)
......@@ -29,7 +34,7 @@ function cm.initial_effect(c)
e3:SetCategory(CATEGORY_TOHAND+CATEGORY_SEARCH)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetRange(LOCATION_MZONE)
e3:SetRange(LOCATION_SZONE)
e3:SetProperty(EFFECT_FLAG_DELAY)
e3:SetCountLimit(1,m+2)
e3:SetCondition(cm.lvcon)
......@@ -38,40 +43,50 @@ function cm.initial_effect(c)
c:RegisterEffect(e3)
end
function cm.srcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMatchingGroupCount(Card.IsType,tp,LOCATION_HAND,0,e:GetHandler(),TYPE_MONSTER)>0 end
if chk==0 then return Duel.IsExistingMatchingCard(cm.fit1,tp,LOCATION_HAND,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,cm.fit1,tp,LOCATION_HAND,0,1,1,nil)
Duel.ConfirmCards(1-tp,g)
Duel.ShuffleHand(tp)
e:SetLabel(g:GetFirst():GetAttribute())
end
function cm.fit1(c,tp)
return not c:IsPublic() and Duel.IsExistingMatchingCard(cm.fit2,tp,LOCATION_DECK,0,1,nil,c:GetAttribute())
end
function cm.fit2(c,attr)
return c:IsAttribute() and c:IsAbleToHand() and c:IsSetCard(0xa450)
end
function cm.srfilter(c,att)
return c:IsSetCard(0xa450) and c:IsAttribute(att) and c:IsAbleToHand()
end
function cm.srtg(e,tp,eg,ep,ev,re,r,rp,chk)
local attr=e:GetLabel()
if chk==0 then
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND,0,e:GetHandler(),TYPE_MONSTER)
return #g>0
return Duel.IsExistingMatchingCard(cm.fit2,tp,LOCATION_DECK,0,1,nil,attr)
end
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
end
function cm.fit(c)
return (c:IsAbleToGrave() or c:IsAbleToRemove())
end
function cm.srop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsType,tp,LOCATION_HAND,0,e:GetHandler(),TYPE_MONSTER)
if #g==0 then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local tc=Duel.SelectMatchingCard(tp,Card.IsType,tp,LOCATION_HAND,0,1,1,e:GetHandler(),TYPE_MONSTER):GetFirst()
if not tc then return end
Duel.ConfirmCards(1-tp,tc)
local att=tc:GetAttribute()
local att=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local sg=Duel.SelectMatchingCard(tp,cm.srfilter,tp,LOCATION_DECK,0,1,1,nil,att)
local sg=Duel.SelectMatchingCard(tp,cm.srfilter,tp,LOCATION_DECK,0,1,1,nil,attr)
if #sg>0 and Duel.SendtoHand(sg,nil,REASON_EFFECT)>0 then
Duel.ConfirmCards(1-tp,sg)
local dg=Duel.GetMatchingGroup(Card.IsAbleToGrave,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
if #dg>0 and Duel.SelectYesNo(tp,aux.Stringid(m,3)) then
local dg=Duel.GetMatchingGroup(cm.fit,tp,LOCATION_HAND+LOCATION_ONFIELD,0,e:GetHandler())
if #dg>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local tg=dg:Select(tp,1,1,nil)
if Duel.SelectOption(tp,aux.Stringid(m,4),aux.Stringid(m,5))==0 then
Duel.SendtoGrave(tg,REASON_EFFECT)
local tc=g:GetFirst()
if tc and tc:IsAbleToGrave() and (not tc:IsAbleToRemove() or Duel.SelectOption(tp,1191,1192)==0) then
Duel.SendtoGrave(tc,REASON_EFFECT)
else
Duel.Remove(tg,POS_FACEUP,REASON_EFFECT)
Duel.Remove(tc,POS_FACEUP,REASON_EFFECT)
end
end
end
end
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
......@@ -98,8 +113,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end
end
function cm.lvfilter(c,tp)
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsSetCard(0xa450) and c:IsType(TYPE_EXTRA)
and c:IsReason(REASON_EFFECT) and c:GetReasonPlayer()==1-tp
return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp) and c:IsSetCard(0xa450) and c:IsSummonLocation(LOCATION_EXTRA) and c:GetReasonPlayer()==1-tp
end
function cm.lvcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.lvfilter,1,nil,tp)
......
......@@ -19,27 +19,6 @@ function cm.initial_effect(c)
e2:SetOperation(cm.lvop)
c:RegisterEffect(e2)
--effects by atk
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_UPDATE_ATTACK)
e3:SetRange(LOCATION_MZONE)
e3:SetCondition(cm.atkcon1)
e3:SetValue(1000)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE)
e4:SetCode(EFFECT_UPDATE_ATTACK)
e4:SetRange(LOCATION_MZONE)
e4:SetCondition(cm.atkcon2)
e4:SetValue(2000)
c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE)
e5:SetCode(EFFECT_UPDATE_ATTACK)
e5:SetRange(LOCATION_MZONE)
e5:SetCondition(cm.atkcon3)
e5:SetValue(3000)
c:RegisterEffect(e5)
--direct attack
local e6=Effect.CreateEffect(c)
e6:SetDescription(aux.Stringid(m,0))
......@@ -59,7 +38,62 @@ function cm.initial_effect(c)
e10:SetCost(cm.spcost)
e10:SetOperation(cm.spcop)
c:RegisterEffect(e10)
--effects by atk
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_INDESTRUCTABLE_BATTLE)
e1:SetCondition(cm.indcon)
e1:SetValue(1)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_ATTACK_ALL)
e2:SetCondition(cm.indcon)
e2:SetValue(1)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetCategory(CATEGORY_ATKCHANGE)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PRE_DAMAGE_CALCULATE)
e3:SetCountLimit(1,m+100)
e3:SetCondition(cm.atkcon)
e3:SetOperation(cm.atkop)
c:RegisterEffect(e3)
local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_FIELD)
e4:SetCode(EFFECT_CANNOT_ACTIVATE)
e4:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e4:SetRange(LOCATION_MZONE)
e4:SetTargetRange(0,1)
e4:SetCondition(cm.lockcon)
e4:SetValue(1)
c:RegisterEffect(e4)
end
function cm.indcon(e)
return e:GetHandler():IsAttackAbove(1000)
end
function cm.atkcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(2000) and c:IsRelateToBattle() and Duel.GetAttackTarget()~=nil
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local bc=c:GetBattleTarget()
if c:IsRelateToBattle() and c:IsFaceup() and bc:IsRelateToBattle() and bc:IsFaceup() then
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_DAMAGE_CAL)
e1:SetValue(bc:GetAttack())
c:RegisterEffect(e1)
end
end
function cm.lockcon(e)
return e:GetHandler():IsAttackAbove(3000) and Duel.GetCurrentPhase()>=PHASE_BATTLE_START and Duel.GetCurrentPhase()<=PHASE_BATTLE
end
function cm.fit(c)
return c:IsType(TYPE_MONSTER)and c:IsSetCard(0xa450)
end
......@@ -94,24 +128,7 @@ function cm.statop(e,tp,eg,ep,ev,re,r,rp)
end
end
end
function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsPreviousLocation(LOCATION_ONFIELD) then
Duel.Remove(c,POS_FACEDOWN,REASON_EFFECT)
end
end
function cm.atkcon1(e)
local c=e:GetHandler()
return c:IsAttackAbove(1000) and c:IsAttackBelow(1999)
end
function cm.atkcon2(e)
local c=e:GetHandler()
return c:IsAttackAbove(2000) and c:IsAttackBelow(2999)
end
function cm.atkcon3(e)
local c=e:GetHandler()
return c:IsAttackAbove(3000)
end
function cm.dacost(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)
......
......@@ -2,7 +2,7 @@
local cm,m=GetID()
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedure(c,cm.xyzfilter,1,99)
aux.AddXyzProcedure(c,cm.xyzfilter,1,1,nil,nil,99)
c:EnableReviveLimit()
--stats change
local e1=Effect.CreateEffect(c)
......@@ -117,12 +117,12 @@ function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.negcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(1000) and c:IsAttackBelow(1999) and re:IsActiveType(TYPE_TRAP)
return c:IsAttackAbove(1000) and re:IsActiveType(TYPE_TRAP)
and Duel.IsChainNegatable(ev)
end
function cm.negcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(2000) and c:IsAttackBelow(2999) and re:IsActiveType(TYPE_SPELL)
return c:IsAttackAbove(2000) and re:IsActiveType(TYPE_SPELL)
and Duel.IsChainNegatable(ev)
end
function cm.negcon3(e,tp,eg,ep,ev,re,r,rp)
......
......@@ -79,10 +79,10 @@ function cm.spcop(e,tp,eg,ep,ev,re,r,rp)
Duel.SendtoDeck(g,nil,3,REASON_COST)
end
function cm.matfilter1(c)
return c:IsSetCard(0xa450) and c:IsType(TYPE_TUNER) and c:IsType(TYPE_MONSTER)
return c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER)
end
function cm.matfilter2(c)
return c:IsNotTuner() and c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER)
return c:IsType(TYPE_MONSTER)
end
function cm.statop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
......@@ -112,8 +112,7 @@ function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.syncon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(1000) and c:IsAttackBelow(1999)
and (Duel.GetTurnPlayer()==tp or Duel.GetTurnPlayer()==1-tp)
return c:IsAttackAbove(1000)
end
function cm.syntg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(Card.IsSynchroSummonable,tp,LOCATION_EXTRA,0,1,nil,e:GetHandler()) end
......
......@@ -125,7 +125,7 @@ function cm.lvop(e,tp,eg,ep,ev,re,r,rp)
end
function cm.thcon1(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(1000) and c:IsAttackBelow(1999) and Duel.GetTurnPlayer()==tp
return c:IsAttackAbove(1000) and Duel.GetTurnPlayer()==tp
end
function cm.thfilter1(c)
return c:IsSetCard(0xa450) and c:IsType(TYPE_MONSTER) and c:IsAbleToHand()
......@@ -144,7 +144,7 @@ function cm.thop1(e,tp,eg,ep,ev,re,r,rp)
end
function cm.thcon2(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
return c:IsAttackAbove(2000) and c:IsAttackBelow(2999) and Duel.GetTurnPlayer()==1-tp
return c:IsAttackAbove(2000) and Duel.GetTurnPlayer()==1-tp
end
function cm.thfilter2(c)
return (c:IsLocation(LOCATION_GRAVE) or c:IsFaceup()) and c:IsAbleToHand()
......
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