Commit 023db938 authored by Tachibana's avatar Tachibana

eme

parent d6597186
Pipeline #6864 failed with stages
in 58 minutes and 5 seconds
...@@ -19,8 +19,7 @@ function cm.initial_effect(c) ...@@ -19,8 +19,7 @@ function cm.initial_effect(c)
e1:SetDescription(aux.Stringid(m,1)) e1:SetDescription(aux.Stringid(m,1))
e1:SetCategory(CATEGORY_TOHAND) e1:SetCategory(CATEGORY_TOHAND)
e1:SetType(EFFECT_TYPE_QUICK_O) e1:SetType(EFFECT_TYPE_QUICK_O)
e1:SetProperty(EFFECT_FLAG_CARD_TARGET) e1:SetCode(EVENT_FREE_CHAIN)
e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m+100) e1:SetCountLimit(1,m+100)
e1:SetCost(cm.thcost) e1:SetCost(cm.thcost)
......
...@@ -23,6 +23,7 @@ function cm.initial_effect(c) ...@@ -23,6 +23,7 @@ function cm.initial_effect(c)
e1:SetCode(EVENT_CHAINING) e1:SetCode(EVENT_CHAINING)
e1:SetRange(LOCATION_MZONE) e1:SetRange(LOCATION_MZONE)
e1:SetCountLimit(1,m+100) e1:SetCountLimit(1,m+100)
e1:SetCondition(cm.thcon)
e1:SetCost(cm.thcost) e1:SetCost(cm.thcost)
e1:SetTarget(cm.thtg) e1:SetTarget(cm.thtg)
e1:SetOperation(cm.thop) e1:SetOperation(cm.thop)
...@@ -75,7 +76,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -75,7 +76,9 @@ function cm.spop(e,tp,eg,ep,ev,re,r,rp)
tc=sg:GetNext() tc=sg:GetNext()
end end
end end
function cm.thcon(e,tp,eg,ep,ev,re,r,rp)
return rp==1-tp
end
function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk) function cm.thcost(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsReleasable() end if chk==0 then return e:GetHandler():IsReleasable() end
Duel.Release(e:GetHandler(),REASON_EFFECT) Duel.Release(e:GetHandler(),REASON_EFFECT)
......
...@@ -17,6 +17,48 @@ function cm.initial_effect(c) ...@@ -17,6 +17,48 @@ function cm.initial_effect(c)
e5:SetTarget(cm.thtg) e5:SetTarget(cm.thtg)
e5:SetOperation(cm.thop) e5:SetOperation(cm.thop)
c:RegisterEffect(e5) c:RegisterEffect(e5)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(m,2))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_TRIGGER_O)
e3:SetCode(EVENT_PHASE+PHASE_END)
e3:SetRange(LOCATION_MZONE)
e3:SetCountLimit(1,m+100)
e3:SetTarget(cm.mttg)
e3:SetOperation(cm.mtop)
c:RegisterEffect(e3)
if not cm.global_check then
cm.global_check=true
Sr_srlesetback={}
Sr_srlesetback[1]=0
local res1=Effect.CreateEffect(c)
res1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
res1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
res1:SetOperation(cm.reset)
Duel.RegisterEffect(res1,0)
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_SPSUMMON_SUCCESS)
ge1:SetOperation(cm.checkop)
Duel.RegisterEffect(ge1,0)
end
end
function cm.reset(e,tp,eg,ep,ev,re,r,rp)
Sr_srlesetback={}
Sr_srlesetback[1]=0
end
function cm.cfilter(c,tp)
return c:IsType(TYPE_MONSTER) and c:GetSummonLocation()==LOCATION_EXTRA
end
function cm.checkop(e,tp,eg,ep,ev,re,r,rp)
if not eg then return end
local sg=eg:Filter(cm.cfilter,nil,tp)
local tc=sg:GetFirst()
while tc do
Sr_srlesetback[#Sr_srlesetback+1]=tc:GetCode()
tc=sg:GetNext()
end
end end
function cm.filter(c,e,tp) function cm.filter(c,e,tp)
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
...@@ -29,7 +71,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk) ...@@ -29,7 +71,7 @@ function cm.thtg(e,tp,eg,ep,ev,re,r,rp,chk)
local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp) local g=Duel.SelectTarget(tp,cm.filter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0) Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,g,1,0,0)
end end
function cm.activate(e,tp,eg,ep,ev,re,r,rp) function cm.thop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local tc=Duel.GetFirstTarget() local tc=Duel.GetFirstTarget()
local lv=tc:GetLevel() local lv=tc:GetLevel()
...@@ -52,7 +94,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -52,7 +94,7 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
else else
e1:SetValue(-lv) e1:SetValue(-lv)
end end
tc:RegisterEffect(e1) c:RegisterEffect(e1)
if tc then if tc then
if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then if tc:IsAbleToHand() and (not tc:IsCanBeSpecialSummoned(e,0,tp,false,false) or ft<=0 or Duel.SelectOption(tp,1190,1152)==0) then
Duel.SendtoHand(tc,nil,REASON_EFFECT) Duel.SendtoHand(tc,nil,REASON_EFFECT)
...@@ -63,3 +105,19 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -63,3 +105,19 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
end end
end end
end end
function cm.spfilter(c,e,tp)
return c:IsCanBeSpecialSummoned(e,0,tp,false,false) and c:IsCode(table.unpack(Sr_srlesetback)) and not Duel.IsExistingMatchingCard(Card.IsCode,tp,LOCATION_MZONE,0,1,nil,c:GetCode())
end
function cm.mttg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCountFromEx(tp,tp,nil,nil)>0
and Duel.IsExistingMatchingCard(cm.spfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,0,0)
end
function cm.mtop(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCountFromEx(tp,tp,nil,nil)
if ft>0 and Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,cm.spfilter,tp,LOCATION_EXTRA,0,1,ft,nil,e,tp)
if Duel.GetLocationCount(tp,LOCATION_MZONE)<g:GetCount() or (g:GetCount()>1 and Duel.IsPlayerAffectedByEffect(tp,59822133)) then return end
Duel.SpecialSummon(g,SUMMON_TYPE_SYNCHRO,tp,tp,false,false,POS_FACEUP)
end
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment