Skip to content

Commit 2f16003

Browse files
authored
Update "Ultimate Wizardry"
-Should only be able to place 2 counters during the turn it's activated. -Script polish/clean-up
1 parent 15ff3e8 commit 2f16003

File tree

1 file changed

+18
-39
lines changed

1 file changed

+18
-39
lines changed

skill/c300307001.lua

Lines changed: 18 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -2,53 +2,32 @@
22
--Scripted by the Razgriz
33
local s,id=GetID()
44
function s.initial_effect(c)
5-
aux.AddSkillProcedure(c,1,false,s.flipcon,s.flipop,1)
6-
local e1=Effect.CreateEffect(c)
7-
e1:SetProperty(EFFECT_FLAG_UNCOPYABLE+EFFECT_FLAG_CANNOT_DISABLE)
8-
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
9-
e1:SetCode(EVENT_STARTUP)
10-
e1:SetCountLimit(1)
11-
e1:SetRange(0x5f)
12-
e1:SetLabel(0)
13-
e1:SetOperation(s.flipop2)
14-
c:RegisterEffect(e1)
5+
aux.AddSkillProcedure(c,1,false,s.flipcon,s.flipop)
156
end
167
s.counter_place_list={COUNTER_SPELL}
17-
function s.filter(c)
8+
function s.spcounterfilter(c)
189
return c:IsFaceup() and c:IsMonster() and c:IsRace(RACE_SPELLCASTER)and c:IsCanAddCounter(COUNTER_SPELL,1)
1910
end
2011
function s.flipcon(e,tp,eg,ep,ev,re,r,rp)
21-
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
22-
return aux.CanActivateSkill(tp) and #g>0
12+
local g=Duel.GetMatchingGroup(s.spcounterfilter,tp,LOCATION_MZONE,0,nil)
13+
return aux.CanActivateSkill(tp) and #g>0 and Duel.GetFlagEffect(tp,id+100)==0
2314
end
2415
function s.flipop(e,tp,eg,ep,ev,re,r,rp)
2516
Duel.Hint(HINT_SKILL_FLIP,tp,id|(1<<32))
2617
Duel.Hint(HINT_CARD,tp,id)
27-
--Place 1 Spell Counter on all Spellcasters
28-
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
29-
for tc in g:Iter() do
30-
tc:AddCounter(COUNTER_SPELL,1)
18+
local g=Duel.GetMatchingGroup(s.spcounterfilter,tp,LOCATION_MZONE,0,nil)
19+
--Place 1 Spell Counter on all Spellcaster monsters you control that you can place a Spell Counter on (initial activation)
20+
if Duel.GetFlagEffect(tp,id)==0 and #g>0 then
21+
for tc in g:Iter() do
22+
tc:AddCounter(COUNTER_SPELL,1)
23+
end
24+
Duel.RegisterFlagEffect(tp,id,0,0,0)
25+
--Place 1 Spell Counter on 1 Spellcaster monster you control that you can place a Spell Counter on (subsequent activations)
26+
elseif Duel.GetFlagEffect(tp,id)>0 and Duel.GetFlagEffect(tp,id+100)==0 and #g>0 then
27+
local sc=g:Select(tp,1,1,nil):GetFirst()
28+
if sc then
29+
sc:AddCounter(COUNTER_SPELL,1)
30+
end
31+
Duel.RegisterFlagEffect(tp,id+100,RESET_PHASE|PHASE_END,0,1)
3132
end
32-
Duel.RegisterFlagEffect(tp,id,0,0,0)
3333
end
34-
function s.flipop2(e,tp,eg,ep,ev,re,r,rp)
35-
local e1=Effect.CreateEffect(e:GetHandler())
36-
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
37-
e1:SetCode(EVENT_FREE_CHAIN)
38-
e1:SetCountLimit(1)
39-
e1:SetCondition(s.ctcon)
40-
e1:SetOperation(s.ctop)
41-
Duel.RegisterEffect(e1,tp)
42-
end
43-
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
44-
local g=Duel.GetMatchingGroup(s.filter,tp,LOCATION_MZONE,0,nil)
45-
return aux.CanActivateSkill(tp) and #g>0 and Duel.GetFlagEffect(tp,id)>0
46-
end
47-
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
48-
Duel.Hint(HINT_CARD,0,id)
49-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_COUNTER)
50-
local sg=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_MZONE,0,1,1,nil)
51-
if #sg>0 then
52-
sg:GetFirst():AddCounter(COUNTER_SPELL,1)
53-
end
54-
end

0 commit comments

Comments
 (0)