Commit 0a6e176c authored by Vury Leo's avatar Vury Leo

tuning インフェルノイド・ティエラ

parent 52ed02e6
......@@ -3,7 +3,6 @@ local s,id,o=GetID()
function s.initial_effect(c)
--fusion material
c:EnableReviveLimit()
-- aux.AddFusionProcCode2FunRep(c,14799437,23440231,aux.FilterBoolFunction(Card.IsFusionSetCard,0xbb),1,127,true,true)
Fusion.AddFusionProcedure(c,{
slots={
Fusion.Slot.Code(14799437),
......
......@@ -3667,6 +3667,40 @@ function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
return false
end
end
-- Compute a parallel fcheck array
local hasFCheck=aux.FCheckAdditional~=nil
local fcheck_ok={}
if hasFCheck then
for i,c in ipairs(matched) do
local tmp=mg_base:Clone()
tmp:Merge(Group.FromCards(c))
fcheck_ok[i]=aux.FCheckAdditional(tc:GetOwner(),tmp,tc)
end
else
for i=1,#matched do
fcheck_ok[i]=false
end
end
-- Stable-sort matched so that fcheck_ok==true come first
local order={}
for i=1,#matched do order[i]=i end
table.sort(order,function(a,b)
-- place true before false, keep original order otherwise
if fcheck_ok[a]~=fcheck_ok[b] then
return fcheck_ok[a]
else
return a<b
end
end)
local sorted={}
for _, idx in ipairs(order) do
table.insert(sorted,matched[idx])
end
matched=sorted
local comb={}
local function dfs(start,depth)
......@@ -3711,7 +3745,16 @@ function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
comb[depth]=matched[i]
local prune=false
local partial={table.unpack(comb,1,depth)}
-- early FCheckAdditional prune
if not prune and hasFCheck then
-- build a temporary Group with mg_base + the new partial comb
local mg_p=mg_base:Clone()
mg_p:Merge(Group.FromCards(table.unpack(partial)))
-- if it fails, mark prune = true
if not aux.FCheckAdditional(tc:GetOwner(),mg_p,tc) then
prune=true
end
end
-- early unique_by prune on partial subset via UniqueByMatching
if not prune and grp.unique_by then
local part_matcher=Fusion.UniqueByMatching(grp.unique_by,#partial)
......@@ -3727,6 +3770,13 @@ function Fusion.SearchGroup(e,leftovers,mg_base,grp,tc,fgoalcheck,chkf)
end
end
-- early fcheck prune on partial subset
if not prune and grp.has_same and #partial>1 then
if not Fusion.CheckHasSame(grp,partial,e) then
prune=true
end
end
if not prune then
if dfs(i+1,depth+1) then
return true
......
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