added battle state as globals, adds half working battle flow
This commit is contained in:
parent
b09eee0805
commit
4963131d3e
12 changed files with 250 additions and 95 deletions
11
globals/Global.gd
Normal file
11
globals/Global.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends Node
|
||||
|
||||
enum BattleState {
|
||||
NOT_IN_BATTLE = -1,
|
||||
STARTED = 0,
|
||||
PLAYER_TURN = 1,
|
||||
ENEMY_TURN = 2,
|
||||
CATCH = 3,
|
||||
WIN = 4,
|
||||
LOSE = 5
|
||||
}
|
||||
|
|
@ -2,11 +2,11 @@ extends Node
|
|||
|
||||
var player: Node3D = null
|
||||
|
||||
|
||||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
pass # Replace with function body.
|
||||
|
||||
func set_player(p_player: Node3D) -> void:
|
||||
player = p_player
|
||||
|
||||
func get_player() -> Node3D:
|
||||
return player
|
||||
|
||||
func load_base_monster_data(p_unique_id) -> MonsterData:
|
||||
var path = "res://resources/monsters/" + p_unique_id + ".tres"
|
||||
|
|
@ -16,9 +16,3 @@ func load_base_monster_data(p_unique_id) -> MonsterData:
|
|||
else:
|
||||
printerr("Monster.gd: No monster with the ID %s found" % p_unique_id)
|
||||
return null
|
||||
|
||||
func set_player(p_player) -> void:
|
||||
player = p_player
|
||||
|
||||
func get_player() -> Node3D:
|
||||
return player
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue