From ccdfce9f88abda4a4f16c3a6e440272639f512b5 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 7 Mar 2021 22:40:48 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=97=8B=E8=BD=AC=E6=97=B6=E5=90=91=E4=B8=8A?= =?UTF-8?q?=E8=B8=A2=E5=A2=99=E6=89=A3=E4=B8=A4=E7=82=B9=E5=88=B7=E6=96=B0?= =?UTF-8?q?=E6=AC=A1=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/kickList.lua | 6 +++--- parts/player/player.lua | 22 ++++++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/parts/kickList.lua b/parts/kickList.lua index f115d71a..51d8b92d 100644 --- a/parts/kickList.lua +++ b/parts/kickList.lua @@ -271,9 +271,9 @@ do },--W function(P,d) if P.type=="human"then SFX.fieldPlay("rotate",nil,P)end - local iki=XspinList[d] - for test=1,#iki do - local x,y=P.curX+iki[test][1],P.curY+iki[test][2] + local kickData=XspinList[d] + for test=1,#kickData do + local x,y=P.curX+kickData[test][1],P.curY+kickData[test][2] if not P:ifoverlap(P.cur.bk,x,y)then P.curX,P.curY=x,y P.spinLast=1 diff --git a/parts/player/player.lua b/parts/player/player.lua index 553354f4..24caa2d5 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -573,11 +573,11 @@ function Player.resetBlock(P)--Reset Block's position and execute I*S end function Player.spin(P,d,ifpre) - local iki=P.RS[P.cur.id] - if type(iki)=="table"then + local kickData=P.RS[P.cur.id] + if type(kickData)=="table"then local idir=(P.cur.dir+d)%4 - iki=iki[P.cur.dir*10+idir] - if not iki then + kickData=kickData[P.cur.dir*10+idir] + if not kickData then P:freshBlock("move") SFX.fieldPlay(ifpre and"prerotate"or"rotate",nil,P) return @@ -585,9 +585,9 @@ function Player.spin(P,d,ifpre) local icb=BLOCKS[P.cur.id][idir] local isc=SCS[P.cur.id][idir] local ix,iy=P.curX+P.cur.sc[2]-isc[2],P.curY+P.cur.sc[1]-isc[1] - for test=1,#iki do - local x,y=ix+iki[test][1],iy+iki[test][2] - if not P:ifoverlap(icb,x,y)and(P.freshTime>=0 or iki[test][2]<0)then + for test=1,#kickData do + local x,y=ix+kickData[test][1],iy+kickData[test][2] + if not P:ifoverlap(icb,x,y)and(P.freshTime>=0 or kickData[test][2]<0)then ix,iy=x,y if P.gameEnv.moveFX and P.gameEnv.block then P:createMoveFX() @@ -595,10 +595,12 @@ function Player.spin(P,d,ifpre) P.curX,P.curY,P.cur.dir=ix,iy,idir P.cur.sc,P.cur.bk=isc,icb P.spinLast=test==2 and 0 or 1 + + local t=P.freshTime if not ifpre then P:freshBlock("move") end - if iki[test][2]>0 and P.curY~=P.imgY then + if kickData[test][2]>0 and P.freshTime~=t and P.curY~=P.imgY then P.freshTime=P.freshTime-1 end @@ -609,8 +611,8 @@ function Player.spin(P,d,ifpre) return end end - elseif iki then - iki(P,d) + elseif kickData then + kickData(P,d) else P:freshBlock("move") SFX.fieldPlay(ifpre and"prerotate"or"rotate",nil,P)