Skip to content

Commit 10ebf64

Browse files
committed
"Ghostrick Shot" fix
Fixed a bug where it would be possible to activate the GY effect even if "Ghostrick Shot" was the only "Ghostrick" card in the GY
1 parent 064406c commit 10ebf64

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

official/c69809989.lua

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,19 @@ function s.spop(e,tp,eg,ep,ev,re,r,rp)
5353
end
5454
end
5555
end
56-
function s.xyzfilter(c,tp)
56+
function s.xyzfilter(c,tp,exc)
5757
return c:IsFaceup() and c:IsType(TYPE_XYZ) and c:IsSetCard(SET_GHOSTRICK)
58-
and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_GRAVE,0,1,nil,tp,c)
58+
and Duel.IsExistingMatchingCard(s.attachfilter,tp,LOCATION_GRAVE,0,1,exc,tp,c)
5959
end
6060
function s.attachfilter(c,tp,xyzc)
6161
return c:IsSetCard(SET_GHOSTRICK) and c:IsCanBeXyzMaterial(xyzc,tp,REASON_EFFECT)
6262
end
6363
function s.mattg(e,tp,eg,ep,ev,re,r,rp,chk,chkc)
64-
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc,tp) end
65-
if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp) end
64+
local c=e:GetHandler()
65+
if chkc then return chkc:IsControler(tp) and chkc:IsLocation(LOCATION_MZONE) and s.xyzfilter(chkc,tp,c) end
66+
if chk==0 then return Duel.IsExistingTarget(s.xyzfilter,tp,LOCATION_MZONE,0,1,nil,tp,c) end
6667
Duel.Hint(HINT_SELECTMSG,tp,HINTMSG_TARGET)
67-
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp)
68+
Duel.SelectTarget(tp,s.xyzfilter,tp,LOCATION_MZONE,0,1,1,nil,tp,c)
6869
Duel.SetOperationInfo(0,CATEGORY_LEAVE_GRAVE,nil,1,tp,0)
6970
end
7071
function s.matop(e,tp,eg,ep,ev,re,r,rp)

0 commit comments

Comments
 (0)