Commit b04117e7 authored by Vury Leo's avatar Vury Leo

more 多層融合 filter

parent b02703c0
Pipeline #37084 failed with stages
in 3 minutes and 29 seconds
...@@ -3,6 +3,7 @@ local s,id,o=GetID() ...@@ -3,6 +3,7 @@ local s,id,o=GetID()
function s.initial_effect(c) function s.initial_effect(c)
--Activate --Activate
local e1=FusionSpell.CreateSummonEffect(c,{ local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
additional_fcheck=s.additional_fcheck, additional_fcheck=s.additional_fcheck,
additional_fgoalcheck=s.additional_fgoalcheck, additional_fgoalcheck=s.additional_fgoalcheck,
pre_select_mat_location=LOCATION_HAND|LOCATION_MZONE|LOCATION_EXTRA, pre_select_mat_location=LOCATION_HAND|LOCATION_MZONE|LOCATION_EXTRA,
...@@ -16,6 +17,20 @@ function s.initial_effect(c) ...@@ -16,6 +17,20 @@ function s.initial_effect(c)
c:RegisterEffect(e1) c:RegisterEffect(e1)
end end
function s.fusfilter(c)
--- fusion monster must have maximium mertial number >= 3, material_count = {min,max} in metatable
local mt=getmetatable(c)
if mt~=nil then
local material_count=mt.material_count
if material_count~=nil and #material_count>=2 then
if material_count[2]<3 then
return false
end
end
end
return true
end
---@type FUSION_FGCHECK_FUNCTION ---@type FUSION_FGCHECK_FUNCTION
function s.additional_fcheck(tp,mg,fc,all_mg) function s.additional_fcheck(tp,mg,fc,all_mg)
--- material from extra deck by this fusion spell can not exceed monster opponent controls --- material from extra deck by this fusion spell can not exceed monster opponent controls
......
...@@ -2912,7 +2912,7 @@ function FusionSpell.GetFusionOperationByCode(code,matlocation,fusion_spell_oper ...@@ -2912,7 +2912,7 @@ function FusionSpell.GetFusionOperationByCode(code,matlocation,fusion_spell_oper
elseif code==FusionSpell.FUSION_OPERATION_INHERIT then elseif code==FusionSpell.FUSION_OPERATION_INHERIT then
if matlocation==nil or fusion_spell_operation_code_map==nil then if matlocation==nil or fusion_spell_operation_code_map==nil then
-- we are in trouble -- we are in trouble
assert(false, "we have a material that inhreits, but operation can be inhreited") assert(false, "we have a material that inhreits, but no operation to inhreit from")
return FusionSpell.GraveMaterial return FusionSpell.GraveMaterial
end end
return FusionSpell.GetFusionOperationByCode(FusionSpell.GetOperationCodeByMaterialLocation(matlocation,fusion_spell_operation_code_map)) return FusionSpell.GetFusionOperationByCode(FusionSpell.GetOperationCodeByMaterialLocation(matlocation,fusion_spell_operation_code_map))
...@@ -2936,7 +2936,7 @@ function FusionSpell.GetFusionFilterByCode(code,matlocation,fusion_spell_operati ...@@ -2936,7 +2936,7 @@ function FusionSpell.GetFusionFilterByCode(code,matlocation,fusion_spell_operati
elseif code==FusionSpell.FUSION_OPERATION_INHERIT then elseif code==FusionSpell.FUSION_OPERATION_INHERIT then
if matlocation==nil or fusion_spell_operation_code_map==nil then if matlocation==nil or fusion_spell_operation_code_map==nil then
-- we are in trouble -- we are in trouble
assert(false, "we have a material that inhreits, but operation can be inhreited") assert(false, "we have a material that inhreits, but no operation to inhreit from")
return FusionSpell.GraveMaterialFilter return FusionSpell.GraveMaterialFilter
end end
return FusionSpell.GetFusionFilterByCode(FusionSpell.GetOperationCodeByMaterialLocation(matlocation,fusion_spell_operation_code_map)) return FusionSpell.GetFusionFilterByCode(FusionSpell.GetOperationCodeByMaterialLocation(matlocation,fusion_spell_operation_code_map))
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment