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