From bcb5d3eba42918de20ab99cf9c6b47e0db870ed6 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 16 May 2021 20:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Espike=E8=AE=A1=E6=95=B0?= =?UTF-8?q?=E5=99=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 12 +++++++++--- parts/player/init.lua | 2 ++ parts/player/player.lua | 7 +++++++ parts/player/update.lua | 3 +++ 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index a8014e87..c2feafab 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -672,14 +672,20 @@ function draw.norm(P) gc_setStencilTest() end + --Spike + if P.spikeTime>0 and P.spike>=10 then + gc_setColor(1,1,1,min(P.spikeTime/30,.8)) + mDraw(P.spikeText,150,100,nil,min(.3+(P.spike/26)*.4+P.spikeTime/100*.3,1)) + end + --Bonus texts TEXT.draw(P.bonus) --Display Ys -- gc_setLineWidth(6) - -- if P.curY then gc_setColor(COLOR.R)gc_line(0,611-P.curY*30,300,610-P.curY*30)end - -- if P.ghoY then gc_setColor(COLOR.G)gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30)end - -- if P.minY then gc_setColor(COLOR.B)gc_line(0,619-P.minY*30,300,620-P.minY*30)end + -- if P.curY then gc_setColor(COLOR.R) gc_line(0,611-P.curY*30,300,610-P.curY*30)end + -- if P.ghoY then gc_setColor(COLOR.G) gc_line(0,615-P.ghoY*30,300,615-P.ghoY*30)end + -- if P.minY then gc_setColor(COLOR.B) gc_line(0,619-P.minY*30,300,620-P.minY*30)end -- gc_line(0,600-P.garbageBeneath*30,300,600-P.garbageBeneath*30) gc_pop() diff --git a/parts/player/init.lua b/parts/player/init.lua index 1d643658..1a88c2ae 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -151,6 +151,8 @@ local function newEmptyPlayer(id,mini) --Attack-related P.atkBuffer={} P.atkBufferSum,P.atkBufferSum1=0,0 + P.spike,P.spikeTime=0,0 + P.spikeText=love.graphics.newText(getFont(100)) --Attacker-related P.badge,P.strength=0,0 diff --git a/parts/player/player.lua b/parts/player/player.lua index d663b2f4..96cf378b 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1380,6 +1380,13 @@ do--Player.drop(self)--Place piece self.combo=cmb + --Spike + if atk>0 then + self.spike=self.spikeTime==0 and atk or self.spike+atk + self.spikeText:set(self.spike) + self.spikeTime=min(self.spikeTime+40+atk*5,100) + end + --DropSpeed bonus if self._20G then cscore=cscore*2 diff --git a/parts/player/update.lua b/parts/player/update.lua index aeaaab76..9b11a8de 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -12,6 +12,9 @@ local function update_misc(P,dt) P.finesseComboTime=P.finesseComboTime-1 end + --Update spike counter + if P.spikeTime>0 then P.spikeTime=P.spikeTime-1 end + --Update atkBuffer alert local t=P.atkBufferSum1 if t