Commit 9ab4d90e authored by Chen Bill's avatar Chen Bill

remove global var

parent 196781c9
...@@ -53,6 +53,7 @@ function c26273196.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -53,6 +53,7 @@ function c26273196.desop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COIN)
local coin=Duel.AnnounceCoin(tp) local coin=Duel.AnnounceCoin(tp)
local res=Duel.TossCoin(tp,1) local res=Duel.TossCoin(tp,1)
local damp=0
if coin~=res then if coin~=res then
damp=1-tp damp=1-tp
else else
......
...@@ -58,7 +58,7 @@ function c26866984.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -58,7 +58,7 @@ function c26866984.spop(e,tp,eg,ep,ev,re,r,rp)
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY) Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
local dg=g:Select(tp,1,1,nil) local dg=g:Select(tp,1,1,nil)
Duel.HintSelection(dg) Duel.HintSelection(dg)
res=Duel.Destroy(dg,REASON_EFFECT) Duel.Destroy(dg,REASON_EFFECT)
end end
if ct==3 and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(26866984,2)) then if ct==3 and Duel.IsPlayerCanDraw(tp,2) and Duel.SelectYesNo(tp,aux.Stringid(26866984,2)) then
Duel.BreakEffect() Duel.BreakEffect()
......
...@@ -71,13 +71,16 @@ function c32549749.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -71,13 +71,16 @@ function c32549749.activate(e,tp,eg,ep,ev,re,r,rp)
local ft=Duel.GetLocationCount(tp,LOCATION_SZONE) local ft=Duel.GetLocationCount(tp,LOCATION_SZONE)
local b1=tc:IsSSetable(true) and ft>0 local b1=tc:IsSSetable(true) and ft>0
local b2=Duel.IsExistingMatchingCard(c32549749.eqfilter,tp,LOCATION_MZONE,0,1,nil,tc,tp) local b2=Duel.IsExistingMatchingCard(c32549749.eqfilter,tp,LOCATION_MZONE,0,1,nil,tc,tp)
local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(32549749,2),aux.Stringid(32549749,3)) op=Duel.SelectOption(tp,aux.Stringid(32549749,2),aux.Stringid(32549749,3))
elseif b1 then elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(32549749,2)) op=Duel.SelectOption(tp,aux.Stringid(32549749,2))
elseif b2 then elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(32549749,3))+1 op=Duel.SelectOption(tp,aux.Stringid(32549749,3))+1
else return end else
return
end
if op==0 then if op==0 then
Duel.SSet(tp,tc) Duel.SSet(tp,tc)
else else
......
...@@ -46,13 +46,16 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp) ...@@ -46,13 +46,16 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) local b1=Duel.GetLocationCount(tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) local b2=Duel.GetLocationCount(1-tp,LOCATION_MZONE)>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local res=0 local res=0
local op=0
if b1 and b2 then if b1 and b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3)) op=Duel.SelectOption(tp,aux.Stringid(id,2),aux.Stringid(id,3))
elseif b1 then elseif b1 then
op=Duel.SelectOption(tp,aux.Stringid(id,2)) op=Duel.SelectOption(tp,aux.Stringid(id,2))
elseif b2 then elseif b2 then
op=Duel.SelectOption(tp,aux.Stringid(id,3))+1 op=Duel.SelectOption(tp,aux.Stringid(id,3))+1
else return end else
return
end
if op==0 then if op==0 then
res=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP) res=Duel.SpecialSummon(tc,0,tp,tp,false,false,POS_FACEUP)
else else
......
...@@ -31,6 +31,7 @@ function c33970665.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -31,6 +31,7 @@ function c33970665.activate(e,tp,eg,ep,ev,re,r,rp)
local tc=g:Select(1-tp,1,1,nil):GetFirst() local tc=g:Select(1-tp,1,1,nil):GetFirst()
local s1=ft1>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false) local s1=ft1>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false)
local s2=ft2>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp) local s2=ft2>0 and tc:IsCanBeSpecialSummoned(e,0,tp,false,false,POS_FACEUP,1-tp)
local op=0
if s1 and s2 then op=Duel.SelectOption(tp,aux.Stringid(33970665,0),aux.Stringid(33970665,1)) if s1 and s2 then op=Duel.SelectOption(tp,aux.Stringid(33970665,0),aux.Stringid(33970665,1))
elseif s1 then op=Duel.SelectOption(tp,aux.Stringid(33970665,0)) elseif s1 then op=Duel.SelectOption(tp,aux.Stringid(33970665,0))
elseif s2 then op=Duel.SelectOption(tp,aux.Stringid(33970665,1))+1 elseif s2 then op=Duel.SelectOption(tp,aux.Stringid(33970665,1))+1
......
...@@ -60,7 +60,8 @@ function c38694052.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -60,7 +60,8 @@ function c38694052.desop(e,tp,eg,ep,ev,re,r,rp)
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,0,nil)
if og:IsExists(c38694052.checkfilter,1,nil) and #g>0 if og:IsExists(c38694052.checkfilter,1,nil) and #g>0
and Duel.SelectYesNo(tp,aux.Stringid(38694052,1)) then and Duel.SelectYesNo(tp,aux.Stringid(38694052,1)) then
if tc:IsType(TYPE_XYZ) then atk=tc:GetOriginalRank() else atk=tc:GetOriginalLevel() end local star=0
if tc:IsType(TYPE_XYZ) then star=tc:GetOriginalRank() else star=tc:GetOriginalLevel() end
Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(38694052,2)) Duel.Hint(HINT_SELECTMSG,tp,aux.Stringid(38694052,2))
local sg=g:Select(tp,1,1,nil) local sg=g:Select(tp,1,1,nil)
Duel.HintSelection(sg) Duel.HintSelection(sg)
...@@ -69,7 +70,7 @@ function c38694052.desop(e,tp,eg,ep,ev,re,r,rp) ...@@ -69,7 +70,7 @@ function c38694052.desop(e,tp,eg,ep,ev,re,r,rp)
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetType(EFFECT_TYPE_SINGLE) e1:SetType(EFFECT_TYPE_SINGLE)
e1:SetCode(EFFECT_UPDATE_ATTACK) e1:SetCode(EFFECT_UPDATE_ATTACK)
e1:SetValue(atk*300) e1:SetValue(star*300)
e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2) e1:SetReset(RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,2)
tc:RegisterEffect(e1) tc:RegisterEffect(e1)
end end
......
...@@ -28,6 +28,7 @@ function c4632019.efop(e,tp,eg,ep,ev,re,r,rp) ...@@ -28,6 +28,7 @@ function c4632019.efop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
local rc=c:GetReasonCard() local rc=c:GetReasonCard()
local lv=rc:GetOriginalLevel() local lv=rc:GetOriginalLevel()
local reg=nil
if lv>0 and lv<=8 then if lv>0 and lv<=8 then
--atkup --atkup
local e1=Effect.CreateEffect(rc) local e1=Effect.CreateEffect(rc)
......
...@@ -46,6 +46,7 @@ function c50901852.cfilter(c,atk) ...@@ -46,6 +46,7 @@ function c50901852.cfilter(c,atk)
end end
function c50901852.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c50901852.atktg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
local g=Duel.GetMatchingGroup(c50901852.atkfilter,tp,LOCATION_MZONE,0,nil) local g=Duel.GetMatchingGroup(c50901852.atkfilter,tp,LOCATION_MZONE,0,nil)
local atk=0
if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end if g:GetCount()>0 then atk=g:GetSum(Card.GetBaseAttack) end
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c50901852.cfilter(chkc,atk) end if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and c50901852.cfilter(chkc,atk) end
if chk==0 then return g:GetCount()>0 and Duel.IsExistingTarget(c50901852.cfilter,tp,LOCATION_MZONE,0,1,nil,atk) end if chk==0 then return g:GetCount()>0 and Duel.IsExistingTarget(c50901852.cfilter,tp,LOCATION_MZONE,0,1,nil,atk) end
......
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