Work on quest locations and the first, brokedown guildhall scene.
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
class_name QuestSprite extends Control
|
||||
|
||||
|
||||
@onready var lifebar : TextureProgressBar = $LifeBar
|
||||
|
||||
var life : int = 1
|
||||
var max_life : int = 1
|
||||
var energy : int = 1
|
||||
@@ -25,6 +28,7 @@ func attack(target : QuestSprite) -> void:
|
||||
func take_damage(source : QuestSprite, amount : int) -> void:
|
||||
busy.emit()
|
||||
life = clampi(life - amount, 0, max_life)
|
||||
lifebar.value = life * 100 / max_life
|
||||
if life == 0:
|
||||
print("%s killed %s!" % [source.name, name])
|
||||
die(source)
|
||||
|
||||
Reference in New Issue
Block a user