-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathglobal.gd
65 lines (54 loc) · 1.3 KB
/
global.gd
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
extends Node
var player_health = 100.0 setget set_health
var abilities : Dictionary
var ability_budget = 0
const abilities_prototype = {
"payload_speed": {
"text": "Increase Inferno Heart movement speed",
"active": false,
},
"click_swing": {
"text": "Swing as fast as you can click",
"active": false,
},
"beyblade": {
"text": "Two weapons are better than one",
"active": false,
},
"double_damage": {
"text": "Double Damage",
"active": false,
},
"regen": {
"text": "Slowly regain health when standing still",
"active": false,
},
"player_armor": {
"text": "You take half damage",
"active": false,
},
"payload_armor": {
"text": "Inferno Heart takes half damage",
"active": false,
},
"burning_aura": {
"text": "Inferno Heart damages nearby enemies",
"active": false,
},
}
func get_random_abilites(num):
randomize()
var ability_names = abilities.keys().duplicate()
ability_names.shuffle()
return ability_names.slice(0, num-1)
func reset():
player_health = 100
abilities = abilities_prototype.duplicate()
ability_budget = 0
for key in abilities.keys():
abilities[key]["active"] = false
get_tree().call_group("abilities", "update_abilities")
func set_health(new_value):
player_health = new_value
if player_health <= 0:
get_tree().call_group("game_over", "game_over")