1
1
mirror of https://github.com/Rundll86/Dog-Lynx-And-HCN.git synced 2026-05-27 22:41:56 +08:00

Add import configuration for Chomp.wav audio effect

This commit is contained in:
2025-08-27 10:23:57 +08:00
parent 5b2c2f5cf7
commit 730f732ef1
27 changed files with 387 additions and 73 deletions
+13 -3
View File
@@ -3,15 +3,25 @@ class_name DamageLabel
@export var damage: float = 0
@export var crit: bool = false
@export var color1: Color = Color(1, 0, 0, 1)
@export var color2: Color = Color(0, 1, 0, 1)
@export var color3: Color = Color(0.5, 0.5, 0.5, 1)
@onready var label: Label = $"%label"
@onready var animator: AnimationPlayer = $"%animator"
func _ready():
if damage == 0:
label.text = "MISS"
var damageValue = round(abs(damage))
var damageSign = sign(damage)
if damageSign > 0:
label.label_settings.font_color = color1
label.text = "%s%s" % [damageValue, "!!!" if crit else ""]
elif damageSign < 0:
label.label_settings.font_color = color2
label.text = "+%s%s" % [damageValue, "!!!" if crit else ""]
else:
label.text = str(round(damage)) + ("!!!" if crit else "")
label.label_settings.font_color = color3
label.text = "MISS"
animator.play("show")
await animator.animation_finished
queue_free()