Commit a40f3f67 authored by Vury Leo's avatar Vury Leo

use new param for 月光融合 and 多層融合

parent cb01adad
...@@ -6,7 +6,7 @@ function s.initial_effect(c) ...@@ -6,7 +6,7 @@ function s.initial_effect(c)
fusfilter=s.fusfilter, 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=s.pre_select_mat_location,
mat_operation_code_map={ mat_operation_code_map={
{ [LOCATION_EXTRA|LOCATION_GRAVE] = FusionSpell.FUSION_OPERATION_BANISH }, { [LOCATION_EXTRA|LOCATION_GRAVE] = FusionSpell.FUSION_OPERATION_BANISH },
{ [0xff] = FusionSpell.FUSION_OPERATION_GRAVE } { [0xff] = FusionSpell.FUSION_OPERATION_GRAVE }
...@@ -31,6 +31,15 @@ function s.fusfilter(c) ...@@ -31,6 +31,15 @@ function s.fusfilter(c)
return true return true
end end
--- @type FUSION_SPELL_PRE_SELECT_MAT_LOCATION_FUNCTION
function s.pre_select_mat_location(tc,tp)
local location=LOCATION_HAND|LOCATION_MZONE
if Duel.IsExistingMatchingCard(aux.TRUE,tp,0,LOCATION_MZONE,1,nil) then
location=location|LOCATION_EXTRA
end
return location
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
......
...@@ -5,8 +5,8 @@ function s.initial_effect(c) ...@@ -5,8 +5,8 @@ function s.initial_effect(c)
local e1=FusionSpell.CreateSummonEffect(c,{ local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter, fusfilter=s.fusfilter,
pre_select_mat_location=s.pre_select_mat_location, pre_select_mat_location=s.pre_select_mat_location,
additional_fcheck=s.fcheck, fusion_spell_matfilter=s.fusion_spell_matfilter,
additional_gcheck=s.gcheck additional_fcheck=s.fcheck
}) })
e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES) e1:SetCategory(CATEGORY_SPECIAL_SUMMON+CATEGORY_FUSION_SUMMON+CATEGORY_DECKDES)
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH) e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
...@@ -31,22 +31,20 @@ function s.cfilter(c) ...@@ -31,22 +31,20 @@ function s.cfilter(c)
return c:IsSummonLocation(LOCATION_EXTRA) return c:IsSummonLocation(LOCATION_EXTRA)
end end
--- @type FUSION_FGCHECK_FUNCTION
function s.fcheck(tp,mg,fc,all_mg) function s.fcheck(tp,mg,fc,all_mg)
---@type Group
local extra_mg=mg:Filter(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)
if #extra_mg==0 then
return true
end
--- by fusion spell, the material from deck/extra can only be at most 1 --- by fusion spell, the material from deck/extra can only be at most 1
if #extra_mg>1 then if mg:FilterCount(function(c) return c:IsLocation(LOCATION_DECK+LOCATION_EXTRA) end,nil)>1 then
return false return false
end end
return true
end
--- @param c Card
function s.fusion_spell_matfilter(c)
--- by fusion spell, the material from deck/extra must be Lunalight monster --- by fusion spell, the material from deck/extra must be Lunalight monster
if extra_mg:FilterCount(Card.IsSetCard,nil,0xdf)~=#extra_mg then if c:IsLocation(LOCATION_DECK|LOCATION_EXTRA) and not c:IsFusionSetCard(0xdf) then
return false return false
end end
return true return true
end end
function s.gcheck(sg)
return sg:FilterCount(Card.IsLocation,nil,LOCATION_DECK+LOCATION_EXTRA)<=1
end
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