From 5728194085504f3a740ad8370e560825577912c2 Mon Sep 17 00:00:00 2001 From: MrZ_26 <1046101471@qq.com> Date: Thu, 21 Dec 2023 00:51:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=96=B0=E7=9A=84skip?= =?UTF-8?q?=E6=9A=82=E5=AD=98=E6=A8=A1=E5=BC=8F=EF=BC=8C=E5=8F=AF=E5=9C=A8?= =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E4=BD=BF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/draw.lua | 9 ++++++++- parts/player/player.lua | 29 +++++++++++++++++++++++++++++ parts/scenes/customGame.lua | 2 +- 3 files changed, 38 insertions(+), 2 deletions(-) diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 1c916279..f83feb01 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -503,7 +503,14 @@ local function _drawNext(P,repMode) gc_setColor(1,1,1,.626) gc_draw(seqGenBanner[ENV.sequence],0,-11) gc_setColor(.97,.97,.97) - if ENV.holdMode=='swap' then gc_rectangle('fill',1,72*ENV.holdCount+4,50,4) end + if ENV.holdMode=='swap' then + gc_rectangle('fill',100,72*ENV.holdCount+2,-50,4) + elseif ENV.holdMode=='skip' then + gc_setColor(.97,.97,.97,.26) + gc_rectangle('fill',100,72*P.holdTime+2,-50,4) + gc_setColor(.97,.97,.97) + gc_rectangle('fill',100,72*ENV.holdCount+2,-50,4) + end gc_rectangle('line',0,0,100,h+8,5) gc_push('transform') gc_translate(50,40) diff --git a/parts/player/player.lua b/parts/player/player.lua index 0c4cfab6..2ce44272 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -1399,12 +1399,41 @@ function Player:hold_swap(ifpre) self.stat.hold=self.stat.hold+1 end +function Player:hold_skip(ifpre) + local ENV=self.gameEnv + local C=self.cur + if C then + if self:willDieWith(self.nextQueue[1]) then + self.ghoY=self:getSpawnY(self.nextQueue[1]) + self.cur=nil + self.waiting=ENV.hang + self.holdIXSFromNext={ifpre} + return + end + else + self.holdIXSFromNext=nil + end + self:_popNext(true) + + self.freshTime=floor(min(self.freshTime+ENV.freshLimit*.25,ENV.freshLimit*((self.holdTime+1)/ENV.holdCount),ENV.freshLimit)) + if not ENV.infHold then + self.holdTime=self.holdTime-1 + end + + if self.sound then + SFX.play(ifpre and 'prehold' or 'hold') + end + + self.stat.hold=self.stat.hold+1 +end function Player:hold(ifpre,force) if self.holdTime>0 and (self.cur or ifpre or force) then if self.gameEnv.holdMode=='hold' then self:hold_norm(ifpre) elseif self.gameEnv.holdMode=='swap' then self:hold_swap(ifpre) + elseif self.gameEnv.holdMode=='skip' then + self:hold_skip(ifpre) end return true end diff --git a/parts/scenes/customGame.lua b/parts/scenes/customGame.lua index 356ed2ec..356e0cbd 100644 --- a/parts/scenes/customGame.lua +++ b/parts/scenes/customGame.lua @@ -83,7 +83,7 @@ local sList={ hang={0,1,2,3,4,5,6,7,8,9,10,15,20,30,60}, hurry={0,1,2,3,4,5,6,7,8,9,10,1e99}, eventSet=EVENTSETS, - holdMode={'hold','swap'}, + holdMode={'hold','swap','skip'}, } local modUsed