From 17f07a09874303855a53c671838899ed801bb401 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Tue, 15 Oct 2024 22:35:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/game/basePlayer.lua | 4 ++-- assets/game/brikPlayer.lua | 8 ++++---- assets/game/gelaPlayer.lua | 2 +- assets/game/mode/brik/exterior/sprint.lua | 2 +- assets/game/pubClass.lua | 6 ++++-- assets/game/rectField.lua | 4 ++-- assets/skin/init.lua | 16 ++++++++-------- 7 files changed, 22 insertions(+), 20 deletions(-) diff --git a/assets/game/basePlayer.lua b/assets/game/basePlayer.lua index 1cd3e1a5..72a98fc9 100644 --- a/assets/game/basePlayer.lua +++ b/assets/game/basePlayer.lua @@ -26,7 +26,7 @@ local sign,expApproach=MATH.sign,MATH.expApproach ---@field texts Zenitha.Text ---@field particles Techmino.ParticleSystems --- ----@field updateFrame function +---@field tickStep function ---@field scriptCmd function ---@field decodeScript function ---@field checkScriptSyntax function @@ -505,7 +505,7 @@ function P:update(dt) self.time=self.time+1 end - self:updateFrame() + self:tickStep() end for _,v in next,self.particles do v:update(dt) end self.texts:update(dt) diff --git a/assets/game/brikPlayer.lua b/assets/game/brikPlayer.lua index c4b7e03f..a4712d0d 100644 --- a/assets/game/brikPlayer.lua +++ b/assets/game/brikPlayer.lua @@ -663,7 +663,7 @@ function BP:popNext(ifHold) self:brikDropped() end end ----@return Techmino.Cell +---@return Techmino.Brik.Cell function BP:newCell(color,id) self.totalCellCount=self.totalCellCount+1 return { @@ -693,7 +693,7 @@ function BP:getBrik(shapeData) self.pieceCount=self.pieceCount+1 -- Generate cell matrix from bool matrix - ---@cast shapeMat Mat + ---@cast shapeMat Mat for y=1,#shapeMat do for x=1,#shapeMat[1] do shapeMat[y][x]=shapeMat[y][x] and self:newCell(shapeColor,self.pieceCount) end end @@ -1397,7 +1397,7 @@ function BP:changeFieldWidth(w,origPos) if not origPos then origPos=1 end local w0=self.settings.fieldW for y=1,#self.field:getHeight() do - local L=TABLE.new(false,w) ---@type Techmino.Cell[] + local L=TABLE.new(false,w) ---@type Techmino.Brik.Cell[] for x=1,w0 do local newX=origPos+x-1 if newX>=1 and newX<=w then @@ -1434,7 +1434,7 @@ end -------------------------------------------------------------- -- Press & Release & Update & Render -function BP:updateFrame() +function BP:tickStep() local SET=self.settings -- Hard-drop lock diff --git a/assets/game/gelaPlayer.lua b/assets/game/gelaPlayer.lua index 7d6e65d6..70443e92 100644 --- a/assets/game/gelaPlayer.lua +++ b/assets/game/gelaPlayer.lua @@ -960,7 +960,7 @@ end -------------------------------------------------------------- -- Press & Release & Update & Render -function GP:updateFrame() +function GP:tickStep() local SET=self.settings -- Hard-drop lock diff --git a/assets/game/mode/brik/exterior/sprint.lua b/assets/game/mode/brik/exterior/sprint.lua index 93bd3512..6c7c40e9 100644 --- a/assets/game/mode/brik/exterior/sprint.lua +++ b/assets/game/mode/brik/exterior/sprint.lua @@ -59,7 +59,7 @@ return { beforeClear={ function(P,lines) -- Infinite Sprint Core local CLEAR=P.modeData.infSprint_clears - ---@type Techmino.Cell[][] + ---@type Techmino.Brik.Cell[][] local mat=P.field._matrix for i=1,#lines do local l={[0]=P.time} diff --git a/assets/game/pubClass.lua b/assets/game/pubClass.lua index 56d510ed..d55e26be 100644 --- a/assets/game/pubClass.lua +++ b/assets/game/pubClass.lua @@ -60,7 +60,9 @@ ---@alias Techmino.Event.Gela string | {[1]:number, [2]:fun(P:Techmino.Player.Gela):...} | fun(P:Techmino.Player.Gela):... ---@alias Techmino.Event.Acry string | {[1]:number, [2]:fun(P:Techmino.Player.Acry):...} | fun(P:Techmino.Player.Acry):... ----@class Techmino.Cell + + +---@class Techmino.Brik.Cell ---@field id number piece id ---@field did number drop id (exist when hand piece locks) ---@field cid string cell id (unique) (already exist when piece display in next queue) @@ -76,7 +78,7 @@ ---@field diggable boolean Gela only ---@field connClear boolean Gela only ----@alias Techmino.RectPiece Mat +---@alias Techmino.RectPiece Mat ---@class Techmino.Piece ---@field id Techmino.Brik.ID diff --git a/assets/game/rectField.lua b/assets/game/rectField.lua index dc464561..ff6e99d2 100644 --- a/assets/game/rectField.lua +++ b/assets/game/rectField.lua @@ -2,7 +2,7 @@ local gc=love.graphics ---@class Techmino.RectField ---@field _width number ----@field _matrix Mat +---@field _matrix Mat local F={} -------------------------------------------------------------- @@ -99,7 +99,7 @@ function F:getHeight() end local wallCell=setmetatable({},{__newIndex=NULL,__metatable=true}) ----@return Techmino.Cell|false +---@return Techmino.Brik.Cell|false function F:getCell(x,y) if x<=0 or x>self._width or y<=0 then return wallCell end if y>#self._matrix then return false end diff --git a/assets/skin/init.lua b/assets/skin/init.lua index 585a94a9..9f6c1d55 100644 --- a/assets/skin/init.lua +++ b/assets/skin/init.lua @@ -9,11 +9,11 @@ local function _getTime() return SKIN.time end ---@field base string ---@field getTime function ---@field drawFieldBackground fun(fieldW:number) ----@field drawFieldCell fun(C:Techmino.Cell, F:Techmino.RectField, x:number, y:number) ----@field drawGhostCell fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number) ----@field drawHandCellStroke fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number) ----@field drawHandCell fun(C:Techmino.Cell, B:Techmino.RectPiece, x:number, y:number) ----@field drawFloatHoldCell fun(C:Techmino.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) +---@field drawFieldCell fun(C:Techmino.Brik.Cell, F:Techmino.RectField, x:number, y:number) +---@field drawGhostCell fun(C:Techmino.Brik.Cell, B:Techmino.RectPiece, x:number, y:number) +---@field drawHandCellStroke fun(C:Techmino.Brik.Cell, B:Techmino.RectPiece, x:number, y:number) +---@field drawHandCell fun(C:Techmino.Brik.Cell, B:Techmino.RectPiece, x:number, y:number) +---@field drawFloatHoldCell fun(C:Techmino.Brik.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) ---@field drawFloatHoldMark fun(n:number, disabled:boolean) ---@field drawHeightLines fun(fieldW:number, maxSpawnH:number, spawnH:number, lockoutH:number, deathH:number, voidH:number) ---@field drawFieldBorder fun() @@ -22,9 +22,9 @@ local function _getTime() return SKIN.time end ---@field drawGarbageBuffer fun(garbageBuffer:table) ---@field drawLockDelayIndicator fun(freshCondition:string, freshChance:number, maxFreshTime:number, freshTime:number) ---@field drawNextBorder fun(slot:number) ----@field drawNextCell fun(C:Techmino.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) +---@field drawNextCell fun(C:Techmino.Brik.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) ---@field drawHoldBorder fun(mode:string, slot:number) ----@field drawHoldCell fun(C:Techmino.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) +---@field drawHoldCell fun(C:Techmino.Brik.Cell, disabled:boolean, B:Techmino.RectPiece, x:number, y:number) ---@field drawTime fun(time:number) ---@field drawStartingCounter fun(readyDelay:number) ---@field drawInfoPanel fun(x:number, y:number, w:number, h:number) Only called by mode @@ -32,7 +32,7 @@ local function _getTime() return SKIN.time end ---@class Techmino.Skin.Brik: Techmino.Skin ---@class Techmino.Skin.Gela: Techmino.Skin ----@field drawFieldCell fun(C:Techmino.Cell, F:Techmino.RectField, x:number, y:number, connH?:number) +---@field drawFieldCell fun(C:Techmino.Brik.Cell, F:Techmino.RectField, x:number, y:number, connH?:number) ---@class Techmino.Skin.Acry: Techmino.Skin ---@field drawSwapCursor fun(cx:number, cy:number, lock:boolean)