Cambiados los aspectos visuales del juego a algo gotico
This commit is contained in:
1 parent
ec7e35ddf6
commit
967b3a286d
205 files changed
+7056
-1630
No files matched your search
@@ -11,6 +11,8 @@ extends CanvasLayer
|
||||
@onready var health_label: Label = $HUD/HealthBar/HealthLabel
|
||||
@onready var effects_label: Label = $HUD/EffectsLabel
|
||||
@onready var warning_label: Label = $HUD/WarningLabel
|
||||
@onready var portrait: TextureRect = $HUD/Emblem
|
||||
@onready var identity_label: Label = $HUD/Title
|
||||
|
||||
var player_ref: Node
|
||||
var _received_health: bool = false
|
||||
@@ -27,6 +29,7 @@ func _ready() -> void:
|
||||
return
|
||||
# Los hijos ejecutan _ready antes que Player; su senal inicial llegara despues de esta conexion.
|
||||
player_ref.connect(&"health_changed", _on_health_changed)
|
||||
call_deferred("_update_identity")
|
||||
effects_label.visible = false
|
||||
# Tambien funciona si el HUD se instancia despues de _ready del jugador.
|
||||
if player_ref.is_node_ready():
|
||||
@@ -67,7 +70,7 @@ func _process(delta: float) -> void:
|
||||
]:
|
||||
var bonus: float = float(player_ref.get(effect[1]))
|
||||
if bonus > 0.0:
|
||||
active.append("%s +%d%% | HASTA GOLPE" % [effect[0], roundi(bonus * 100.0)])
|
||||
active.append("%s +%d%% HASTA GOLPE" % [effect[0], roundi(bonus * 100.0)])
|
||||
|
||||
var shield_hits: int = int(player_ref.get("_shield_hits"))
|
||||
if shield_hits > 0:
|
||||
@@ -88,3 +91,22 @@ func _on_health_changed(current_health: int, max_health: int) -> void:
|
||||
health_bar.highlighted = low_health and amount > 0
|
||||
warning_label.visible = low_health or amount == 0
|
||||
warning_label.text = "SIN VIDA" if amount == 0 else "PELIGRO"
|
||||
|
||||
|
||||
## Retrato derivado del arte del personaje seleccionado; no modifica su estado.
|
||||
func _update_identity() -> void:
|
||||
if not is_instance_valid(player_ref):
|
||||
return
|
||||
var data: CharacterData = player_ref.get("character_data") as CharacterData
|
||||
if data == null:
|
||||
return
|
||||
identity_label.text = data.display_name.to_upper()
|
||||
var portrait_path: String = "res://assets/ashen/portraits/%s.png" % data.id
|
||||
if ResourceLoader.exists(portrait_path, "Texture2D"):
|
||||
var source: Texture2D = load(portrait_path) as Texture2D
|
||||
var bust := AtlasTexture.new()
|
||||
bust.atlas = source
|
||||
bust.region = Rect2(20, 0, 88, 88)
|
||||
portrait.texture = bust
|
||||
elif data.sprite_frames != null and data.sprite_frames.has_animation(&"idle"):
|
||||
portrait.texture = data.sprite_frames.get_frame_texture(&"idle", 0)
|
||||
Reference in new issue
Block a user