From bbb44d00ecd944c1823ec271fb2fe8dbe734478f 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: Thu, 4 Dec 2025 22:42:58 +0800 Subject: [PATCH] =?UTF-8?q?fix(EntityBase):=20=E4=BF=AE=E5=A4=8D=E4=BC=A4?= =?UTF-8?q?=E5=AE=B3=E5=80=8D=E7=8E=87=E8=AE=A1=E7=AE=97=E5=8F=AF=E8=83=BD?= =?UTF-8?q?=E4=B8=BA=E8=B4=9F=E5=80=BC=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 添加clamp确保伤害倍率最小为1.0,防止在特定难度下计算出现负值 --- scripts/Statemachine/EntityBase.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index fffbf94..a27fd6e 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -214,7 +214,7 @@ func setStage(stage: int): currentInvinsible = false func applyLevel(): fields[FieldStore.Entity.MAX_HEALTH] *= (1 + GameRule.entityHealthIncreasePerWave * (GameRule.difficulty - GameRule.difficultyRange.x + 1)) ** level - fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= (1 + GameRule.entityDamageIncreasePerWave * GameRule.difficulty) ** level + fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= clamp((1 + GameRule.entityDamageIncreasePerWave * GameRule.difficulty), 1.0, INF) ** level func displace(direction: Vector2, isSprinting: bool = false): return (direction if isSprinting else direction.normalized()) * fields.get(FieldStore.Entity.MOVEMENT_SPEED) * 400 * abs(animatree.get("parameters/blend_position")) func move(direction: Vector2, isSprinting: bool = false):