Commit 2bdbab55 authored by xiaoye's avatar xiaoye Committed by nanahira

update 37564701

parent ab13b30f
No preview for this file type
......@@ -68,10 +68,10 @@ function cm.xyzcon(e,c,og,min,max)
else
mg=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_MZONE,0,nil,c)
local exg=Duel.GetMatchingGroup(cm.xyzfilter1,tp,LOCATION_PZONE,0,nil,c)
if #exg==2 and Duel.GetLocationCountFromEx(tp,tp,exg,c)>0 and Duel.GetFlagEffect(tp,m)==0 and not Duel.IsPlayerAffectedByEffect(EFFECT_MUST_BE_XMATERIAL) then return true end
if #exg==2 and Duel.GetLocationCountFromEx(tp,tp,exg,c)>0 and Duel.GetFlagEffect(tp,m)==0 and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL) then return true end
end
local sg=Group.CreateGroup()
local ce={Duel.IsPlayerAffectedByEffect(EFFECT_MUST_BE_XMATERIAL)}
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
if not mg:IsContains(tc) then return false end
......@@ -96,7 +96,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
else
mg=Duel.GetMatchingGroup(cm.xyzfilter,tp,LOCATION_MZONE,0,nil,c)
local exg=Duel.GetMatchingGroup(cm.xyzfilter1,tp,LOCATION_PZONE,0,nil,c)
if #exg==2 and Duel.GetLocationCountFromEx(tp,tp,exg,c)>0 and Duel.GetFlagEffect(tp,m)==0 and not Duel.IsPlayerAffectedByEffect(EFFECT_MUST_BE_XMATERIAL) and (not Senya.CheckGroup(mg,Senya.CheckFieldFilter,nil,minc,maxc,tp,c) or Duel.SelectYesNo(tp,m*16)) then
if #exg==2 and Duel.GetLocationCountFromEx(tp,tp,exg,c)>0 and Duel.GetFlagEffect(tp,m)==0 and not Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL) and (not Senya.CheckGroup(mg,Senya.CheckFieldFilter,nil,minc,maxc,tp,c) or Duel.SelectYesNo(tp,m*16)) then
Duel.HintSelection(exg)
Duel.RegisterFlagEffect(tp,m,RESET_PHASE+PHASE_END,0,1)
c:SetMaterial(exg)
......@@ -105,7 +105,7 @@ function cm.xyzop(e,tp,eg,ep,ev,re,r,rp,c,og,min,max)
end
end
local sg=Group.CreateGroup()
local ce={Duel.IsPlayerAffectedByEffect(EFFECT_MUST_BE_XMATERIAL)}
local ce={Duel.IsPlayerAffectedByEffect(tp,EFFECT_MUST_BE_XMATERIAL)}
for _,te in ipairs(ce) do
local tc=te:GetHandler()
sg:AddCard(tc)
......@@ -149,91 +149,63 @@ function cm.thop(e,tp,eg,ep,ev,re,r,rp)
Duel.ConfirmCards(1-tp,g)
end
end
function cm.PConditionFilter(c,e,tp)
local bool=aux.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)
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
local bool=Auxiliary.PendulumSummonableBool(c)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM)))
and lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden()
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.GetMZoneCount(tp)>0 then loc=loc+LOCATION_HAND end
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=nil
if og then
g=og:Filter(Card.IsLocation,nil,loc)
else
g=Duel.GetFieldGroup(tp,loc,0)
end
local g=Duel.GetFieldGroup(tp,loc,0)
return g:IsExists(cm.PConditionFilter,1,nil,e,tp,lscale,rscale)
end
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,nil,3,tp,LOCATION_EXTRA+LOCATION_HAND)
end
function cm.activate(e,tp,eg,ep,ev,re,r,rp)
if not cm.target(e,tp,eg,ep,ev,re,r,rp,0) then return end
local sg=Group.CreateGroup()
local ft1=math.max(Duel.GetMZoneCount(tp),2)
local ft2=math.max(Duel.GetLocationCountFromEx(tp,tp,nil,TYPE_PENDULUM),2)
local ft=math.max(Duel.GetUsableMZoneCount(tp),2)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
local loc=0
if ft1>0 then loc=loc+LOCATION_HAND end
if ft2>0 then loc=loc+LOCATION_EXTRA end
local tg=nil
if og then
tg=og:Filter(Card.IsLocation,nil,loc):Filter(cm.PConditionFilter,nil,e,tp,lscale,rscale)
else
tg=Duel.GetMatchingGroup(cm.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale)
end
ft1=math.min(ft1,tg:FilterCount(Card.IsLocation,nil,LOCATION_HAND))
ft2=math.min(ft2,tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA))
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
while true do
local ct1=tg:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
local ct2=tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
local ct=ft
if ct1>ft1 then ct=math.min(ct,ft1) end
if ct2>ft2 then ct=math.min(ct,ft2) end
if ct<=0 then break end
if #sg>0 and not Duel.SelectYesNo(tp,210) then ft=0 break end
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ct,nil)
tg:Sub(g)
sg:Merge(g)
if #g<ct then ft=0 break end
ft=ft-#g
ft1=ft1-g:FilterCount(Card.IsLocation,nil,LOCATION_HAND)
ft2=ft2-g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
end
if ft>0 then
local tg1=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
local tg2=tg:Filter(Card.IsLocation,nil,LOCATION_EXTRA)
if ft1>0 and ft2==0 and #tg1>0 and (#sg==0 or Duel.SelectYesNo(tp,210)) then
local ct=math.min(ft1,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg1:Select(tp,1,ct,nil)
sg:Merge(g)
end
if ft1==0 and ft2>0 and #tg2>0 and (#sg==0 or Duel.SelectYesNo(tp,210)) then
local ct=math.min(ft2,ft)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg2:Select(tp,1,ct,nil)
sg:Merge(g)
end
end
if #sg<=0 then return end
for tc in aux.Next(sg) do
local bool=aux.PendulumSummonableBool(tc)
Duel.SpecialSummonStep(tc,SUMMON_TYPE_PENDULUM,tp,tp,bool,bool,POS_FACEUP)
end
Duel.SpecialSummonComplete()
for tc in aux.Next(sg) do tc:CompleteProcedure() end
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)
local ft=Duel.GetUsableMZoneCount(tp)
local ect=c29724053 and Duel.IsPlayerAffectedByEffect(tp,29724053) and c29724053[tp]
if ect and ect<ft2 then ft2=ect end
if Duel.IsPlayerAffectedByEffect(tp,59822133) then
if ft1>0 then ft1=1 end
if ft2>0 then ft2=1 end
ft=1
end
if ft1>0 then loc=loc|LOCATION_HAND end
if ft2>0 then loc=loc|LOCATION_EXTRA end
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))
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)
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_ONFIELD)
......
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