Commit a9457f25 authored by DailyShana's avatar DailyShana

remove usage of STATUS_ACTIVATED

in contiuous spell/traps, it can be replaced by STATUS_EFFECT_ENABLED
parent f4fc8334
...@@ -19,6 +19,13 @@ function c16437822.initial_effect(c) ...@@ -19,6 +19,13 @@ function c16437822.initial_effect(c)
e2:SetTarget(c16437822.rettg) e2:SetTarget(c16437822.rettg)
e2:SetOperation(c16437822.retop) e2:SetOperation(c16437822.retop)
c:RegisterEffect(e2) c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD_P)
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e3:SetOperation(c16437822.checkop)
c:RegisterEffect(e3)
e2:SetLabelObject(e3)
end end
function c16437822.filter(c) function c16437822.filter(c)
return c:GetEquipCount()~=0 and c:GetEquipGroup():IsExists(Card.IsCode,1,nil,75560629) return c:GetEquipCount()~=0 and c:GetEquipGroup():IsExists(Card.IsCode,1,nil,75560629)
...@@ -36,8 +43,13 @@ function c16437822.activate(e,tp,eg,ep,ev,re,r,rp) ...@@ -36,8 +43,13 @@ function c16437822.activate(e,tp,eg,ep,ev,re,r,rp)
Duel.Destroy(tc,REASON_EFFECT) Duel.Destroy(tc,REASON_EFFECT)
end end
end end
function c16437822.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsStatus(STATUS_LEAVE_CONFIRMED) then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c16437822.retcon(e,tp,eg,ep,ev,re,r,rp) function c16437822.retcon(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_ACTIVATED) return e:GetLabelObject():GetLabel()==1
end end
function c16437822.rettg(e,tp,eg,ep,ev,re,r,rp,chk) function c16437822.rettg(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return e:GetHandler():IsAbleToDeck() end if chk==0 then return e:GetHandler():IsAbleToDeck() end
......
...@@ -39,7 +39,7 @@ end ...@@ -39,7 +39,7 @@ end
function c20426907.distg1(e,tp,eg,ep,ev,re,r,rp,chk) function c20426907.distg1(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then if chk==0 then
local tc=eg:GetFirst() local tc=eg:GetFirst()
if e:GetHandler():IsStatus(STATUS_ACTIVATED) then if e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED) then
return tc:IsLevelBelow(4) return tc:IsLevelBelow(4)
else else
return tc:IsLevelBelow(4) and not tc:IsType(TYPE_NORMAL) return tc:IsLevelBelow(4) and not tc:IsType(TYPE_NORMAL)
...@@ -71,7 +71,7 @@ function c20426907.filter(c,activated) ...@@ -71,7 +71,7 @@ function c20426907.filter(c,activated)
return c:IsFaceup() and c:IsLevelAbove(5) and (activated or not c:IsType(TYPE_NORMAL)) return c:IsFaceup() and c:IsLevelAbove(5) and (activated or not c:IsType(TYPE_NORMAL))
end end
function c20426907.distg2(e,tp,eg,ep,ev,re,r,rp,chk) function c20426907.distg2(e,tp,eg,ep,ev,re,r,rp,chk)
local activated=e:GetHandler():IsStatus(STATUS_ACTIVATED) local activated=e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
if chk==0 then return eg:IsExists(c20426907.filter,1,nil,activated) end if chk==0 then return eg:IsExists(c20426907.filter,1,nil,activated) end
local g=eg:Filter(c20426907.filter,nil,activated) local g=eg:Filter(c20426907.filter,nil,activated)
Duel.SetTargetCard(g) Duel.SetTargetCard(g)
......
...@@ -52,7 +52,7 @@ function c276357.filter(c,tp) ...@@ -52,7 +52,7 @@ function c276357.filter(c,tp)
and c:IsControler(tp) and c:IsType(TYPE_SPIRIT) and c:IsControler(tp) and c:IsType(TYPE_SPIRIT)
end end
function c276357.descon(e,tp,eg,ep,ev,re,r,rp) function c276357.descon(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c276357.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_ACTIVATED) return eg:IsExists(c276357.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end end
function c276357.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc) function c276357.destg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end if chkc then return chkc:IsOnField() and chkc:IsControler(1-tp) end
......
...@@ -35,13 +35,14 @@ function c47060347.recop(e,tp,eg,ep,ev,re,r,rp) ...@@ -35,13 +35,14 @@ function c47060347.recop(e,tp,eg,ep,ev,re,r,rp)
Duel.Recover(p,d,REASON_EFFECT) Duel.Recover(p,d,REASON_EFFECT)
end end
function c47060347.checkop(e,tp,eg,ep,ev,re,r,rp) function c47060347.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then local c=e:GetHandler()
if c:IsDisabled() or not c:IsStatus(STATUS_EFFECT_ENABLED) then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
function c47060347.leave(e,tp,eg,ep,ev,re,r,rp) function c47060347.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp and c:IsStatus(STATUS_ACTIVATED) then if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp then
Duel.Damage(tp,3000,REASON_EFFECT) Duel.Damage(tp,3000,REASON_EFFECT)
end end
end end
...@@ -24,13 +24,14 @@ function c53569894.filter(c) ...@@ -24,13 +24,14 @@ function c53569894.filter(c)
return c:IsFaceup() and c:IsCode(15013468,51402177) return c:IsFaceup() and c:IsCode(15013468,51402177)
end end
function c53569894.checkop(e,tp,eg,ep,ev,re,r,rp) function c53569894.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then local c=e:GetHandler()
if c:IsDisabled() or not c:IsStatus(STATUS_EFFECT_ENABLED) then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
function c53569894.leave(e,tp,eg,ep,ev,re,r,rp) function c53569894.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp and c:IsStatus(STATUS_ACTIVATED) then if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp then
local g=Duel.GetMatchingGroup(c53569894.filter,tp,LOCATION_ONFIELD,0,nil) local g=Duel.GetMatchingGroup(c53569894.filter,tp,LOCATION_ONFIELD,0,nil)
Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED) Duel.Destroy(g,REASON_EFFECT,LOCATION_REMOVED)
end end
......
...@@ -61,12 +61,13 @@ function c73578229.adjustop(e,tp,eg,ep,ev,re,r,rp) ...@@ -61,12 +61,13 @@ function c73578229.adjustop(e,tp,eg,ep,ev,re,r,rp)
Duel.Readjust() Duel.Readjust()
end end
function c73578229.checkop(e,tp,eg,ep,ev,re,r,rp) function c73578229.checkop(e,tp,eg,ep,ev,re,r,rp)
if e:GetHandler():IsDisabled() then local c=e:GetHandler()
if c:IsDisabled() or not c:IsStatus(STATUS_EFFECT_ENABLED) then
e:SetLabel(1) e:SetLabel(1)
else e:SetLabel(0) end else e:SetLabel(0) end
end end
function c73578229.desop(e,tp,eg,ep,ev,re,r,rp) function c73578229.desop(e,tp,eg,ep,ev,re,r,rp)
if e:GetLabelObject():GetLabel()==0 and e:GetHandler():IsStatus(STATUS_ACTIVATED) then if e:GetLabelObject():GetLabel()==0 then
local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil) local g=Duel.GetMatchingGroup(Card.IsFaceup,tp,LOCATION_MZONE,LOCATION_MZONE,nil)
if g:GetCount()>0 then if g:GetCount()>0 then
local ag=g:GetMaxGroup(Card.GetAttack) local ag=g:GetMaxGroup(Card.GetAttack)
......
...@@ -41,11 +41,17 @@ function c74402414.initial_effect(c) ...@@ -41,11 +41,17 @@ function c74402414.initial_effect(c)
--damage --damage
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e4:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e4:SetCode(EVENT_LEAVE_FIELD) e4:SetCode(EVENT_LEAVE_FIELD_P)
e4:SetCondition(c74402414.damcon) e4:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e4:SetOperation(c74402414.damop) e4:SetOperation(c74402414.checkop)
e4:SetLabelObject(g) e4:SetLabelObject(g)
c:RegisterEffect(e4) c:RegisterEffect(e4)
local e5=Effect.CreateEffect(c)
e5:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e5:SetCode(EVENT_LEAVE_FIELD)
e5:SetOperation(c74402414.damop)
e5:SetLabelObject(e4)
c:RegisterEffect(e5)
end end
function c74402414.cost(e,tp,eg,ep,ev,re,r,rp,chk) function c74402414.cost(e,tp,eg,ep,ev,re,r,rp,chk)
local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0) local hg=Duel.GetFieldGroup(tp,LOCATION_HAND,0)
...@@ -106,10 +112,16 @@ end ...@@ -106,10 +112,16 @@ end
function c74402414.dfilter(c) function c74402414.dfilter(c)
return c:GetFlagEffect(74402414)~=0 return c:GetFlagEffect(74402414)~=0
end end
function c74402414.damcon(e,tp,eg,ep,ev,re,r,rp) function c74402414.checkop(e,tp,eg,ep,ev,re,r,rp)
return e:GetHandler():IsStatus(STATUS_ACTIVATED) local ct=e:GetLabelObject():FilterCount(c74402414.dfilter,nil)
local c=e:GetHandler()
if c:IsDisabled() or not c:IsStatus(STATUS_EFFECT_ENABLED) or ct==0 then
e:SetLabel(1)
else e:SetLabel(0) end
end end
function c74402414.damop(e,tp,eg,ep,ev,re,r,rp) function c74402414.damop(e,tp,eg,ep,ev,re,r,rp)
local ct=e:GetLabelObject():FilterCount(c74402414.dfilter,nil) local c=e:GetHandler()
if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp then
Duel.Damage(tp,ct*500,REASON_EFFECT) Duel.Damage(tp,ct*500,REASON_EFFECT)
end
end end
...@@ -6,10 +6,17 @@ function c77859858.initial_effect(c) ...@@ -6,10 +6,17 @@ function c77859858.initial_effect(c)
e1:SetCode(EVENT_FREE_CHAIN) e1:SetCode(EVENT_FREE_CHAIN)
c:RegisterEffect(e1) c:RegisterEffect(e1)
--leave --leave
local e2=Effect.CreateEffect(c)
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e2:SetCode(EVENT_LEAVE_FIELD_P)
e2:SetProperty(EFFECT_FLAG_CANNOT_DISABLE)
e2:SetOperation(c77859858.checkop)
c:RegisterEffect(e2)
local e3=Effect.CreateEffect(c) local e3=Effect.CreateEffect(c)
e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS) e3:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_CONTINUOUS)
e3:SetCode(EVENT_LEAVE_FIELD) e3:SetCode(EVENT_LEAVE_FIELD)
e3:SetOperation(c77859858.leave) e3:SetOperation(c77859858.leave)
e3:SetLabelObject(e2)
c:RegisterEffect(e3) c:RegisterEffect(e3)
--Draw --Draw
local e4=Effect.CreateEffect(c) local e4=Effect.CreateEffect(c)
...@@ -42,9 +49,15 @@ function c77859858.initial_effect(c) ...@@ -42,9 +49,15 @@ function c77859858.initial_effect(c)
e6:SetOperation(c77859858.costop) e6:SetOperation(c77859858.costop)
c:RegisterEffect(e6) c:RegisterEffect(e6)
end end
function c77859858.checkop(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler()
if c:IsDisabled() or not c:IsStatus(STATUS_EFFECT_ENABLED) then
e:SetLabel(1)
else e:SetLabel(0) end
end
function c77859858.leave(e,tp,eg,ep,ev,re,r,rp) function c77859858.leave(e,tp,eg,ep,ev,re,r,rp)
local c=e:GetHandler() local c=e:GetHandler()
if c:GetPreviousControler()==tp and c:IsStatus(STATUS_ACTIVATED) then if e:GetLabelObject():GetLabel()==0 and c:GetPreviousControler()==tp then
Duel.Damage(tp,3000,REASON_EFFECT) Duel.Damage(tp,3000,REASON_EFFECT)
end end
end end
......
...@@ -31,7 +31,7 @@ function c92394653.filter(c,tp) ...@@ -31,7 +31,7 @@ function c92394653.filter(c,tp)
and c:IsControler(tp) and c:IsType(TYPE_SPIRIT) and c:IsControler(tp) and c:IsType(TYPE_SPIRIT)
end end
function c92394653.condition(e,tp,eg,ep,ev,re,r,rp) function c92394653.condition(e,tp,eg,ep,ev,re,r,rp)
return eg:IsExists(c92394653.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_ACTIVATED) return eg:IsExists(c92394653.filter,1,nil,tp) and e:GetHandler():IsStatus(STATUS_EFFECT_ENABLED)
end end
function c92394653.target(e,tp,eg,ep,ev,re,r,rp,chk) function c92394653.target(e,tp,eg,ep,ev,re,r,rp,chk)
if chk==0 then return true end if chk==0 then return true 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