Implemented simple quest system
This commit is contained in:
@@ -1,5 +1,11 @@
|
||||
extends Spatial
|
||||
var loading
|
||||
|
||||
func new_quest(q):
|
||||
var title = q.get_title()
|
||||
var desc = q.get_description()
|
||||
print("title: ", title)
|
||||
print("desc: ", desc)
|
||||
func _ready():
|
||||
loading = preload("res://ui/loading.tscn").instance()
|
||||
get_tree().get_root().add_child(loading)
|
||||
@@ -12,6 +18,8 @@ func _ready():
|
||||
global.set_save_slot(0)
|
||||
e = $dungeon.connect("prepared", self, "start_ai")
|
||||
assert(e == OK)
|
||||
e = quests.connect("new_quest", self, "new_quest")
|
||||
assert(e == OK)
|
||||
|
||||
var default_meta = {
|
||||
"grabbing": false,
|
||||
@@ -32,6 +40,12 @@ func start_ai():
|
||||
print("prepared")
|
||||
$"meta-ai".start()
|
||||
|
||||
func save():
|
||||
global.save_characters()
|
||||
$dungeon.save()
|
||||
quests.save()
|
||||
global.save_game()
|
||||
|
||||
func spawn_player(spawner):
|
||||
print("spawned player")
|
||||
loading.queue_free()
|
||||
@@ -50,6 +64,7 @@ func spawn_player(spawner):
|
||||
player.set_meta("spawner", spawner)
|
||||
player.add_to_group("player")
|
||||
$cam_target/cam_rot/offset/Camera.current = true
|
||||
global.start_time()
|
||||
func spawn_npc(spawner):
|
||||
var npc
|
||||
var g
|
||||
@@ -221,3 +236,5 @@ func _process(delta):
|
||||
$cam_target.rotate_y(-angle * delta)
|
||||
else:
|
||||
cam_fixup_cooldown -= delta
|
||||
if Input.is_action_just_pressed("save_game"):
|
||||
save()
|
||||
|
||||
Reference in New Issue
Block a user