Commit 56a33c6a authored by Tachibana's avatar Tachibana

E

parent 177c81d1
Pipeline #15651 passed with stages
in 36 minutes and 41 seconds
No preview for this file type
...@@ -52,10 +52,10 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,10 +52,10 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
end end
--Destroy --Destroy
function cm.descon1(e,tp,eg,ep,ev,re,r,rp) function cm.descon1(e,tp,eg,ep,ev,re,r,rp)
return not Duel.IsExistingMatchingCard(Card.IsLevel,tp,LOCATION_MZONE,0,1,nil,7) return not Duel.IsExistingMatchingCard(Card.IsLevel,tp,0,LOCATION_MZONE,1,nil,7)
end end
function cm.descon2(e,tp,eg,ep,ev,re,r,rp) function cm.descon2(e,tp,eg,ep,ev,re,r,rp)
return Duel.IsExistingMatchingCard(Card.IsLevel,tp,LOCATION_MZONE,0,1,nil,7) return Duel.IsExistingMatchingCard(Card.IsLevel,tp,0,LOCATION_MZONE,1,nil,7)
end end
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end if chkc then return chkc:IsOnField() end
......
...@@ -34,9 +34,9 @@ function cm.initial_effect(c) ...@@ -34,9 +34,9 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_CHAINING) e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1) e3:SetCountLimit(1,m+1)
e3:SetCondition(c284224.descon) e3:SetCondition(cm.drcon)
e3:SetTarget(c284224.destg) e3:SetTarget(cm.drtg)
e3:SetOperation(c284224.desop) e3:SetOperation(cm.drop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
--tograve --tograve
...@@ -45,7 +45,7 @@ function cm.cfilter(c) ...@@ -45,7 +45,7 @@ function cm.cfilter(c)
end end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp) function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
return ep==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER) return ep==tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
and re:GetHandler():IsSetCard(0x482) and re:GetHandler():IsSetCard(0x482)
end end
function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.tgtg(e,tp,eg,ep,ev,re,r,rp,chk)
...@@ -60,9 +60,9 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,9 +60,9 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
local a=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil) local a=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_MZONE,1,nil)
local b=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil) local b=Duel.IsExistingMatchingCard(Card.IsAbleToGrave,tp,0,LOCATION_HAND,1,nil)
local op=-1 local op=-1
if a and b then op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1)) if a and b then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif b then op=Duel.SelectOption(tp,aux.Stringid(id,0)) elseif a then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif a then op=Duel.SelectOption(tp,aux.Stringid(id,1))+1 elseif b then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end else return end
if op==0 then if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
...@@ -81,7 +81,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp) ...@@ -81,7 +81,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
end end
--SpecialSummon --SpecialSummon
function cm.spcfilter(c) function cm.spcfilter(c)
return c:IsSetCard(0x482) and c:IsType(TYPE_FUSION+TYPE_SYNCHRO+TYPE_XYZ+TYPE_LINK) return c:IsSetCard(0x482) and (c:IsSummonType(SUMMON_TYPE_FUSION) or c:IsSummonType(SUMMON_TYPE_SYNCHRO) or c:IsSummonType(SUMMON_TYPE_XYZ) or c:IsSummonType(SUMMON_TYPE_LINK))
end end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp) function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spcfilter,1,nil) return eg:IsExists(cm.spcfilter,1,nil)
...@@ -103,7 +103,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -103,7 +103,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end end
end end
--Draw --Draw
function cm.dron(e,tp,eg,ep,ev,re,r,rp) function cm.drcon(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=re:GetHandler() local rc=re:GetHandler()
return ep==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER) return ep==1-tp and re:GetHandler():IsOnField() and re:GetHandler():IsRelateToEffect(re) and re:IsActiveType(TYPE_MONSTER)
......
...@@ -42,7 +42,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c) ...@@ -42,7 +42,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp,c)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,c,ft):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE+LOCATION_HAND,0,1,1,c,ft):GetFirst()
if tc:IsOnField() then Duel.Release(tc,REASON_COST) if tc:IsOnField() then Duel.Release(tc,REASON_COST)
else Duel.SendtoGrave(g,REASON_COST) end else Duel.SendtoGrave(tc,REASON_COST) end
end end
--Destroy --Destroy
function cm.descon(e,tp,eg,ep,ev,re,r,rp) function cm.descon(e,tp,eg,ep,ev,re,r,rp)
...@@ -56,7 +56,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -56,7 +56,7 @@ function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.desop(e,tp,eg,ep,ev,re,r,rp) function cm.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,nil) local g=Duel.SelectMatchingCard(tp,aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,1,e:GetHandler())
g:AddCard(e:GetHandler()) g:AddCard(e:GetHandler())
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.HintSelection(g) Duel.HintSelection(g)
......
...@@ -4,7 +4,7 @@ local cm=_G["c"..m] ...@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--Special Summon --Special Summon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0)) e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION) e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE) e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
...@@ -15,7 +15,7 @@ function cm.initial_effect(c) ...@@ -15,7 +15,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--recover --recover
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40975574,1)) e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_RECOVER) e2:SetCategory(CATEGORY_RECOVER)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET) e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
...@@ -26,12 +26,13 @@ function cm.initial_effect(c) ...@@ -26,12 +26,13 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--link --link
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON) e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION) e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE) e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+1) e4:SetCountLimit(1,m+1)
e4:SetTarget(cm.sptg) e4:SetTarget(cm.lktg)
e4:SetOperation(cm.spop) e4:SetOperation(cm.lkop)
c:RegisterEffect(e4) c:RegisterEffect(e4)
end end
--SpecialSummon --SpecialSummon
...@@ -44,14 +45,14 @@ function cm.spfilter(c,e,tp) ...@@ -44,14 +45,14 @@ function cm.spfilter(c,e,tp)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0 if chk==0 then return Duel.GetMZoneCount(tp,e:GetHandler())>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_HAND+LOCATION_GRAVE,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_DECK+LOCATION_GRAVE,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK+LOCATION_GRAVE)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler() local c=e:GetHandler()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_HAND+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst() local tc=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.spfilter),tp,LOCATION_DECK+LOCATION_GRAVE,0,1,1,nil,e,tp):GetFirst()
if tc then if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end end
...@@ -75,27 +76,27 @@ function cm.recop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,27 +76,27 @@ function cm.recop(e,tp,eg,ep,ev,re,r,rp)
end end
--link --link
--SpecialSummon --SpecialSummon
function cm.spfilter(c,e,tp) function cm.lkfilter(c,e,tp)
return c:IsCode(10702111) return c:IsCode(10702111)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0 and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end end
function cm.spcfilter(c) function cm.spcfilter(c)
return c:IsSetCard(0x482) and c:IsLevel(6,7) return c:IsSetCard(0x482) and c:IsLevel(6,7)
end end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk) function cm.lktg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL) if chk==0 then return aux.MustMaterialCheck(nil,tp,EFFECT_MUST_BE_FMATERIAL)
and Duel.IsExistingMatchingCard(cm.fispfilterlter,tp,LOCATION_EXTRA,0,1,nil,e,tp) and Duel.IsExistingMatchingCard(cm.lkfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp)
and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil) end and Duel.IsExistingMatchingCard(cm.spcfilter,tp,LOCATION_MZONE,0,1,nil) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
end end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.lkop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE,0,1,1,nil) local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE,0,1,1,nil)
if #g<1 then return end if #g<1 then return end
g:Merge(Duel.GetFieldGroup(tp,LOCATION_PZONE,0)) g:AddCard(e:GetHandler())
if Duel.Release(g,REASON_EFFECT)>0 then if Duel.Release(g,REASON_EFFECT)>0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp) local g=Duel.SelectMatchingCard(tp,cm.lkfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp)
local tc=g:GetFirst() local tc=g:GetFirst()
if not tc then return end if not tc then return end
tc:SetMaterial(nil) tc:SetMaterial(nil)
......
...@@ -29,13 +29,13 @@ end ...@@ -29,13 +29,13 @@ end
function cm.spfilter2(c,e,tp,code) function cm.spfilter2(c,e,tp,code)
return c:IsSetCard(0x482) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) return c:IsSetCard(0x482) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133) if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end and Duel.IsExistingMatchingCard(cm.spfilter1,tp,LOCATION_DECK,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,2,tp,LOCATION_DECK)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if not Duel.IsPlayerAffectedByEffect(tp,59822133) if not Duel.IsPlayerAffectedByEffect(tp,59822133)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
...@@ -18,15 +18,15 @@ function cm.initial_effect(c) ...@@ -18,15 +18,15 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--SpecialSummon --SpecialSummon
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(96162588,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON) e1:SetCategory(CATEGORY_RELEASE+CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE) e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.rlcon) e1:SetCondition(cm.spcon)
e1:SetTarget(cm.rltg) e1:SetTarget(cm.sptg)
e1:SetOperation(cm.rlop) e1:SetOperation(cm.spop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
--tohand --tohand
......
...@@ -12,9 +12,9 @@ function cm.initial_effect(c) ...@@ -12,9 +12,9 @@ function cm.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m) e1:SetCountLimit(1,m)
e1:SetCost(cm.thcost) e1:SetCost(cm.efcost)
e1:SetTarget(cm.thtg) e1:SetTarget(cm.eftg)
e1:SetOperation(cm.thop) e1:SetOperation(cm.efop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--swap2 --swap2
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -47,7 +47,7 @@ function cm.mfilter(c,xyzc) ...@@ -47,7 +47,7 @@ function cm.mfilter(c,xyzc)
return c:IsXyzLevel(xyzc,7) and c:IsType(TYPE_EFFECT) return c:IsXyzLevel(xyzc,7) and c:IsType(TYPE_EFFECT)
end end
--gain effect --gain effect
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.efcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end if chk==0 then return Duel.CheckRemoveOverlayCard(tp,1,0,1,REASON_COST) end
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST) Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end end
...@@ -73,7 +73,7 @@ function cm.efop(e,tp,eg,ep,ev,re,r,rp) ...@@ -73,7 +73,7 @@ function cm.efop(e,tp,eg,ep,ev,re,r,rp)
e3:SetRange(LOCATION_MZONE) e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter1) e3:SetValue(cm.efilter1)
e3:SetCondition(cm.econ1) e3:SetCondition(cm.econ1)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
tc:RegisterEffect(e3) tc:RegisterEffect(e3)
local e2=e3:Clone() local e2=e3:Clone()
e2:SetValue(cm.efilter2) e2:SetValue(cm.efilter2)
......
...@@ -4,23 +4,48 @@ local cm=_G["c"..m] ...@@ -4,23 +4,48 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--synchro summon --synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),aux.NonTuner(nil),1) aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),aux.NonTuner(nil),1)
c:EnableReviveLimit() c:EnableReviveLimit()
--atk up --atk up
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_ATKCHANGE)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetTarget(cm.atktg)
e1:SetOperation(cm.atkop)
c:RegisterEffect(e1)
--copy effect
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_IGNITION)
e3:SetRange(LOCATION_MZONE)
e3:SetProperty(EFFECT_FLAG_CARD_TARGET)
e3:SetCountLimit(1)
e3:SetCost(cm.copycost)
e3:SetTarget(cm.copytg)
e3:SetOperation(cm.copyop)
c:RegisterEffect(e3)
--spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,1)) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetCategory(CATEGORY_ATKCHANGE) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetType(EFFECT_TYPE_IGNITION) e2:SetCode(EVENT_DESTROYED)
e2:SetRange(LOCATION_MZONE) e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetCountLimit(1,m) e2:SetRange(LOCATION_GRAVE)
e2:SetCondition(cm.atkcon) e2:SetCost(aux.bfgcost)
e2:SetTarget(cm.atktg) e2:SetCondition(cm.spcon)
e2:SetOperation(cm.atkop) e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCode(EVENT_RELEASE)
c:RegisterEffect(e4)
end end
--atk --atk
function cm.cfilter(c) function cm.cfilter(c)
return ((c:IsOnField() and c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsReleasable()) return ((c:IsOnField() and c:IsFaceup() and c:IsRace(RACE_WARRIOR) and c:IsReleasable())
or (c:IsLocation(LOCATION_HAND) c:IsSetCard(0x482) and c:IsDiscardable())) or (c:IsLocation(LOCATION_HAND) and c:IsSetCard(0x482) and c:IsDiscardable()))
and Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,c) and Duel.IsExistingMatchingCard(cm.atkfilter,tp,LOCATION_MZONE,0,1,c)
end end
function cm.atkfilter(c) function cm.atkfilter(c)
...@@ -31,21 +56,107 @@ function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -31,21 +56,107 @@ function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst() local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst()
e:SetLabel(tc:GetAttack()) e:SetLabel(tc:GetAttack())
if tc:IsLocation(LOCATION_HAND) then Duel.SendtoGrave(g,REASON_COST+REASON_DISCARD) if tc:IsLocation(LOCATION_HAND) then Duel.SendtoGrave(tc,REASON_COST+REASON_DISCARD)
else Duel.Release(tc,REASON_COST) end else Duel.Release(tc,REASON_COST) end
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabel() local atk=e:GetLabel()
if atk<=0 then return end if atk<=0 then return end
local e1=Effect.CreateEffect(e:GetHandler()) local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
e1:SetType(EFFECT_TYPE_SINGLE) if #g<1 then return end
e1:SetCode(EFFECT_UPDATE_ATTACK) local sc=g:GetFirst()
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END) while sc do
e1:SetValue(atk) local e1=Effect.CreateEffect(e:GetHandler())
sc:RegisterEffect(e1) e1:SetType(EFFECT_TYPE_SINGLE)
local e2=e1:Clone() e1:SetCode(EFFECT_UPDATE_ATTACK)
e2:SetCode(EFFECT_UPDATE_DEFENSE) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
sc:RegisterEffect(e2) e1:SetValue(atk)
sc=tg:GetNext() sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc:RegisterEffect(e2)
sc=g:GetNext()
end end
end end
\ No newline at end of file --copy
function cm.copycost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():GetFlagEffect(m)==0 end
e:GetHandler():RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
end
function cm.copyfilter(c)
return c:IsType(TYPE_MONSTER) and not c:IsType(TYPE_TOKEN) and c:IsSetCard(0x482)
end
function cm.copytg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local c=e:GetHandler()
if chkc then return chkc:IsLocation(LOCATION_MZONE+LOCATION_GRAVE) and cm.copyfilter(chkc) and chkc~=c end
if chk==0 then return Duel.IsExistingTarget(cm.copyfilter,tp,LOCATION_GRAVE,0,1,c) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_FACEUP)
Duel.SelectTarget(tp,cm.copyfilter,tp,LOCATION_GRAVE,0,1,1,c)
end
function cm.copyop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local tc=Duel.GetFirstTarget()
if tc and c:IsRelateToEffect(e) and c:IsFaceup() and tc:IsRelateToEffect(e) then
local code=tc:GetOriginalCodeRule()
local cid=0
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetCode(EFFECT_CHANGE_CODE)
e1:SetValue(code)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e1)
if not tc:IsType(TYPE_TRAPMONSTER) then
cid=c:CopyEffect(code,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,1)
end
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,1))
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
e3:SetCountLimit(1)
e3:SetRange(LOCATION_MZONE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e3:SetLabelObject(e1)
e3:SetLabel(cid)
e3:SetOperation(cm.rstop)
c:RegisterEffect(e3)
end
end
function cm.rstop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local cid=e:GetLabel()
if cid~=0 then
c:ResetEffect(cid,RESET_COPY)
c:ResetEffect(RESET_DISABLE,RESET_EVENT)
end
local e1=e:GetLabelObject()
e1:Reset()
Duel.HintSelection(Group.FromCards(c))
Duel.Hint(HINT_OPSELECTED,1-tp,e:GetDescription())
end
--SpecialSummon
function cm.spcfilter(c,e,tp)
return (c:IsReason(REASON_BATTLE+REASON_EFFECT) or c:IsReason(REASON_RELEASE))
and c:IsSetCard(0x482) and c:IsCanBeSpecialSummoned(e,0,tp,false,false) and e:GetHandler()~=c
and c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousControler(tp)
end
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spcfilter,1,nil,e,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=eg:Filter(cm.spcfilter,nil,e,tp)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_MZONE)>0
and g:GetCount()>=1 end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,nil)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local g=eg:Filter(cm.spcfilter,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local tc=g:Select(tp,1,1,nil)
if tc then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
end
...@@ -4,7 +4,7 @@ local cm=_G["c"..m] ...@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
c:SetSPSummonOnce(m) c:SetSPSummonOnce(m)
--link summon --link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x482),3) aux.AddLinkProcedure(c,cm.matfilter,3)
c:EnableReviveLimit() c:EnableReviveLimit()
--SpecialSummon link material --SpecialSummon link material
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
...@@ -32,7 +32,7 @@ function cm.initial_effect(c) ...@@ -32,7 +32,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2) c:RegisterEffect(e2)
--spsummon --spsummon
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7480763,1)) e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON) e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O) e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE) e2:SetCode(EVENT_RELEASE)
...@@ -43,7 +43,13 @@ function cm.initial_effect(c) ...@@ -43,7 +43,13 @@ function cm.initial_effect(c)
e2:SetOperation(cm.spgop) e2:SetOperation(cm.spgop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
function cm.matfilter(c)
return c:IsSetCard(0x482) and c:IsType(TYPE_EFFECT)
end
--SpecialSummon --SpecialSummon
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsSummonType(SUMMON_TYPE_LINK)
end
function cm.spfilter(c,e,tp) function cm.spfilter(c,e,tp)
return c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup())) return c:IsType(TYPE_MONSTER) and (c:IsLocation(LOCATION_GRAVE) or (c:IsLocation(LOCATION_REMOVED) and c:IsFaceup()))
and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) and c:IsCanBeEffectTarget(e) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
...@@ -66,14 +72,26 @@ end ...@@ -66,14 +72,26 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp) function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SpecialSummon(g,0,tp,tp,false,false,POS_FACEUP)>0 then if tc:IsRelateToEffect(e) and Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)>0 then
local e1=Effect.CreateEffect(e:GetHandler()) local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT) e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT) e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
e1:SetValue(LOCATION_REMOVED) e1:SetValue(LOCATION_REMOVED)
g:GetFirst():RegisterEffect(e1,true) tc:RegisterEffect(e1,true)
--disable
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_DISABLE)
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e3)
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)
tc:RegisterEffect(e2)
end end
end end
--disable --disable
...@@ -102,7 +120,7 @@ function cm.cfilter(c) ...@@ -102,7 +120,7 @@ function cm.cfilter(c)
return c:IsSetCard(0x482) and c:IsPreviousPosition(POS_FACEUP) return c:IsSetCard(0x482) and c:IsPreviousPosition(POS_FACEUP)
end end
function cm.spgcon(e,tp,eg,ep,ev,re,r,rp) function cm.spgcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.cfilter,1,nil) return eg:IsExists(cm.cfilter,1,nil) and Duel.GetTurnPlayer()==tp and (Duel.GetCurrentPhase()==PHASE_MAIN1 or Duel.GetCurrentPhase()==PHASE_MAIN2)
end end
function cm.spgfilter(c,e,tp) function cm.spgfilter(c,e,tp)
return c:IsSetCard(0x482) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP) return c:IsSetCard(0x482) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
......
...@@ -39,8 +39,8 @@ function cm.filter1(c) ...@@ -39,8 +39,8 @@ function cm.filter1(c)
end end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,0,1,nil) if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(cm.filter1,tp,0,LOCATION_ONFIELD,1,nil) end and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g1=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_ONFIELD,0,1,1,nil) local g1=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
...@@ -48,31 +48,32 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -48,31 +48,32 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
g1:Merge(g2) g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g1,g1:GetCount(),0,0) Duel.SetOperationInfo(0,CATEGORY_DISABLE,g1,g1:GetCount(),0,0)
end end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS) local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e) local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then if tg:GetCount()>0 then
local c=e:GetHandler()
local tc=tg:GetFirst() local tc=tg:GetFirst()
while tc do while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET) Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE) e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD) e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT) e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET) e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD) e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2) tc:RegisterEffect(e2)
if tc:IsType(TYPE_MONSTER) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end if tc:IsType(TYPE_MONSTER) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
tc=tg:GetNext() tc=tg:GetNext()
end
end end
end end
function cm.handcon(e) function cm.handcon(e)
return Duel.GetMatchingGroupCount(Card.IsCode,c:GetControler(),LOCATION_MZONE,0,nil,10702001)==1 return Duel.GetMatchingGroupCount(Card.IsCode,e:GetHandler():GetControler(),LOCATION_MZONE,0,nil,10702001)==1
end end
--todeck --todeck
function cm.tdfilter(c) function cm.tdfilter(c)
...@@ -91,10 +92,10 @@ end ...@@ -91,10 +92,10 @@ end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp) function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then if tc:IsRelateToEffect(e) and Duel.SendtoDeck(tc,nil,SEQ_DECKSHUFFLE,REASON_EFFECT)>0 then
Duel.ShuffleDeck(tp)
Duel.BreakEffect()
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM) local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
Duel.Draw(p,d,REASON_EFFECT) Duel.Draw(p,d,REASON_EFFECT)
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end end
end end
......
...@@ -99,9 +99,10 @@ function cm.cfilter2(c,tp) ...@@ -99,9 +99,10 @@ function cm.cfilter2(c,tp)
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.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) and if chk==0 then return Duel.CheckReleaseGroup(tp,cm.cfilter,1,nil,tp) and
Duel.CheckReleaseGroup(1-tp,cm.cfilter,1,nil,1-tp) end Duel.IsExistingMatchingCard(Card.IsReleasable,tp,0,LOCATION_MZONE,1,nil) end
local g=Duel.SelectReleaseGroup(tp,cm.cfilter1,1,1,nil,tp) local g=Duel.SelectReleaseGroup(tp,cm.cfilter1,1,1,nil,tp)
local g2=Duel.SelectReleaseGroup(tp,cm.cfilter2,1,1,nil,1-tp) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_RELEASE)
local g2=Duel.SelectMatchingCard(tp,Card.IsReleasable,tp,0,LOCATION_MZONE,1,1,nil)
g:Merge(g2) g:Merge(g2)
Duel.Release(g,REASON_COST) Duel.Release(g,REASON_COST)
end end
......
...@@ -4,26 +4,31 @@ local cm=_G["c"..m] ...@@ -4,26 +4,31 @@ local cm=_G["c"..m]
function cm.initial_effect(c) function cm.initial_effect(c)
--xyz summon --xyz summon
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,3,3,cm.ovfilter,aux.Stringid(m,0),cm.xyzop) aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,3,3,cm.ovfilter,aux.Stringid(m,0),cm.xyzop)
c:EnableReviveLimit() c:EnableReviveLimit()
--material --material
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12744567,0)) e1:SetDescription(aux.Stringid(m,0))
e1:SetCode(EVENT_SPSUMMON_SUCCESS) e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY) e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1) e1:SetCountLimit(1)
e1:SetTarget(cm.mtg) e1:SetTarget(cm.mtg)
e1:SetOperation(cm.mop) e1:SetOperation(cm.mop)
c:RegisterEffect(e1) c:RegisterEffect(e1)
-- --
local e1=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48739166,0)) e2:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_IGNITION) e2:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET) e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1) e2:SetCountLimit(1)
e1:SetTarget(cm.target) e2:SetTarget(cm.target)
e1:SetOperation(cm.operation) e2:SetOperation(cm.operation)
c:RegisterEffect(e1) c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e3)
end end
function cm.mfilter(c,xyzc) function cm.mfilter(c,xyzc)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x482) return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x482)
...@@ -33,6 +38,7 @@ function cm.xyzcheck(g) ...@@ -33,6 +38,7 @@ function cm.xyzcheck(g)
end end
function cm.ovfilter(c) function cm.ovfilter(c)
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRace(RACE_WARRIOR) and c:IsRank(7,8) and c:GetOverlayCount()~=0 return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsRace(RACE_WARRIOR) and c:IsRank(7,8) and c:GetOverlayCount()~=0
end
function cm.xyzop(e,tp,chk) function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1) Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,EFFECT_FLAG_OATH,1)
...@@ -67,6 +73,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) ...@@ -67,6 +73,7 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
end end
function cm.operation(e,tp,eg,ep,ev,re,r,rp) function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
local c=e:GetHandler()
if tc:IsType(TYPE_MONSTER) then if tc:IsType(TYPE_MONSTER) then
--atk --atk
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -74,6 +81,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -74,6 +81,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetRange(LOCATION_MZONE) e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS) e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.atkop) e2:SetOperation(cm.atkop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2) c:RegisterEffect(e2)
end end
if tc:IsType(TYPE_SPELL) then if tc:IsType(TYPE_SPELL) then
...@@ -98,6 +106,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp) ...@@ -98,6 +106,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp) function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE) e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE) e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
...@@ -106,12 +115,37 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp) ...@@ -106,12 +115,37 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(500) e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE) e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local tc=eg:GetFirst()
while tc do
tc:RegisterFlagEffect(m,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1)
--immune
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,0))
e3:SetType(EFFECT_TYPE_SINGLE)
e3:SetCode(EFFECT_IMMUNE_EFFECT)
e3:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
e3:SetRange(LOCATION_MZONE)
e3:SetLabelObject(tc)
e3:SetCondition(cm.econ)
e3:SetValue(cm.efilter)
e3:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e3)
tc=eg:GetNext()
end
end end
function cm.splimit(e,c) function cm.splimit(e,c)
local tc=e:GetLabelObject() local tc=e:GetLabelObject()
return c:IsRace(tc:GetRace()) and c:IsLocation(LOCATION_EXTRA+LOCATION_DECK) return c:IsRace(tc:GetRace()) and c:IsLocation(LOCATION_EXTRA+LOCATION_DECK)
end end
--immune
function cm.econ(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabelObject():GetFlagEffect(m)>0
end
function cm.efilter(e,re,te)
local rc=re:GetHandler()
local tc=e:GetLabelObject()
return rc==tc and rc:IsType(TYPE_MONSTER)
end
......
...@@ -17,11 +17,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -17,11 +17,13 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local ph=Duel.GetTurnCount()
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.regcon) e1:SetCondition(cm.regcon)
e1:SetOperation(cm.regop1) e1:SetOperation(cm.regop1)
e1:SetLabel(ph)
e1:SetReset(RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp) Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c) local e2=Effect.CreateEffect(c)
...@@ -29,6 +31,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -29,6 +31,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED) e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetCondition(cm.regcon) e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop2) e2:SetOperation(cm.regop2)
e2:SetLabel(ph)
e2:SetReset(RESET_PHASE+PHASE_END,2) e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp) Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
...@@ -41,35 +44,37 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -41,35 +44,37 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp) Duel.RegisterEffect(e3,tp)
e1:SetLabelObject(e3) e1:SetLabelObject(e3)
e2:SetLabelObject(e3) e2:SetLabelObject(e3)
e:GetHandler():RegisterFlagEffect(m+1,RESET_PHASE+PHASE_END,0,1)
end end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp) function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE) return re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP) and re:IsActiveType(TYPE_TRAP)
and e:GetHandler():GetFlagEffect(m+1)>0 and Duel.GetTurnCount()==e:GetLabel()
end end
function cm.regop1(e,tp,eg,ep,ev,re,r,rp) function cm.regop1(e,tp,eg,ep,ev,re,r,rp)
local pt=e:GetLabel()
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1) e:GetLabelObject():SetLabel(ct+1,pt)
end end
function cm.regop2(e,tp,eg,ep,ev,re,r,rp) function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
local pt=e:GetLabel()
local ct=e:GetLabelObject():GetLabel() local ct=e:GetLabelObject():GetLabel()
if ct==0 then ct=1 end if ct==0 then ct=1 end
e:GetLabelObject():SetLabel(ct-1) e:GetLabelObject():SetLabel(ct-1,pt)
end end
function cm.effcon(e,tp,eg,ep,ev,re,r,rp) function cm.effcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetLabel()>0 and e:GetHandler():GetFlagEffect(m+1)==0 local ct,pt=e:GetLabel()
return e:GetLabel()>0 and Duel.GetTurnCount()~=pt
end end
function cm.sfilter(c) function cm.sfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToHand() return c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end end
function cm.effop(e,tp,eg,ep,ev,re,r,rp) function cm.effop(e,tp,eg,ep,ev,re,r,rp)
local ct,pt=e:GetLabel()
Duel.Hint(HINT_CARD,0,m) Duel.Hint(HINT_CARD,0,m)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,e:GetLabel(),nil) local g=Duel.SelectMatchingCard(tp,aux.NecroValleyFilter(cm.sfilter),tp,LOCATION_DECK+LOCATION_GRAVE+LOCATION_ONFIELD,0,1,ct,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
Duel.SendtoHand(g,nil,REASON_EFFECT) Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g) Duel.ConfirmCards(1-tp,g)
end end
end end
...@@ -52,17 +52,21 @@ function c64800123.sptg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -52,17 +52,21 @@ function c64800123.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end end
end end
function c64800123.spop(e,tp,eg,ep,ev,re,r,rp) function c64800123.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
local g1=Duel.SelectMatchingCard(tp,c64800123.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp) else
local tc=g1:GetFirst() if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
if tc then
local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c64800123.spfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,tc,e,tp,lv) local g1=Duel.SelectMatchingCard(tp,c64800123.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
g1:Merge(g2) local tc=g1:GetFirst()
if g1:GetCount()==2 then if tc then
Duel.SpecialSummon(g1,0,tp,tp,true,false,POS_FACEUP) local lv=tc:GetLevel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g2=Duel.SelectMatchingCard(tp,c64800123.spfilter2,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,tc,e,tp,lv)
g1:Merge(g2)
if g1:GetCount()==2 then
Duel.SpecialSummon(g1,0,tp,tp,true,false,POS_FACEUP)
end
end end
end end
end end
\ No newline at end of file
...@@ -27,6 +27,7 @@ function c9310022.initial_effect(c) ...@@ -27,6 +27,7 @@ function c9310022.initial_effect(c)
e3:SetOperation(c9310022.efop) e3:SetOperation(c9310022.efop)
c:RegisterEffect(e3) c:RegisterEffect(e3)
end end
c9310022.named_with_CosmosHero=1
function c9310022.filter(c) function c9310022.filter(c)
return c:IsFaceup() and c:IsLevel(8) return c:IsFaceup() and c:IsLevel(8)
end end
......
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