Skip to content

Commit 3475313

Browse files
committed
Fusion procedure update
Prevent effects that can use an extra group of materials (e.g. "Lubellion the Searing Dragon") and interact with the GY from bypassing "Necrovalley"'s effect
1 parent c3d5504 commit 3475313

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

proc_fusion_spell.lua

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@ function (fusfilter,matfilter,extrafil,extraop,gc2,stage2,exactcount,value,locat
330330
local efmg=fmg_all:Filter(GetExtraMatEff,nil)
331331
local extragroup=nil
332332
local repl_flag=false
333+
local function filter_material_immunity_and_necrovalley(card,fvalue,feffect)
334+
return card:IsCanBeFusionMaterial(nil,fvalue) and not card:IsImmuneToEffect(feffect) and aux.nvfilter(card)
335+
end
333336
if #efmg>0 then
334337
local extra_feff=GetExtraMatEff(efmg:GetFirst())
335338
if extra_feff and extra_feff:GetLabelObject() then
@@ -344,7 +347,7 @@ function (fusfilter,matfilter,extrafil,extraop,gc2,stage2,exactcount,value,locat
344347
ret[1]:Match(repl_function[2],nil,e,tp)
345348
efmg:Match(repl_function[2],nil,e,tp)
346349
end
347-
Fusion.ExtraGroup=ret[1]:Filter(Card.IsCanBeFusionMaterial,nil,nil,value):Match(aux.NOT(Card.IsImmuneToEffect),nil,e)
350+
Fusion.ExtraGroup=ret[1]:Filter(filter_material_immunity_and_necrovalley,nil,value,e)
348351
mg1:Merge(ret[1])
349352
end
350353
checkAddition=ret[2]
@@ -355,7 +358,7 @@ function (fusfilter,matfilter,extrafil,extraop,gc2,stage2,exactcount,value,locat
355358
if ret[1] then
356359
repl[1]:Match(matfilter,nil,e,tp,1)
357360
ret[1]:Merge(repl[1])
358-
Fusion.ExtraGroup=ret[1]:Filter(Card.IsCanBeFusionMaterial,nil,nil,value):Match(aux.NOT(Card.IsImmuneToEffect),nil,e)
361+
Fusion.ExtraGroup=ret[1]:Filter(filter_material_immunity_and_necrovalley,nil,value,e)
359362
mg1:Merge(ret[1])
360363
end
361364
if ret[2] then
@@ -370,13 +373,13 @@ function (fusfilter,matfilter,extrafil,extraop,gc2,stage2,exactcount,value,locat
370373
if not repl_flag and extrafil then
371374
local ret = {extrafil(e,tp,mg1)}
372375
if ret[1] then
373-
Fusion.ExtraGroup=ret[1]:Filter(Card.IsCanBeFusionMaterial,nil,nil,value):Match(aux.NOT(Card.IsImmuneToEffect),nil,e)
376+
Fusion.ExtraGroup=ret[1]:Filter(filter_material_immunity_and_necrovalley,nil,value,e)
374377
extragroup=ret[1]
375378
mg1:Merge(ret[1])
376379
end
377380
checkAddition=ret[2]
378381
end
379-
mg1:Match(Card.IsCanBeFusionMaterial,nil,nil,value):Match(aux.NOT(Card.IsImmuneToEffect),nil,e)
382+
mg1:Match(filter_material_immunity_and_necrovalley,nil,value,e)
380383
if gc and (not mg1:Includes(gc) or gc:IsExists(Fusion.ForcedMatValidity,1,nil,e)) then
381384
Fusion.ExtraGroup=nil
382385
return false

0 commit comments

Comments
 (0)