1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-28 06:51:54 +08:00

fix(难度系统): 调整敌人属性和难度计算方式

修改敌人生命值和伤害倍率的计算公式,考虑难度范围最小值
降低每波敌人生命值增长百分比从10%到1%
新增difficultyRange变量定义难度范围
This commit is contained in:
2025-11-09 10:59:25 +08:00
parent 12d2f390b6
commit a56196351c
2 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -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):
+2 -1
View File
@@ -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) # 幸运值对苹果掉率的影响