blob: d2d1de7c9b5e803641a8729709d0fc6171dfeee5 (
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", _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("morale_changed", _morale)
func get_current_wave() -> int:
return _current_wave
func increment_wave():
_current_wave += 1
|