Fix the issue of AI passing Hold parameters in custom mode (#1163)
* 自定义游戏传递hold开关的问题 表现:即使holdCount为0,CC依旧会开启hold,导致无法预期运行,场地逐渐混乱 原因:传递了错误的类型(boolean->number) * 非正常hold模式时,AI不启用hold 相关问题#1106
This commit is contained in:
@@ -14,10 +14,11 @@ return {
|
||||
PLY.newPlayer(1)
|
||||
local AItype=GAME.modeEnv.opponent:sub(1,2)
|
||||
local AIlevel=tonumber(GAME.modeEnv.opponent:sub(-1))
|
||||
local useHold=GAME.modeEnv.holdCount>0 and GAME.modeEnv.holdMode=='hold'
|
||||
if AItype=='9S' then
|
||||
PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=GAME.modeEnv.holdCount})
|
||||
PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=useHold})
|
||||
elseif AItype=='CC' then
|
||||
PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=GAME.modeEnv.holdCount,node=20000+5000*AIlevel})
|
||||
PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=useHold,node=20000+5000*AIlevel})
|
||||
end
|
||||
|
||||
for _,P in next,PLY_ALIVE do
|
||||
|
||||
@@ -56,10 +56,11 @@ return {
|
||||
local AItype=GAME.modeEnv.opponent:sub(1,2)
|
||||
local AIlevel=tonumber(GAME.modeEnv.opponent:sub(-1))
|
||||
PLY.newPlayer(1)
|
||||
local useHold=GAME.modeEnv.holdCount>0 and GAME.modeEnv.holdMode=='hold'
|
||||
if AItype=='9S' then
|
||||
PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=GAME.modeEnv.holdCount})
|
||||
PLY.newAIPlayer(2,BOT.template{type='9S',speedLV=2*AIlevel,hold=useHold})
|
||||
elseif AItype=='CC' then
|
||||
PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=GAME.modeEnv.holdCount,node=20000+5000*AIlevel})
|
||||
PLY.newAIPlayer(2,BOT.template{type='CC',speedLV=2*AIlevel-1,next=math.floor(AIlevel*.5+1),hold=useHold,node=20000+5000*AIlevel})
|
||||
end
|
||||
end,
|
||||
savePrivate=function()
|
||||
|
||||
Reference in New Issue
Block a user