Commit f3609109 authored by mercury233's avatar mercury233

rename PENDULUM_CHECKLIST

parent 1b6c41a4
...@@ -11,8 +11,8 @@ function c31531170.initial_effect(c) ...@@ -11,8 +11,8 @@ function c31531170.initial_effect(c)
end end
function c31531170.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c31531170.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return false end if chkc then return false end
if not PENDULUM_CHECKLIST then PENDULUM_CHECKLIST=0 end if not aux.PendulumChecklist then aux.PendulumChecklist=0 end
if chk==0 then return (PENDULUM_CHECKLIST&(0x1<<tp)==0 or Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)) and Duel.IsExistingTarget(nil,tp,0,LOCATION_PZONE,2,nil) end if chk==0 then return (aux.PendulumChecklist&(0x1<<tp)==0 or Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)) and Duel.IsExistingTarget(nil,tp,0,LOCATION_PZONE,2,nil) end
local g=Duel.GetFieldGroup(tp,0,LOCATION_PZONE) local g=Duel.GetFieldGroup(tp,0,LOCATION_PZONE)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
end end
...@@ -38,7 +38,7 @@ function c31531170.pendcon(e,c,og) ...@@ -38,7 +38,7 @@ function c31531170.pendcon(e,c,og)
if c==nil then return true end if c==nil then return true end
local tp=e:GetOwnerPlayer() local tp=e:GetOwnerPlayer()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)} local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if PENDULUM_CHECKLIST&(0x1<<tp)~=0 and #eset==0 then return false end if aux.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local rpz=Duel.GetFieldCard(1-tp,LOCATION_PZONE,1) local rpz=Duel.GetFieldCard(1-tp,LOCATION_PZONE,1)
if rpz==nil or rpz:GetFieldID()~=c:GetFlagEffectLabel(31531170) then return false end if rpz==nil or rpz:GetFieldID()~=c:GetFlagEffectLabel(31531170) then return false end
local lscale=c:GetLeftScale() local lscale=c:GetLeftScale()
...@@ -70,7 +70,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og) ...@@ -70,7 +70,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset) tg=Duel.GetMatchingGroup(aux.PConditionFilter,tp,LOCATION_EXTRA,0,nil,e,tp,lscale,rscale,eset)
end end
local ce=nil local ce=nil
local b1=PENDULUM_CHECKLIST&(0x1<<tp)==0 local b1=aux.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0 local b2=#eset>0
if b1 and b2 then if b1 and b2 then
local options={1163} local options={1163}
...@@ -96,7 +96,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og) ...@@ -96,7 +96,7 @@ function c31531170.pendop(e,tp,eg,ep,ev,re,r,rp,c,sg,og)
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode()) Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset() ce:Reset()
else else
PENDULUM_CHECKLIST=PENDULUM_CHECKLIST|(0x1<<tp) aux.PendulumChecklist=aux.PendulumChecklist|(0x1<<tp)
end end
Duel.Hint(HINT_CARD,0,31531170) Duel.Hint(HINT_CARD,0,31531170)
sg:Merge(g) sg:Merge(g)
......
...@@ -1686,8 +1686,8 @@ function Auxiliary.AddRitualProcGreater2Code2(c,code1,code2,summon_location,grav ...@@ -1686,8 +1686,8 @@ function Auxiliary.AddRitualProcGreater2Code2(c,code1,code2,summon_location,grav
end end
--add procedure to Pendulum monster, also allows registeration of activation effect --add procedure to Pendulum monster, also allows registeration of activation effect
function Auxiliary.EnablePendulumAttribute(c,reg) function Auxiliary.EnablePendulumAttribute(c,reg)
if not PENDULUM_CHECKLIST then if not Auxiliary.PendulumChecklist then
PENDULUM_CHECKLIST=0 Auxiliary.PendulumChecklist=0
local ge1=Effect.GlobalEffect() local ge1=Effect.GlobalEffect()
ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS) ge1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW) ge1:SetCode(EVENT_PHASE_START+PHASE_DRAW)
...@@ -1715,7 +1715,7 @@ function Auxiliary.EnablePendulumAttribute(c,reg) ...@@ -1715,7 +1715,7 @@ function Auxiliary.EnablePendulumAttribute(c,reg)
end end
end end
function Auxiliary.PendulumReset(e,tp,eg,ep,ev,re,r,rp) function Auxiliary.PendulumReset(e,tp,eg,ep,ev,re,r,rp)
PENDULUM_CHECKLIST=0 Auxiliary.PendulumChecklist=0
end end
function Auxiliary.PConditionExtraFilterSpecific(c,e,tp,lscale,rscale,te) function Auxiliary.PConditionExtraFilterSpecific(c,e,tp,lscale,rscale,te)
if not te then return true end if not te then return true end
...@@ -1739,14 +1739,14 @@ function Auxiliary.PConditionFilter(c,e,tp,lscale,rscale,eset) ...@@ -1739,14 +1739,14 @@ function Auxiliary.PConditionFilter(c,e,tp,lscale,rscale,eset)
return (c:IsLocation(LOCATION_HAND) or (c:IsFaceup() and c:IsType(TYPE_PENDULUM))) 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 lv>lscale and lv<rscale and c:IsCanBeSpecialSummoned(e,SUMMON_TYPE_PENDULUM,tp,bool,bool)
and not c:IsForbidden() and not c:IsForbidden()
and (PENDULUM_CHECKLIST&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset)) and (Auxiliary.PendulumChecklist&(0x1<<tp)==0 or Auxiliary.PConditionExtraFilter(c,e,tp,lscale,rscale,eset))
end end
function Auxiliary.PendCondition() function Auxiliary.PendCondition()
return function(e,c,og) return function(e,c,og)
if c==nil then return true end if c==nil then return true end
local tp=c:GetControler() local tp=c:GetControler()
local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)} local eset={Duel.IsPlayerAffectedByEffect(tp,EFFECT_EXTRA_PENDULUM_SUMMON)}
if PENDULUM_CHECKLIST&(0x1<<tp)~=0 and #eset==0 then return false end if Auxiliary.PendulumChecklist&(0x1<<tp)~=0 and #eset==0 then return false end
local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1) local rpz=Duel.GetFieldCard(tp,LOCATION_PZONE,1)
if rpz==nil or c==rpz then return false end if rpz==nil or c==rpz then return false end
local lscale=c:GetLeftScale() local lscale=c:GetLeftScale()
...@@ -1799,7 +1799,7 @@ function Auxiliary.PendOperation() ...@@ -1799,7 +1799,7 @@ function Auxiliary.PendOperation()
tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset) tg=Duel.GetMatchingGroup(Auxiliary.PConditionFilter,tp,loc,0,nil,e,tp,lscale,rscale,eset)
end end
local ce=nil local ce=nil
local b1=PENDULUM_CHECKLIST&(0x1<<tp)==0 local b1=Auxiliary.PendulumChecklist&(0x1<<tp)==0
local b2=#eset>0 local b2=#eset>0
if b1 and b2 then if b1 and b2 then
local options={1163} local options={1163}
...@@ -1830,7 +1830,7 @@ function Auxiliary.PendOperation() ...@@ -1830,7 +1830,7 @@ function Auxiliary.PendOperation()
Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode()) Duel.Hint(HINT_CARD,0,ce:GetOwner():GetOriginalCode())
ce:Reset() ce:Reset()
else else
PENDULUM_CHECKLIST=PENDULUM_CHECKLIST|(0x1<<tp) Auxiliary.PendulumChecklist=Auxiliary.PendulumChecklist|(0x1<<tp)
end end
sg:Merge(g) sg:Merge(g)
Duel.HintSelection(Group.FromCards(c)) Duel.HintSelection(Group.FromCards(c))
......
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