Skip to content

Commit ff50e09

Browse files
authored
Update "Odd-Eyes Synchrogate"
- Should destroy itself, not send itself to the GY - Script clean-up
1 parent 357672e commit ff50e09

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

unofficial/c511015105.lua

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function s.initial_effect(c)
1414
c:RegisterEffect(e1)
1515
Duel.AddCustomActivityCounter(id,ACTIVITY_SPSUMMON,s.counterfilter)
1616
end
17-
s.listed_names={16178681,id+1}
17+
s.listed_names={16178681,id+1} --"Odd-Eyes Pendulum Dragon", "Odd-Eyes Xyzgate"
1818
function s.counterfilter(c)
1919
return not c:IsPendulumSummoned()
2020
end
@@ -27,30 +27,30 @@ function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
2727
e1:SetType(EFFECT_TYPE_FIELD)
2828
e1:SetProperty(EFFECT_FLAG_PLAYER_TARGET+EFFECT_FLAG_OATH)
2929
e1:SetCode(EFFECT_CANNOT_SPECIAL_SUMMON)
30-
e1:SetReset(RESET_PHASE+PHASE_END)
3130
e1:SetTargetRange(1,0)
3231
e1:SetTarget(s.splimit)
32+
e1:SetReset(RESET_PHASE|PHASE_END)
3333
Duel.RegisterEffect(e1,tp)
3434
if e:IsHasType(EFFECT_TYPE_ACTIVATE) then
3535
aux.RemainFieldCost(e,tp,eg,ep,ev,re,r,rp,1)
3636
end
3737
end
38-
function s.filter1(c,e,tp)
38+
function s.oddeyesspfilter(c,e,tp)
3939
return c:IsCode(16178681) and c:IsFaceup() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
4040
and Duel.GetLocationCountFromEx(tp,tp,nil,c)>0
41-
and Duel.IsExistingTarget(s.filter2,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
41+
and Duel.IsExistingTarget(s.syngyspfilter,tp,LOCATION_GRAVE,0,1,nil,e,tp,c)
4242
end
43-
function s.filter2(c,e,tp,odd)
44-
return c:IsType(TYPE_SYNCHRO) and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
45-
and Duel.IsExistingMatchingCard(s.filter3,tp,LOCATION_EXTRA,0,1,odd,e,tp,c,odd)
43+
function s.syngyspfilter(c,e,tp,odd)
44+
return c:IsSynchroMonster() and c:IsCanBeSpecialSummoned(e,0,tp,false,false)
45+
and Duel.IsExistingMatchingCard(s.synedspfilter,tp,LOCATION_EXTRA,0,1,odd,e,tp,c,odd)
4646
end
47-
function s.filter3(c,e,tp,syn,odd)
47+
function s.synedspfilter(c,e,tp,syn,odd)
4848
if not c:IsType(TYPE_PENDULUM) then return false end
4949
local e1=Effect.CreateEffect(e:GetHandler())
5050
e1:SetType(EFFECT_TYPE_SINGLE)
5151
e1:SetCode(EFFECT_CHANGE_LEVEL)
5252
e1:SetValue(1)
53-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
53+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
5454
odd:RegisterEffect(e1)
5555
odd:AssumeProperty(ASSUME_TYPE,odd:GetType()|TYPE_TUNER)
5656
local result=c:IsSynchroSummonable(nil,Group.FromCards(syn,odd))
@@ -62,11 +62,11 @@ function s.target(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
6262
if chkc then return false end
6363
if chk==0 then return not Duel.IsPlayerAffectedByEffect(tp,CARD_BLUEEYES_SPIRIT) and Duel.IsPlayerCanSpecialSummonCount(tp,2)
6464
and aux.CheckSummonGate(tp,2) and Duel.GetLocationCount(tp,LOCATION_MZONE)>0
65-
and Duel.GetUsableMZoneCount(tp)>1 and Duel.IsExistingMatchingCard(s.filter1,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
65+
and Duel.GetUsableMZoneCount(tp)>1 and Duel.IsExistingMatchingCard(s.oddeyesspfilter,tp,LOCATION_EXTRA,0,1,nil,e,tp) end
6666
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
67-
local c1=Duel.SelectMatchingCard(tp,s.filter1,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
67+
local c1=Duel.SelectMatchingCard(tp,s.oddeyesspfilter,tp,LOCATION_EXTRA,0,1,1,nil,e,tp):GetFirst()
6868
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_SPSUMMON)
69-
local c2=Duel.SelectTarget(tp,s.filter2,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c1):GetFirst()
69+
local c2=Duel.SelectTarget(tp,s.syngyspfilter,tp,LOCATION_GRAVE,0,1,1,nil,e,tp,c1):GetFirst()
7070
Duel.SetTargetCard(c1)
7171
Duel.SetOperationInfo(0,CATEGORY_SPECIAL_SUMMON,Group.FromCards(c1,c2),2,0,0)
7272
end
@@ -76,7 +76,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
7676
local g=Duel.GetChainInfo(0,CHAININFO_TARGET_CARDS)
7777
local sg=g:Filter(Card.IsRelateToEffect,nil,e)
7878
if Duel.SpecialSummon(sg,0,tp,tp,false,false,POS_FACEUP) > 0 then
79-
for tc in aux.Next(sg) do
79+
for tc in sg:Iter() do
8080
if tc:IsLocation(LOCATION_MZONE) then
8181
s.disop(e,tp,eg,ep,ev,re,r,rp,tc)
8282
end
@@ -101,7 +101,7 @@ function s.activate(e,tp,eg,ep,ev,re,r,rp)
101101
e1:SetCondition(s.descon)
102102
e1:SetTarget(s.destg)
103103
e1:SetOperation(s.desop)
104-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
104+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
105105
e1:SetLabelObject(sc)
106106
c:RegisterEffect(e1)
107107
end
@@ -110,7 +110,7 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp,tc)
110110
local e1=Effect.CreateEffect(e:GetHandler())
111111
e1:SetType(EFFECT_TYPE_SINGLE)
112112
e1:SetCode(EFFECT_DISABLE)
113-
e1:SetReset(RESET_EVENT+RESETS_STANDARD)
113+
e1:SetReset(RESET_EVENT|RESETS_STANDARD)
114114
tc:RegisterEffect(e1)
115115
local e2=e1:Clone()
116116
e2:SetCode(EFFECT_DISABLE_EFFECT)
@@ -120,12 +120,12 @@ function s.disop(e,tp,eg,ep,ev,re,r,rp,tc)
120120
e3:SetType(EFFECT_TYPE_SINGLE)
121121
e3:SetCode(EFFECT_CHANGE_LEVEL)
122122
e3:SetValue(1)
123-
e3:SetReset(RESET_EVENT+RESETS_STANDARD)
123+
e3:SetReset(RESET_EVENT|RESETS_STANDARD)
124124
tc:RegisterEffect(e3)
125125
local e4=Effect.CreateEffect(e:GetHandler())
126126
e4:SetType(EFFECT_TYPE_SINGLE)
127127
e4:SetCode(EFFECT_ADD_TYPE)
128-
e4:SetReset(RESET_EVENT+RESETS_STANDARD)
128+
e4:SetReset(RESET_EVENT|RESETS_STANDARD)
129129
e4:SetValue(TYPE_TUNER)
130130
tc:RegisterEffect(e4)
131131
end
@@ -138,19 +138,19 @@ function s.thfilter(c)
138138
return c:IsAbleToHand() and c:IsCode(id+1)
139139
end
140140
function s.destg(e,tp,eg,ep,ev,re,r,rp,chk)
141-
if chk==0 then return e:GetHandler():IsAbleToGrave()
141+
if chk==0 then return e:GetHandler():IsDestructable()
142142
and Duel.IsExistingMatchingCard(s.thfilter,tp,LOCATION_DECK,0,1,nil) end
143143
Duel.SetOperationInfo(0,CATEGORY_TOGRAVE,e:GetHandler(),1,0,0)
144144
Duel.SetOperationInfo(0,CATEGORY_TOHAND,nil,1,tp,LOCATION_DECK)
145145
end
146146
function s.desop(e,tp,eg,ep,ev,re,r,rp)
147147
local c=e:GetHandler()
148-
if c:IsRelateToEffect(e) and Duel.SendtoGrave(c,REASON_EFFECT)~=0 and c:IsLocation(LOCATION_GRAVE) then
148+
if c:IsRelateToEffect(e) and Duel.Destroy(c,REASON_EFFECT)>0 then
149149
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_ATOHAND)
150150
local g=Duel.SelectMatchingCard(tp,s.thfilter,tp,LOCATION_DECK,0,1,1,nil)
151151
if #g>0 then
152152
Duel.SendtoHand(g,nil,REASON_EFFECT)
153153
Duel.ConfirmCards(1-tp,g)
154154
end
155155
end
156-
end
156+
end

0 commit comments

Comments
 (0)