From 4ba05ae80c1550521532c8de54ff3c819f0b42cf Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Wed, 5 Jan 2022 19:58:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9A=B4=E5=8A=9B=E4=BF=AE=E5=A4=8D=E5=9B=9E?= =?UTF-8?q?=E5=90=88=E5=88=B6=E5=BC=80=E5=85=B3=E7=8E=A9=E5=AE=B6=E6=8E=A7?= =?UTF-8?q?=E5=88=B6=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=88=E5=BC=80=E5=A7=8B?= =?UTF-8?q?=E6=91=86=E7=83=82=EF=BC=8C=E5=87=86=E5=A4=87=E9=87=8D=E6=9E=84?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 2 +- parts/player/player.lua | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 2c18209a..375f0f49 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -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 diff --git a/parts/player/player.lua b/parts/player/player.lua index dec52b62..51dd87b7 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -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.frameself.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()