Skip to content

Commit dbfd19b

Browse files
authored
fix "Witchcrafter Walpurgis"
should be able to use cost replacement multiple times in a chain even if the player does not have a Spell in their hand
1 parent 43912a5 commit dbfd19b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

cards_specific_functions.lua

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,13 +287,15 @@ function Witchcrafter.CreateCostReplaceEffect(c)
287287
e:SetProperty(EFFECT_FLAG_PLAYER_TARGET)
288288
e:SetCode(EFFECT_COST_REPLACE)
289289
e:SetTargetRange(1,0)
290-
e:SetValue(function(base,extracon,e,tp)
291-
local c=e:GetHandler()
292-
local trig_eff=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_EFFECT)
293-
if not trig_eff or c:IsRelateToEffect(e) then
290+
e:SetValue(function(base,extracon,e,tp,eg,ep,ev,re,r,rp,chk)
291+
if chk==0 then
292+
local c=e:GetHandler()
294293
return c:IsSetCard(SET_WITCHCRAFTER) and c:IsControler(tp) and c:IsLocation(LOCATION_MZONE)
295-
else
296-
return c:IsPreviousSetCard(SET_WITCHCRAFTER) and c:IsPreviousControler(tp) and c:IsPreviousLocation(LOCATION_MZONE)
294+
end
295+
local ctrl,loc,setcodes=Duel.GetChainInfo(0,CHAININFO_TRIGGERING_CONTROLER,CHAININFO_TRIGGERING_LOCATION,CHAININFO_TRIGGERING_SETCODES)
296+
if ctrl==1-tp or loc~=LOCATION_MZONE then return false end
297+
for _,setcode in ipairs(setcodes) do
298+
if (SET_WITCHCRAFTER&0xfff)==(setcode&0xfff) and (SET_WITCHCRAFTER&setcode)==SET_WITCHCRAFTER then return true end
297299
end
298300
end)
299301
return e

0 commit comments

Comments
 (0)