Commit 7b32188d authored by Grajade's avatar Grajade

Update c51562805.lua

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