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