blob: 0ed0f616db4e652f6e49b2682b3b8fe6a86f0918 (
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
31
32
33
34
35
36
37
|
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
var _current_wave : int = 1
func get_life() -> int:
return _life
func add_life(amount: int):
_life += amount
emit_signal("life_changed")
func subtract_life(amount: int):
_life -= amount
emit_signal("life_changed")
func get_morale() -> int:
return _morale
func add_morale(amount: int):
_morale += amount
emit_signal("morale_changed")
func subtract_morale(amount: int):
_morale -= amount
emit_signal("morale_changed")
func get_current_wave() -> int:
return _current_wave
func increment_wave():
_current_wave += 1
|