Skip to content

Commit 582dd64

Browse files
authored
Update "Odd-Eyes Raging Dragon (Anime)"
- Slight script polish - Missing delay flag - Missing category/opinfo in negation/destruction effect
1 parent 2b7451b commit 582dd64

1 file changed

Lines changed: 26 additions & 50 deletions

File tree

unofficial/c511009340.lua

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,10 @@
33
local s,id=GetID()
44
function s.initial_effect(c)
55
c:EnableReviveLimit()
6-
Pendulum.AddProcedure(c,false)
76
--Xyz Summon procedure: 2 Level 7 Dragon monstes
87
Xyz.AddProcedure(c,aux.FilterBoolFunctionEx(Card.IsRace,RACE_DRAGON),7,2)
8+
--Pendulum procedure
9+
Pendulum.AddProcedure(c,false)
910
--Place 1 Pendulum Monster from your Deck in your Pendulum Zone
1011
local e1=Effect.CreateEffect(c)
1112
e1:SetDescription(aux.Stringid(id,0))
@@ -30,7 +31,7 @@ function s.initial_effect(c)
3031
--Negate the effects of all face-up Spells/Traps on the field, and if you do, destroy as many other cards on the field as possible, then this card gains 200 ATK for each card destroyed until the end of this turn
3132
local e4=Effect.CreateEffect(c)
3233
e4:SetDescription(aux.Stringid(id,1))
33-
e4:SetCategory(CATEGORY_ATKCHANGE+CATEGORY_DESTROY)
34+
e4:SetCategory(CATEGORY_DISABLE+CATEGORY_DESTROY+CATEGORY_ATKCHANGE)
3435
e4:SetType(EFFECT_TYPE_IGNITION)
3536
e4:SetRange(LOCATION_MZONE)
3637
e4:SetCountLimit(1)
@@ -42,8 +43,8 @@ function s.initial_effect(c)
4243
e5:SetRange(LOCATION_ONFIELD)
4344
e5:SetTargetRange(LOCATION_ONFIELD,0)
4445
e5:SetProperty(EFFECT_FLAG_IGNORE_IMMUNE)
45-
e5:SetCondition(s.efcon)
46-
e5:SetTarget(s.eftg)
46+
e5:SetCondition(function(e) return e:GetHandler():IsXyzSummoned() and e:GetHandler():HasFlagEffect(id) end)
47+
e5:SetTarget(function(e,c) return c=e:GetHandler() end)
4748
e5:SetLabelObject(e3)
4849
c:RegisterEffect(e5)
4950
local e6=e5:Clone()
@@ -53,9 +54,9 @@ function s.initial_effect(c)
5354
local e7=Effect.CreateEffect(c)
5455
e7:SetDescription(aux.Stringid(id,2))
5556
e7:SetType(EFFECT_TYPE_TRIGGER_O+EFFECT_TYPE_SINGLE)
56-
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP)
57+
e7:SetProperty(EFFECT_FLAG_DAMAGE_STEP+EFFECT_FLAG_DELAY)
5758
e7:SetCode(EVENT_LEAVE_FIELD)
58-
e7:SetCondition(s.pencon)
59+
e7:SetCondition(function(e) local c=e:GetHandler() return c:IsPreviousPosition(POS_FACEUP) and c:IsPreviousLocation(LOCATION_MZONE) end)
5960
e7:SetTarget(s.pentg)
6061
e7:SetOperation(s.penop)
6162
c:RegisterEffect(e7)
@@ -76,35 +77,28 @@ function s.pcop(e,tp,eg,ep,ev,re,r,rp)
7677
Duel.MoveToField(g:GetFirst(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
7778
end
7879
end
79-
function s.negfilter(c)
80-
return c:IsSpellTrap() and c:IsFaceup() and not c:IsDisabled()
80+
end
81+
function s.matfilter(c,sc)
82+
return c:IsType(TYPE_XYZ,sc,SUMMON_TYPE_XYZ,sc:GetSummonPlayer()) and c:IsXyzLevel(sc,7)
83+
end
84+
function s.valcheck(e,c)
85+
local g=c:GetMaterial()
86+
if g:IsExists(s.matfilter,1,nil,c) then
87+
c:RegisterFlagEffect(id,(RESET_EVENT|RESETS_STANDARD_DISABLE)&~RESET_TOFIELD,0,1)
88+
end
8189
end
8290
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
83-
if chk==0 then return Duel.IsExistingMatchingCard(s.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,1,nil) end
84-
local g=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
85-
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
91+
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsNegatableSpellTrap),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
92+
if chk==0 then return #g>0 end
93+
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,e:GetHandler())
94+
Duel.SetOperationInfo(0,CATEGORY_DISABLE,g,#g,0,0)
95+
Duel.SetOperationInfo(0,CATEGORY_DESTROY,dg,#dg,0,0)
8696
end
8797
function s.desop(e,tp,eg,ep,ev,re,r,rp)
8898
local c=e:GetHandler()
89-
local g=Duel.GetMatchingGroup(s.negfilter,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
90-
for tc in aux.Next(g) do
91-
local e1=Effect.CreateEffect(c)
92-
e1:SetType(EFFECT_TYPE_SINGLE)
93-
e1:SetCode(EFFECT_DISABLE)
94-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
95-
tc:RegisterEffect(e1)
96-
local e2=Effect.CreateEffect(c)
97-
e2:SetType(EFFECT_TYPE_SINGLE)
98-
e2:SetCode(EFFECT_DISABLE_EFFECT)
99-
e2:SetReset(RESET_EVENT+RESETS_STANDARD)
100-
tc:RegisterEffect(e2)
101-
if tc:IsType(TYPE_TRAPMONSTER) then
102-
local e3=Effect.CreateEffect(c)
103-
e3:SetType(EFFECT_TYPE_SINGLE)
104-
e3:SetCode(EFFECT_DISABLE_TRAPMONSTER)
105-
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
106-
tc:RegisterEffect(e3)
107-
end
99+
local g=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsNegatableSpellTrap),tp,LOCATION_ONFIELD,LOCATION_ONFIELD,nil)
100+
for tc in g:Iter() do
101+
tc:NegateEffects(c,nil,true)
108102
end
109103
local dg=Duel.GetMatchingGroup(aux.TRUE,tp,LOCATION_ONFIELD,LOCATION_ONFIELD,c)
110104
local ct=Duel.Destroy(dg,REASON_EFFECT)
@@ -113,37 +107,19 @@ function s.desop(e,tp,eg,ep,ev,re,r,rp)
113107
local e4=Effect.CreateEffect(c)
114108
e4:SetType(EFFECT_TYPE_SINGLE)
115109
e4:SetCode(EFFECT_UPDATE_ATTACK)
116-
e4:SetReset(RESET_EVENT+RESETS_STANDARD_DISABLE+RESET_PHASE+PHASE_END)
110+
e4:SetReset(RESETS_STANDARD_DISABLE_PHASE_END)
117111
e4:SetValue(ct*200)
118112
c:RegisterEffect(e4)
119113
end
120114
end
121-
function s.matfilter(c,sc)
122-
return c:IsType(TYPE_XYZ,sc,SUMMON_TYPE_XYZ,sc:GetSummonPlayer()) and c:IsXyzLevel(sc,7)
123-
end
124-
function s.valcheck(e,c)
125-
local g=c:GetMaterial()
126-
if g:IsExists(s.matfilter,1,nil,c) then
127-
c:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD_DISABLE-RESET_TOFIELD,0,1)
128-
end
129-
end
130-
function s.efcon(e)
131-
return e:GetHandler():IsXyzSummoned() and e:GetHandler():GetFlagEffect(id)>0
132-
end
133-
function s.eftg(e,c)
134-
return c==e:GetHandler()
135-
end
136-
function s.pencon(e,tp,eg,ep,ev,re,r,rp)
137-
return e:GetHandler():IsPreviousPosition(POS_FACEUP) and e:GetHandler():IsPreviousLocation(LOCATION_MZONE)
138-
end
139115
function s.pentg(e,tp,eg,ep,ev,re,r,rp,chk)
140116
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
141117
if chk==0 then return #g>0 end
142118
Duel.SetOperationInfo(0,CATEGORY_DESTROY,g,#g,0,0)
143119
end
144120
function s.penop(e,tp,eg,ep,ev,re,r,rp)
145121
local g=Duel.GetFieldGroup(tp,LOCATION_PZONE,0)
146-
if Duel.Destroy(g,REASON_EFFECT)~=0 and e:GetHandler():IsRelateToEffect(e) then
122+
if Duel.Destroy(g,REASON_EFFECT)>0 and e:GetHandler():IsRelateToEffect(e) then
147123
Duel.MoveToField(e:GetHandler(),tp,tp,LOCATION_PZONE,POS_FACEUP,true)
148124
end
149125
end

0 commit comments

Comments
 (0)