Skip to content

Commit e279c5b

Browse files
authored
Update "Full Moon Mirror"
- No stated maximum number of Full Moon Counters (text implies more than 10 can be present) - Effect to place "Infinite Fiend Mirror" should be ignition-like, not quick-like - Replace manual method of activating Field Spells with properly Duel method - Other bits of script modernization/polish
1 parent 4fa31b5 commit e279c5b

File tree

1 file changed

+31
-60
lines changed

1 file changed

+31
-60
lines changed

unofficial/c511000919.lua

Lines changed: 31 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,47 @@
11
--月輪鏡
22
--Full Moon Mirror
33
local s,id=GetID()
4+
local COUNTER_FULL_MOON=0x99
45
function s.initial_effect(c)
5-
c:EnableCounterPermit(0x99)
6-
c:SetCounterLimit(0x99,10)
6+
--"Full Moon Counter" enable
7+
c:EnableCounterPermit(COUNTER_FULL_MOON)
78
--Activate
9+
local e0=Effect.CreateEffect(c)
10+
e0:SetType(EFFECT_TYPE_ACTIVATE)
11+
e0:SetCode(EVENT_FREE_CHAIN)
12+
c:RegisterEffect(e0)
13+
--Each time a monster(s) is destroyed, add 1 "Full Moon Counter" to this card
814
local e1=Effect.CreateEffect(c)
9-
e1:SetType(EFFECT_TYPE_ACTIVATE)
10-
e1:SetCode(EVENT_FREE_CHAIN)
15+
e1:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
16+
e1:SetCode(EVENT_DESTROYED)
17+
e1:SetRange(LOCATION_SZONE)
18+
e1:SetCondition(function(e,tp,eg,ep,ev,re,r,rp) return eg:IsExists(s.ctfilter,1,nil) end)
19+
e1:SetOperation(function(e) e:GetHandler():AddCounter(COUNTER_FULL_MOON,1) end)
1120
c:RegisterEffect(e1)
12-
--Add counter
21+
--Activate 1 "Infinite Fiend Mirror" from your hand or Deck
1322
local e2=Effect.CreateEffect(c)
14-
e2:SetType(EFFECT_TYPE_FIELD+EFFECT_TYPE_CONTINUOUS)
15-
e2:SetProperty(EFFECT_FLAG_DELAY)
23+
e2:SetDescription(aux.Stringid(id,0))
24+
e2:SetType(EFFECT_TYPE_IGNITION)
1625
e2:SetRange(LOCATION_SZONE)
17-
e2:SetCode(EVENT_DESTROY)
18-
e2:SetCondition(s.ctcon)
19-
e2:SetOperation(s.ctop)
26+
e2:SetCondition(function(e) return e:GetHandler():HasCounter(COUNTER_FULL_MOON,10) end)
27+
e2:SetCost(Cost.SelfTribute)
28+
e2:SetTarget(s.acttg)
29+
e2:SetOperation(s.actop)
2030
c:RegisterEffect(e2)
21-
--Activate
22-
local e3=Effect.CreateEffect(c)
23-
e3:SetDescription(aux.Stringid(id,0))
24-
e3:SetType(EFFECT_TYPE_QUICK_O)
25-
e3:SetCode(EVENT_FREE_CHAIN)
26-
e3:SetRange(LOCATION_SZONE)
27-
e3:SetCondition(s.accon)
28-
e3:SetCost(s.accost)
29-
e3:SetTarget(s.actg)
30-
e3:SetOperation(s.acop)
31-
c:RegisterEffect(e3)
3231
end
33-
s.listed_names={100000080}
32+
s.counter_place_list={COUNTER_FULL_MOON}
33+
s.listed_names={100000080} --"Infinite Fiend Mirror"
3434
function s.ctfilter(c)
35-
return c:IsFaceup() and c:IsLocation(LOCATION_MZONE)
36-
end
37-
function s.ctcon(e,tp,eg,ep,ev,re,r,rp)
38-
return eg:IsExists(s.ctfilter,1,nil)
39-
end
40-
function s.ctop(e,tp,eg,ep,ev,re,r,rp)
41-
e:GetHandler():AddCounter(0x99,1)
42-
end
43-
function s.accon(e)
44-
return e:GetHandler():GetCounter(0x99)==10
35+
return c:IsPreviousLocation(LOCATION_MZONE) and c:IsPreviousPosition(POS_FACEUP)
4536
end
46-
function s.accost(e,tp,eg,ep,ev,re,r,rp,chk)
47-
if chk==0 then return e:GetHandler():IsAbleToGraveAsCost() end
48-
Duel.SendtoGrave(e:GetHandler(),REASON_COST)
37+
function s.actfilter(c,tp)
38+
return c:IsCode(100000080) and c:GetActivateEffect():IsActivatable(tp,true,true)
4939
end
50-
function s.filter(c,tp)
51-
return c:IsCode(100000080) and c:GetActivateEffect():IsActivatable(tp,true,true)
40+
function s.acttg(e,tp,eg,ep,ev,re,r,rp,chk)
41+
if chk==0 then return Duel.IsExistingMatchingCard(s.actfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end
5242
end
53-
function s.actg(e,tp,eg,ep,ev,re,r,rp,chk)
54-
if chk==0 then return Duel.IsExistingMatchingCard(s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,nil,tp) end
43+
function s.actop(e,tp,eg,ep,ev,re,r,rp)
44+
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TOFIELD)
45+
local sc=Duel.SelectMatchingCard(tp,s.actfilter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst()
46+
Duel.ActivateFieldSpell(sc,e,tp,eg,ep,ev,re,r,rp)
5547
end
56-
function s.acop(e,tp,eg,ep,ev,re,r,rp)
57-
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_EFFECT)
58-
local tc=Duel.SelectMatchingCard(tp,s.filter,tp,LOCATION_HAND|LOCATION_DECK,0,1,1,nil,tp):GetFirst()
59-
if tc then
60-
local loc=LOCATION_SZONE
61-
if (tpe&TYPE_FIELD)~=0 then
62-
loc=LOCATION_FZONE
63-
local fc=Duel.GetFieldCard(1-tp,LOCATION_FZONE,0)
64-
if Duel.GetFlagEffect(tp,62765383)>0 then
65-
if fc then Duel.Destroy(fc,REASON_RULE) end
66-
of=Duel.GetFieldCard(tp,LOCATION_FZONE,0)
67-
if fc and Duel.Destroy(fc,REASON_RULE)==0 then Duel.SendtoGrave(tc,REASON_RULE) end
68-
else
69-
Duel.GetFieldCard(tp,LOCATION_FZONE,0)
70-
if fc and Duel.SendtoGrave(fc,REASON_RULE)==0 then Duel.SendtoGrave(tc,REASON_RULE) end
71-
end
72-
end
73-
Duel.MoveToField(tc,tp,tp,loc,POS_FACEUP,true)
74-
Duel.RaiseEvent(tc,EVENT_CHAIN_SOLVED,tc:GetActivateEffect(),0,tp,tp,Duel.GetCurrentChain())
75-
end
76-
end

0 commit comments

Comments
 (0)