Commit e6aa9a18 authored by nanahira's avatar nanahira

Update expansions/script/c37564701.lua

parent e176864e
Pipeline #35302 passed with stage
in 59 seconds
......@@ -149,13 +149,7 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.PConditionFilter(c,e,tp,lscale,rscale)
local lv=0
if c.pendulum_level then
lv=c.pendulum_level
else
lv=c:GetLevel()
end
function cm.PConditionFilter(c,e,tp)
local bool=Auxiliary.PendulumSummonableBool(c)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
......@@ -163,27 +157,15 @@ function cm.PConditionFilter(c,e,tp,lscale,rscale)
end
function cm.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then
local c0=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local c1=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not c0 or not c1 then return false end
local lscale=c0:GetLeftScale()
local rscale=c1:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local loc=0
if Duel.GetLocationCount(tp,LOCATION_MZONE)>0 then loc=loc+LOCATION_HAND end
if Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)>0 then loc=loc+LOCATION_EXTRA end
if loc==0 then return false end
local g=Duel.GetFieldGroup(tp,loc,0)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp)
end
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local c0=Duel.GetFieldCard(tp,LOCATION_PZONE,0)
local c1=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if not c0 or not c1 then return false end
local lscale=c0:GetLeftScale()
local rscale=c1:GetRightScale()
if lscale>rscale then lscale,rscale=rscale,lscale end
local loc=0
local ft1=Duel.GetLocationCount(tp,LOCATION_MZONE)
local ft2=Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM)
......@@ -200,11 +182,8 @@ function cm.activate(e,tp,eg,ep,ev,re,r,rp)
local tg=Duel.GetMatchingGroup(cm.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
Auxiliary.GCheckAdditional=Auxiliary.PendOperationCheck(ft1,ft2,ft)
local g=tg:SelectSubGroup(tp,Auxiliary.TRUE,true,1,math.min(#tg,ft,2))
local g=tg:SelectSubGroup(tp,Auxiliary.TRUE,false,1,math.min(#tg,ft,2))
Auxiliary.GCheckAdditional=nil
if not g then return end
Duel.HintSelection(Group.FromCards(c0))
Duel.HintSelection(Group.FromCards(c1))
Duel.SpecialSummon(g,SUMMON_TYPE_PENDULUM,tp,tp,false,false,POS_FACEUP)
end
function cm.sumcon(e,tp,eg,ep,ev,re,r,rp)
......
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