@@ -2419,6 +2423,7 @@ function FusionSpell.CreateSummonEffect(c,opts)
sumpos,
extra_target,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter
))
...
...
@@ -2435,6 +2440,7 @@ function FusionSpell.CreateSummonEffect(c,opts)
sumpos,
stage_x_operation,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter
))
...
...
@@ -2443,7 +2449,7 @@ function FusionSpell.CreateSummonEffect(c,opts)
end
---@param fusfilter fun(c:Card):boolean filter for the monster to be Fusion Summoned
---@param matfilter fun(c:Card,e:Effect,tp:integer):boolean filter for the materials, use it only under very strong limitation like D-Fusion.
---@param matfilter FUSION_SPELL_MATFILTER_FUNCTION filter for the materials, use it only under very strong limitation like D-Fusion.
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials
---@param mat_operation_code_map {[integer]:FUSION_OPERATION_CODE}[] operation code to do for the materials, it will be check in order
---@param post_select_mat_location integer location where to find the materials after known the materials
...
...
@@ -2454,8 +2460,9 @@ end
---@param sumpos integer summon position
---@param extra_target fun(e:Effect, tp:integer, eg:Group, ep:integer, ev:integer, re:Effect, r:integer, rp:integer, chk:integer):nil extra target function to add opration info etc
---@param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
---@param post_select_mat_opponent_location integer location where to find the materials after known the materials on opponent location
---@param gc fun(e:Effect):Card|nil Function that returns a card that must be included in the fusion materials
---@param fusion_spell_matfilter fun(c:Card):boolean a material must pass this to be legal as material come from fusion spell
---@param fusion_spell_matfilter FUSION_SPELL_MATFILTER_FUNCTION a material must pass this to be legal as material come from fusion spell
functionFusionSpell.GetSummonTarget(
fusfilter,
matfilter,
...
...
@@ -2469,6 +2476,7 @@ function FusionSpell.GetSummonTarget(
sumpos,
extra_target,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter
)
...
...
@@ -2491,6 +2499,7 @@ function FusionSpell.GetSummonTarget(
additional_fgoalcheck,
sumtype,sumpos,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter)
end,
...
...
@@ -2513,7 +2522,7 @@ function FusionSpell.GetSummonTarget(
end
---@param fusfilter fun(c:Card):boolean filter for the monster to be Fusion Summoned
---@param matfilter fun(c:Card,e:Effect,tp:integer):boolean filter for the materials, use it only under very strong limitation like D-Fusion.
---@param matfilter FUSION_SPELL_MATFILTER_FUNCTION filter for the materials, use it only under very strong limitation like D-Fusion.
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials
---@param mat_operation_code_map {[integer]:FUSION_OPERATION_CODE}[] operation code to do for the materials, it will be check in order
---@param post_select_mat_location integer location where to find the materials after known the materials
...
...
@@ -2524,8 +2533,9 @@ end
---@param sumpos integer summon position
---@param stage_x_operation function callback function when special summon is in progress. will be called with different stage name
---@param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
---@param post_select_mat_opponent_location integer location where to find the materials after known the materials on opponent location
---@param gc fun(e:Effect):Card|nil Function that returns a card that must be included in the fusion materials
---@param fusion_spell_matfilter fun(c:Card):boolean a material must pass this to be legal as material come from fusion spell
---@param fusion_spell_matfilter FUSION_SPELL_MATFILTER_FUNCTION a material must pass this to be legal as material come from fusion spell
functionFusionSpell.GetSummonOperation(
fusfilter,
matfilter,
...
...
@@ -2539,6 +2549,7 @@ function FusionSpell.GetSummonOperation(
sumpos,
stage_x_operation,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter
)
...
...
@@ -2561,6 +2572,7 @@ function FusionSpell.GetSummonOperation(
additional_fgoalcheck,
sumtype,sumpos,
pre_select_mat_opponent_location,
post_select_mat_opponent_location,
gc,
fusion_spell_matfilter)
end,
...
...
@@ -2613,8 +2625,19 @@ function FusionSpell.GetSummonOperation(
assert(#materials_with_one_material_effect+#materials_with_two_material_effect==#materials,"We can not have one material have zero/3+ material effect yet")
--For material that can be material by multiple effect, ask user which to apply.
--As of 2025 May, if a material could be used as extra material, it must be able to be used as fusion spell material. The code below is based on this assumption.
...
...
@@ -2786,7 +2823,7 @@ function FusionSpell.GetSummonOperation(
end
end
---@param pre_select_mat_location integer|(fun(tc:Card,tp:integer):integer) location where to find the materials before known the materials
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials
---@param post_select_mat_location integer location where to find the materials after known the materials
---@return integer locations all possible locations of the material
---@param matfilter fun(c:Card,e:Effect,tp:integer):boolean filter for the materials, use it only under very strong limitation like D-Fusion.
---@param matfilter FUSION_SPELL_MATFILTER_FUNCTION filter for the materials, use it only under very strong limitation like D-Fusion.
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials
---@param mat_operation_code_map {[integer]:FUSION_OPERATION_CODE}[] operation code to do for the materials, it will be check in order
---@param post_select_mat_location integer location where to find the materials after known the materials
---@param sumtype integer summon type
---@param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
---@param fusion_spell_matfilter fun(c:Card,tp:integer):boolean a material must pass this to be legal as material come from fusion spell
---@param post_select_mat_opponent_location integer location where to find the materials after known the materials on opponent location
---@param fusion_spell_matfilter FUSION_SPELL_MATFILTER_FUNCTION a material must pass this to be legal as material come from fusion spell
---@param matfilter fun(c:Card,e:Effect,tp:integer):boolean filter for the materials, use it only under very strong limitation like D-Fusion.
---@param pre_select_mat_location integer|function location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)
---@param matfilter FUSION_SPELL_MATFILTER_FUNCTION filter for the materials, use it only under very strong limitation like D-Fusion.
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)
---@param post_select_mat_location integer location where to find the materials after known the materials
---@param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
---@param post_select_mat_opponent_location integer location where to find the materials before known the materials on opponent location
---@param gc fun(e:Effect):Card|nil
---@param fusion_spell_matfilter fun(c:Card):boolean a material must pass this to be legal as material come from fusion spell
--if element is true, stands for it can be included by the fusion effect itself.
---@param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials
---@param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
---@param fusion_spell_matfilter fun(c:Card):boolean a material must pass this to be legal as material come from fusion spell
---@param post_select_mat_opponent_location integer location where to find the materials after known the materials on opponent location
---@param fusion_spell_matfilter FUSION_SPELL_MATFILTER_FUNCTION a material must pass this to be legal as material come from fusion spell
---@param e Effect the fusion effect
---@param mat_operation_code_map {[integer]:FUSION_OPERATION_CODE}[] operation code to do for the materials, it will be check in order
--- @param pre_select_mat_location integer|function location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)
--- @param post_select_mat_location integer?
--- @param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)
--- @param post_select_mat_location integer
--- @param pre_select_mat_opponent_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials on opponent location
--- @param fusion_spell_matfilter fun(c:Card):boolean a material must pass this to be legal as material come from fusion spell
--- @param post_select_mat_opponent_location integer location where to find the materials after known the materials on opponent location
--- @param fusion_spell_matfilter FUSION_SPELL_MATFILTER_FUNCTION a material must pass this to be legal as material come from fusion spell
--- @param e Effect the fusion effect
--- @param mat_operation_code_map {[integer]:FUSION_OPERATION_CODE}[] operation code to do for the materials, it will be check in order
--- @param pre_select_mat_location integer|function location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)
--- @param pre_select_mat_location integer|FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION location where to find the materials before known the materials (default LOCATION_HAND|LOCATION_MZONE)