修复之前重构next和hold系统后ai的不正确行为

This commit is contained in:
MrZ626
2020-11-20 00:20:54 +08:00
parent 25b8098c02
commit 7bfd362567
3 changed files with 10 additions and 15 deletions

View File

@@ -4,8 +4,8 @@ return function(type,speedLV,next,hold,node)
if not hold then hold=false else hold=true end if not hold then hold=false else hold=true end
return{ return{
type="CC", type="CC",
nextCount=next, next=next,
holdCount=hold, hold=hold,
delta=AISpeed[speedLV], delta=AISpeed[speedLV],
node=node, node=node,
} }
@@ -13,7 +13,7 @@ return function(type,speedLV,next,hold,node)
return{ return{
type="9S", type="9S",
delta=math.floor(AISpeed[speedLV]), delta=math.floor(AISpeed[speedLV]),
holdCount=hold, hold=hold,
} }
end end
end end

View File

@@ -316,8 +316,8 @@ function PLY.newDemoPlayer(id,x,y,size)
prepareSequence(P) prepareSequence(P)
P:loadAI({ P:loadAI({
type="CC", type="CC",
nextCount=5, next=5,
holdCount=true, hold=true,
delay=30, delay=30,
delta=6, delta=6,
bag="bag", bag="bag",

View File

@@ -601,7 +601,7 @@ function Player.popNext(P,ifhold)--Pop nextQueue to hand
if P.cur then if P.cur then
P.pieceCount=P.pieceCount+1 P.pieceCount=P.pieceCount+1
if P.AI_mode=="CC"then if P.AI_mode=="CC"then
local next=P.nextQueue[P.AIdata.nextCount] local next=P.nextQueue[P.AIdata.next]
if next then if next then
CC.addNext(P.AI_bot,next.id) CC.addNext(P.AI_bot,next.id)
end end
@@ -1292,35 +1292,30 @@ function Player.loadAI(P,data)--Load AI params
delay=data.delay, delay=data.delay,
delta=data.delta, delta=data.delta,
nextCount=data.nextCount, next=data.next,
holdCount=data.holdCount, hold=data.hold,
_20G=P._20G, _20G=P._20G,
bag=data.bag, bag=data.bag,
node=data.node, node=data.node,
} }
if P.gameEnv.holdCount==0 then
P.AIdata.holdCount=false
end
if not CC then if not CC then
P.AI_mode="9S" P.AI_mode="9S"
P.AI_delay0=int(P.AI_delay0*.3) P.AI_delay0=int(P.AI_delay0*.3)
end end
if P.AI_mode=="CC"then if P.AI_mode=="CC"then
P:setHold(P.AIdata.holdCount)
P:setRS("SRS") P:setRS("SRS")
local opt,wei=CC.getConf() local opt,wei=CC.getConf()
CC.fastWeights(wei) CC.fastWeights(wei)
CC.setHold(opt,P.AIdata.holdCount) CC.setHold(opt,P.AIdata.hold)
CC.set20G(opt,P.AIdata._20G) CC.set20G(opt,P.AIdata._20G)
CC.setBag(opt,P.AIdata.bag=="bag") CC.setBag(opt,P.AIdata.bag=="bag")
CC.setNode(opt,P.AIdata.node) CC.setNode(opt,P.AIdata.node)
P.AI_bot=CC.new(opt,wei) P.AI_bot=CC.new(opt,wei)
CC.free(opt)CC.free(wei) CC.free(opt)CC.free(wei)
for i=1,data.nextCount do for i=1,P.AIdata.next do
CC.addNext(P.AI_bot,P.nextQueue[i].id) CC.addNext(P.AI_bot,P.nextQueue[i].id)
end end
else else
P:setHold(P.AIdata.holdCount)
P:setRS("TRS") P:setRS("TRS")
end end
end end