暴力修复回合制开关玩家控制的问题(开始摆烂,准备重构)

This commit is contained in:
MrZ_26
2022-01-05 19:58:19 +08:00
parent 30a700d0be
commit 4ba05ae80c
2 changed files with 21 additions and 1 deletions

View File

@@ -782,7 +782,7 @@ function draw.norm(P,repMode)
_drawFXs(P)
--Draw current block
if P.alive and P.cur then
if P.alive and P.control and P.cur then
local C=P.cur
local curColor=C.color

View File

@@ -217,6 +217,7 @@ function Player:_deepDrop()
end
end
function Player:act_moveLeft(auto)
if not self.control then return end
if not auto then
self.ctrlCount=self.ctrlCount+1
end
@@ -238,6 +239,7 @@ function Player:act_moveLeft(auto)
end
end
function Player:act_moveRight(auto)
if not self.control then return end
if not auto then
self.ctrlCount=self.ctrlCount+1
end
@@ -259,6 +261,7 @@ function Player:act_moveRight(auto)
end
end
function Player:act_rotRight()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
self:spin(1)
@@ -266,6 +269,7 @@ function Player:act_rotRight()
end
end
function Player:act_rotLeft()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+1
self:spin(3)
@@ -273,6 +277,7 @@ function Player:act_rotLeft()
end
end
function Player:act_rot180()
if not self.control then return end
if self.cur then
self.ctrlCount=self.ctrlCount+2
self:spin(2)
@@ -280,6 +285,7 @@ function Player:act_rot180()
end
end
function Player:act_hardDrop()
if not self.control then return end
local ENV=self.gameEnv
if self.cur then
if self.lastPiece.autoLock and self.frameRun-self.lastPiece.frame<ENV.dropcut then
@@ -305,6 +311,7 @@ function Player:act_hardDrop()
end
end
function Player:act_softDrop()
if not self.control then return end
self.downing=0
if self.cur then
if self.curY>self.ghoY then
@@ -325,6 +332,7 @@ function Player:act_softDrop()
end
end
function Player:act_hold()
if not self.control then return end
if self.cur then
if self:hold()then
self.keyPressing[8]=false
@@ -332,13 +340,16 @@ function Player:act_hold()
end
end
function Player:act_func1()
if not self.control then return end
self.gameEnv.fkey1(self)
end
function Player:act_func2()
if not self.control then return end
self.gameEnv.fkey2(self)
end
function Player:act_insLeft(auto)
if not self.control then return end
if not self.cur then
return
end
@@ -364,6 +375,7 @@ function Player:act_insLeft(auto)
end
end
function Player:act_insRight(auto)
if not self.control then return end
if not self.cur then
return
end
@@ -389,6 +401,7 @@ function Player:act_insRight(auto)
end
end
function Player:act_insDown()
if not self.control then return end
if self.cur and self.curY>self.ghoY then
local ENV=self.gameEnv
self:createDropFX()
@@ -403,6 +416,7 @@ function Player:act_insDown()
end
end
function Player:act_down1()
if not self.control then return end
if self.cur then
if self.curY>self.ghoY then
self:createMoveFX('down')
@@ -415,6 +429,7 @@ function Player:act_down1()
end
end
function Player:act_down4()
if not self.control then return end
if self.cur then
if self.curY>self.ghoY then
local ghoY0=self.ghoY
@@ -429,6 +444,7 @@ function Player:act_down4()
end
end
function Player:act_down10()
if not self.control then return end
if self.cur then
if self.curY>self.ghoY then
local ghoY0=self.ghoY
@@ -443,18 +459,21 @@ function Player:act_down10()
end
end
function Player:act_dropLeft()
if not self.control then return end
if self.cur then
self:act_insLeft()
self:act_hardDrop()
end
end
function Player:act_dropRight()
if not self.control then return end
if self.cur then
self:act_insRight()
self:act_hardDrop()
end
end
function Player:act_zangiLeft()
if not self.control then return end
if self.cur then
self:act_insLeft()
self:act_insDown()
@@ -463,6 +482,7 @@ function Player:act_zangiLeft()
end
end
function Player:act_zangiRight()
if not self.control then return end
if self.cur then
self:act_insRight()
self:act_insDown()