From a56196351c1c29ef6bfe41d5ff21b6eb9ab7ae99 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: Sun, 9 Nov 2025 10:59:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E9=9A=BE=E5=BA=A6=E7=B3=BB=E7=BB=9F):=20?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=95=8C=E4=BA=BA=E5=B1=9E=E6=80=A7=E5=92=8C?= =?UTF-8?q?=E9=9A=BE=E5=BA=A6=E8=AE=A1=E7=AE=97=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改敌人生命值和伤害倍率的计算公式,考虑难度范围最小值 降低每波敌人生命值增长百分比从10%到1% 新增difficultyRange变量定义难度范围 --- scripts/Statemachine/EntityBase.gd | 4 ++-- scripts/Tools/GameRule.gd | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index a04ba0a..3c42a2d 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -203,8 +203,8 @@ func setStage(stage: int): canRunAi = true currentInvinsible = false func applyLevel(): - fields[FieldStore.Entity.MAX_HEALTH] *= (1 + GameRule.entityHealthIncreasePerWave * (GameRule.difficulty + 1)) ** level - fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= (1 + GameRule.entityDamageIncreasePerWave * (GameRule.difficulty + 1)) ** level + 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 - GameRule.difficultyRange.x)) ** 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): diff --git a/scripts/Tools/GameRule.gd b/scripts/Tools/GameRule.gd index 6dab4e0..46867a6 100644 --- a/scripts/Tools/GameRule.gd +++ b/scripts/Tools/GameRule.gd @@ -1,6 +1,7 @@ class_name GameRule static var deadReasons: Array = JsonTool.parseJson("res://resources/constants/deadReasons.json") +static var difficultyRange: Vector2 = Vector2(-5, 10) # 难度倍数范围,包括最小值和最大值,负数则降低难度 static var difficulty: float = 10 # 难度倍数,可以写小数 static var allowFriendlyFire: bool = false # 是否允许友军伤害 static var bulletSpeedMultiplier: float = 1 # 子弹速度倍率 @@ -13,7 +14,7 @@ static var refreshCountIncreasePercent: Vector2 = Vector2(MathTool.percent(10), static var entityCountBoostPerWave: float = MathTool.percent(10) # 每波敌人数量增加的百分比,倍数级 static var itemShowLifetime: int = 1500 # 物品展示组件如果设置了自动隐藏,那么隐藏前可以存活的时间 static var tipSpawnRateWhenGetDroppedItem: float = MathTool.percent(25) # 当玩家获取到掉落物时,提示的概率 -static var entityHealthIncreasePerWave: float = MathTool.percent(10) # 每波敌人生命值增加的百分比,指数级 +static var entityHealthIncreasePerWave: float = MathTool.percent(1) # 每波敌人生命值增加的百分比,指数级 static var entityDamageIncreasePerWave: float = MathTool.percent(1) # 每波敌人伤害增加的百分比,指数级 static var entityLevelOffsetByWave: float = MathTool.percent(30) # 每波敌人等级根据当前波数随机浮动的比例 static var appleDropRateInfluenceByLuckValue: float = MathTool.percent(2) # 幸运值对苹果掉率的影响