Skip to content

Commit

Permalink
修改自动/手动硬降锁名称为ahdl/mhdl
Browse files Browse the repository at this point in the history
整理代码
  • Loading branch information
MrZ626 committed Dec 30, 2023
1 parent 96b90a0 commit 2f0a743
Show file tree
Hide file tree
Showing 8 changed files with 45 additions and 45 deletions.
9 changes: 4 additions & 5 deletions assets/game/mechanicLib/mino/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ local function move(P,dir,canBuffer)
end
end
local function pressMove(P,dir)
-- WARNING: Has early return
local d=dir=='L' and -1 or 1

local SET=P.settings
Expand All @@ -49,12 +48,12 @@ local function pressMove(P,dir)
P.moveDir=d
end
P.moveCharge=getCharge(P.moveCharge,SET.dblMoveChrg,SET)
if not SET.dblMoveStep then return end -- [Early return]
if SET.dblMoveStep then move(P,dir,true) end
else
P.moveDir=d
P.moveCharge=0
move(P,dir,true)
end
move(P,dir,true)
end
local function releaseMove(P,dir)
local invD=dir=='L' and 'R' or 'L'
Expand Down Expand Up @@ -136,11 +135,11 @@ actions.softDrop={
}
actions.hardDrop={
press=function(P)
if P.hdLockMTimer~=0 or P.hdLockATimer~=0 then
if P.mhdlTimer~=0 or P.ahdlTimer~=0 then
P:playSound('rotate_failed')
elseif P.hand then
if not P.deathTimer then
P.hdLockMTimer=P.settings.hdLockM
P.mhdlTimer=P.settings.mhdl
P:minoDropped()
else
P.deathTimer=ceil(P.deathTimer/2.6)
Expand Down
9 changes: 4 additions & 5 deletions assets/game/mechanicLib/puyo/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ local function move(P,dir,canBuffer)
end
end
local function pressMove(P,dir)
-- WARNING: Has early return
local d=dir=='L' and -1 or 1

local SET=P.settings
Expand All @@ -47,12 +46,12 @@ local function pressMove(P,dir)
P.moveDir=d
end
P.moveCharge=getCharge(P.moveCharge,SET.dblMoveChrg,SET)
if not SET.dblMoveStep then return end -- [Early return]
if SET.dblMoveStep then move(P,dir,true) end
else
P.moveDir=d
P.moveCharge=0
move(P,dir,true)
end
move(P,dir,true)
end
local function releaseMove(P,dir)
local invD=dir=='L' and 'R' or 'L'
Expand Down Expand Up @@ -134,10 +133,10 @@ actions.softDrop={
}
actions.hardDrop={
press=function(P)
if P.hdLockMTimer~=0 or P.hdLockATimer~=0 then
if P.mhdlTimer~=0 or P.ahdlTimer~=0 then
P:playSound('rotate_failed')
elseif P.hand and not P.deathTimer then
P.hdLockMTimer=P.settings.hdLockM
P.mhdlTimer=P.settings.mhdl
P:puyoDropped()
else
P.keyBuffer.hardDrop=true
Expand Down
28 changes: 15 additions & 13 deletions assets/game/minoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1448,8 +1448,8 @@ function MP:updateFrame()
local SET=self.settings

-- Hard-drop lock
if self.hdLockATimer>0 then self.hdLockATimer=self.hdLockATimer-1 end
if self.hdLockMTimer>0 then self.hdLockMTimer=self.hdLockMTimer-1 end
if self.ahdlTimer>0 then self.ahdlTimer=self.ahdlTimer-1 end
if self.mhdlTimer>0 then self.mhdlTimer=self.mhdlTimer-1 end

-- Current controlling piece
if not self.deathTimer then
Expand Down Expand Up @@ -1550,7 +1550,7 @@ function MP:updateFrame()
if self.handY==self.ghostY then
self.lockTimer=self.lockTimer-1
if self.lockTimer<=0 then
self.hdLockATimer=self.settings.hdLockA
self.ahdlTimer=self.settings.ahdl
self:minoDropped()
end
break
Expand Down Expand Up @@ -1947,11 +1947,11 @@ local baseEnv={
script=false,
allowTransform=true,

-- May be overrode with user setting
asd=122, -- Auto shift delay
asp=26, -- Auto shift period
adp=26, -- Auto drop period
ash=26, -- Auto Shift Halt, discharge asd when piece spawn
-- Control
asd=122, -- *Auto shift delay
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
Expand All @@ -1968,12 +1968,14 @@ local baseEnv={
initMove='buffer', -- buffer/hold to do initial move
initRotate='buffer', -- buffer/hold to do initial rotate
initHold='buffer', -- buffer/hold to do initial hold
hdLockA=1000, -- Harddrop lock (auto)
hdLockM=100, -- Harddrop lock (manual)
ahdl=1000, -- *Auto harddrop lock
mhdl=100, -- *Manual harddrop lock

-- Other
IRSpushUp=true, -- Use bottom-align when IRS or suffocate
skin='mino_plastic',
particles=true,
shakeness=.26,
shakeness=.26, -- *
inputDelay=0,
}
local soundEventMeta={
Expand Down Expand Up @@ -2074,8 +2076,8 @@ function MP:initialize()
self.moveCharge=0
self.downCharge=false

self.hdLockATimer=0
self.hdLockMTimer=0
self.ahdlTimer=0
self.mhdlTimer=0

self.keyBuffer={
move=false,
Expand Down
14 changes: 7 additions & 7 deletions assets/game/puyoPlayer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,8 @@ function PP:updateFrame()
local SET=self.settings

-- Hard-drop lock
if self.hdLockATimer>0 then self.hdLockATimer=self.hdLockATimer-1 end
if self.hdLockMTimer>0 then self.hdLockMTimer=self.hdLockMTimer-1 end
if self.ahdlTimer>0 then self.ahdlTimer=self.ahdlTimer-1 end
if self.mhdlTimer>0 then self.mhdlTimer=self.mhdlTimer-1 end

-- Controlling piece
if not self.deathTimer then
Expand Down Expand Up @@ -1047,7 +1047,7 @@ function PP:updateFrame()
if self.handY==self.ghostY then
self.lockTimer=self.lockTimer-1
if self.lockTimer<=0 then
self.hdLockATimer=self.settings.hdLockA
self.ahdlTimer=self.settings.ahdl
self:puyoDropped()
end
break
Expand Down Expand Up @@ -1288,8 +1288,8 @@ local baseEnv={
dblMoveRelInvRedir=true,
initMove='buffer',
initRotate='buffer',
hdLockA=1000,
hdLockM=100,
ahdl=1000,
mhdl=100,
IRSpushUp=true,
skin='puyo_jelly',
particles=true,
Expand Down Expand Up @@ -1379,8 +1379,8 @@ function PP:initialize()
self.moveCharge=0
self.downCharge=false

self.hdLockATimer=0
self.hdLockMTimer=0
self.ahdlTimer=0
self.mhdlTimer=0

self.keyBuffer={
move=false,
Expand Down
4 changes: 2 additions & 2 deletions assets/language/lang_en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ return {
setting_asp="ASP",
setting_adp="ADP",
setting_ash="AS Halt",
setting_hdLockA="Auto hard-drop lock",
setting_hdLockM="Manual hard-drop lock",
setting_ahdl="Auto harddrop lock",
setting_mhdl="Manual harddrop lock",
setting_shakeness="Shakiness",
setting_hitWavePower="Hitwave Power",

Expand Down
4 changes: 2 additions & 2 deletions assets/language/lang_zh.lua
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ return {
setting_asp="自动重复周期",
setting_adp="软降重复周期",
setting_ash="自动移动阻止",
setting_hdLockA="自动硬降锁",
setting_hdLockM="手动硬降锁",
setting_ahdl="自动硬降锁",
setting_mhdl="手动硬降锁",
setting_shakeness="场地晃动",
setting_hitWavePower="冲击波强度",

Expand Down
14 changes: 7 additions & 7 deletions assets/scene/setting_out.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,12 +60,12 @@ scene.widgetList={
{name='S4',type='button_invis',pos={1,0},x=-200,y=60,w=150,h=100,cornerR=20,fontSize=70,text=CHAR.icon.controller,sound_trigger='move',code=function() if page~='4' then SCN.swapTo('setting_out','none',4) end end},

-- Controls
{name='1',type='slider', pos={0,0},x=340, y=220,w=650, fontSize=40,text=LANG'setting_asd', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'asd'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.asd=v; SETTINGS.game_mino.asp=math.min(SETTINGS.game_mino.asp,SETTINGS.game_mino.asd); SETTINGS.game_mino.ash=math.min(SETTINGS.game_mino.ash,SETTINGS.game_mino.asd) end},
{name='1',type='slider', pos={0,0},x=340, y=300,w=300, fontSize=40,text=LANG'setting_asp', widthLimit=260,axis={0,120,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'asp'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.asp=v; SETTINGS.game_mino.asd=math.max(SETTINGS.game_mino.asd,SETTINGS.game_mino.asp) end},
{name='1',type='slider', pos={0,0},x=340, y=380,w=250, fontSize=40,text=LANG'setting_adp', widthLimit=260,axis={0,100,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'adp'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'adp')},
{name='1',type='slider', pos={0,0},x=340, y=460,w=650, fontSize=30,text=LANG'setting_ash', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'ash'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.ash=v; SETTINGS.game_mino.asd=math.max(SETTINGS.game_mino.asd,SETTINGS.game_mino.ash) end},
{name='1',type='slider', pos={0,0},x=340, y=540,w=650, fontSize=30,text=LANG'setting_hdLockA', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'hdLockA'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'hdLockA')},
{name='1',type='slider', pos={0,0},x=340, y=620,w=650, fontSize=30,text=LANG'setting_hdLockM', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'hdLockM'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'hdLockM')},
{name='1',type='slider', pos={0,0},x=340, y=220,w=650, fontSize=40,text=LANG'setting_asd', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'asd'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.asd=v; SETTINGS.game_mino.asp=math.min(SETTINGS.game_mino.asp,SETTINGS.game_mino.asd); SETTINGS.game_mino.ash=math.min(SETTINGS.game_mino.ash,SETTINGS.game_mino.asd) end},
{name='1',type='slider', pos={0,0},x=340, y=300,w=300, fontSize=40,text=LANG'setting_asp', widthLimit=260,axis={0,120,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'asp'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.asp=v; SETTINGS.game_mino.asd=math.max(SETTINGS.game_mino.asd,SETTINGS.game_mino.asp) end},
{name='1',type='slider', pos={0,0},x=340, y=380,w=250, fontSize=40,text=LANG'setting_adp', widthLimit=260,axis={0,100,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'adp'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'adp')},
{name='1',type='slider', pos={0,0},x=340, y=460,w=650, fontSize=40,text=LANG'setting_ash', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'ash'), valueShow=sliderShow_time, code=function(v) SETTINGS.game_mino.ash=v; SETTINGS.game_mino.asd=math.max(SETTINGS.game_mino.asd,SETTINGS.game_mino.ash) end},
{name='1',type='slider', pos={0,0},x=340, y=540,w=650, fontSize=40,text=LANG'setting_ahdl', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'ahdl'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'ahdl')},
{name='1',type='slider', pos={0,0},x=340, y=620,w=650, fontSize=40,text=LANG'setting_mhdl', widthLimit=260,axis={0,260,1},smooth=true,disp=TABLE.func_getVal(SETTINGS.game_mino,'mhdl'), valueShow=sliderShow_time, code=TABLE.func_setVal(SETTINGS.game_mino,'mhdl')},
{name='1',type='button', pos={0,0},x=500, y=720,w=360, h=80,cornerR=10, fontSize=40,text=LANG'setting_keymapping', code=WIDGET.c_goScn('keyset_out','fadeHeader')},
{name='1',type='switch', pos={0,0},x=360, y=820,h=40, labelPos='right',fontSize=40,text=LANG'setting_enableTouching', disp=TABLE.func_getVal(SETTINGS.system,'touchControl'),code=TABLE.func_revVal(SETTINGS.system,'touchControl')},
{name='1',type='button', pos={0,0},x=500, y=900,w=360, h=80,cornerR=10, fontSize=40,text=LANG'setting_touching', code=WIDGET.c_goScn'keyset_touch_out',visibleTick=function() return page=='1' and SETTINGS.system.touchControl end},
Expand All @@ -75,7 +75,7 @@ scene.widgetList={
{name='2',type='slider_fill',pos={0,0},x=340, y=300,w=650, fontSize=40,text=LANG'setting_bgm', widthLimit=260, disp=TABLE.func_getVal(SETTINGS.system,'bgmVol'), code=TABLE.func_setVal(SETTINGS.system,'bgmVol')},
{name='2',type='slider_fill',pos={0,0},x=340, y=380,w=650, fontSize=40,text=LANG'setting_sfx', widthLimit=260, disp=TABLE.func_getVal(SETTINGS.system,'sfxVol'), code=TABLE.func_setVal(SETTINGS.system,'sfxVol')},
{name='2',type='slider_fill',pos={0,0},x=340, y=460,w=650, fontSize=40,text=LANG'setting_vib', widthLimit=260, disp=TABLE.func_getVal(SETTINGS.system,'vibVol'), code=TABLE.func_setVal(SETTINGS.system,'vibVol')},
{name='2',type='switch', pos={0,0},x=390, y=540,h=45, fontSize=40,text=LANG'setting_autoMute',widthLimit=550,labelPos='right', disp=TABLE.func_getVal(SETTINGS.system,'autoMute'), code=TABLE.func_revVal(SETTINGS.system,'autoMute')},
{name='2',type='switch', pos={0,0},x=390, y=540,h=45, fontSize=40,text=LANG'setting_autoMute',widthLimit=550,labelPos='right', disp=TABLE.func_getVal(SETTINGS.system,'autoMute'), code=TABLE.func_revVal(SETTINGS.system,'autoMute')},

-- Video
{name='3',type='slider_fill',pos={0,0},x=340, y=220,w=500,h=30,text=LANG'setting_hitWavePower',widthLimit=260,axis={0,1}, disp=TABLE.func_getVal(SETTINGS.system,'hitWavePower'), code=TABLE.func_setVal(SETTINGS.system,'hitWavePower')},
Expand Down
8 changes: 4 additions & 4 deletions assets/settings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ local settings={
asp=20,
adp=20,
ash=26,
hdLockA=200,
hdLockM=62,
ahdl=200,
mhdl=62,

-- Video
shakeness=.6,
Expand All @@ -45,8 +45,8 @@ local settings={
asp=20,
adp=20,
ash=26,
hdLockA=200,
hdLockM=62,
ahdl=200,
mhdl=62,

-- Video
shakeness=.6,
Expand Down

0 comments on commit 2f0a743

Please sign in to comment.