From 0e5262e9024cb11ab9c30425ef58485cb1cc040d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=A8=E8=90=BD=E5=9F=BA=E5=9B=B4=E8=99=BE?= <3161880837@qq.com> Date: Sat, 6 Sep 2025 17:13:34 +0800 Subject: [PATCH] =?UTF-8?q?=E5=82=BB=E9=80=BCtrae=E4=B8=8D=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=8F=90=E4=BA=A4=E4=BF=A1=E6=81=AF=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/Statemachine/ColorBar.gd | 6 +++--- scripts/Tools/GameRule.gd | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/Statemachine/ColorBar.gd b/scripts/Statemachine/ColorBar.gd index 4f0e5a4..ebc6a35 100644 --- a/scripts/Statemachine/ColorBar.gd +++ b/scripts/Statemachine/ColorBar.gd @@ -34,10 +34,10 @@ func _ready(): lastChangeTime = WorldManager.getTime() func _draw(): draw_style_box(backBox, Rect2(0, 0, size.x, size.y)) - if WorldManager.getTime() - lastChangeTime > GameRule.detainTime: - draw_style_box(middleBox2 if forwardDirection > 0 else middleBox1, Rect2(0, 0, size.x * getPercent(middleValue), size.y)) + draw_style_box(middleBox2 if forwardDirection > 0 else middleBox1, Rect2(0, 0, size.x * getPercent(middleValue), size.y)) draw_style_box(frontBox, Rect2(0, 0, size.x * getPercent(frontValue), size.y)) func _physics_process(_delta: float) -> void: - middleValue = lerpf(middleValue, currentValue, speed1 if forwardDirection > 0 else speed2) + if WorldManager.getTime() - lastChangeTime > GameRule.detainTime: + middleValue = lerpf(middleValue, currentValue, speed1 if forwardDirection > 0 else speed2) frontValue = lerpf(frontValue, currentValue, speed1 if forwardDirection < 0 else speed2) queue_redraw() diff --git a/scripts/Tools/GameRule.gd b/scripts/Tools/GameRule.gd index bbbae3e..5ff7d5a 100644 --- a/scripts/Tools/GameRule.gd +++ b/scripts/Tools/GameRule.gd @@ -26,4 +26,4 @@ static var entityLevelOffsetByWave: float = MathTool.percent(30) # 每波敌人 static var appleDropRateInfluenceByLuckValue: float = MathTool.percent(2) # 幸运值对苹果掉率的影响 static var critRateInfluenceByLuckValue: float = MathTool.percent(2.5) # 幸运值对暴击率的影响 static var penerateRateInfluenceByLuckValue: float = MathTool.percent(3) # 幸运值对穿透率的影响 -static var detainTime: float = 1000 # 血量如果在这个时间内没有改变才会开始播放降低动画 \ No newline at end of file +static var detainTime: float = 500 # 血量如果在这个时间内没有改变才会开始播放降低动画 \ No newline at end of file