From cc22ca97bde2fddeae7041bc3fef5191b29f3ce6 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 30 Nov 2024 07:14:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4spin=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E5=85=85=E8=83=BD=E6=A0=BC=E8=A7=84=E5=88=99=E5=92=8C=E8=A7=86?= =?UTF-8?q?=E8=A7=89=E8=A1=A8=E7=8E=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/game/mechanicLib/brik/chargeLimit.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/assets/game/mechanicLib/brik/chargeLimit.lua b/assets/game/mechanicLib/brik/chargeLimit.lua index 4eaeec32..4b03a4c6 100644 --- a/assets/game/mechanicLib/brik/chargeLimit.lua +++ b/assets/game/mechanicLib/brik/chargeLimit.lua @@ -126,17 +126,26 @@ end do -- spin function chargeLimit.spin_event_playerInit(P) P.modeData.spinClear=0 - P:addEvent('beforeClear',{-1,chargeLimit.spin_event_beforeClear}) + P:addEvent('afterDrop',chargeLimit.spin_event_afterDrop) P:addEvent('afterClear',{-1e99,chargeLimit.spin_event_afterClear}) P:addEvent('drawBelowMarks',chargeLimit.spin_event_drawBelowMarks) end - function chargeLimit.spin_event_beforeClear(P) + function chargeLimit.spin_event_afterDrop(P) + local F=P.field if P.lastMovement.immobile then local CB=P.hand.matrix for y=1,#CB do for x=1,#CB[1] do local C=CB[y][x] if C then - C.spin_charge=true + local cx,cy=x+P.handX-1,y+P.handY-1 + if + F:getCell(cx-1,cy) or + F:getCell(cx+1,cy) or + F:getCell(cx,cy-1) or + F:getCell(cx,cy+1) + then + C.spin_charge=true + end end end end end @@ -147,7 +156,7 @@ do -- spin end end function chargeLimit.spin_event_drawBelowMarks(P) - gc_setColor(1,1,1,.42) + gc_setColor(1,1,1,.62) local mat=P.field._matrix for y=1,#mat do for x=1,#mat[1] do local C=mat[y][x]