修正cc初始化时的一些小问题

This commit is contained in:
MrZ626
2021-08-26 15:19:40 +08:00
parent 27a0e8ee3a
commit de1a1cbe9a

View File

@@ -42,23 +42,24 @@ local AISpeed={60,50,40,30,20,14,10,6,4,3}
-- TODO you still need to switch20G() at the right time.
-- since it's not cc-specific I'm not dealing with it for now
--[[
next: number of nexts
hold: holdable?
speedLV: level
node: search nodes
randomizer: random generator
_20G: 20G?
arg={
next: number of nexts
hold: holdable
speedLV: level
node: search nodes
randomizer: random generator
_20G: 20G?
}
]]
function BOT.template(arg)
if arg.type=='CC'then
if not arg.randomizer then arg.randomizer='bag' end
return{
type='CC',
next=arg.next,
hold=arg.hold,
delay=AISpeed[arg.speedLV],
node=arg.node,
bag=arg.randomizer=='bag',
bag=(arg.randomizer or'bag')=='bag',
_20G=arg._20G,
}
elseif arg.type=='9S'then
@@ -78,14 +79,14 @@ function BOT.new(P,data)
bot.nexts={}
bot.delay=data.delay
bot.delay0=data.delay
if P.gameEnv.holdCount and P.gameEnv.holdCount>1 then P:setHold(1)end
if P.gameEnv.holdCount>1 then P:setHold(1)end
local cc=LOADLIB"CCloader"
local opt,wei=cc.getDefaultConfig()
wei:fastWeights()
opt:setHold(data.hold)
opt:set20G(data._20G)
opt:setBag(data.bag=='bag')
opt:setBag(data.bag)
opt:setNode(data.node)
bot.ccBot=cc.launchAsync(opt,wei)
local cc_lua=require"parts.bot.bot_cc"