Commit 13521a24 authored by VanillaSalt's avatar VanillaSalt

new

parent 2da67847
--サモン・ゲート
function c29724053.initial_effect(c)
--activate
local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_ACTIVATE)
e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1)
--summon count limit
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_FIELD)
e2:SetRange(LOCATION_SZONE)
e2:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
e2:SetTargetRange(1,1)
e2:SetTarget(c29724053.sumlimit)
c:RegisterEffect(e2)
if c29724053.global_check==nil then
c29724053.global_check=true
c29724053[0]=3
c29724053[1]=3
local ge1=Effect.CreateEffect(c)
ge1:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
ge1:SetOperation(c29724053.resetop)
Duel.RegisterEffect(ge1,0)
local ge2=Effect.CreateEffect(c)
ge2:SetType(EFFECT_TYPE_CONTINUOUS+EFFECT_TYPE_FIELD)
ge2:SetCode(EVENT_SPSUMMON_SUCCESS)
ge2:SetOperation(c29724053.checkop)
Duel.RegisterEffect(ge2,0)
end
end
function c29724053.sumlimit(e,c,sump,sumtype,sumpos,targetp,se)
return c:IsLocation(LOCATION_EXTRA) and c29724053[sump]<=0
end
function c29724053.resetop(e,tp,eg,ep,ev,re,r,rp)
c29724053[0]=3
c29724053[1]=3
end
function c29724053.checkop(e,tp,eg,ep,ev,re,r,rp)
local tc=eg:GetFirst()
while tc do
if tc:IsPreviousLocation(LOCATION_EXTRA) then
local p=tc:GetSummonPlayer()
c29724053[p]=c29724053[p]-1
end
tc=eg:GetNext()
end
end
...@@ -1553,14 +1553,33 @@ function Auxiliary.PendOperation() ...@@ -1553,14 +1553,33 @@ function Auxiliary.PendOperation()
if lscale>rscale then lscale,rscale=rscale,lscale end if lscale>rscale then lscale,rscale=rscale,lscale end
local ft=Duel.GetLocationCount(tp,LOCATION_MZONE) local ft=Duel.GetLocationCount(tp,LOCATION_MZONE)
if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end if Duel.IsPlayerAffectedByEffect(tp,59822133) then ft=1 end
local tg=nil
if og then if og then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) tg=og:Filter(tp,Auxiliary.PConditionFilter,nil,e,tp,lscale,rscale)
local g=og:FilterSelect(tp,Auxiliary.PConditionFilter,1,ft,nil,e,tp,lscale,rscale)
sg:Merge(g)
else else
tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,nil,e,tp,lscale,rscale)
end
local ect=c29724053 and c29724053[tp]
if ect and (ect<=0 or ect>ft) then ect=nil end
if ect==nil or tg:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)<=ect then
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=Duel.SelectMatchingCard(tp,Auxiliary.PConditionFilter,tp,LOCATION_HAND+LOCATION_EXTRA,0,1,ft,nil,e,tp,lscale,rscale) local g=tg:Select(tp,1,ft,nil)
sg:Merge(g) sg:Merge(g)
else
repeat
local ct=math.min(ft,ect)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
local g=tg:Select(tp,1,ct,nil)
tg:Sub(g)
sg:Merge(g)
ft=ft-g:GetCount()
ect=ect-g:FilterCount(Card.IsLocation,nil,LOCATION_EXTRA)
until ft==0 or ect==0 or not Duel.SelectYesNo(tp,210)
local hg=tg:Filter(Card.IsLocation,nil,LOCATION_HAND)
if ft>0 and ect==0 and hg:GetCount()>0 and Duel.SelectYesNo(tp,210) then
local g=hg:Select(tp,1,ft,nil)
sg:Merge(g)
end
end end
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
Duel.HintSelection(Group.FromCards(rpz)) Duel.HintSelection(Group.FromCards(rpz))
......
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