Initial commit

This commit is contained in:
Bad Manners 2024-03-14 00:53:46 -03:00
commit 7becdd23b6
989 changed files with 28526 additions and 0 deletions

View file

@ -0,0 +1,11 @@
[center]A game by Bad Manners
[url]https://badmanners.xyz[/url]
© 2024 - All rights reserved
Special thanks to:
[ul]Hans Woofington, whose encouragement made this project a reality.
B., for their unwavering friendship.
destinyisbad1, for the support since the very beginning.
asofyeun, for supporting me on SubscribeStar.[/ul]
[url=licenses]Open third-party licenses[/url][/center]

View file

@ -0,0 +1,5 @@
[center]
BONUS
[url=bonus_music]Music room[/url]
[url=bonus_animation]Play video[/url]
[url=bonus_fishing]Fishing minigame[/url][/center]

View file

@ -0,0 +1,78 @@
extends Node2D
var all_targets = []
var targets_in_net = []
var grabbed_target = null
var boat_is_moving = false
var net_is_dropped = false
var fishing_target_packed_scene: PackedScene = preload("res://scenes/logic/fishing_target.tscn")
signal fished(name: String)
signal fished_all_targets
# Debug autostart
#func _ready():
# start_fishing_minigame(
# [{"name": "test1", "sprite": load("res://images/sprites/fishing_targets/test.png")}],
# 0.0,
# false,
# )
func _process(delta):
if boat_is_moving and net_is_dropped:
$ReleasedNet.position += Vector2.UP * 70.0 * delta
func play_sfx(sfx):
if $"../VNInterpreter".can_play_sfx():
#SoundManager.play("fishing_sfx", sfx)
SoundManager.play_varied("fishing_sfx", sfx, 1.0, FileGlobals.get_global_data("volume", 0.0))
func start_fishing_minigame(targets, difficulty, is_moving = false):
all_targets = targets
boat_is_moving = is_moving
if boat_is_moving:
$Background.play("fishing_moving")
else:
$Background.play("fishing_stopped")
$Net.visible = true
$Net/Button.disabled = false
for i in all_targets.size():
var target = fishing_target_packed_scene.instantiate()
target.init_target(i, all_targets[i]["sprite"], difficulty)
$FishingTargets.add_child(target)
func _on_net_dropped(dropped_position):
$ReleasedNet.play("default")
net_is_dropped = true
$ReleasedNet.position = dropped_position + 140 * Vector2.DOWN
$ReleasedNet.visible = true
$AnimationPlayer.play("drop_net")
func _on_animation_player_animation_finished(anim_name):
if anim_name == "drop_net":
play_sfx("net_splash")
$ReleasedNet.play("grab_underwater")
$ReleasedNet/DisappearTimer.start()
if targets_in_net.size() >= 1:
grabbed_target = targets_in_net.pop_back()
# Stop target's movement and set position to inside the net
grabbed_target.grab_with($ReleasedNet)
else:
grabbed_target = null
func _on_released_net_target_entered(target):
targets_in_net.append(target)
func _on_released_net_target_exited(target):
targets_in_net.erase(target)
func _on_released_net_disappear_timer_timeout():
if grabbed_target:
fished.emit(all_targets[grabbed_target.index]["name"])
if $FishingTargets.get_child_count() <= 1:
fished_all_targets.emit()
grabbed_target.queue_free()
grabbed_target = null
net_is_dropped = false
$ReleasedNet.visible = false

View file

@ -0,0 +1,364 @@
[gd_scene load_steps=44 format=3 uid="uid://b051fdn22dftw"]
[ext_resource type="Script" path="res://scenes/screens/fishing_minigame.gd" id="1_7s5h5"]
[ext_resource type="Script" path="res://scenes/logic/net.gd" id="1_yetkk"]
[ext_resource type="Texture2D" uid="uid://b3mgxwv3cp1qm" path="res://images/backgrounds/fishing_02/0001.png" id="2_4krj7"]
[ext_resource type="Texture2D" uid="uid://lqy1x6kqm88q" path="res://images/backgrounds/fishing_01.png" id="2_dgwmc"]
[ext_resource type="Texture2D" uid="uid://kepym7kmjifc" path="res://images/backgrounds/fishing_02/0002.png" id="3_e8c31"]
[ext_resource type="Texture2D" uid="uid://dgoe2mysnljkf" path="res://images/backgrounds/fishing_02/0003.png" id="4_02oa4"]
[ext_resource type="Texture2D" uid="uid://bg3w5mitkvquh" path="res://images/backgrounds/fishing_02/0004.png" id="5_tqtjh"]
[ext_resource type="Texture2D" uid="uid://c1yoisbs8lgko" path="res://images/backgrounds/fishing_02/0005.png" id="6_ty1bg"]
[ext_resource type="Texture2D" uid="uid://lxwjghm7etg2" path="res://images/backgrounds/fishing_02/0006.png" id="7_gud5g"]
[ext_resource type="Texture2D" uid="uid://b124fi3eupqhk" path="res://images/backgrounds/fishing_02/0007.png" id="8_e8v68"]
[ext_resource type="Texture2D" uid="uid://ch4b24x872268" path="res://images/backgrounds/fishing_02/0008.png" id="9_dubgg"]
[ext_resource type="Texture2D" uid="uid://dmyv3kehfplqg" path="res://images/backgrounds/fishing_02/0009.png" id="10_j2ciw"]
[ext_resource type="Texture2D" uid="uid://dbimx1shxh47s" path="res://images/sprites/fishing_net/ground.png" id="12_gow3b"]
[ext_resource type="Texture2D" uid="uid://bgxon7ni33yvo" path="res://images/sprites/fishing_foreground.png" id="12_jlj73"]
[ext_resource type="Texture2D" uid="uid://bxs47a05ioxwu" path="res://images/sprites/fishing_net/grabbed_shadow.png" id="14_mfswx"]
[ext_resource type="Texture2D" uid="uid://cca7inw67j1aj" path="res://images/sprites/fishing_net/shadow_underwater/0001.png" id="15_sanpa"]
[ext_resource type="Texture2D" uid="uid://c5p4iqee53bdn" path="res://images/sprites/fishing_net/released.png" id="16_020uy"]
[ext_resource type="Texture2D" uid="uid://bvyx2qdefcgbg" path="res://images/sprites/fishing_net/shadow_underwater/0002.png" id="16_lbjk3"]
[ext_resource type="Texture2D" uid="uid://c0v4akcfgy6f3" path="res://images/sprites/fishing_net/shadow_underwater/0003.png" id="17_dm662"]
[ext_resource type="Texture2D" uid="uid://58hecowyh01o" path="res://images/sprites/fishing_net/shadow_underwater/0004.png" id="18_rph7a"]
[ext_resource type="Texture2D" uid="uid://c7jann5xx0mjj" path="res://images/sprites/fishing_net/shadow_underwater/0005.png" id="19_17qn5"]
[ext_resource type="Texture2D" uid="uid://wbrk7ketjskv" path="res://images/sprites/fishing_net/shadow_underwater/0006.png" id="20_f1sxv"]
[ext_resource type="Texture2D" uid="uid://dere026aqonp8" path="res://images/sprites/fishing_net/shadow_underwater/0007.png" id="21_2tvvq"]
[ext_resource type="Texture2D" uid="uid://cgrrpfsuscyye" path="res://images/sprites/fishing_net/shadow_underwater/0008.png" id="22_veott"]
[ext_resource type="Texture2D" uid="uid://mh34nrov6tum" path="res://images/sprites/fishing_net/shadow_underwater/0009.png" id="23_qdeun"]
[ext_resource type="Script" path="res://addons/resonate/sound_manager/sound_bank.gd" id="26_3dk6v"]
[ext_resource type="Script" path="res://addons/resonate/sound_manager/sound_event_resource.gd" id="27_j0p8c"]
[ext_resource type="AudioStream" uid="uid://ia71ea5lkhf0" path="res://sounds/net_picked_up.mp3" id="28_gwvbf"]
[ext_resource type="AudioStream" uid="uid://cpw5iy7xmmdxl" path="res://sounds/net_splash.mp3" id="29_ws3wp"]
[ext_resource type="AudioStream" uid="uid://baaj7tqj81uun" path="res://sounds/net_returns.mp3" id="30_kih1b"]
[sub_resource type="Animation" id="Animation_niynd"]
resource_name = "RESET"
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ReleasedNet/ReleasedNetGhost:offset:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(-140, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Net:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Net/Button:disabled")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("ReleasedNet:animation")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [&"default"]
}
tracks/4/type = "value"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("ReleasedNet/ReleasedNetGhost:visible")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [true]
}
tracks/5/type = "value"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath("ReleasedNet:visible")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="Animation" id="Animation_bir22"]
resource_name = "drop_net"
length = 0.8
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ReleasedNet/ReleasedNetGhost:offset:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0, 0),
"points": PackedFloat32Array(-140, 0, 0, 0, 0, -140, 0, 0, 0, 0, -20, 0, -100, 0, 0),
"times": PackedFloat32Array(0, 0.1, 0.8)
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("ReleasedNet/ReleasedNetGhost:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.8),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [true, false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_u2oub"]
_data = {
"RESET": SubResource("Animation_niynd"),
"drop_net": SubResource("Animation_bir22")
}
[sub_resource type="SpriteFrames" id="SpriteFrames_4e28o"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_4krj7")
}, {
"duration": 1.0,
"texture": ExtResource("3_e8c31")
}, {
"duration": 1.0,
"texture": ExtResource("4_02oa4")
}, {
"duration": 1.0,
"texture": ExtResource("5_tqtjh")
}, {
"duration": 1.0,
"texture": ExtResource("6_ty1bg")
}, {
"duration": 1.0,
"texture": ExtResource("7_gud5g")
}, {
"duration": 1.0,
"texture": ExtResource("8_e8v68")
}, {
"duration": 1.0,
"texture": ExtResource("9_dubgg")
}, {
"duration": 1.0,
"texture": ExtResource("10_j2ciw")
}],
"loop": true,
"name": &"fishing_moving",
"speed": 6.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("2_dgwmc")
}],
"loop": false,
"name": &"fishing_stopped",
"speed": 6.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_7eg46"]
size = Vector2(879, 28)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_qcfpa"]
size = Vector2(60, 463)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_si7tm"]
size = Vector2(63, 465)
[sub_resource type="RectangleShape2D" id="RectangleShape2D_s7cl4"]
size = Vector2(876, 72)
[sub_resource type="SpriteFrames" id="SpriteFrames_nktfp"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": ExtResource("15_sanpa")
}],
"loop": false,
"name": &"default",
"speed": 5.0
}, {
"frames": [{
"duration": 1.0,
"texture": ExtResource("16_lbjk3")
}, {
"duration": 1.0,
"texture": ExtResource("17_dm662")
}, {
"duration": 1.0,
"texture": ExtResource("18_rph7a")
}, {
"duration": 1.0,
"texture": ExtResource("19_17qn5")
}, {
"duration": 1.0,
"texture": ExtResource("20_f1sxv")
}, {
"duration": 1.0,
"texture": ExtResource("21_2tvvq")
}, {
"duration": 1.0,
"texture": ExtResource("22_veott")
}, {
"duration": 1.0,
"texture": ExtResource("23_qdeun")
}],
"loop": false,
"name": &"grab_underwater",
"speed": 12.0
}]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_f8txh"]
size = Vector2(107, 45)
[sub_resource type="Resource" id="Resource_sxq6n"]
script = ExtResource("27_j0p8c")
name = "net_picked_up"
bus = ""
volume = -6.0
pitch = 1.0
streams = Array[AudioStream]([ExtResource("28_gwvbf")])
[sub_resource type="Resource" id="Resource_ifamc"]
script = ExtResource("27_j0p8c")
name = "net_splash"
bus = ""
volume = -6.0
pitch = 1.0
streams = Array[AudioStream]([ExtResource("29_ws3wp")])
[sub_resource type="Resource" id="Resource_8l1se"]
script = ExtResource("27_j0p8c")
name = "net_returns"
bus = ""
volume = 0.0
pitch = 1.0
streams = Array[AudioStream]([ExtResource("30_kih1b")])
[node name="FishingMinigame" type="Node2D"]
script = ExtResource("1_7s5h5")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
"": SubResource("AnimationLibrary_u2oub")
}
[node name="Background" type="AnimatedSprite2D" parent="."]
position = Vector2(400, 300)
sprite_frames = SubResource("SpriteFrames_4e28o")
animation = &"fishing_stopped"
[node name="Sprite2D" type="Sprite2D" parent="Background"]
z_index = 1
texture = ExtResource("12_jlj73")
[node name="Area2D" type="StaticBody2D" parent="Background"]
collision_layer = 2
[node name="BoundaryBottom" type="CollisionShape2D" parent="Background/Area2D"]
position = Vector2(4.5, 107)
shape = SubResource("RectangleShape2D_7eg46")
[node name="BoundaryRight" type="CollisionShape2D" parent="Background/Area2D"]
position = Vector2(395, -98.5)
shape = SubResource("RectangleShape2D_qcfpa")
[node name="BoundaryLeft" type="CollisionShape2D" parent="Background/Area2D"]
position = Vector2(-396.5, -103.5)
shape = SubResource("RectangleShape2D_si7tm")
[node name="BoundaryTop" type="CollisionShape2D" parent="Background/Area2D"]
position = Vector2(0, -278)
shape = SubResource("RectangleShape2D_s7cl4")
[node name="FishingTargets" type="Node2D" parent="."]
[node name="Net" type="Sprite2D" parent="."]
visible = false
z_index = 1
position = Vector2(400, 560)
texture = ExtResource("12_gow3b")
script = ExtResource("1_yetkk")
[node name="Shadow" type="Sprite2D" parent="Net"]
z_as_relative = false
texture = ExtResource("14_mfswx")
offset = Vector2(0, 120)
[node name="Button" type="Button" parent="Net"]
self_modulate = Color(1, 1, 1, 0)
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = -96.5
offset_top = -41.0
offset_right = -96.5
offset_bottom = -41.0
grow_horizontal = 2
grow_vertical = 2
disabled = true
[node name="ResetTimer" type="Timer" parent="Net"]
wait_time = 3.0
one_shot = true
[node name="ReleasedNet" type="AnimatedSprite2D" parent="."]
visible = false
position = Vector2(-162, 244)
sprite_frames = SubResource("SpriteFrames_nktfp")
[node name="Area2D" type="Area2D" parent="ReleasedNet"]
collision_layer = 0
[node name="CollisionShape2D" type="CollisionShape2D" parent="ReleasedNet/Area2D"]
position = Vector2(-0.5, -15.5)
shape = SubResource("RectangleShape2D_f8txh")
[node name="ReleasedNetGhost" type="Sprite2D" parent="ReleasedNet"]
z_index = 1
texture = ExtResource("16_020uy")
offset = Vector2(0, -140)
[node name="DisappearTimer" type="Timer" parent="ReleasedNet"]
wait_time = 1.5
one_shot = true
[node name="SoundBank" type="Node" parent="."]
script = ExtResource("26_3dk6v")
label = "fishing_sfx"
events = Array[ExtResource("27_j0p8c")]([SubResource("Resource_sxq6n"), SubResource("Resource_ifamc"), SubResource("Resource_8l1se")])
[connection signal="animation_finished" from="AnimationPlayer" to="." method="_on_animation_player_animation_finished"]
[connection signal="net_dropped" from="Net" to="." method="_on_net_dropped"]
[connection signal="button_down" from="Net/Button" to="Net" method="_on_button_down"]
[connection signal="button_up" from="Net/Button" to="Net" method="_on_button_up"]
[connection signal="timeout" from="Net/ResetTimer" to="Net" method="_on_reset_timer_timeout"]
[connection signal="body_entered" from="ReleasedNet/Area2D" to="." method="_on_released_net_target_entered"]
[connection signal="body_exited" from="ReleasedNet/Area2D" to="." method="_on_released_net_target_exited"]
[connection signal="timeout" from="ReleasedNet/DisappearTimer" to="." method="_on_released_net_disappear_timer_timeout"]

474
scenes/screens/maiA0EA.tmp Normal file
View file

@ -0,0 +1,474 @@
[gd_scene load_steps=30 format=3 uid="uid://onv4dnuf1kk1"]
[ext_resource type="FontFile" uid="uid://cvjffehw5s8ut" path="res://fonts/FsJenson1.ttf" id="1_qkfah"]
[ext_resource type="Script" path="res://scenes/screens/main_menu.gd" id="1_yehem"]
[ext_resource type="Texture2D" uid="uid://cwx25ylanlny2" path="res://images/backgrounds/main_menu_01/0001.png" id="2_3aa2r"]
[ext_resource type="Texture2D" uid="uid://c0qa5ixkx1cdj" path="res://images/backgrounds/main_menu_01/0002.png" id="3_rix5m"]
[ext_resource type="Texture2D" uid="uid://bags8op6x23ay" path="res://images/backgrounds/main_menu_01/0003.png" id="4_iiljn"]
[ext_resource type="Texture2D" uid="uid://8jipdoai5gy7" path="res://images/backgrounds/main_menu_01/0004.png" id="5_xbe5v"]
[ext_resource type="Texture2D" uid="uid://gobqqmxfdtq" path="res://images/backgrounds/main_menu_01/0005.png" id="6_11q4i"]
[ext_resource type="Texture2D" uid="uid://cgauglb4shsm3" path="res://images/backgrounds/main_menu_01/0006.png" id="7_mafjt"]
[ext_resource type="Texture2D" uid="uid://c1y26yiulx1xv" path="res://images/backgrounds/main_menu_01/0007.png" id="8_4qyl7"]
[ext_resource type="Texture2D" uid="uid://eepfmshimjne" path="res://images/backgrounds/main_menu_01/0008.png" id="9_hm22s"]
[ext_resource type="Texture2D" uid="uid://b21cecq2oiuj8" path="res://images/backgrounds/main_menu_01/0009.png" id="10_u8yo1"]
[ext_resource type="Texture2D" uid="uid://ryis6tpqxxpp" path="res://images/backgrounds/main_menu_2.png" id="11_c4y3s"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_bank.gd" id="12_kf5m8"]
[ext_resource type="Texture2D" uid="uid://b350qf6o6i6gy" path="res://images/ui/volume-high-solid.svg" id="13_etr4h"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_track_resource.gd" id="13_li636"]
[ext_resource type="Texture2D" uid="uid://ykb3qmxlb1ph" path="res://images/ui/panel-border-014.png" id="13_y2w4v"]
[ext_resource type="Theme" uid="uid://ckrbqku1sx5ge" path="res://scenes/ui_elements/textbox_theme.tres" id="14_j72go"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_stem_resource.gd" id="14_l87h8"]
[ext_resource type="AudioStream" uid="uid://dyam8vvj6rlp7" path="res://music/Fulminant.mp3" id="15_w4ohi"]
[sub_resource type="Animation" id="Animation_3tys0"]
resource_name = "main_menu_01"
length = 1.50002
loop_mode = 1
step = 0.166667
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("TextureRect:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.166667, 0.333333, 0.5, 0.666667, 0.833333, 1, 1.16667, 1.33333, 1.5),
"transitions": PackedFloat32Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1),
"update": 1,
"values": [ExtResource("2_3aa2r"), ExtResource("3_rix5m"), ExtResource("4_iiljn"), ExtResource("5_xbe5v"), ExtResource("6_11q4i"), ExtResource("7_mafjt"), ExtResource("8_4qyl7"), ExtResource("9_hm22s"), ExtResource("10_u8yo1"), ExtResource("2_3aa2r")]
}
[sub_resource type="Animation" id="Animation_abbe0"]
resource_name = "RESET"
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [Color(0, 0, 0, 1)]
}
[sub_resource type="Animation" id="Animation_cf6h8"]
resource_name = "reveal_main_menu"
length = 0.5
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("ColorRect:color")
tracks/0/interp = 2
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [Color(0, 0, 0, 1), Color(0, 0, 0, 0)]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("TitleMarginContainer:theme_override_constants/margin_top")
tracks/1/interp = 2
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 0.5),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [-30, 20]
}
[sub_resource type="Animation" id="Animation_6xul7"]
resource_name = "main_menu_02"
length = 0.001
loop_mode = 2
step = 0.166667
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("TextureRect:texture")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [ExtResource("11_c4y3s")]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_hgqec"]
_data = {
"RESET": SubResource("Animation_abbe0"),
"main_menu_01": SubResource("Animation_3tys0"),
"main_menu_02": SubResource("Animation_6xul7"),
"reveal_main_menu": SubResource("Animation_cf6h8")
}
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_llf77"]
bg_color = Color(0.74902, 0.74902, 0.74902, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_wa6sw"]
bg_color = Color(0.517647, 0.517647, 0.517647, 1)
border_width_left = 3
border_width_top = 3
border_width_right = 3
border_width_bottom = 3
border_color = Color(0.203922, 0.482353, 0.85098, 1)
corner_radius_top_left = 6
corner_radius_top_right = 2
corner_radius_bottom_right = 2
corner_radius_bottom_left = 2
expand_margin_left = 3.0
expand_margin_top = 3.0
expand_margin_right = 3.0
expand_margin_bottom = 3.0
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_07dbw"]
bg_color = Color(0.0470588, 0.0666667, 0.160784, 0.752941)
corner_radius_top_left = 14
corner_radius_top_right = 14
corner_radius_bottom_right = 14
corner_radius_bottom_left = 14
[sub_resource type="Resource" id="Resource_os855"]
script = ExtResource("14_l87h8")
name = "main"
enabled = true
volume = 0.0
stream = ExtResource("15_w4ohi")
[sub_resource type="Resource" id="Resource_kpms5"]
script = ExtResource("13_li636")
name = "fulminant"
bus = ""
stems = Array[ExtResource("14_l87h8")]([SubResource("Resource_os855")])
[node name="MainMenu" type="Node2D"]
script = ExtResource("1_yehem")
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
root_node = NodePath("../CanvasLayer")
libraries = {
"": SubResource("AnimationLibrary_hgqec")
}
[node name="AnimationPlayerBG" type="AnimationPlayer" parent="."]
root_node = NodePath("../CanvasLayer")
libraries = {
"": SubResource("AnimationLibrary_hgqec")
}
[node name="CanvasLayer" type="CanvasLayer" parent="."]
[node name="TextureRect" type="TextureRect" parent="CanvasLayer"]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -400.0
offset_top = -600.0
offset_right = 400.0
grow_horizontal = 2
grow_vertical = 0
texture = ExtResource("11_c4y3s")
[node name="TitleMarginContainer" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 5
anchor_left = 0.5
anchor_right = 0.5
offset_left = -217.0
offset_right = 218.0
offset_bottom = 222.0
grow_horizontal = 2
theme_override_constants/margin_top = -20
[node name="Title" type="Label" parent="CanvasLayer/TitleMarginContainer"]
layout_mode = 2
theme_override_colors/font_outline_color = Color(0, 0, 0, 1)
theme_override_constants/outline_size = 40
theme_override_constants/line_spacing = -26
theme_override_fonts/font = ExtResource("1_qkfah")
theme_override_font_sizes/font_size = 180
text = "Crossing
Over"
horizontal_alignment = 1
[node name="MuteButtonContainer" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 1
anchor_left = 1.0
anchor_right = 1.0
offset_left = -40.0
offset_bottom = 40.0
grow_horizontal = 0
theme_override_constants/margin_top = 20
theme_override_constants/margin_right = 20
[node name="MuteButton" type="Button" parent="CanvasLayer/MuteButtonContainer"]
custom_minimum_size = Vector2(30, 30)
layout_mode = 2
focus_next = NodePath("../../ButtonsMarginContainer/VBoxContainer/NewGame/NewGameButton")
focus_previous = NodePath("../../ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton")
theme_override_styles/hover = SubResource("StyleBoxFlat_llf77")
theme_override_styles/focus = SubResource("StyleBoxFlat_wa6sw")
keep_pressed_outside = true
icon = ExtResource("13_etr4h")
[node name="Panel" type="Panel" parent="CanvasLayer/MuteButtonContainer/MuteButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_07dbw")
[node name="MarginContainer" type="MarginContainer" parent="CanvasLayer/MuteButtonContainer/MuteButton"]
layout_mode = 0
offset_right = 40.0
offset_bottom = 40.0
theme_override_constants/margin_left = 8
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 8
theme_override_constants/margin_bottom = 8
[node name="TextureRect" type="TextureRect" parent="CanvasLayer/MuteButtonContainer/MuteButton/MarginContainer"]
layout_mode = 2
texture = ExtResource("13_etr4h")
expand_mode = 2
[node name="ButtonsMarginContainer" type="MarginContainer" parent="CanvasLayer"]
anchors_preset = 7
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
offset_left = -266.0
offset_top = -52.0
offset_right = 266.0
grow_horizontal = 2
grow_vertical = 0
theme_override_constants/margin_bottom = 40
[node name="VBoxContainer" type="VBoxContainer" parent="CanvasLayer/ButtonsMarginContainer"]
custom_minimum_size = Vector2(532, 0)
layout_mode = 2
size_flags_horizontal = 4
size_flags_vertical = 4
theme_override_constants/separation = 52
alignment = 1
[node name="NewGame" type="Control" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer"]
layout_mode = 2
[node name="NewGameButton" type="Button" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/NewGame"]
unique_name_in_owner = true
custom_minimum_size = Vector2(0, 26)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 512.0
offset_bottom = 21.0
grow_vertical = 2
focus_previous = NodePath("../../../../MuteButtonContainer/MuteButton")
theme_override_styles/hover = SubResource("StyleBoxFlat_llf77")
theme_override_styles/focus = SubResource("StyleBoxFlat_wa6sw")
keep_pressed_outside = true
[node name="Panel" type="Panel" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/NewGame/NewGameButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_07dbw")
[node name="NameFrame" type="NinePatchRect" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/NewGame/NewGameButton"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("13_y2w4v")
draw_center = false
patch_margin_left = 14
patch_margin_top = 14
patch_margin_right = 14
patch_margin_bottom = 14
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[node name="Margin" type="MarginContainer" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/NewGame/NewGameButton/NameFrame"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 532.0
offset_bottom = 21.0
grow_vertical = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 8
[node name="NewGameLabel" type="Label" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/NewGame/NewGameButton/NameFrame/Margin"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 2
size_flags_horizontal = 4
theme = ExtResource("14_j72go")
text = "New game"
visible_characters_behavior = 1
[node name="Continue" type="Control" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer"]
layout_mode = 2
[node name="ContinueButton" type="Button" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Continue"]
custom_minimum_size = Vector2(0, 26)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 512.0
offset_bottom = 21.0
grow_vertical = 2
theme_override_styles/hover = SubResource("StyleBoxFlat_llf77")
theme_override_styles/focus = SubResource("StyleBoxFlat_wa6sw")
keep_pressed_outside = true
[node name="Panel" type="Panel" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Continue/ContinueButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_07dbw")
[node name="NameFrame" type="NinePatchRect" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Continue/ContinueButton"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("13_y2w4v")
draw_center = false
patch_margin_left = 14
patch_margin_top = 14
patch_margin_right = 14
patch_margin_bottom = 14
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[node name="Margin" type="MarginContainer" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Continue/ContinueButton/NameFrame"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 532.0
offset_bottom = 21.0
grow_vertical = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 8
[node name="ContinueLabel" type="Label" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Continue/ContinueButton/NameFrame/Margin"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 2
size_flags_horizontal = 4
theme = ExtResource("14_j72go")
text = "Continue"
visible_characters_behavior = 1
[node name="Credits" type="Control" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer"]
layout_mode = 2
[node name="CreditsButton" type="Button" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Credits"]
custom_minimum_size = Vector2(0, 26)
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 512.0
offset_bottom = 21.0
grow_vertical = 2
focus_next = NodePath("../../../../MuteButtonContainer/MuteButton")
theme_override_styles/hover = SubResource("StyleBoxFlat_llf77")
theme_override_styles/focus = SubResource("StyleBoxFlat_wa6sw")
keep_pressed_outside = true
[node name="Panel" type="Panel" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton"]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_07dbw")
[node name="NameFrame" type="NinePatchRect" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
texture = ExtResource("13_y2w4v")
draw_center = false
patch_margin_left = 14
patch_margin_top = 14
patch_margin_right = 14
patch_margin_bottom = 14
axis_stretch_horizontal = 1
axis_stretch_vertical = 1
[node name="Margin" type="MarginContainer" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton/NameFrame"]
layout_mode = 1
anchors_preset = 4
anchor_top = 0.5
anchor_bottom = 0.5
offset_top = -21.0
offset_right = 532.0
offset_bottom = 21.0
grow_vertical = 2
theme_override_constants/margin_left = 16
theme_override_constants/margin_top = 8
theme_override_constants/margin_right = 16
theme_override_constants/margin_bottom = 8
[node name="CreditsLabel" type="Label" parent="CanvasLayer/ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton/NameFrame/Margin"]
modulate = Color(0.882353, 0.894118, 0.960784, 1)
layout_mode = 2
size_flags_horizontal = 4
theme = ExtResource("14_j72go")
text = "Credits"
visible_characters_behavior = 1
[node name="ColorRect" type="ColorRect" parent="CanvasLayer"]
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0, 0, 0, 1)
[node name="MusicBank" type="Node" parent="."]
script = ExtResource("12_kf5m8")
label = "main_menu"
tracks = Array[ExtResource("13_li636")]([SubResource("Resource_kpms5")])

196
scenes/screens/main_menu.gd Normal file
View file

@ -0,0 +1,196 @@
extends Node2D
@onready var vn_scene = preload("res://scenes/screens/visual_novel.tscn")
var licenses_scroll_bar = null
func advance_sfx():
if not FileGlobals.get_global_data("muted"):
#SoundManager.play("sfx_menu", "advance")
SoundManager.play_varied("sfx_menu", "advance", 1.0, FileGlobals.get_global_data("volume", 0.0))
# Called when the node enters the scene tree for the first time.
func _ready():
get_window().title = "Crossing Over"
if not FileGlobals.has_loaded:
await FileGlobals.loaded
if not MusicManager.has_loaded:
await MusicManager.loaded
if not SoundManager.has_loaded:
await SoundManager.loaded
$CanvasLayer/CreditsMenuControl/AnimatedBardSprite.play("default")
FileGlobals.new_game_save_file.clear()
if str(FileGlobals.get_global_data("answer")) == "42":
$AnimationPlayerBG.play("main_menu_02")
else:
$AnimationPlayerBG.play("main_menu_01")
%VolumeSlider.value = FileGlobals.get_global_data("volume", 0.0)
init_credits()
if FileGlobals.can_continue:
%Continue.visible = true
for file in FileGlobals.save_files:
if file.get("is_autosave"):
%ItemList.add_item(" Autosave | %s (%s)" % [file["name"], file["timestamp"]])
else:
%ItemList.add_item(" %s (%s)" % [file["name"], file["timestamp"]])
if FileGlobals.get_global_data("muted"):
mute()
else:
MusicManager.set_volume(%VolumeSlider.value)
MusicManager.play("main_menu", "fulminant_mm", 0.0)
$AnimationPlayer.play("reveal_main_menu")
%NewGameButton.grab_focus()
func _process(delta):
if $CanvasLayer/LicensesWindow.visible:
if Input.is_action_just_pressed("ui_accept") or Input.is_action_just_pressed("ui_cancel"):
advance_sfx()
$CanvasLayer/LicensesWindow.hide()
else:
var vertical_scroll = Input.get_vector("ui_left", "ui_right", "ui_up", "ui_down").y * delta * 1000
$CanvasLayer/LicensesWindow/RichTextLabel.get_v_scroll_bar().value += vertical_scroll
func mute():
MusicManager.set_volume(-80.0)
#SoundManager.set_volume(-80.0)
FileGlobals.set_global_data("muted", true)
%MuteTextureRect.texture = load("res://images/ui/speaker-x-mark.svg")
func unmute():
var volume = FileGlobals.get_global_data("volume", 0.0)
MusicManager.set_volume(FileGlobals.get_global_data("volume", 0.0))
#SoundManager.set_volume(0.0)
#SoundManager.play("sfx_menu", "advance")
SoundManager.play_varied("sfx_menu", "advance", 1.0, volume)
FileGlobals.set_global_data("muted", false)
%MuteTextureRect.texture = load("res://images/ui/speaker-wave.svg")
func init_credits():
%CreditsRichText.text = FileAccess.open("res://scenes/screens/credits.txt", FileAccess.READ).get_as_text()
#if OS.has_feature("debug") or str(FileGlobals.get_global_data("game_completed")) == "1":
if OS.has_feature("editor") or str(FileGlobals.get_global_data("game_completed")) == "1":
%CreditsRichText.append_text(FileAccess.open("res://scenes/screens/credits_bonus.txt", FileAccess.READ).get_as_text())
%PostGameButtons.visible = true
func show_licenses():
if not $CanvasLayer/LicensesWindow/RichTextLabel.text:
$CanvasLayer/LicensesWindow/RichTextLabel.text = FileAccess.open("res://licenses.txt", FileAccess.READ).get_as_text()
advance_sfx()
$CanvasLayer/LicensesWindow.show()
func start_new_game():
FileGlobals.current_load_source = FileGlobals.VNLoadSource.NEW_GAME
get_tree().change_scene_to_packed(vn_scene)
func _on_licenses_window_close_requested():
advance_sfx()
$CanvasLayer/LicensesWindow.hide()
func _on_mute_button_pressed():
if FileGlobals.get_global_data("muted"):
unmute()
else:
mute()
func _on_new_game_button_pressed():
advance_sfx()
start_new_game()
func _on_continue_button_pressed():
advance_sfx()
$CanvasLayer/ContinueMenuControl.visible = true
$CanvasLayer/ContinueMenuControl/ReturnToMainMenuButtonContainer/ReturnToMainMenuButton.grab_focus()
$CanvasLayer/MainMenuControl.visible = false
func _on_credits_button_pressed():
advance_sfx()
$CanvasLayer/CreditsMenuControl.visible = true
$CanvasLayer/CreditsMenuControl/ReturnToMainMenuButtonContainer/ReturnToMainMenuButton.grab_focus()
$CanvasLayer/MainMenuControl.visible = false
# Return to main menu
func _on_return_to_main_menu_from_continue():
$CanvasLayer/MainMenuControl/ButtonsMarginContainer/VBoxContainer/Continue/ContinueButton.grab_focus()
_on_return_to_main_menu()
func _on_return_to_main_menu_from_credits():
$CanvasLayer/MainMenuControl/ButtonsMarginContainer/VBoxContainer/Credits/CreditsButton.grab_focus()
_on_return_to_main_menu()
func _on_return_to_main_menu():
advance_sfx()
$CanvasLayer/MainMenuControl.visible = true
$CanvasLayer/CreditsMenuControl.visible = false
$CanvasLayer/ContinueMenuControl.visible = false
$CanvasLayer/LicensesWindow.hide()
func _on_credits_rich_text_meta_clicked(meta):
match meta:
"licenses":
show_licenses()
"bonus_music":
FileGlobals.new_game_save_file["current_vn"] = "bonus_music"
start_new_game()
"bonus_animation":
FileGlobals.new_game_save_file["current_vn"] = "bonus_animation"
advance_sfx()
start_new_game()
"bonus_fishing":
FileGlobals.new_game_save_file["current_vn"] = "bonus_fishing"
advance_sfx()
start_new_game()
_:
if meta.left(8) == "https://":
advance_sfx()
OS.shell_open(meta)
else:
push_warning("Unhandled [url] meta '%s'" % meta)
func _on_save_item_list_item_selected(index):
FileGlobals.current_load_file = FileGlobals.save_files[index]
if FileGlobals.current_load_file.get("is_autosave"):
FileGlobals.current_load_source = FileGlobals.VNLoadSource.FROM_AUTOSAVE
else:
FileGlobals.current_load_source = FileGlobals.VNLoadSource.FROM_MANUAL_SAVE
advance_sfx()
get_tree().change_scene_to_packed(vn_scene)
#func _on_load_save_button_focus_entered():
# if %LoadSaveButton.disabled:
# %LoadSaveButton.find_next_valid_focus().grab_focus()
#
#func _on_load_save_button_focus_exited():
# $AnimationPlayer.play("save_file_desselected")
# await $AnimationPlayer.animation_finished
#
#func _on_load_save_button_pressed():
# advance_sfx()
# get_tree().change_scene_to_packed(vn_scene)
func _on_website_button_pressed():
_on_credits_rich_text_meta_clicked("https://badmanners.xyz")
func _on_licenses_button_pressed():
if $CanvasLayer/LicensesWindow.visible:
advance_sfx()
$CanvasLayer/LicensesWindow.hide()
else:
show_licenses()
func _on_music_room_button_pressed():
_on_credits_rich_text_meta_clicked("bonus_music")
func _on_play_video_button_pressed():
_on_credits_rich_text_meta_clicked("bonus_animation")
func _on_fishing_minigame_button_pressed():
_on_credits_rich_text_meta_clicked("bonus_fishing")
func _on_volume_slider_value_changed(value):
FileGlobals.set_global_data("volume", value)
if not FileGlobals.get_global_data("muted", false):
MusicManager.set_volume(value)

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,61 @@
[gd_scene load_steps=15 format=3 uid="uid://4v1jmfn8kjpg"]
[ext_resource type="PackedScene" uid="uid://b3hnb4vtqq6p3" path="res://scenes/ui_elements/textbox.tscn" id="1_7wls5"]
[ext_resource type="Script" path="res://scenes/screens/visual_novel.gd" id="1_hggao"]
[ext_resource type="PackedScene" uid="uid://x4yl51efxs5s" path="res://scenes/ui_elements/chat_log.tscn" id="3_cvy53"]
[ext_resource type="PackedScene" uid="uid://db604d7kgvdrt" path="res://scenes/ui_elements/prompt.tscn" id="3_fgnej"]
[ext_resource type="PackedScene" uid="uid://jfv4ss4g55mw" path="res://scenes/logic/vn_interpreter.tscn" id="5_3vb6j"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_bank.gd" id="6_sqlrv"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_track_resource.gd" id="7_so7qg"]
[ext_resource type="Script" path="res://addons/resonate/music_manager/music_stem_resource.gd" id="8_74ruw"]
[ext_resource type="AudioStream" uid="uid://bnvod0ng5ci14" path="res://music/LooseThoughts.mp3" id="9_4awv5"]
[ext_resource type="AudioStream" uid="uid://4oq4eo5jxtw1" path="res://music/AboardTheAkhirah.mp3" id="10_5nc5r"]
[sub_resource type="Resource" id="Resource_gpkbv"]
script = ExtResource("8_74ruw")
name = "main"
enabled = true
volume = 0.0
stream = ExtResource("9_4awv5")
[sub_resource type="Resource" id="Resource_nuey8"]
script = ExtResource("7_so7qg")
name = "loose_thoughts"
bus = ""
stems = Array[ExtResource("8_74ruw")]([SubResource("Resource_gpkbv")])
[sub_resource type="Resource" id="Resource_38r80"]
script = ExtResource("8_74ruw")
name = "main"
enabled = true
volume = 0.0
stream = ExtResource("10_5nc5r")
[sub_resource type="Resource" id="Resource_grrpr"]
script = ExtResource("7_so7qg")
name = "aboard_the_akhirah"
bus = ""
stems = Array[ExtResource("8_74ruw")]([SubResource("Resource_38r80")])
[node name="VisualNovel" type="Node2D"]
script = ExtResource("1_hggao")
[node name="Background" type="Node2D" parent="."]
[node name="Sprites" type="CanvasLayer" parent="."]
[node name="Textbox" parent="." instance=ExtResource("1_7wls5")]
[node name="Prompt" parent="." instance=ExtResource("3_fgnej")]
[node name="ChatLog" parent="." instance=ExtResource("3_cvy53")]
[node name="VNInterpreter" parent="." instance=ExtResource("5_3vb6j")]
[node name="Timer" type="Timer" parent="."]
one_shot = true
[node name="MusicBank" type="Node" parent="."]
script = ExtResource("6_sqlrv")
label = "vn_music"
tracks = Array[ExtResource("7_so7qg")]([SubResource("Resource_nuey8"), SubResource("Resource_grrpr")])

View file

@ -0,0 +1,21 @@
[gd_scene load_steps=6 format=3 uid="uid://4v1jmfn8kjpg"]
[ext_resource type="PackedScene" uid="uid://b3hnb4vtqq6p3" path="res://scenes/ui_elements/textbox.tscn" id="1_7wls5"]
[ext_resource type="Script" path="res://scenes/screens/visual_novel.gd" id="1_hggao"]
[ext_resource type="PackedScene" uid="uid://x4yl51efxs5s" path="res://scenes/ui_elements/chat_log.tscn" id="3_cvy53"]
[ext_resource type="PackedScene" uid="uid://db604d7kgvdrt" path="res://scenes/ui_elements/prompt.tscn" id="3_fgnej"]
[ext_resource type="PackedScene" uid="uid://jfv4ss4g55mw" path="res://scenes/logic/vn_interpreter.tscn" id="5_3vb6j"]
[node name="VisualNovel" type="Node2D"]
script = ExtResource("1_hggao")
[node name="Textbox" parent="." instance=ExtResource("1_7wls5")]
[node name="Prompt" parent="." instance=ExtResource("3_fgnej")]
visible = false
[node name="ChatLog" parent="." instance=ExtResource("3_cvy53")]
[node name="VNInterpreter" parent="." instance=ExtResource("5_3vb6j")]
[connection signal="prompt_option_selected" from="Prompt" to="VNInterpreter" method="_on_prompt_prompt_option_selected"]

View file

@ -0,0 +1,272 @@
extends Node2D
var can_advance_text = true
var vn_current_name = null
var vn_save_state = null
var fishing_minigame_label = ""
var fishing_minigame_finished = false
var fishing_minigame_active = false
const SHOULD_SAVE_PARSED_BUFFERS = false
const START_VN_NAME = "00_content_warning"
signal autosaved
signal quick_saved
func _ready():
if not FileGlobals.has_loaded:
await FileGlobals.loaded
if not MusicManager.has_loaded:
await MusicManager.loaded
#if SHOULD_SAVE_PARSED_BUFFERS:
# parse_all_txt_scenes()
$FishingMinigame.visible = false
$ChatLog.visible = false
# Get current load source from file globals
load_game(FileGlobals.current_load_source, FileGlobals.current_load_file)
#run_visual_novel(vn_current_name, FileGlobals.current_load_source == FileGlobals.VNLoadSource.NEW_GAME, vn_save_state)
run_visual_novel(vn_current_name, false, vn_save_state)
func _process(_delta):
if Input.is_action_just_pressed("quicksave"):
if save_game(FileGlobals.VNSaveTarget.MANUAL_SAVE):
quick_saved.emit()
elif Input.is_action_just_pressed("log"):
toggle_chatlog()
elif Input.is_action_just_pressed("ui_accept"):
if should_process_click():
#if $Textbox.is_ready():
if $Textbox.is_idle():
can_advance_text = false
$TimerCanAdvanceText.start()
vn_step()
else:
$Textbox.skip()
elif Input.is_action_just_pressed("click"):
if should_process_click():
if $Textbox.is_idle():
var mouse_position = get_global_mouse_position()
if mouse_position.x <= 60 and mouse_position.y <= 60:
toggle_chatlog()
else:
can_advance_text = false
$TimerCanAdvanceText.start()
vn_step()
else:
$Textbox.skip()
#if should_advance_textbox():
# if $Textbox.is_ready():
# vn_step()
# else:
# $Textbox.skip()
func should_process_click() -> bool:
return can_advance_text and not fishing_minigame_active and not $ChatLog.visible
#func should_advance_textbox() -> bool:
# if fishing_minigame_active or $ChatLog.visible:
# return false
# if Input.is_action_just_pressed("ui_accept"):
# return true
# if Input.is_action_just_pressed("click"):
# var mouse_position = get_global_mouse_position()
# if mouse_position.x <= 60 and mouse_position.y <= 60:
# toggle_chatlog()
# return false
# return true
# return false
func toggle_chatlog():
if $ChatLog.visible:
$ChatLog.visible = false
$VNInterpreter.advance_sfx()
elif $Textbox.is_ready():
$ChatLog.visible = true
#$ChatLog.scroll_to_end()
$ChatLog/CloseChatLogButtonContainer/CloseChatLogButton.grab_focus()
$VNInterpreter.advance_sfx()
else:
print_debug("Can't open chatlog right now!")
func load_game(load_source: FileGlobals.VNLoadSource, load_file):
var save_data = FileGlobals.load_save_file(load_source, load_file)
vn_current_name = save_data.get("current_vn", START_VN_NAME)
vn_save_state = save_data.get("save_state", {})
func save_game(save_target: FileGlobals.VNSaveTarget):
#if $FishingMinigame.visible or $ChatLog.visible or not $VNInterpreter.can_save():
if $FishingMinigame.visible or not $VNInterpreter.can_save():
print_debug("Can't save VN right now!")
return false
vn_save_state = $VNInterpreter.save_vn()
FileGlobals.create_save_file(save_target, {"current_vn": vn_current_name, "save_state": vn_save_state}, vn_save_state["title"])
return true
func parse_all_txt_scenes():
DirAccess.make_dir_absolute("user://compiled_scenes")
for path in DirAccess.get_files_at("res://scenes/visual_novels"):
if path.ends_with(".txt"):
var data = $VNInterpreter.parse_vn_file("res://scenes/visual_novels/%s" % path)
var file = FileAccess.open("user://compiled_scenes/%s.buf" % path.left(-4), FileAccess.WRITE)
file.store_buffer(var_to_bytes_with_objects(data))
file.close()
func run_visual_novel(vn_scene, should_autosave: bool = false, save_state = {}):
vn_current_name = vn_scene
# Find source for current file
var file = null
# Try pre-parsed scene first
var should_parse = false
var vn_file = "res://scenes/visual_novels/%s.buf" % vn_current_name
file = FileAccess.open(vn_file, FileAccess.READ)
if file:
file.close()
else:
# Try unparsed scene
should_parse = true
vn_file = "res://scenes/visual_novels/%s.txt" % vn_current_name
file = FileAccess.open(vn_file, FileAccess.READ)
if file:
file.close()
else:
assert(false, "Cannot find next VN scene '%s'!" % vn_scene)
push_warning("Visual novel (%s) not found. Restarting visual novel..." % vn_scene)
vn_current_name = START_VN_NAME
save_state = {}
var data = null
if should_parse:
# Parse the original file
data = $VNInterpreter.parse_vn_file(vn_file)
# Store parsed data
if SHOULD_SAVE_PARSED_BUFFERS:
DirAccess.make_dir_absolute("user://compiled_scenes")
file = FileAccess.open("user://compiled_scenes/%s.buf" % vn_current_name, FileAccess.WRITE)
file.store_buffer(var_to_bytes_with_objects(data))
file.close()
else:
# Load previously parsed data directly
file = FileAccess.open(vn_file, FileAccess.READ)
data = bytes_to_var_with_objects(file.get_buffer(file.get_length()))
file.close()
# Make sure MusicManager is ready before proceeding
if not MusicManager.has_loaded:
await MusicManager.loaded
await $VNInterpreter.load_vn_data(data, save_state)
# Autosave only when loading a new VN
if should_autosave:
var saved = save_game(FileGlobals.VNSaveTarget.AUTOSAVE)
if vn_scene != START_VN_NAME and saved:
autosaved.emit()
vn_step()
func vn_step(label = null):
while true:
var vn_value = await $VNInterpreter.advance_vn(label)
label = null
match vn_value:
[]:
return
["@escape", ..]:
match vn_value.slice(1):
# @escape print my_var $my_var
["print", var value]:
print("@print ", value)
# @escape store_global name john_doe
["store_global", var key, var value]:
FileGlobals.set_global_data(key, value)
# @escape fishing done_fishing 0.5 false {"name":"label_for_fishing_01","sprite":"sprite_name_01"} {...}
["fishing", var label_finished, var difficulty_str, var boat_is_moving_str, ..]:
fishing_minigame_label = label_finished
var difficulty = float(difficulty_str)
var is_moving = boat_is_moving_str == "true"
fishing_minigame_finished = false
var targets = []
for target_json in vn_value.slice(5):
var target = JSON.parse_string(target_json)
target["sprite"] = load("res://images/sprites/fishing_targets/%s.png" % target["sprite"])
targets.append(target)
$FishingMinigame.start_fishing_minigame(targets, difficulty, is_moving)
fishing_minigame_active = true
$FishingMinigame.visible = true
#$FishingMinigame/Net.can_move = true
$TimerNetCanMove.start()
$Sprites.visible = false
$Textbox.visible = false
$OverlayColor.visible = false
$Prompt.visible = false
# $ChatLog.visible = false
can_advance_text = false
return
["return_to_fishing"]:
if fishing_minigame_finished:
$FishingMinigame.visible = false
#$FishingMinigame/Net.can_move = false
$Sprites.visible = true
$Textbox.visible = true
$OverlayColor.visible = true
$Prompt.visible = true
# $ChatLog.visible = true
label = fishing_minigame_label
else:
fishing_minigame_active = true
#$FishingMinigame/Net.can_move = true
$TimerNetCanMove.start()
$Sprites.visible = false
$Textbox.visible = false
$OverlayColor.visible = false
$Prompt.visible = false
# $ChatLog.visible = false
return
_:
push_warning("Unhandled @escape ", vn_value.slice(1))
return
["@load", var next_scene, ..]:
run_visual_novel(next_scene, true)
return
["@eof"]:
push_warning("Reached end of VN instead of exiting gracefully!")
get_tree().change_scene_to_file("res://scenes/screens/main_menu.tscn")
return
["@quit"]:
get_tree().change_scene_to_file("res://scenes/screens/main_menu.tscn")
return
_:
push_warning("Unknown interrupt ", vn_value)
func _on_fishing_minigame_fished(target_name):
can_advance_text = false
$TimerCanAdvanceText.start()
fishing_minigame_active = false
$FishingMinigame/Net.can_move = false
$Sprites.visible = true
$Textbox.visible = true
$OverlayColor.visible = true
$Prompt.visible = true
# $ChatLog.visible = true
vn_step(target_name)
func _on_fishing_minigame_fished_all_targets():
fishing_minigame_finished = true
func _on_timer_net_can_move_timeout():
$FishingMinigame/Net.can_move = true
func _on_timer_can_advance_text_timeout():
can_advance_text = true
func _on_close_chat_log_button_pressed():
toggle_chatlog()
func _on_quicksave_button_pressed():
if save_game(FileGlobals.VNSaveTarget.MANUAL_SAVE):
quick_saved.emit()

File diff suppressed because it is too large Load diff