Extensive work on the sideview and initial work on player profiles, inventory display, and renaming adventurerdata vs adventurer to adventurer vs adventurersprite

This commit is contained in:
2025-08-27 08:02:11 -04:00
parent 38845e26fa
commit 2a236ea041
55 changed files with 1975 additions and 417 deletions

38
scripts/quest_sprite.gd Normal file
View File

@@ -0,0 +1,38 @@
class_name QuestSprite extends Control
var life : int = 1
var max_life : int = 1
var energy : int = 1
var max_energy : int = 1
var level : int = 1
var exp : int = 0
@export var stats : StatBlock
var gold : int = 0
@onready var anim_player : AnimationPlayer = $AnimationPlayer
signal died(killer :QuestSprite)
signal action_complete(requeue : bool)
signal busy()
func attack(target : QuestSprite) -> void:
print("Attack by %s to %s" % [name, target.name])
target.take_damage(self, 10)
action_complete.emit(true)
func take_damage(source : QuestSprite, amount : int) -> void:
busy.emit()
life = clampi(life - amount, 0, max_life)
if life == 0:
print("%s killed %s!" % [source.name, name])
die(source)
else:
print("%s hit %s for %d damage!" % [source.name, name, amount])
action_complete.emit(false)
func die(killer : QuestSprite) -> void:
died.emit(killer)
queue_free()