Skip to content

Commit 89ee4c8

Browse files
authored
Update "Cyber Phoenix (Anime)"
- Added auxiliary function for "Double Snare" check - Should check if it's an activated Spell/Trap effect that is potentially affecting it - Slight script modernization update
1 parent f01c036 commit 89ee4c8

File tree

1 file changed

+10
-19
lines changed

1 file changed

+10
-19
lines changed

unofficial/c511007022.lua

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,45 @@
33
--Scripted by Lyris, modified by MLD
44
local s,id=GetID()
55
function s.initial_effect(c)
6-
--Negate the activated effects of Spells/Traps
6+
--Negate the activated effects of Spells/Traps that target a Machine monster you control
77
local e1=Effect.CreateEffect(c)
88
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
99
e1:SetCode(EVENT_CHAIN_SOLVING)
1010
e1:SetRange(LOCATION_MZONE)
11-
e1:SetCondition(s.discon)
11+
e1:SetCondition(function(e) return e:GetHandler():IsAttackPos() end)
1212
e1:SetOperation(s.disop)
1313
c:RegisterEffect(e1)
14-
--Draw 1 card
14+
--Draw 1 card when this card is destroyed and sent to the GY
1515
local e2=Effect.CreateEffect(c)
1616
e2:SetDescription(aux.Stringid(id,0))
1717
e2:SetCategory(CATEGORY_DRAW)
1818
e2:SetType(EFFECT_TYPE_SINGLE+EFFECT_TYPE_TRIGGER_O)
1919
e2:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
2020
e2:SetCode(EVENT_TO_GRAVE)
2121
e2:SetCondition(function(e) return e:GetHandler():IsReason(REASON_DESTROY) end)
22-
e2:SetTarget(s.target)
23-
e2:SetOperation(s.operation)
22+
e2:SetTarget(s.drtg)
23+
e2:SetOperation(s.drop)
2424
c:RegisterEffect(e2)
25-
--Double Snare
26-
local e3=Effect.CreateEffect(c)
27-
e3:SetType(EFFECT_TYPE_SINGLE)
28-
e3:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_SINGLE_RANGE)
29-
e3:SetRange(LOCATION_MZONE)
30-
e3:SetCondition(s.discon)
31-
e3:SetCode(3682106)
32-
c:RegisterEffect(e3)
33-
end
34-
function s.discon(e)
35-
return e:GetHandler():IsAttackPos()
25+
--Double Snare check
26+
aux.DoubleSnareValidity(c,LOCATION_MZONE)
3627
end
3728
function s.disfilter(c,p)
3829
return c:IsControler(p) and c:IsFaceup() and c:IsRace(RACE_MACHINE)
3930
end
4031
function s.disop(e,tp,eg,ep,ev,re,r,rp)
41-
if re:IsMonsterEffect() or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) then return end
32+
if re:IsMonsterEffect() or not re:IsHasProperty(EFFECT_FLAG_CARD_TARGET) or not re:IsActivated() then return end
4233
local g=Duel.GetChainInfo(ev,CHAININFO_TARGET_CARDS)
4334
if g:IsExists(s.disfilter,1,nil,tp) and Duel.SelectEffectYesNo(tp,e:GetHandler(),aux.Stringid(id,1)) then
4435
Duel.NegateEffect(ev)
4536
end
4637
end
47-
function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
38+
function s.drtg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
4839
if chk==0 then return Duel.IsPlayerCanDraw(tp,1) end
4940
Duel.SetTargetPlayer(tp)
5041
Duel.SetTargetParam(1)
5142
Duel.SetOperationInfo(0,CATEGORY_DRAW,nil,0,tp,1)
5243
end
53-
function s.operation(e,tp,eg,ep,ev,re,r,rp)
44+
function s.drop(e,tp,eg,ep,ev,re,r,rp)
5445
local p,d=Duel.GetChainInfo(0,CHAININFO_TARGET_PLAYER,CHAININFO_TARGET_PARAM)
5546
Duel.Draw(p,d,REASON_EFFECT)
5647
end

0 commit comments

Comments
 (0)