diff --git a/assets/game/mechanicLib/mino/actions.lua b/assets/game/mechanicLib/mino/actions.lua index c1cf4ffd..b9e9e8c0 100644 --- a/assets/game/mechanicLib/mino/actions.lua +++ b/assets/game/mechanicLib/mino/actions.lua @@ -22,13 +22,21 @@ local function move(P,dir,canBuffer) P:playSound('move') else P:freshDelay('move') + if P.settings.wallChrg=='on' or P.settings.wallChrg=='full' then + P.moveCharge=P.settings.asd + end P:playSound('move_failed') if P.settings.particles then P:createHandEffect(1,.26,0) end end - elseif canBuffer then - P.keyBuffer.move=dir + else + if P.settings.entryChrg=='on' or P.settings.entryChrg=='full' then + P.moveCharge=P.settings.asd + end + if canBuffer then + P.keyBuffer.move=dir + end end end local function pressMove(P,dir) @@ -63,6 +71,8 @@ local function releaseMove(P,dir) if SET.dblMoveRelInvStep then move(P,invD,true) end end else + P.moveDir=false + P.moveCharge=0 if P.keyBuffer.move==dir then P.keyBuffer.move=false end if P.hand and P.deathTimer then P[dir=='L' and 'moveLeft' or 'moveRight'](P) end end diff --git a/assets/game/mechanicLib/puyo/actions.lua b/assets/game/mechanicLib/puyo/actions.lua index 4aff18b5..d475dd0a 100644 --- a/assets/game/mechanicLib/puyo/actions.lua +++ b/assets/game/mechanicLib/puyo/actions.lua @@ -20,13 +20,21 @@ local function move(P,dir,canBuffer) P:playSound('move') else P:freshDelay('move') + if P.settings.wallChrg=='on' or P.settings.wallChrg=='full' then + P.moveCharge=P.settings.asd + end P:playSound('move_failed') if P.settings.particles then P:createHandEffect(1,.26,0) end end - elseif canBuffer then - P.keyBuffer.move=dir + else + if P.settings.entryChrg=='on' or P.settings.entryChrg=='full' then + P.moveCharge=P.settings.asd + end + if canBuffer then + P.keyBuffer.move=dir + end end end local function pressMove(P,dir) @@ -61,6 +69,8 @@ local function releaseMove(P,dir) if SET.dblMoveRelInvStep then move(P,invD,true) end end else + P.moveDir=false + P.moveCharge=0 if P.keyBuffer.move==dir then P.keyBuffer.move=false end if P.hand and P.deathTimer then P[dir=='L' and 'moveLeft' or 'moveRight'](P) end end diff --git a/assets/game/minoPlayer.lua b/assets/game/minoPlayer.lua index cbba8f4f..226ff929 100644 --- a/assets/game/minoPlayer.lua +++ b/assets/game/minoPlayer.lua @@ -1456,7 +1456,6 @@ function MP:updateFrame() -- Auto shift if self.moveDir and (self.moveDir==-1 and self.keyState.moveLeft or self.moveDir==1 and self.keyState.moveRight) then if self.hand and not self:ifoverlap(self.hand.matrix,self.handX+self.moveDir,self.handY) then - self.moveCharge=self.moveCharge+1 local dist=0 if SET.asp==0 then if self.moveCharge>=SET.asd then @@ -1476,10 +1475,28 @@ function MP:updateFrame() self:playSound('move') end end + self.moveCharge=self.moveCharge+1 -- NOTICE: this may have problem else - self.moveCharge=SET.asd - if self.hand then - self:shakeBoard(self.moveDir>0 and '-right' or '-left') + if not self.hand then + if SET.entryChrg=='full' then + self.moveCharge=SET.asd + elseif SET.entryChrg=='on' then + self.moveCharge=min(self.moveCharge+1,SET.asd) + elseif SET.entryChrg=='break' then + self.moveDir=false + self.moveCharge=0 + end + else + if SET.wallChrg=='full' then + self.moveCharge=SET.asd + self:shakeBoard(self.moveDir>0 and '-right' or '-left') + elseif SET.wallChrg=='on' then + self.moveCharge=min(self.moveCharge+1,SET.asd) + self:shakeBoard(self.moveDir>0 and '-right' or '-left') + elseif SET.wallChrg=='break' then + self.moveDir=false + self.moveCharge=0 + end end end end @@ -1935,6 +1952,8 @@ local baseEnv={ asp=26, -- Auto shift period adp=26, -- Auto drop period ash=26, -- Auto Shift Halt, discharge asd when piece spawn + entryChrg='on', -- on/off/full/cancel charge when move before spawn + wallChrg='on', -- on/off/full/cancel charge when move towards wall stopMoveWhenSpawn=false, -- Stop moving when piece spawn stopMoveWhenRotate=false, -- Stop moving when rotate stopMoveWhenHold=false, -- Stop moving when hold diff --git a/assets/game/puyoPlayer.lua b/assets/game/puyoPlayer.lua index 8b694726..a0475ee3 100644 --- a/assets/game/puyoPlayer.lua +++ b/assets/game/puyoPlayer.lua @@ -928,7 +928,6 @@ function PP:updateFrame() -- Auto shift if self.moveDir and (self.moveDir==-1 and self.keyState.moveLeft or self.moveDir==1 and self.keyState.moveRight) then if self.hand and not self:ifoverlap(self.hand.matrix,self.handX+self.moveDir,self.handY) then - self.moveCharge=self.moveCharge+1 local dist=0 if SET.asp==0 then if self.moveCharge>=SET.asd then @@ -948,10 +947,28 @@ function PP:updateFrame() self:playSound('move') end end + self.moveCharge=self.moveCharge+1 else - self.moveCharge=SET.asd - if self.hand then - self:shakeBoard(self.moveDir>0 and '-right' or '-left') + if not self.hand then + if SET.entryChrg=='full' then + self.moveCharge=SET.asd + elseif SET.entryChrg=='on' then + self.moveCharge=min(self.moveCharge+1,SET.asd) + elseif SET.entryChrg=='break' then + self.moveDir=false + self.moveCharge=0 + end + else + if SET.wallChrg=='full' then + self.moveCharge=SET.asd + self:shakeBoard(self.moveDir>0 and '-right' or '-left') + elseif SET.wallChrg=='on' then + self.moveCharge=min(self.moveCharge+1,SET.asd) + self:shakeBoard(self.moveDir>0 and '-right' or '-left') + elseif SET.wallChrg=='break' then + self.moveDir=false + self.moveCharge=0 + end end end else @@ -1257,6 +1274,8 @@ local baseEnv={ asp=26, adp=26, ash=26, + entryChrg='on', + wallChrg='on', stopMoveWhenSpawn=false, stopMoveWhenRotate=false, dblMoveCover=true,