mirror of
https://github.com/Rundll86/Dog-Lynx-And-HCN.git
synced 2026-05-27 22:41:56 +08:00
feat: 添加小鸡角色显示名称,更新Boss状态条和伤害标签逻辑,增强EntityBase类的移动和攻击功能
This commit is contained in:
@@ -3,10 +3,18 @@ class_name DamageLabel
|
||||
|
||||
@export var damage: float = 0
|
||||
@export var crit: bool = false
|
||||
|
||||
@onready var label: Label = $"%label"
|
||||
@onready var animator: AnimationPlayer = $"%animator"
|
||||
|
||||
func _ready():
|
||||
$"%label".text = str(round(damage)) + ("!!!" if crit else "")
|
||||
$"%animator".play("show")
|
||||
await $"%animator".animation_finished
|
||||
if damage == 0:
|
||||
label.text = "MISS"
|
||||
else:
|
||||
label.text = str(round(damage)) + ("!!!" if crit else "")
|
||||
animator.play("show")
|
||||
await animator.animation_finished
|
||||
queue_free()
|
||||
|
||||
static func create(spawnDamage: float, spawnCrit: bool, spawnPosition: Vector2, addToWorld: bool = true) -> DamageLabel:
|
||||
var instance = preload("res://components/UI/DamageLabel.tscn").instantiate()
|
||||
|
||||
Reference in New Issue
Block a user