From d795e6efd8297b349b10c993833bde4957a7cdb4 Mon Sep 17 00:00:00 2001 From: Spencer Killen Date: Mon, 2 Jan 2023 23:48:46 -0700 Subject: [PATCH] flashlight_seconds --- godot/dialogic/definitions.json | 6 ++++++ godot/dialogic/folder_structure.json | 3 ++- godot/effects/player/Flashlight.gd | 4 ++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/godot/dialogic/definitions.json b/godot/dialogic/definitions.json index 7a81ace..06c8265 100644 --- a/godot/dialogic/definitions.json +++ b/godot/dialogic/definitions.json @@ -38,6 +38,12 @@ "name": "bb_counter", "type": 0, "value": "0" + }, + { + "id": "1672728461-648", + "name": "flashlight_seconds", + "type": 0, + "value": "0.0" } ] } diff --git a/godot/dialogic/folder_structure.json b/godot/dialogic/folder_structure.json index b53ce4a..30aa9b0 100644 --- a/godot/dialogic/folder_structure.json +++ b/godot/dialogic/folder_structure.json @@ -29,7 +29,8 @@ "1667755202-648", "1667770005-207", "1672699752-574", - "1672699872-250" + "1672699872-250", + "1672728461-648" ], "folders": { diff --git a/godot/effects/player/Flashlight.gd b/godot/effects/player/Flashlight.gd index f6ed7d9..06b8f5e 100644 --- a/godot/effects/player/Flashlight.gd +++ b/godot/effects/player/Flashlight.gd @@ -22,3 +22,7 @@ func toggle(): visible = not visible $AudioStreamPlayer.pitch_scale = rand_range(0.5, 1.2) $AudioStreamPlayer.play() + +func _process(delta): + if visible: + Dialogic.set_variable("flashlight_seconds", Dialogic.get_variable("flashlight_seconds")+delta)