From 8ece2a60a56e42033740c4c3cf594e6100489a01 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 11:34:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E4=BC=A4=E5=AE=B3=E8=AE=A1=E7=AE=97=E5=92=8C=E7=89=A9=E5=93=81?= =?UTF-8?q?=E6=8E=89=E8=90=BD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 调整实体伤害倍数的计算公式,使用平方根来平衡增长曲线 修正物品掉落数量计算,考虑难度范围的影响 修复boss掉落和玩家死亡面板的代码缩进问题 --- scripts/Contents/Panels/Starter.gd | 2 ++ scripts/Statemachine/EntityBase.gd | 22 +++++++++++----------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/scripts/Contents/Panels/Starter.gd b/scripts/Contents/Panels/Starter.gd index 2360a76..f305558 100644 --- a/scripts/Contents/Panels/Starter.gd +++ b/scripts/Contents/Panels/Starter.gd @@ -6,6 +6,8 @@ extends FullscreenPanelBase @onready var levelShow: Label = $"%levelShow" func _ready(): + diffEdit.min_value = GameRule.difficultyRange.x + diffEdit.max_value = GameRule.difficultyRange.y startBtn.pressed.connect( func(): Wave.next() diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 3c42a2d..0a75371 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -204,7 +204,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 - GameRule.difficultyRange.x)) ** level + fields[FieldStore.Entity.DAMAGE_MULTIPILER] *= sqrt((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): @@ -314,7 +314,7 @@ func tryDie(by: BulletBase = null): var item = drops[drop] var count = ceil(randf_range(dropCounts[drop].x, dropCounts[drop].y)) for i in range(count): - ItemDropped.generate(item, randi_range(1, int(sqrt(count) + GameRule.difficulty)), position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset)) + ItemDropped.generate(item, randi_range(1, int(sqrt(count) * (GameRule.difficulty - GameRule.difficultyRange.x + 1))), position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset)) if MathTool.rate( GameRule.appleDropRate + by.launcher.fields.get(FieldStore.Entity.DROP_APPLE_RATE) + @@ -327,15 +327,15 @@ func tryDie(by: BulletBase = null): fields[FieldStore.Entity.MAX_HEALTH] * randf_range(1 - GameRule.beachballOffset, 1 + GameRule.beachballOffset), position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset) ) - if isBoss: - ItemDropped.generate( - ItemStore.ItemType.SOUL, - randi_range(1, 2), - position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset) - ) - if isPlayer(): - if UIState.player == self: - UIState.setPanel("GameOver", [displayName, by.launcher.displayName, by.displayName]) + if isBoss: + ItemDropped.generate( + ItemStore.ItemType.SOUL, + randi_range(1, 2), + position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset) + ) + if isPlayer(): + if UIState.player == self: + UIState.setPanel("GameOver", [displayName, by.launcher.displayName, by.displayName]) EffectController.create(ComponentManager.getEffect("DeadBlood"), texture.global_position).shot() await die() died.emit()