From 2f2894e6567b2d10364af42a9e7de8685989cf95 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Wed, 4 Jan 2023 19:25:46 -0700 Subject: [PATCH] NPC death --- godot/assets/meat_bore/npcs/npc.gd | 5 +++-- godot/player/CameraController.gd | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/godot/assets/meat_bore/npcs/npc.gd b/godot/assets/meat_bore/npcs/npc.gd index 68cac72..76a40e1 100644 --- a/godot/assets/meat_bore/npcs/npc.gd +++ b/godot/assets/meat_bore/npcs/npc.gd @@ -67,8 +67,9 @@ func close_dialog(): func player_entered(): if has_node("npc_common/SignalGenerator"): $npc_common.remove_child($npc_common/SignalGenerator) - create_dialog(initial_dialogic_timeline) - + if is_alive: + create_dialog(initial_dialogic_timeline) + func player_exited(): close_dialog() diff --git a/godot/player/CameraController.gd b/godot/player/CameraController.gd index 5627ca1..e9ebd30 100644 --- a/godot/player/CameraController.gd +++ b/godot/player/CameraController.gd @@ -22,7 +22,7 @@ func _input(event): if Input.is_action_just_pressed("ui_cancel"): Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) else: - if event is InputEventMouseButton and Input.is_action_just_pressed("ui cancel"): + if event is InputEventMouseButton and Input.is_action_just_pressed("ui_cancel"): Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) var look_relative = Vector2(