diff --git a/default_bus_layout.tres b/default_bus_layout.tres index 0bc18ec..7381d96 100644 --- a/default_bus_layout.tres +++ b/default_bus_layout.tres @@ -1,4 +1,4 @@ -[gd_resource type="AudioBusLayout" load_steps=5 format=3 uid="uid://l2ld5cr1ew0r"] +[gd_resource type="AudioBusLayout" load_steps=6 format=3 uid="uid://l2ld5cr1ew0r"] [sub_resource type="AudioEffectReverb" id="AudioEffectReverb_728t0"] resource_name = "Reverb" @@ -16,6 +16,10 @@ room_size = 0.1 resource_name = "StereoEnhance" surround = 1.0 +[sub_resource type="AudioEffectReverb" id="AudioEffectReverb_g1p66"] +resource_name = "Reverb" +room_size = 0.1 + [resource] bus/1/name = &"Music" bus/1/solo = false @@ -43,3 +47,11 @@ bus/3/effect/0/effect = SubResource("AudioEffectReverb_y6xta") bus/3/effect/0/enabled = true bus/3/effect/1/effect = SubResource("AudioEffectStereoEnhance_2b60j") bus/3/effect/1/enabled = true +bus/4/name = &"Spook" +bus/4/solo = false +bus/4/mute = false +bus/4/bypass_fx = false +bus/4/volume_db = 0.0 +bus/4/send = &"Master" +bus/4/effect/0/effect = SubResource("AudioEffectReverb_g1p66") +bus/4/effect/0/enabled = true diff --git a/prefabs/Day1Cutscene.tscn b/prefabs/Day1Cutscene.tscn new file mode 100644 index 0000000..c406c64 --- /dev/null +++ b/prefabs/Day1Cutscene.tscn @@ -0,0 +1,37 @@ +[gd_scene load_steps=6 format=3 uid="uid://ca2cali2s1y6x"] + +[ext_resource type="SpriteFrames" uid="uid://bwssm27bm14s7" path="res://resources/sprites/npcs/captain.tres" id="1_pra77"] +[ext_resource type="Script" path="res://scripts/Day1Cutscene.cs" id="1_ryay5"] +[ext_resource type="PackedScene" uid="uid://c5ndo6b0unkst" path="res://prefabs/NPC.tscn" id="3_c46dh"] +[ext_resource type="AudioStream" uid="uid://dtbu8f2sp1lql" path="res://resources/sounds/spook8.wav" id="4_dfp4a"] + +[sub_resource type="RectangleShape2D" id="RectangleShape2D_yoe65"] +size = Vector2(53, 20) + +[node name="Day1Cutscene" type="Node2D"] +script = ExtResource("1_ryay5") + +[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."] +sprite_frames = ExtResource("1_pra77") + +[node name="Area2D" type="Area2D" parent="."] + +[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"] +position = Vector2(-16.5, 0) +shape = SubResource("RectangleShape2D_yoe65") + +[node name="NPC1" parent="." instance=ExtResource("3_c46dh")] +position = Vector2(225, -339) +NPCName = "Eugene" +DialogLines = ["Captain, I have found a quite strange signal.", "Listen"] + +[node name="NPC2" parent="." instance=ExtResource("3_c46dh")] +position = Vector2(361, -342) +NPCName = "Captain" +DialogLines = ["...", "Quite intresting", "Process this signal on main computer", "We will set cource on source of this signal", "Keep up the good work"] + +[node name="Spook" type="AudioStreamPlayer" parent="."] +stream = ExtResource("4_dfp4a") +bus = &"Spook" + +[connection signal="body_entered" from="Area2D" to="." method="Stage1"] diff --git a/resources/sounds/spook8.wav b/resources/sounds/spook8.wav new file mode 100644 index 0000000..8bf4022 Binary files /dev/null and b/resources/sounds/spook8.wav differ diff --git a/resources/sounds/spook8.wav.import b/resources/sounds/spook8.wav.import new file mode 100644 index 0000000..4e7a948 --- /dev/null +++ b/resources/sounds/spook8.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://dtbu8f2sp1lql" +path="res://.godot/imported/spook8.wav-4324397a78d4da0b1262a5789ce80e63.sample" + +[deps] + +source_file="res://resources/sounds/spook8.wav" +dest_files=["res://.godot/imported/spook8.wav-4324397a78d4da0b1262a5789ce80e63.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop_mode=0 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=0 diff --git a/scripts/Day1Cutscene.cs b/scripts/Day1Cutscene.cs new file mode 100644 index 0000000..3aca061 --- /dev/null +++ b/scripts/Day1Cutscene.cs @@ -0,0 +1,50 @@ +using Godot; +using System; + +public partial class Day1Cutscene : Node2D +{ + private Player _player; + + private NPC _npc1; + + private NPC _npc2; + + private AudioStreamPlayer _spook; + // Called when the node enters the scene tree for the first time. + public override void _Ready() + { + _npc1 = (NPC)FindChild("NPC1"); + _npc2 = (NPC)FindChild("NPC2"); + _spook = (AudioStreamPlayer)FindChild("Spook"); + } + + // Called every frame. 'delta' is the elapsed time since the previous frame. + public override void _Process(double delta) + { + } + + public void Stage1(Node2D body) + { + if (body is Player player) + { + _player = player; + player.InteractableObjects.Add(_npc1); + player.CurrentState = Player.State.ChatWithNPC; + } + } + + public void Stage2() + { + _player.CurrentState = Player.State.Wait; + _player.InteractableObjects.Remove(_npc1); + AudioServer.SetBusVolumeDb(0, -20); + _spook.Play(); + _player.InteractableObjects.Add(_npc2); + } + + public void Stage3() + { + AudioServer.SetBusVolumeDb(0, 0); + _player.CurrentState = Player.State.ChatWithNPC; + } +} diff --git a/scripts/Player.cs b/scripts/Player.cs index 6440ba2..74f8a59 100644 --- a/scripts/Player.cs +++ b/scripts/Player.cs @@ -170,7 +170,8 @@ public partial class Player : CharacterBody2D ShowChatLog(delta); break; case State.Wait: - _camera.Offset = _cameraDefaultPosition; + // _camera.Offset = _cameraDefaultPosition; + HideChatLog(delta); break; default: throw new ArgumentOutOfRangeException();