blob: 7c822579492ab7ffde0744002542465f6efe9485 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
extends Node
var game_stats_config = preload("res://resources/game_stats_config.tres")
signal life_changed
signal morale_changed
var _life: int = game_stats_config.starting_life
var _morale: int = game_stats_config.starting_morale
func get_life() -> int:
return _life
func add_life(amount: int):
_life += amount
emit_signal("life_changed", _life)
func subtract_life(amount: int):
_life -= amount
emit_signal("life_changed", _life)
func get_morale() -> int:
return _morale
func add_morale(amount: int):
_morale += amount
emit_signal("morale_changed", _morale)
func subtract_morale(amount: int):
_morale -= amount
emit_signal("life_changed", _morale)
|