AITemplate小模块合并至BOT模块并优化参数样式

修改所有之前的AITemplate至新格式
启用9s的hold开关(之前有开关但是没用)
准备好cc对接相关代码模板(不能用所以注释了,需要修改)
This commit is contained in:
MrZ626
2021-08-24 05:15:27 +08:00
parent 1c43e92577
commit 7817499da7
25 changed files with 189 additions and 129 deletions

View File

@@ -828,13 +828,6 @@ function Player:hold(ifpre)
SFX.play(ifpre and'prehold'or'hold')
end
if self.bot then
local next=self.nextQueue[ENV.nextCount]
if next then
self.bot:pushNewNext(next.id)
end
end
self.stat.hold=self.stat.hold+1
end
end
@@ -853,6 +846,9 @@ function Player:getBlock(id,name,color)--Get a block object
end
function Player:getNext(id)--Push a block to nextQueue
ins(self.nextQueue,self:getBlock(id))
if self.bot then
self.bot:pushNewNext(id)
end
end
function Player:popNext(ifhold)--Pop nextQueue to hand
local ENV=self.gameEnv
@@ -865,12 +861,6 @@ function Player:popNext(ifhold)--Pop nextQueue to hand
self.cur=rem(self.nextQueue,1)
self.newNext()
if self.bot then
local next=self.nextQueue[ENV.nextCount]
if next then
self.bot:pushNewNext(next.id)
end
end
if self.cur then
self.pieceCount=self.pieceCount+1
@@ -1519,10 +1509,6 @@ function Player:loadAI(data)--Load AI params
self.bot=BOT.new(self,data)
self.bot.data=data
end
function Player:reloadAI()--Load AI params
assert(self.bot,"Cannot reload AI before loading one!")
self.bot=BOT.load(self.bot.data)
end
--------------------------</Methods>--------------------------
--------------------------<Ticks>--------------------------

View File

@@ -3,7 +3,7 @@ local int,abs=math.floor,math.abs
local rem=table.remove
local assert,resume,status=assert,coroutine.resume,coroutine.status
local TEXT,GAME,CC=TEXT,GAME,CC
local TEXT,GAME=TEXT,GAME
local PLY_ALIVE=PLY_ALIVE
local function update_misc(P,dt)