From 17d670a1babe208a263b2c24f3db474b5783dbbd Mon Sep 17 00:00:00 2001 From: Gompyn Date: Wed, 29 Jul 2020 14:47:49 +0800 Subject: [PATCH] adapt cold-clear 45d5276 --- parts/ai.lua | 12 +++++++----- parts/player.lua | 2 +- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/parts/ai.lua b/parts/ai.lua index 5360ebbb..30623400 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -18,7 +18,7 @@ local Timer=love.timer.getTime local blockPos={4,4,4,4,4,5,4} local scs={{1,2},{1,2},{1,2},{1,2},{1,2},{1.5,1.5},{0.5,2.5}} -------------------------------------------------Cold clear -local CCblockID={4,3,6,5,1,2,0} +local CCblockID={6,5,4,3,2,1,0} if system=="Windows"then require("CCloader") BOT={ @@ -29,12 +29,12 @@ if system=="Windows"then addNext= cc.add_next_piece_async ,--(bot,piece) update= cc.reset_async ,--(bot,field,b2b,combo) think= cc.request_next_move ,--(bot) - getMove= cc.poll_next_move ,--(bot)success,hold,move - ifDead= cc.is_dead_async ,--(bot)dead + getMove= cc.poll_next_move ,--(bot)success,dest,hold,move destroy= cc.destroy_async ,--(bot) setHold= cc.set_hold ,--(opt,bool) set20G= cc.set_20g ,--(opt,bool) + setPCLoop= cc.set_pcloop ,--(opt,bool) setBag= cc.set_bag7 ,--(opt,bool) setNode= cc.set_max_nodes ,--(opt,bool) free= cc.free ,--(opt/wei) @@ -275,9 +275,11 @@ return{ return 2 end,--start thinking function(P,ctrl) - if BOT.ifDead(P.AI_bot)then ins(ctrl,6)return 3 end local success,hold,move=BOT.getMove(P.AI_bot) - if success then + if success == 2 then + ins(ctrl,6) + return 3 + elseif success == 0 then if hold then ctrl[1]=8 end--Hold while move[1]do local m=rem(move,1) diff --git a/parts/player.lua b/parts/player.lua index 3e5464c8..28b257a6 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -83,7 +83,7 @@ local finesseList={ finesseList[1][3],finesseList[1][4],finesseList[7][3],finesseList[7][4]=finesseList[1][1],finesseList[1][2],finesseList[7][1],finesseList[7][2]--"2-phase" SZI finesseList[2]=finesseList[1]--S=Z finesseList[4],finesseList[5]=finesseList[3],finesseList[3]--J=L=T -local CCblockID={4,3,6,5,1,2,0} +local CCblockID={6,5,4,3,2,1,0} local freshPrepare={ none=NULL, bag=function(P)