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)
end
--Destroy
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
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
function cm.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() end
......
......@@ -34,9 +34,9 @@ function cm.initial_effect(c)
e3:SetCode(EVENT_CHAINING)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+1)
e3:SetCondition(c284224.descon)
e3:SetTarget(c284224.destg)
e3:SetOperation(c284224.desop)
e3:SetCondition(cm.drcon)
e3:SetTarget(cm.drtg)
e3:SetOperation(cm.drop)
c:RegisterEffect(e3)
end
--tograve
......@@ -45,7 +45,7 @@ function cm.cfilter(c)
end
function cm.tgcon(e,tp,eg,ep,ev,re,r,rp)
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)
end
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)
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 op=-1
if a and b then op=Duel.SelectOption(tp,aux.Stringid(id,0),aux.Stringid(id,1))
elseif b then op=Duel.SelectOption(tp,aux.Stringid(id,0))
elseif a then op=Duel.SelectOption(tp,aux.Stringid(id,1))+1
if a and b then op=Duel.SelectOption(tp,aux.Stringid(m,0),aux.Stringid(m,1))
elseif a then op=Duel.SelectOption(tp,aux.Stringid(m,0))
elseif b then op=Duel.SelectOption(tp,aux.Stringid(m,1))+1
else return end
if op==0 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOGRAVE)
......@@ -81,7 +81,7 @@ function cm.tgop(e,tp,eg,ep,ev,re,r,rp)
end
--SpecialSummon
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
function cm.spcon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(cm.spcfilter,1,nil)
......@@ -103,7 +103,7 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
end
end
--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 rc=re:GetHandler()
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)
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()
if tc:IsOnField() then Duel.Release(tc,REASON_COST)
else Duel.SendtoGrave(g,REASON_COST) end
else Duel.SendtoGrave(tc,REASON_COST) end
end
--Destroy
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)
end
function cm.desop(e,tp,eg,ep,ev,re,r,rp)
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())
if g:GetCount()>0 then
Duel.HintSelection(g)
......
......@@ -4,7 +4,7 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--Special Summon
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(m,0))
e1:SetDescription(aux.Stringid(m,2))
e1:SetCategory(CATEGORY_SPECIAL_SUMMON)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND+LOCATION_MZONE)
......@@ -15,7 +15,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e1)
--recover
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(40975574,1))
e2:SetDescription(aux.Stringid(m,0))
e2:SetCategory(CATEGORY_RECOVER)
e2:SetProperty(EFFECT_FLAG_CARD_TARGET+EFFECT_FLAG_NO_TURN_RESET)
e2:SetType(EFFECT_TYPE_IGNITION)
......@@ -26,12 +26,13 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
--link
local e4=Effect.CreateEffect(c)
e4:SetDescription(aux.Stringid(m,1))
e4:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON)
e4:SetType(EFFECT_TYPE_IGNITION)
e4:SetRange(LOCATION_MZONE)
e4:SetCountLimit(1,m+1)
e4:SetTarget(cm.sptg)
e4:SetOperation(cm.spop)
e4:SetTarget(cm.lktg)
e4:SetOperation(cm.lkop)
c:RegisterEffect(e4)
end
--SpecialSummon
......@@ -44,14 +45,14 @@ function cm.spfilter(c,e,tp)
end
function cm.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_HAND+LOCATION_GRAVE)
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_DECK+LOCATION_GRAVE)
end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<=0 then return end
local c=e:GetHandler()
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
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
end
......@@ -75,27 +76,27 @@ function cm.recop(e,tp,eg,ep,ev,re,r,rp)
end
--link
--SpecialSummon
function cm.spfilter(c,e,tp)
function cm.lkfilter(c,e,tp)
return c:IsCode(10702111)
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_LINK,tp,false,false) and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
end
function cm.spcfilter(c)
return c:IsSetCard(0x482) and c:IsLevel(6,7)
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)
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
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_EXTRA)
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)
local g=Duel.SelectMatchingCard(tp,cm.spcfilter,tp,LOCATION_MZONE,0,1,1,nil)
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
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()
if not tc then return end
tc:SetMaterial(nil)
......
......@@ -29,13 +29,13 @@ end
function cm.spfilter2(c,e,tp,code)
return c:IsSetCard(0x482) and not c:IsCode(code) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
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)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
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)
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)
and Duel.GetLocationCount(tp,LOCATION_MZONE)>1 then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
......
......@@ -18,15 +18,15 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
--SpecialSummon
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:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e1:SetCode(EVENT_RELEASE)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetRange(LOCATION_MZONE)
e1:SetCondition(cm.rlcon)
e1:SetTarget(cm.rltg)
e1:SetOperation(cm.rlop)
e1:SetCondition(cm.spcon)
e1:SetTarget(cm.sptg)
e1:SetOperation(cm.spop)
c:RegisterEffect(e1)
end
--tohand
......
......@@ -12,9 +12,9 @@ function cm.initial_effect(c)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m)
e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop)
e1:SetCost(cm.efcost)
e1:SetTarget(cm.eftg)
e1:SetOperation(cm.efop)
c:RegisterEffect(e1)
--swap2
local e4=Effect.CreateEffect(c)
......@@ -47,7 +47,7 @@ function cm.mfilter(c,xyzc)
return c:IsXyzLevel(xyzc,7) and c:IsType(TYPE_EFFECT)
end
--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
Duel.RemoveOverlayCard(tp,1,0,1,1,REASON_COST)
end
......@@ -73,7 +73,7 @@ function cm.efop(e,tp,eg,ep,ev,re,r,rp)
e3:SetRange(LOCATION_MZONE)
e3:SetValue(cm.efilter1)
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)
local e2=e3:Clone()
e2:SetValue(cm.efilter2)
......
......@@ -4,23 +4,48 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--synchro summon
aux.AddSynchroProcedure(c,aux.FilterBoolFunction(Card.IsRace,RACE_WARRIOR),aux.NonTuner(nil),1)
c:EnableReviveLimit()
c:EnableReviveLimit()
--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)
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_ATKCHANGE)
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1,m)
e2:SetCondition(cm.atkcon)
e2:SetTarget(cm.atktg)
e2:SetOperation(cm.atkop)
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_DESTROYED)
e2:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
e2:SetRange(LOCATION_GRAVE)
e2:SetCost(aux.bfgcost)
e2:SetCondition(cm.spcon)
e2:SetTarget(cm.sptg)
e2:SetOperation(cm.spop)
c:RegisterEffect(e2)
local e4=e2:Clone()
e4:SetCode(EVENT_RELEASE)
c:RegisterEffect(e4)
end
--atk
function cm.cfilter(c)
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)
end
function cm.atkfilter(c)
......@@ -31,21 +56,107 @@ function cm.atktg(e,tp,eg,ep,ev,re,r,rp,chk)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,cm.cfilter,tp,LOCATION_HAND+LOCATION_MZONE,0,1,1,nil):GetFirst()
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
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local atk=e:GetLabel()
if atk<=0 then return end
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc:RegisterEffect(e2)
sc=tg:GetNext()
local g=Duel.GetMatchingGroup(cm.atkfilter,tp,LOCATION_MZONE,0,nil)
if #g<1 then return end
local sc=g:GetFirst()
while sc do
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
e1:SetValue(atk)
sc:RegisterEffect(e1)
local e2=e1:Clone()
e2:SetCode(EFFECT_UPDATE_DEFENSE)
sc:RegisterEffect(e2)
sc=g:GetNext()
end
end
\ No newline at end of file
end
--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]
function cm.initial_effect(c)
c:SetSPSummonOnce(m)
--link summon
aux.AddLinkProcedure(c,aux.FilterBoolFunction(Card.IsLinkSetCard,0x482),3)
aux.AddLinkProcedure(c,cm.matfilter,3)
c:EnableReviveLimit()
--SpecialSummon link material
local e1=Effect.CreateEffect(c)
......@@ -32,7 +32,7 @@ function cm.initial_effect(c)
c:RegisterEffect(e2)
--spsummon
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(7480763,1))
e2:SetDescription(aux.Stringid(m,1))
e2:SetCategory(CATEGORY_SPECIAL_SUMMON)
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e2:SetCode(EVENT_RELEASE)
......@@ -43,7 +43,13 @@ function cm.initial_effect(c)
e2:SetOperation(cm.spgop)
c:RegisterEffect(e2)
end
function cm.matfilter(c)
return c:IsSetCard(0x482) and c:IsType(TYPE_EFFECT)
end
--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)
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)
......@@ -66,14 +72,26 @@ end
function cm.spop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
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())
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_LEAVE_FIELD_REDIRECT)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_REDIRECT)
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
--disable
......@@ -102,7 +120,7 @@ function cm.cfilter(c)
return c:IsSetCard(0x482) and c:IsPreviousPosition(POS_FACEUP)
end
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
function cm.spgfilter(c,e,tp)
return c:IsSetCard(0x482) and c:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP)
......
......@@ -39,8 +39,8 @@ function cm.filter1(c)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,LOCATION_ONFIELD,0,1,nil)
and Duel.IsExistingTarget(cm.filter1,tp,0,LOCATION_ONFIELD,1,nil) end
if chk==0 then return Duel.IsExistingTarget(aux.NegateAnyFilter,tp,0,LOCATION_ONFIELD,1,nil)
and Duel.IsExistingTarget(cm.filter1,tp,LOCATION_ONFIELD,0,1,nil) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
local g1=Duel.SelectTarget(tp,cm.filter1,tp,LOCATION_ONFIELD,0,1,1,nil)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DISABLE)
......@@ -48,31 +48,32 @@ function cm.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
g1:Merge(g2)
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g1,g1:GetCount(),0,0)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
local tg=g:Filter(Card.IsRelateToEffect,nil,e)
if tg:GetCount()>0 then
local c=e:GetHandler()
local tc=tg:GetFirst()
while tc do
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_MONSTER) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
tc=tg:GetNext()
Duel.NegateRelatedChain(tc,RESET_TURN_SET)
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_DISABLE)
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetCode(EFFECT_DISABLE_EFFECT)
e2:SetValue(RESET_TURN_SET)
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
tc:RegisterEffect(e2)
if tc:IsType(TYPE_MONSTER) then Duel.Remove(tc,POS_FACEUP,REASON_EFFECT) end
tc=tg:GetNext()
end
end
end
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
--todeck
function cm.tdfilter(c)
......@@ -91,10 +92,10 @@ end
function cm.tdop(e,tp,eg,ep,ev,re,r,rp)
local tc=Duel.GetFirstTarget()
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)
Duel.Draw(p,d,REASON_EFFECT)
Duel.BreakEffect()
Duel.DiscardDeck(tp,2,REASON_EFFECT)
end
end
......
......@@ -99,9 +99,10 @@ function cm.cfilter2(c,tp)
end
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
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 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)
Duel.Release(g,REASON_COST)
end
......
......@@ -4,26 +4,31 @@ local cm=_G["c"..m]
function cm.initial_effect(c)
--xyz summon
aux.AddXyzProcedureLevelFree(c,cm.mfilter,cm.xyzcheck,3,3,cm.ovfilter,aux.Stringid(m,0),cm.xyzop)
c:EnableReviveLimit()
c:EnableReviveLimit()
--material
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(12744567,0))
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetDescription(aux.Stringid(m,0))
e1:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e1:SetProperty(EFFECT_FLAG_DELAY)
e1:SetCode(EVENT_SPSUMMON_SUCCESS)
e1:SetCountLimit(1)
e1:SetTarget(cm.mtg)
e1:SetOperation(cm.mop)
c:RegisterEffect(e1)
--
local e1=Effect.CreateEffect(c)
e1:SetDescription(aux.Stringid(48739166,0))
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1)
e1:SetTarget(cm.target)
e1:SetOperation(cm.operation)
c:RegisterEffect(e1)
local e2=Effect.CreateEffect(c)
e2:SetDescription(aux.Stringid(m,0))
e2:SetType(EFFECT_TYPE_IGNITION)
e2:SetProperty(EFFECT_FLAG_NO_TURN_RESET)
e2:SetRange(LOCATION_MZONE)
e2:SetCountLimit(1)
e2:SetTarget(cm.target)
e2:SetOperation(cm.operation)
c:RegisterEffect(e2)
local e3=e2:Clone()
e3:SetType(EFFECT_TYPE_QUICK_O)
e3:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e3)
end
function cm.mfilter(c,xyzc)
return c:IsType(TYPE_MONSTER) and c:IsSetCard(0x482)
......@@ -33,6 +38,7 @@ function cm.xyzcheck(g)
end
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
end
function cm.xyzop(e,tp,chk)
if chk==0 then return Duel.GetFlagEffect(tp,m)==0 end
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)
end
function cm.operation(e,tp,eg,ep,ev,re,r,rp)
local tc=e:GetLabelObject()
local c=e:GetHandler()
if tc:IsType(TYPE_MONSTER) then
--atk
local e2=Effect.CreateEffect(c)
......@@ -74,6 +81,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
e2:SetRange(LOCATION_MZONE)
e2:SetCode(EVENT_SPSUMMON_SUCCESS)
e2:SetOperation(cm.atkop)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END)
c:RegisterEffect(e2)
end
if tc:IsType(TYPE_SPELL) then
......@@ -98,6 +106,7 @@ function cm.operation(e,tp,eg,ep,ev,re,r,rp)
end
function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE)
e2:SetProperty(EFFECT_FLAG_SINGLE_RANGE)
......@@ -106,12 +115,37 @@ function cm.atkop(e,tp,eg,ep,ev,re,r,rp)
e2:SetValue(500)
e2:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_DISABLE)
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
function cm.splimit(e,c)
local tc=e:GetLabelObject()
return c:IsRace(tc:GetRace()) and c:IsLocation(LOCATION_EXTRA+LOCATION_DECK)
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)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local ph=Duel.GetTurnCount()
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
e1:SetCode(EVENT_CHAINING)
e1:SetCondition(cm.regcon)
e1:SetOperation(cm.regop1)
e1:SetLabel(ph)
e1:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e1,tp)
local e2=Effect.CreateEffect(c)
......@@ -29,6 +31,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
e2:SetCode(EVENT_CHAIN_NEGATED)
e2:SetCondition(cm.regcon)
e2:SetOperation(cm.regop2)
e2:SetLabel(ph)
e2:SetReset(RESET_PHASE+PHASE_END,2)
Duel.RegisterEffect(e2,tp)
local e3=Effect.CreateEffect(c)
......@@ -41,35 +44,37 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.RegisterEffect(e3,tp)
e1:SetLabelObject(e3)
e2:SetLabelObject(e3)
e:GetHandler():RegisterFlagEffect(m+1,RESET_PHASE+PHASE_END,0,1)
end
function cm.regcon(e,tp,eg,ep,ev,re,r,rp)
return re:IsHasType(EFFECT_TYPE_ACTIVATE)
and re:IsActiveType(TYPE_TRAP)
and e:GetHandler():GetFlagEffect(m+1)>0
and Duel.GetTurnCount()==e:GetLabel()
end
function cm.regop1(e,tp,eg,ep,ev,re,r,rp)
local pt=e:GetLabel()
local ct=e:GetLabelObject():GetLabel()
e:GetLabelObject():SetLabel(ct+1)
e:GetLabelObject():SetLabel(ct+1,pt)
end
function cm.regop2(e,tp,eg,ep,ev,re,r,rp)
local pt=e:GetLabel()
local ct=e:GetLabelObject():GetLabel()
if ct==0 then ct=1 end
e:GetLabelObject():SetLabel(ct-1)
e:GetLabelObject():SetLabel(ct-1,pt)
end
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
function cm.sfilter(c)
return c:IsType(TYPE_TRAP) and c:IsAbleToHand()
end
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_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
Duel.SendtoHand(g,nil,REASON_EFFECT)
Duel.ConfirmCards(1-tp,g)
end
end
......@@ -52,17 +52,21 @@ function c64800123.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
end
end
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
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g1=Duel.SelectMatchingCard(tp,c64800123.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g1:GetFirst()
if tc then
local lv=tc:GetLevel()
if Duel.GetFieldGroupCount(tp,LOCATION_HAND,0)~=0 then
Duel.DiscardHand(tp,aux.TRUE,1,1,REASON_EFFECT+REASON_DISCARD)
else
if Duel.GetLocationCount(tp,LOCATION_MZONE)<2 or Duel.IsPlayerAffectedByEffect(tp,59822133) then return end
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)
local g1=Duel.SelectMatchingCard(tp,c64800123.spfilter,tp,LOCATION_GRAVE+LOCATION_DECK,0,1,1,nil,e,tp)
local tc=g1:GetFirst()
if tc then
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
\ No newline at end of file
......@@ -27,6 +27,7 @@ function c9310022.initial_effect(c)
e3:SetOperation(c9310022.efop)
c:RegisterEffect(e3)
end
c9310022.named_with_CosmosHero=1
function c9310022.filter(c)
return c:IsFaceup() and c:IsLevel(8)
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