Second station built, mission system soon

This commit is contained in:
ToasterPanic 2025-12-07 16:13:25 -05:00
parent 979341cba2
commit 7e673de5ca
14 changed files with 341 additions and 54 deletions

View file

@ -1,6 +1,12 @@
[gd_resource type="AudioBusLayout" format=3 uid="uid://cbmx3klr6k4mt"]
[gd_resource type="AudioBusLayout" load_steps=2 format=3 uid="uid://cbmx3klr6k4mt"]
[sub_resource type="AudioEffectLowPassFilter" id="AudioEffectLowPassFilter_j3pel"]
resource_name = "LowPassFilter"
cutoff_hz = 10000.0
[resource]
bus/0/effect/0/effect = SubResource("AudioEffectLowPassFilter_j3pel")
bus/0/effect/0/enabled = false
bus/1/name = &"Music"
bus/1/solo = false
bus/1/mute = false

View file

@ -36,9 +36,11 @@ bus = &"Sound Effects"
[node name="Fire" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_ipns3")
bus = &"Sound Effects"
[node name="Explode" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_ipns3")
bus = &"Sound Effects"
[node name="Sprite" type="Sprite2D" parent="."]
texture = ExtResource("6_w8i8w")

File diff suppressed because one or more lines are too long

View file

@ -161,10 +161,12 @@ script = ExtResource("1_6ra5r")
[node name="Dialogue" type="AudioStreamPlayer" parent="."]
process_mode = 3
stream = ExtResource("3_rncil")
bus = &"Sound Effects"
[node name="UiSelect" type="AudioStreamPlayer" parent="."]
process_mode = 3
stream = ExtResource("3_26mqe")
bus = &"Sound Effects"
[node name="PlayerGround" type="CharacterBody2D" parent="."]
position = Vector2(349, -58)

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -30,9 +30,11 @@ script = ExtResource("1_5d2l8")
[node name="UiSelect" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_v4r4p")
bus = &"Sound Effects"
[node name="UiBack" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_1s2dm")
bus = &"Sound Effects"
[node name="Panel" type="PanelContainer" parent="."]
layout_mode = 1

16
scenes/props/desk.tscn Normal file
View file

@ -0,0 +1,16 @@
[gd_scene load_steps=3 format=3 uid="uid://udpwphfxtuf2"]
[ext_resource type="Texture2D" uid="uid://bahp733iqv2us" path="res://textures/desk.png" id="1_551uk"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_aadnw"]
size = Vector2(191, 32)
[node name="StaticBody2D" type="StaticBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(2, 2)
texture = ExtResource("1_551uk")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-32, 48)
shape = SubResource("RectangleShape2D_aadnw")

View file

@ -40,14 +40,17 @@ script = ExtResource("1_pyl7j")
[node name="UiSelect" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_hiwto")
bus = &"Sound Effects"
[node name="UiBack" type="AudioStreamPlayer" parent="."]
stream = ExtResource("3_w65of")
bus = &"Sound Effects"
[node name="Title" type="AudioStreamPlayer" parent="."]
stream = ExtResource("2_ia1n6")
volume_db = -4.0
autoplay = true
bus = &"Music"
parameters/looping = true
[node name="Stars" type="GPUParticles2D" parent="."]

View file

@ -36,6 +36,14 @@ var game = null
@export var always_sees_player: bool = false
## The time it takes for an enemy to start shooting / notice the player.
@export var reaction_time: float = 0.35
## A path for the enemy to follow while idle.
@export var points: Array[Node2D] = []
## Time to wait between points while idle.
@export var wait_time_between_points: int = 5
var current_node = null
var current_point = 0
@export var inaccuracy: int = 15
@ -88,6 +96,28 @@ func _process(delta: float) -> void:
if reaction_timer < 0:
reaction_timer = 0
if points.size() > 0:
if !current_node: current_node = points[0]
print(current_node)
if $Navagent.is_navigation_finished():
if points.find(current_node) + 1 > points.size() - 1:
current_node = points[0]
else:
current_node = points[points.find(current_node) + 1]
else:
var next_position = $Navagent.get_next_path_position()
next_position.y -= 32
var axes = global_position.direction_to(next_position)
horizontial_movement = axes.x
vertical_movement = axes.y
print(next_position)
if !$Navagent.target_position or ($Navagent.target_position != current_node.position): $Navagent.target_position = current_node.position
elif ai_mode == AI_MODE_ATTACK:
$Detecting.playing = false

View file

@ -11,14 +11,20 @@ var enemy_scene = preload("res://scenes/enemy.tscn")
var star_scene = preload("res://scenes/star.tscn")
@onready var spawn_points = {
"space_station_1": $Orbits/SpaceStation1/SpaceStation1/ExitPoint
"space_station_1": $Orbits/SpaceStation1/space_station_1/ExitPoint,
"space_station_2": $Orbits/SpaceStation2/space_station_2/ExitPoint
}
@onready var navigation_points = [
{
"name": "Space Station 1",
"name": "Space Station 01",
"id": "ss1",
"point": $Orbits/SpaceStation1/SpaceStation1
"point": $Orbits/SpaceStation1/space_station_1
},
{
"name": "Space Station 02",
"id": "ss2",
"point": $Orbits/SpaceStation2/space_station_2
}
]

View file

@ -37,11 +37,18 @@ func checkpoint() -> void:
packed_scene.pack(get_tree().get_current_scene())
global.checkpoint = packed_scene
func give_ground_gun(string: String) -> void:
global.stats.equipped_ground_gun = string
func _ready() -> void:
$UI/Control/Dialogue.visible = false
var location_scene = load("res://scenes/locations/space_station_1.tscn").instantiate()
LimboConsole.register_command(give_ground_gun, "give_ground_gun", "Gives a gun for ground mode")
print(global.stats.location)
var location_scene = load("res://scenes/locations/" + global.stats.location + ".tscn").instantiate()
for n in location_scene.get_children():
location_scene.remove_child(n)
@ -175,3 +182,6 @@ func _input(event: InputEvent) -> void:
$UI/Control/PauseMenu/Panel/Flow/Resume.grab_focus()
get_tree().paused = true
func _exit_tree() -> void:
LimboConsole.unregister_command(give_ground_gun)

View file

@ -28,6 +28,37 @@ var orbit_zones = [
]
var missions = [
{
"id": "waking_up",
"name": "Waking Up",
"desc": "Welcome back, spaceperson.",
"rewards": {
"marks": 500
},
"objectives": {
"desk": "Visit the doctor at their desk",
"follow": "Follow the doctor",
"run": "My suggestion: RUN!",
"escape": "Escape to your ship"
}
},
{
"id": "test_contract",
"name": "HEMA Removal",
"desc": "Space station 02 is currently overrun with HEMA mercenaries. We know they have a bomb in the storage warehouse. We want someone to plant that bomb on the station.",
"rewards": {
"marks": 500
},
"objectives": {
"arrive": "Enter Space Station 02 (navigate to it via your navagent)",
"collect_bomb": "Collect the bomb in the back room",
"plant_bomb": "Plant the bomb in the main foyer",
"escape": "Escape"
}
},
]
var ground_guns = {
"pistol": {
"name": "Oni",
@ -120,7 +151,7 @@ func set_story_progress(value: int) -> void:
var default_stats = {
"loaded": false,
"fuel": 12,
"fuel": 75,
"fuel_tank_size": 1,
"speed": 512,
"boost_tank_size": 1,
@ -132,6 +163,10 @@ var default_stats = {
"navigation_goal": null,
"equipped_ground_gun": null,
"gun_holstered": true,
"active_mission": "waking_up",
"mission_progress": 0,
"completed_missions": [],
}
var stats = default_stats.duplicate_deep()

View file

@ -1,39 +0,0 @@
[gd_scene load_steps=4 format=3 uid="uid://cmp1bhx77d1j5"]
[ext_resource type="Script" uid="uid://d4kq5akkly15i" path="res://addons/godot-rapier2d/faucet_2d.gd" id="1_dv1o8"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_lv57a"]
size = Vector2(404, 20)
[sub_resource type="FluidEffect2DSurfaceTensionAKINCI" id="FluidEffect2DSurfaceTensionAKINCI_dv1o8"]
fluid_tension_coefficient = 100.0
[node name="TestFluid" type="Node2D"]
[node name="StaticBody2D" type="StaticBody2D" parent="."]
position = Vector2(591, 545)
[node name="CollisionShape2D" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(29, 0)
shape = SubResource("RectangleShape2D_lv57a")
[node name="CollisionShape2D2" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(-191, -134)
rotation = 1.2401063
shape = SubResource("RectangleShape2D_lv57a")
[node name="CollisionShape2D3" type="CollisionShape2D" parent="StaticBody2D"]
position = Vector2(258, -172)
rotation = -1.3760309
shape = SubResource("RectangleShape2D_lv57a")
[node name="Fluid2D" type="Fluid2D" parent="."]
debug_draw = true
density = 1000.0
effects = Array[Resource]([SubResource("FluidEffect2DSurfaceTensionAKINCI_dv1o8")])
position = Vector2(653, -76)
script = ExtResource("1_dv1o8")
interval = 0.1
[node name="Camera2D" type="Camera2D" parent="."]
position = Vector2(591, 323)