From 6e644324cb876daf0ba7ebf789df2f9c38b446c6 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: Sat, 27 Sep 2025 22:40:37 +0800 Subject: [PATCH] =?UTF-8?q?fix(EntityBase):=20=E4=BB=85=E5=9C=A8Boss?= =?UTF-8?q?=E6=AD=BB=E4=BA=A1=E6=97=B6=E6=8E=89=E8=90=BD=E7=81=B5=E9=AD=82?= =?UTF-8?q?=E7=89=A9=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修改tryDie函数,使灵魂物品只在Boss死亡时生成,避免普通敌人也掉落灵魂物品 --- scripts/Statemachine/EntityBase.gd | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/Statemachine/EntityBase.gd b/scripts/Statemachine/EntityBase.gd index 045c6ac..a1ef17b 100644 --- a/scripts/Statemachine/EntityBase.gd +++ b/scripts/Statemachine/EntityBase.gd @@ -321,11 +321,12 @@ func tryDie(by: BulletBase = null): fields[FieldStore.Entity.MAX_HEALTH] * randf_range(1 - GameRule.beachballOffset, 1 + GameRule.beachballOffset), position + MathTool.randv2_range(GameRule.itemDroppedSpawnOffset) ) - ItemDropped.generate( - ItemStore.ItemType.SOUL, - randi_range(1, 2), - 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])