Skip to content

Commit e98c5fc

Browse files
committed
"Skull Lair" update
Fixed a bug where it would be possible to activate its effects multiple times in the same chain, which should not happen according to rulings
1 parent 8b87576 commit e98c5fc

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

official/c6733059.lua

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,26 +3,23 @@
33
local s,id=GetID()
44
function s.initial_effect(c)
55
--Activate
6+
local e0=Effect.CreateEffect(c)
7+
e0:SetType(EFFECT_TYPE_ACTIVATE)
8+
e0:SetCode(EVENT_FREE_CHAIN)
9+
e0:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
10+
c:RegisterEffect(e0)
11+
--Destroy 1 face-up monster on the field whose Level is equal to the number of the cards you banished
612
local e1=Effect.CreateEffect(c)
7-
e1:SetType(EFFECT_TYPE_ACTIVATE)
13+
e1:SetDescription(aux.Stringid(id,1))
14+
e1:SetCategory(CATEGORY_DESTROY)
15+
e1:SetType(EFFECT_TYPE_QUICK_O)
16+
e1:SetRange(LOCATION_SZONE)
817
e1:SetCode(EVENT_FREE_CHAIN)
918
e1:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
19+
e1:SetCountLimit(1,0,EFFECT_COUNT_CODE_CHAIN)
20+
e1:SetTarget(s.target)
21+
e1:SetOperation(s.operation)
1022
c:RegisterEffect(e1)
11-
--Destroy monster
12-
local e2=Effect.CreateEffect(c)
13-
e2:SetDescription(aux.Stringid(id,1))
14-
e2:SetCategory(CATEGORY_DESTROY)
15-
e2:SetType(EFFECT_TYPE_QUICK_O)
16-
e2:SetRange(LOCATION_SZONE)
17-
e2:SetCode(EVENT_FREE_CHAIN)
18-
e2:SetHintTiming(0,TIMINGS_CHECK_MONSTER)
19-
e2:SetCost(s.descost)
20-
e2:SetOperation(s.desop)
21-
c:RegisterEffect(e2)
22-
end
23-
function s.cost(e,tp,eg,ep,ev,re,r,rp,chk)
24-
e:SetLabel(1)
25-
return true
2623
end
2724
function s.cfilter(c)
2825
return c:IsMonster() and c:IsAbleToRemoveAsCost() and aux.SpElimFilter(c)
@@ -32,7 +29,7 @@ function s.rescon(fg)
3229
return fg:IsExists(Card.IsLevel,1,sg,#sg),not fg:IsExists(Card.IsLevelAbove,1,sg,#sg)
3330
end
3431
end
35-
function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
32+
function s.target(e,tp,eg,ep,ev,re,r,rp,chk)
3633
local cg=Duel.GetMatchingGroup(s.cfilter,tp,LOCATION_MZONE|LOCATION_GRAVE,0,nil)
3734
local fg=Duel.GetMatchingGroup(aux.FaceupFilter(Card.IsLevelBelow,#cg),tp,LOCATION_MZONE,LOCATION_MZONE,nil)
3835
if chk==0 then return aux.SelectUnselectGroup(cg,e,tp,nil,nil,s.rescon(fg),0) end
@@ -41,11 +38,13 @@ function s.descost(e,tp,eg,ep,ev,re,r,rp,chk)
4138
Duel.SetTargetParam(#rg)
4239
Duel.SetOperationInfo(0,CATEGORY_DESTROY,fg:Filter(Card.IsLevel,rg,#rg),1,0,0)
4340
end
44-
function s.desop(e,tp,eg,ep,ev,re,r,rp)
45-
if not e:GetHandler():IsRelateToEffect(e) then return end
41+
function s.operation(e,tp,eg,ep,ev,re,r,rp)
4642
local lv=Duel.GetChainInfo(0,CHAININFO_TARGET_PARAM)
4743
if lv==0 then return end
4844
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_DESTROY)
4945
local g=Duel.SelectMatchingCard(tp,aux.FaceupFilter(Card.IsLevel,lv),tp,LOCATION_MZONE,LOCATION_MZONE,1,1,nil)
50-
Duel.Destroy(g,REASON_EFFECT)
46+
if #g>0 then
47+
Duel.HintSelection(g)
48+
Duel.Destroy(g,REASON_EFFECT)
49+
end
5150
end

0 commit comments

Comments
 (0)