Commit 98f9633c authored by Vury Leo's avatar Vury Leo

hint level

parent 37cb08ee
--A・O・J カタストル --A・O・J カタストル
function c26593852.initial_effect(c) function c26593852.initial_effect(c)
--synchro summon --synchro summon
aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
Synchro.AddSynchroProcedure(c) Synchro.AddSynchroProcedure(c)
-- aux.AddSynchroProcedure(c,nil,aux.NonTuner(nil),1)
c:EnableReviveLimit() c:EnableReviveLimit()
--destroy --destroy
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
......
...@@ -3391,7 +3391,8 @@ function Synchro.AddSynchroProcedure(c,params) ...@@ -3391,7 +3391,8 @@ function Synchro.AddSynchroProcedure(c,params)
local base_mapper=params.base_mapper or Synchro.LevelMapper local base_mapper=params.base_mapper or Synchro.LevelMapper
local e1=Effect.CreateEffect(c) local e1=Effect.CreateEffect(c)
e1:SetDescription(1164) -- e1:SetDescription(1164)
e1:SetDescription(1379) --- 启用扩展卡包调试模式
e1:SetType(EFFECT_TYPE_FIELD) e1:SetType(EFFECT_TYPE_FIELD)
e1:SetCode(EFFECT_SPSUMMON_PROC) e1:SetCode(EFFECT_SPSUMMON_PROC)
e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE) e1:SetProperty(EFFECT_FLAG_CANNOT_DISABLE+EFFECT_FLAG_UNCOPYABLE)
...@@ -3415,7 +3416,7 @@ function Synchro.FindValidSelection(candidates,target_level, ...@@ -3415,7 +3416,7 @@ function Synchro.FindValidSelection(candidates,target_level,
end end
local function is_flower(c) local function is_flower(c)
return c:IsCode(57261568, 33541430, 89818984) return c:IsCode(57261568,33541430,89818984)
end end
table.sort(candidates,function(a,b) table.sort(candidates,function(a,b)
...@@ -3608,9 +3609,16 @@ function Synchro.SynCondition(tuner_filter,non_tuner_filter,tuner_min,tuner_max, ...@@ -3608,9 +3609,16 @@ function Synchro.SynCondition(tuner_filter,non_tuner_filter,tuner_min,tuner_max,
return function(e,c,smat,mg,min,max) return function(e,c,smat,mg,min,max)
if c==nil then return true end if c==nil then return true end
if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end if c:IsType(TYPE_PENDULUM) and c:IsFaceup() then return false end
--- we do not support Accel Synchro yet
if smat~=nil then
return false
end
if mg~=nil and #mg>0 then
return false
end
local target_level=c:GetLevel() local target_level=c:GetLevel()
mg=mg or Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,c:GetControler(),LOCATION_MZONE+LOCATION_HAND,0,nil) mg=Duel.GetMatchingGroup(Card.IsCanBeSynchroMaterial,c:GetControler(),LOCATION_MZONE+LOCATION_HAND,0,nil)
local candidates={} local candidates={}
for mc in aux.Next(mg) do for mc in aux.Next(mg) do
table.insert(candidates,mc) table.insert(candidates,mc)
...@@ -3636,6 +3644,23 @@ function Synchro.SynTarget(tuner_filter,non_tuner_filter,tuner_min,tuner_max,non ...@@ -3636,6 +3644,23 @@ function Synchro.SynTarget(tuner_filter,non_tuner_filter,tuner_min,tuner_max,non
local sg_arr=GroupToArray(sg) local sg_arr=GroupToArray(sg)
local cg_arr=GroupToArray(mg-sg) local cg_arr=GroupToArray(mg-sg)
local target_level=tc:GetLevel() local target_level=tc:GetLevel()
local selected_level_min=target_level
local selected_states=Synchro.BuildStatesFromSelection(
sg_arr,
tuner_filter,non_tuner_filter,
base_mapper,
tc,math.huge
)
--- use the min select level as hint
for _,state in ipairs(selected_states) do
for lvl,_ in pairs(state.possible_sums) do
if lvl < selected_level_min then
selected_level_min=lvl
end
end
end
for _,candidate in ipairs(cg_arr) do for _,candidate in ipairs(cg_arr) do
-- simulate adding candidate to sg_arr -- simulate adding candidate to sg_arr
local test_selection={} local test_selection={}
...@@ -3676,7 +3701,7 @@ function Synchro.SynTarget(tuner_filter,non_tuner_filter,tuner_min,tuner_max,non ...@@ -3676,7 +3701,7 @@ function Synchro.SynTarget(tuner_filter,non_tuner_filter,tuner_min,tuner_max,non
local finishable=Synchro.IsSelectionValid(sg_arr,target_level,tuner_filter,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max) local finishable=Synchro.IsSelectionValid(sg_arr,target_level,tuner_filter,non_tuner_filter,tc,tuner_min,tuner_max,non_tuner_min,non_tuner_max)
local picked=Group.SelectUnselect(addable,sg,tp,finishable,true,tuner_min+non_tuner_min,Synchro.GetDisplayMax(tuner_max,non_tuner_max)) local picked=Group.SelectUnselect(addable,sg,tp,finishable,true,selected_level_min,target_level)
if not picked then if not picked then
-- user clicked Complete -- user clicked Complete
......
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