From 2798fad052dd6c02a57b41813f74b7740c06bdcf Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Sat, 30 Nov 2024 07:05:46 +0800 Subject: [PATCH] =?UTF-8?q?spin=E6=A8=A1=E5=BC=8F=E5=85=85=E8=83=BD?= =?UTF-8?q?=E6=A0=BC=E5=AD=90=E5=8F=AF=E8=A7=86=E5=8C=96?= 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, 14 insertions(+), 3 deletions(-) diff --git a/assets/game/mechanicLib/brik/chargeLimit.lua b/assets/game/mechanicLib/brik/chargeLimit.lua index e4518de9..dbbe8114 100644 --- a/assets/game/mechanicLib/brik/chargeLimit.lua +++ b/assets/game/mechanicLib/brik/chargeLimit.lua @@ -189,6 +189,7 @@ do -- spin P:addEvent('always',chargeLimit.spin_piece_event_always) P:addEvent('beforeClear',{-1,chargeLimit.spin_piece_event_beforeClear}) P:addEvent('drawOnPlayer',chargeLimit.spin_piece_event_drawOnPlayer) + P:addEvent('drawBelowMarks',chargeLimit.spin_piece_event_drawBelowMarks) end function chargeLimit.spin_piece_event_always(P) ---@type Techmino.Mech.Brik.PieceDevice[] @@ -231,12 +232,12 @@ do -- spin end end - local F=P.field + local mat=P.field._matrix local lines=#fullLines for i=1,lines do local y=fullLines[i] for x=1,P.settings.fieldW do - local C=F:getCell(x,y) + local C=mat[y][x] if C and C.spin_charge then local id=colorToID[C.color] if id then @@ -257,6 +258,16 @@ do -- spin mainDev.display=false end end + function chargeLimit.spin_piece_event_drawBelowMarks(P) + gc_setColor(1,1,1,.42) + local mat=P.field._matrix + for y=1,#mat do for x=1,#mat[1] do + local C=mat[y][x] + if C and C.spin_charge then + gc_rectangle('fill',40*(x-1)+10,-40*(y-1)-10,20,-20) + end + end end + end function chargeLimit.spin_piece_event_drawOnPlayer(P) ---@type Techmino.Mech.Brik.PieceDevice[] local devices=P.modeData.spin_powDevice @@ -274,7 +285,7 @@ do -- spin mRect('line',x,y,w,h) else gc_setColor(styles[i].color) - mRect('fill',x,y,w,h*.26) + mRect('fill',x,y,w,h*.2) gc_setColor(.42,.42,.42,styles[i].color[4]) mRect('line',x,y,w,h) end