Skip to content

Commit

Permalink
新增两个das系统选项:没出块、撞墙时充能
Browse files Browse the repository at this point in the history
  • Loading branch information
MrZ626 committed Dec 29, 2023
1 parent e18b77b commit 96b90a0
Show file tree
Hide file tree
Showing 4 changed files with 70 additions and 12 deletions.
14 changes: 12 additions & 2 deletions assets/game/mechanicLib/mino/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
14 changes: 12 additions & 2 deletions assets/game/mechanicLib/puyo/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
27 changes: 23 additions & 4 deletions assets/game/minoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
27 changes: 23 additions & 4 deletions assets/game/puyoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -1257,6 +1274,8 @@ local baseEnv={
asp=26,
adp=26,
ash=26,
entryChrg='on',
wallChrg='on',
stopMoveWhenSpawn=false,
stopMoveWhenRotate=false,
dblMoveCover=true,
Expand Down

0 comments on commit 96b90a0

Please sign in to comment.