Commit 22ca0690 authored by Tachibana's avatar Tachibana

eme

parents df5c8258 c445181f
Pipeline #6875 passed with stages
in 49 minutes and 33 seconds
......@@ -6,6 +6,7 @@ function c51562805.initial_effect(c)
e1:SetType(EFFECT_TYPE_IGNITION)
e1:SetRange(LOCATION_HAND)
e1:SetCountLimit(1,51562805)
e1:SetLabel(0)
e1:SetCost(c51562805.tscost)
e1:SetTarget(c51562805.tstg)
e1:SetOperation(c51562805.tsop)
......@@ -25,7 +26,7 @@ function c51562805.initial_effect(c)
local e3=Effect.CreateEffect(c)
e3:SetDescription(aux.Stringid(51562802,1))
e3:SetCategory(CATEGORY_SPECIAL_SUMMON)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_F)
e3:SetCode(EVENT_SPSUMMON_SUCCESS)
e3:SetCountLimit(1,515628053)
e3:SetTarget(c51562805.sptg2)
......@@ -34,25 +35,33 @@ function c51562805.initial_effect(c)
end
--ef1
function c51562805.chkfilter(c)
return c:IsSetCard(0x351a) and not c:IsPublic()
return c:IsSetCard(0x351a) and not c:IsPublic() and not c:IsForbidden()
end
function c51562805.tscost(e,tp,eg,ep,ev,re,r,rp,chk)
e:SetLabel(100)
if chk==0 then return true end
end
function c51562805.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
local c=e:GetHandler()
if chk==0 then return Duel.IsExistingMatchingCard(c51562805.chkfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>=2 end
if chk==0 then
if e:GetLabel()~=100 then return false end
e:SetLabel(0)
return Duel.IsExistingMatchingCard(c51562805.chkfilter,tp,LOCATION_HAND,0,1,c) and Duel.GetLocationCount(tp,LOCATION_SZONE)>=2
end
e:SetLabel(0)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_CONFIRM)
local g=Duel.SelectMatchingCard(tp,c51562805.chkfilter,tp,LOCATION_HAND,0,1,1,c)
Duel.ConfirmCards(1-tp,g)
g:AddCard(e:GetHandler())
Duel.SetTargetCard(g)
end
function c51562805.tstg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.GetLocationCount(tp,LOCATION_SZONE)>=2 end
end
function c51562805.tsop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
if Duel.GetLocationCount(tp,LOCATION_SZONE)>=2 then
local tc=g:GetFirst()
while tc do
if Duel.GetLocationCount(tp,LOCATION_SZONE)<2 then return end
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
if sg:GetCount()<1 then return end
for tc in aux.Next(sg) do
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(tc)
e1:SetCode(EFFECT_CHANGE_TYPE)
......@@ -61,60 +70,50 @@ function c51562805.tsop(e,tp,eg,ep,ev,re,r,rp)
e1:SetReset(RESET_EVENT+RESETS_STANDARD-RESET_TURN_SET)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
tc=g:GetNext()
end
end
end
--ef2
--ef2
function c51562805.tfilter1(c,e,tp)
return c:IsSetCard(0x351a) and c:IsFaceup() and Duel.IsExistingTarget(c51562805.tfilter2,tp,LOCATION_ONFIELD,0,1,nil,e,tp,c)
end
function c51562805.tfilter2(c,e,tp,tc)
local lv1=math.max(c:GetOriginalLevel(),tc:GetOriginalLevel())
local lv2=math.min(c:GetOriginalLevel(),tc:GetOriginalLevel())
return c:IsSetCard(0x351a) and c:GetCode()~=tc:GetCode() and c:IsFaceup() and (Duel.IsExistingMatchingCard(c51562805.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,lv1+lv2) or Duel.IsExistingMatchingCard(c51562805.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,lv1-lv2))
return c:IsSetCard(0x351a) and c:GetCode()~=tc:GetCode() and c:IsFaceup()
and Duel.IsExistingMatchingCard(c51562805.spfilter,tp,LOCATION_DECK,0,1,nil,e,tp,lv1+lv2,lv1-lv2)
end
function c51562805.spfilter(c,e,tp,lv)
return c:IsSetCard(0x351a) and c:IsCanBeSpecialSummoned(e,0,tp,true,false) and c:IsLevel(lv)
function c51562805.spfilter(c,e,tp,lv1,lv2)
return c:IsSetCard(0x351a) and c:IsLevel(lv1,lv2)
and ((Duel.GetMZoneCount(tp)>0 and c:IsCanBeSpecialSummoned(e,0,tp,false,false))
or (Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not c:IsForbidden()))
end
function c51562805.sptg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingTarget(c51562805.tfilter1,tp,LOCATION_ONFIELD,0,1,nil,e,tp) and (Duel.GetMZoneCount(tp)>0 or Duel.GetLocationCount(tp,LOCATION_SZONE)>0) end
if chkc then return false end
if chk==0 then return Duel.IsExistingTarget(c51562805.tfilter1,tp,LOCATION_ONFIELD,0,1,nil,e,tp) end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g1=Duel.SelectTarget(tp,c51562805.tfilter1,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
local g2=Duel.SelectTarget(tp,c51562805.tfilter2,tp,LOCATION_ONFIELD,0,1,1,nil,e,tp,g1:GetFirst())
local g2=Duel.SelectTarget(tp,c51562805.tfilter2,tp,LOCATION_ONFIELD,0,1,1,g1,e,tp,g1:GetFirst())
local lv1=math.max(g1:GetFirst():GetOriginalLevel(),g2:GetFirst():GetOriginalLevel())
local lv2=math.min(g1:GetFirst():GetOriginalLevel(),g2:GetFirst():GetOriginalLevel())
local sel=nil
local r1=0
local r2=0
local gr1=Duel.GetMatchingGroupCount(c51562805.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv1+lv2)
local gr2=Duel.GetMatchingGroupCount(c51562805.spfilter,tp,LOCATION_DECK,0,nil,e,tp,lv1-lv2)
if gr1>0 then r1=1 end
if gr2>0 then r2=1 end
if r1==1 and r2==1 then sel=Duel.SelectOption(tp,aux.Stringid(51562805,2),aux.Stringid(51562805,3)) end
if r1==1 and r2==0 then sel=0 end
if r1==0 and r2==1 then sel=1 end
if sel==0 then e:SetLabel(lv1+lv2) else e:SetLabel(lv1-lv2) end
e:SetLabel(lv1+lv2,lv1-lv2)
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c51562805.spop(e,tp,eg,ep,ev,re,r,rp)
local mz=Duel.GetMZoneCount(tp)
local sz=Duel.GetLocationCount(tp,LOCATION_SZONE)
if mz<=0 and sz<=0 then return end
local lv=e:GetLabel()
local c=e:GetHandler()
local lv1,lv2=e:GetLabel()
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_OPERATECARD)
local tc=Duel.SelectMatchingCard(tp,c51562805.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv):GetFirst()
local op=nil
if mz>0 and sz<=0 then op=0 end
if mz<=0 and sz>0 then op=1 end
if mz>0 and sz>0 then op=Duel.SelectOption(tp,aux.Stringid(51562805,1),aux.Stringid(51562805,0)) end
if op==0 and tc then
Duel.SpecialSummon(tc,0,tp,tp,true,false,POS_FACEUP)
local tc=Duel.SelectMatchingCard(tp,c51562805.spfilter,tp,LOCATION_DECK,0,1,1,nil,e,tp,lv1,lv2):GetFirst()
if tc then
local b1=(Duel.GetMZoneCount(tp)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false))
local b2=(Duel.GetLocationCount(tp,LOCATION_SZONE)>0 and not tc:IsForbidden())
if b1 and (not b2 or Duel.SelectOption(tp,aux.Stringid(51562805,1),aux.Stringid(51562805,0))==1) then
Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else
Duel.MoveToField(tc,tp,tp,LOCATION_SZONE,POS_FACEUP,true)
local e1=Effect.CreateEffect(tc)
local e1=Effect.CreateEffect(c)
e1:SetCode(EFFECT_CHANGE_TYPE)
e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
......@@ -122,17 +121,19 @@ function c51562805.spop(e,tp,eg,ep,ev,re,r,rp)
e1:SetValue(TYPE_SPELL+TYPE_CONTINUOUS)
tc:RegisterEffect(e1)
end
end
end
--ef3
function c51562805.spfilter2(c,e,tp)
return c:IsCode(51562805) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
end
function c51562805.sptg2(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return Duel.IsExistingMatchingCard(c51562805.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)>0 end
if chk==0 then return true end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,1,tp,LOCATION_DECK)
end
function c51562805.spop2(e,tp,eg,ep,ev,re,r,rp)
if Duel.IsExistingMatchingCard(c51562805.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) and Duel.GetMZoneCount(tp)<=0 then return end
if Duel.GetMZoneCount(tp)<=0 then return end
if Duel.IsExistingMatchingCard(c51562805.spfilter2,tp,LOCATION_DECK,0,1,nil,e,tp) then return end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,c51562805.spfilter2,tp,LOCATION_DECK,0,1,1,nil,e,tp)
if g:GetCount()>0 then
......
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