diff --git a/assets/game/brikPlayer.lua b/assets/game/brikPlayer.lua index 19499375..4b772a34 100644 --- a/assets/game/brikPlayer.lua +++ b/assets/game/brikPlayer.lua @@ -386,6 +386,7 @@ function BP:resetPos() -- Move hand piece to the normal spawn position end function BP:resetPosCheck() + local SET=self.settings local suffocated if self.deathTimer then self.ghostState=false @@ -396,8 +397,8 @@ function BP:resetPosCheck() end if suffocated then - if self.settings.deathDelay>0 then - self.deathTimer=self.settings.deathDelay + if SET.deathDelay>0 then + self.deathTimer=SET.deathDelay self.ghostState=true -- Suffocate IMS, always trigger when held @@ -407,14 +408,14 @@ function BP:resetPosCheck() end -- Suffocate IRS - if self.settings.initRotate then - if self.settings.initRotate=='hold' then + if SET.initRotate then + if SET.initRotate=='hold' then if self.keyState.rotate180 then self:rotate('F',true) elseif self.keyState.rotateCW~=self.keyState.rotateCCW then self:rotate(self.keyState.rotateCW and 'R' or 'L',true) end - elseif self.settings.initRotate=='buffer' then + elseif SET.initRotate=='buffer' then if self.keyBuffer.rotate then self:rotate(self.keyBuffer.rotate,true) if not self.keyBuffer.hold then @@ -428,7 +429,7 @@ function BP:resetPosCheck() if self.deathTimer then self:playSound('suffocate') - if self.settings.particles then + if SET.particles then self:createSuffocateEffect() end end @@ -445,13 +446,13 @@ function BP:resetPosCheck() end else -- IMS - if self.settings.initMove then - if self.settings.initMove=='hold' then + if SET.initMove then + if SET.initMove=='hold' then if self.keyState.softDrop then self:moveDown() end if self.keyState.moveRight~=self.keyState.moveLeft then if self.keyState.moveRight then self:moveRight(true) else self:moveLeft(true) end end - elseif self.settings.initMove=='buffer' then + elseif SET.initMove=='buffer' then if self.keyBuffer.move then if self.keyBuffer.move=='L' then self:moveLeft(true) @@ -464,14 +465,14 @@ function BP:resetPosCheck() end -- IRS - if self.settings.initRotate then - if self.settings.initRotate=='hold' then + if SET.initRotate then + if SET.initRotate=='hold' then if self.keyState.rotate180 then self:rotate('F',true) elseif self.keyState.rotateCW~=self.keyState.rotateCCW then self:rotate(self.keyState.rotateCW and 'R' or 'L',true) end - elseif self.settings.initRotate=='buffer' then + elseif SET.initRotate=='buffer' then if self.keyBuffer.rotate then self:rotate(self.keyBuffer.rotate,true) if not self.keyBuffer.hold then @@ -485,11 +486,11 @@ function BP:resetPosCheck() self:freshDelay('spawn') end - if self.settings.stopMoveWhenSpawn then + if SET.stopMoveWhenSpawn then self.moveDir=false self.moveCharge=0 - elseif self.settings.ash>0 then - self.moveCharge=min(self.moveCharge,self.settings.asd-self.settings.ash) + elseif SET.ash>0 then + self.moveCharge=min(self.moveCharge,SET.asd-SET.ash) end end function BP:freshGhost() diff --git a/assets/game/gelaPlayer.lua b/assets/game/gelaPlayer.lua index f64557fa..f3c9add5 100644 --- a/assets/game/gelaPlayer.lua +++ b/assets/game/gelaPlayer.lua @@ -242,6 +242,7 @@ function GP:resetPos() -- Move hand piece to the normal spawn position end function GP:resetPosCheck() + local SET=self.settings local suffocated -- Cancel deathTimer temporarily, or we cannot apply IMS when hold in suffcating if self.deathTimer then self.ghostState=false @@ -252,8 +253,8 @@ function GP:resetPosCheck() end if suffocated then - if self.settings.deathDelay>0 then - self.deathTimer=self.settings.deathDelay + if SET.deathDelay>0 then + self.deathTimer=SET.deathDelay self.ghostState=true -- Suffocate IMS, always trigger when held @@ -263,14 +264,14 @@ function GP:resetPosCheck() end -- Suffocate IRS - if self.settings.initRotate then - if self.settings.initRotate=='hold' then + if SET.initRotate then + if SET.initRotate=='hold' then if self.keyState.rotate180 then self:rotate('F',true) elseif self.keyState.rotateCW~=self.keyState.rotateCCW then self:rotate(self.keyState.rotateCW and 'R' or 'L',true) end - elseif self.settings.initRotate=='buffer' then + elseif SET.initRotate=='buffer' then if self.keyBuffer.rotate then self:rotate(self.keyBuffer.rotate,true) if not self.keyBuffer.hold then @@ -299,15 +300,15 @@ function GP:resetPosCheck() end else -- IMS - if self.settings.initMove then - if self.settings.initMove=='hold' then + if SET.initMove then + if SET.initMove=='hold' then if self.keyState.softDrop then self:moveDown() end if self.keyState.moveRight~=self.keyState.moveLeft then local origY=self.handY -- For canceling 20G effect of IMS if self.keyState.moveRight then self:moveRight() else self:moveLeft() end self.handY=origY end - elseif self.settings.initMove=='buffer' then + elseif SET.initMove=='buffer' then if self.keyBuffer.move then local origY=self.handY -- For canceling 20G effect of IMS if self.keyBuffer.move=='L' then @@ -322,14 +323,14 @@ function GP:resetPosCheck() end -- IRS - if self.settings.initRotate then - if self.settings.initRotate=='hold' then + if SET.initRotate then + if SET.initRotate=='hold' then if self.keyState.rotate180 then self:rotate('F',true) elseif self.keyState.rotateCW~=self.keyState.rotateCCW then self:rotate(self.keyState.rotateCW and 'R' or 'L',true) end - elseif self.settings.initRotate=='buffer' then + elseif SET.initRotate=='buffer' then if self.keyBuffer.rotate then self:rotate(self.keyBuffer.rotate,true) if not self.keyBuffer.hold then @@ -343,11 +344,11 @@ function GP:resetPosCheck() self:freshDelay('spawn') end - if self.settings.stopMoveWhenSpawn then + if SET.stopMoveWhenSpawn then self.moveDir=false self.moveCharge=0 - elseif self.settings.ash>0 then - self.moveCharge=min(self.moveCharge,self.settings.asd-self.settings.ash) + elseif SET.ash>0 then + self.moveCharge=min(self.moveCharge,SET.asd-SET.ash) end end function GP:freshGhost() @@ -670,11 +671,6 @@ function GP:gelaDropped() -- Drop & lock gela, and trigger a lot of things -- Fresh hand if self.settings.spawnDelay<=0 then - -- TODO - -- Trigger garbage - if self.chain<=0 or not self.settings.clearStuck then - self:checkGarbage() - end if self.fallTimer<=0 and self.clearTimer<=0 then self:popNext() end