mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-06-07 04:07:13 +08:00
feat(游戏结束): 添加子弹显示名称并改进死亡信息显示
- 为所有子弹类型添加displayName属性用于显示 - 修改GameOver面板显示死亡原因,包含子弹名称和发射者 - 更新死亡原因文本格式为富文本样式 - 移除GameOver面板中多余的LabelSettings资源
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
@tool
|
||||
extends FullscreenPanelBase
|
||||
|
||||
@onready var audio = $"%audio"
|
||||
@onready var deadreason = $"%deadreason"
|
||||
@onready var audio: AudioStreamPlayer2D = $"%audio"
|
||||
@onready var deadreason: RichTextLabel = $"%deadreason"
|
||||
|
||||
func beforeOpen(args: Array = []):
|
||||
audio.play()
|
||||
var reasonTemplate = MathTool.randc_from(GameRule.deadReasons)
|
||||
deadreason.text = (reasonTemplate + "凶手是%s。") % args
|
||||
deadreason.text = ("[color=gray]" + reasonTemplate + "凶手是[b]%s[/b]的[b]%s[/b]。[/color]") % args
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
extends Area2D
|
||||
class_name BulletBase
|
||||
|
||||
@export var displayName: String = "未知子弹"
|
||||
@export var speed: float = 10.0
|
||||
@export var damage: float = 10.0
|
||||
@export var penerate: float = 0.0
|
||||
|
||||
@@ -290,7 +290,7 @@ func tryDie(by: BulletBase):
|
||||
)
|
||||
if isPlayer():
|
||||
if UIState.player == self:
|
||||
UIState.setPanel("GameOver", [displayName, by.launcher.displayName])
|
||||
UIState.setPanel("GameOver", [displayName, by.launcher.displayName, by.displayName])
|
||||
EffectController.create(preload("res://components/Effects/DeadBlood.tscn"), texture.global_position).shot()
|
||||
await die()
|
||||
func tryHeal(count: float):
|
||||
@@ -299,7 +299,6 @@ func tryHeal(count: float):
|
||||
playSound("heal")
|
||||
healed.emit(heal(count * fields.get(FieldStore.Entity.HEAL_ABILITY)))
|
||||
healthChanged.emit(health)
|
||||
|
||||
func findWeaponAnchor(weaponName: String):
|
||||
var anchor = $"%weapons".get_node_or_null(weaponName)
|
||||
if anchor is Node2D:
|
||||
|
||||
Reference in New Issue
Block a user