Commit 17e45956 authored by Vury Leo's avatar Vury Leo

Add サイバーロード・フュージョン to new fusion and fix facedown banished material

parent dad935b0
No preview for this file type
--サイバーロード・フュージョン
local s,id,o=GetID()
function s.initial_effect(c)
--Activate
local e1=FusionSpell.CreateSummonEffect(c,{
fusfilter=s.fusfilter,
pre_select_mat_location=LOCATION_MZONE|LOCATION_REMOVED,
mat_operation_code_map={
{ [LOCATION_DECK] = FusionSpell.FUSION_OPERATION_GRAVE },
{ [0xff] = FusionSpell.FUSION_OPERATION_SHUFFLE }
},
additional_fcheck=s.fcheck,
stage_x_operation=s.stage_x_operation
})
e1:SetCountLimit(1,id+EFFECT_COUNT_CODE_OATH)
c:RegisterEffect(e1)
end
function s.fusfilter(c)
return aux.IsMaterialListSetCard(c,0x1093)
end
---@type FUSION_FGCHECK_FUNCTION
function s.fcheck(tp,mg,tc,mg_all)
if tc.cyber_fusion_check~=nil then
return tc.cyber_fusion_check(tp,mg_all,tc)
else
return true
end
end
---@type FUSION_SPELL_STAGE_X_CALLBACK_FUNCTION
function s.stage_x_operation(e,tc,tp,stage)
if stage==FusionSpell.STAGE_AT_SUMMON_OPERATION_FINISH then
local fid=e:GetHandler():GetFieldID()
tc:RegisterFlagEffect(id,RESET_EVENT+RESETS_STANDARD+RESET_PHASE+PHASE_END,0,1,fid)
local e1=Effect.CreateEffect(e:GetHandler())
e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_CANNOT_ATTACK)
e1:SetProperty(EFFECT_FLAG_OATH)
e1:SetTargetRange(LOCATION_MZONE,0)
e1:SetTarget(s.ftarget)
e1:SetLabel(fid)
e1:SetReset(RESET_PHASE+PHASE_END)
Duel.RegisterEffect(e1,tp)
end
end
function s.ftarget(e,c)
return e:GetLabel()~=c:GetFlagEffectLabel(id)
end
......@@ -2742,7 +2742,6 @@ function FusionSpell.GetAllLocationsForTargetCard(tc,tp,pre_select_mat_location,
all_locations=all_locations|pre_select_mat_location
end
if post_select_mat_location~=nil then
all_locations=all_locations|post_select_mat_location
end
return all_locations
......@@ -2775,10 +2774,12 @@ function FusionSpell.GetMaterialsGroupForTargetCard(
mg:Merge(opponent_mg)
end
-- filter by the strong material filter, target card can not be fusion material of itself
--- filter by the strong material filter, target card can not be fusion material of itself
mg=mg:Filter(matfilter,tc)
--- filter out card can not be affected by effect
mg=mg:Filter(aux.NOT(Card.IsImmuneToEffect),nil,e)
--- filter out card that are facedown banished
mg=mg:Filter(function(c) return not(c:IsLocation(LOCATION_REMOVED) and c:IsFacedown()) end,nil)
--- filter out card can not be material
--- comment out, currently core can not return correct value if affected by EFFECT_EXTRA_FUSION_MATERIAL.
--mg=mg:Filter(Card.IsCanBeFusionMaterial,nil,tc,sumtype)
......
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