1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

fix(EntityBase): 修复伤害倍率计算可能为负值的问题

添加clamp确保伤害倍率最小为1.0,防止在特定难度下计算出现负值
This commit is contained in:
2025-12-04 22:42:58 +08:00
parent b206142c84
commit bbb44d00ec
+1 -1
View File
@@ -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):