fixes saving of party monsters, adds display of monster stats in battle ui

This commit is contained in:
Luca 2024-09-29 11:10:46 +02:00
parent 5748d34b34
commit b09eee0805
9 changed files with 201 additions and 61 deletions

View file

@ -25,13 +25,13 @@ signal on_level_up
@export var defense: int = 1
@export var tempo: int = 1
@export var level: int = 1
@export var xp: int = 1
@export var xp: int = 0
@export var nickname: String = ""
@export var xp_for_levelup: int = 1
# The ID is the filename of the monster from res://entities/monsters/<filename>.tres
func set_data(p_unique_id = "", current_values: Dictionary = {}, p_level: int = 1) -> void:
func set_values(p_unique_id = "", current_values: Dictionary = {}, p_level: int = 1) -> void:
if p_unique_id.is_empty():
printerr("Monster.gd: No ID given")
return
@ -61,7 +61,8 @@ func set_data(p_unique_id = "", current_values: Dictionary = {}, p_level: int =
return
# else, set custom values here
# TODO
for key in current_values:
self[key] = current_values[key]
## This sets the monster to the specified level
func set_level(p_level: int) -> void: