暴力修复回合制开关玩家控制的问题(开始摆烂,准备重构)
This commit is contained in:
@@ -782,7 +782,7 @@ function draw.norm(P,repMode)
|
|||||||
_drawFXs(P)
|
_drawFXs(P)
|
||||||
|
|
||||||
--Draw current block
|
--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 C=P.cur
|
||||||
local curColor=C.color
|
local curColor=C.color
|
||||||
|
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ function Player:_deepDrop()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_moveLeft(auto)
|
function Player:act_moveLeft(auto)
|
||||||
|
if not self.control then return end
|
||||||
if not auto then
|
if not auto then
|
||||||
self.ctrlCount=self.ctrlCount+1
|
self.ctrlCount=self.ctrlCount+1
|
||||||
end
|
end
|
||||||
@@ -238,6 +239,7 @@ function Player:act_moveLeft(auto)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_moveRight(auto)
|
function Player:act_moveRight(auto)
|
||||||
|
if not self.control then return end
|
||||||
if not auto then
|
if not auto then
|
||||||
self.ctrlCount=self.ctrlCount+1
|
self.ctrlCount=self.ctrlCount+1
|
||||||
end
|
end
|
||||||
@@ -259,6 +261,7 @@ function Player:act_moveRight(auto)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_rotRight()
|
function Player:act_rotRight()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self.ctrlCount=self.ctrlCount+1
|
self.ctrlCount=self.ctrlCount+1
|
||||||
self:spin(1)
|
self:spin(1)
|
||||||
@@ -266,6 +269,7 @@ function Player:act_rotRight()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_rotLeft()
|
function Player:act_rotLeft()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self.ctrlCount=self.ctrlCount+1
|
self.ctrlCount=self.ctrlCount+1
|
||||||
self:spin(3)
|
self:spin(3)
|
||||||
@@ -273,6 +277,7 @@ function Player:act_rotLeft()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_rot180()
|
function Player:act_rot180()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self.ctrlCount=self.ctrlCount+2
|
self.ctrlCount=self.ctrlCount+2
|
||||||
self:spin(2)
|
self:spin(2)
|
||||||
@@ -280,6 +285,7 @@ function Player:act_rot180()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_hardDrop()
|
function Player:act_hardDrop()
|
||||||
|
if not self.control then return end
|
||||||
local ENV=self.gameEnv
|
local ENV=self.gameEnv
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self.lastPiece.autoLock and self.frameRun-self.lastPiece.frame<ENV.dropcut then
|
if self.lastPiece.autoLock and self.frameRun-self.lastPiece.frame<ENV.dropcut then
|
||||||
@@ -305,6 +311,7 @@ function Player:act_hardDrop()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_softDrop()
|
function Player:act_softDrop()
|
||||||
|
if not self.control then return end
|
||||||
self.downing=0
|
self.downing=0
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self.curY>self.ghoY then
|
if self.curY>self.ghoY then
|
||||||
@@ -325,6 +332,7 @@ function Player:act_softDrop()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_hold()
|
function Player:act_hold()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self:hold()then
|
if self:hold()then
|
||||||
self.keyPressing[8]=false
|
self.keyPressing[8]=false
|
||||||
@@ -332,13 +340,16 @@ function Player:act_hold()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_func1()
|
function Player:act_func1()
|
||||||
|
if not self.control then return end
|
||||||
self.gameEnv.fkey1(self)
|
self.gameEnv.fkey1(self)
|
||||||
end
|
end
|
||||||
function Player:act_func2()
|
function Player:act_func2()
|
||||||
|
if not self.control then return end
|
||||||
self.gameEnv.fkey2(self)
|
self.gameEnv.fkey2(self)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Player:act_insLeft(auto)
|
function Player:act_insLeft(auto)
|
||||||
|
if not self.control then return end
|
||||||
if not self.cur then
|
if not self.cur then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -364,6 +375,7 @@ function Player:act_insLeft(auto)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_insRight(auto)
|
function Player:act_insRight(auto)
|
||||||
|
if not self.control then return end
|
||||||
if not self.cur then
|
if not self.cur then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -389,6 +401,7 @@ function Player:act_insRight(auto)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_insDown()
|
function Player:act_insDown()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur and self.curY>self.ghoY then
|
if self.cur and self.curY>self.ghoY then
|
||||||
local ENV=self.gameEnv
|
local ENV=self.gameEnv
|
||||||
self:createDropFX()
|
self:createDropFX()
|
||||||
@@ -403,6 +416,7 @@ function Player:act_insDown()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_down1()
|
function Player:act_down1()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self.curY>self.ghoY then
|
if self.curY>self.ghoY then
|
||||||
self:createMoveFX('down')
|
self:createMoveFX('down')
|
||||||
@@ -415,6 +429,7 @@ function Player:act_down1()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_down4()
|
function Player:act_down4()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self.curY>self.ghoY then
|
if self.curY>self.ghoY then
|
||||||
local ghoY0=self.ghoY
|
local ghoY0=self.ghoY
|
||||||
@@ -429,6 +444,7 @@ function Player:act_down4()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_down10()
|
function Player:act_down10()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
if self.curY>self.ghoY then
|
if self.curY>self.ghoY then
|
||||||
local ghoY0=self.ghoY
|
local ghoY0=self.ghoY
|
||||||
@@ -443,18 +459,21 @@ function Player:act_down10()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_dropLeft()
|
function Player:act_dropLeft()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self:act_insLeft()
|
self:act_insLeft()
|
||||||
self:act_hardDrop()
|
self:act_hardDrop()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_dropRight()
|
function Player:act_dropRight()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self:act_insRight()
|
self:act_insRight()
|
||||||
self:act_hardDrop()
|
self:act_hardDrop()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_zangiLeft()
|
function Player:act_zangiLeft()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self:act_insLeft()
|
self:act_insLeft()
|
||||||
self:act_insDown()
|
self:act_insDown()
|
||||||
@@ -463,6 +482,7 @@ function Player:act_zangiLeft()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
function Player:act_zangiRight()
|
function Player:act_zangiRight()
|
||||||
|
if not self.control then return end
|
||||||
if self.cur then
|
if self.cur then
|
||||||
self:act_insRight()
|
self:act_insRight()
|
||||||
self:act_insDown()
|
self:act_insDown()
|
||||||
|
|||||||
Reference in New Issue
Block a user