Compare commits

...

5 Commits

Author SHA1 Message Date
5dba027b4c Death
All checks were successful
linting & formatting / build (push) Successful in 21s
itch.io publish action / build (linux64, x86_64) (push) Successful in 2m6s
itch.io publish action / build (osx, app) (push) Successful in 2m10s
itch.io publish action / build (win64, exe) (push) Successful in 2m31s
2025-04-19 16:18:12 -06:00
127fb9be38 Get grabbed idiot!! 2025-04-19 12:25:47 -06:00
028b59cddb Player control lockouts 2025-04-19 10:12:18 -06:00
ecdedfc58c Using InputPrompt for interact prompt 2025-04-19 10:01:37 -06:00
db2507048f UI tweaks & i18n 2025-04-19 09:49:07 -06:00
26 changed files with 710 additions and 83 deletions

View File

@ -39,6 +39,8 @@ SETTINGS_AUDIO_HEADING,"Audio Settings"
SETTINGS_CONTROLS,Controls SETTINGS_CONTROLS,Controls
SETTINGS_CONTROLS_HEADING,"Control Bindings" SETTINGS_CONTROLS_HEADING,"Control Bindings"
, ,
ACTION_HOLD_MODIFIER,Hold
,
ACTION_move_forward,"Move forward" ACTION_move_forward,"Move forward"
ACTION_move_left,"Move left" ACTION_move_left,"Move left"
ACTION_move_back,"Move back" ACTION_move_back,"Move back"
@ -57,3 +59,22 @@ ACTION_select_brush,"Select toothbrush"
ACTION_select_mp3_player,"Select MP3 player" ACTION_select_mp3_player,"Select MP3 player"
ACTION_select_manual,"Select manual" ACTION_select_manual,"Select manual"
ACTION_pause,Pause ACTION_pause,Pause
,
HUD_WARNING,WARNING
HUD_ALERT_MSG,"ANTIPSIONIC SURGE DETECTED\nEXERCISE EXTREME CAUTION"
HUD_TANK_WARNING,"TANK FULL\nRETURN TO SHIP"
,
INTERACTIVE_SCANNER_LABEL,"Retinal Scanner"
INTERACTIVE_SCANNER_VERB,use
INTERACTIVE_SWITCH_LABEL,Switch
INTERACTIVE_SWITCH_VERB,use
INTERACTIVE_WORLDITEM_VERB,"pick up"
INTERACTIVE_TANK_LABEL,"Grunk Tank"
INTERACTIVE_TANK_VERB,deposit
,
ITEM_EYEBALLS_NAME,Eyeballs
ITEM_EYEBALLS_DESCRIPTION,"A pair of eyeballs, formerly belonging to the shift supervisor. Could be used with a retinal scanner."
,
SWITCH_BULKHEAD_LABEL,"Bulkhead Control"
SWITCH_QUARANTINE_LABEL,"Quarantine Override"
SWITCH_CARGOBAY_LABEL,"Cargo Bay Security Override"

1 keys en
39 SETTINGS_CONTROLS Controls
40 SETTINGS_CONTROLS_HEADING Control Bindings
41
42 ACTION_HOLD_MODIFIER Hold
43
44 ACTION_move_forward Move forward
45 ACTION_move_left Move left
46 ACTION_move_back Move back
59 ACTION_select_mp3_player Select MP3 player
60 ACTION_select_manual Select manual
61 ACTION_pause Pause
62
63 HUD_WARNING WARNING
64 HUD_ALERT_MSG ANTIPSIONIC SURGE DETECTED\nEXERCISE EXTREME CAUTION
65 HUD_TANK_WARNING TANK FULL\nRETURN TO SHIP
66
67 INTERACTIVE_SCANNER_LABEL Retinal Scanner
68 INTERACTIVE_SCANNER_VERB use
69 INTERACTIVE_SWITCH_LABEL Switch
70 INTERACTIVE_SWITCH_VERB use
71 INTERACTIVE_WORLDITEM_VERB pick up
72 INTERACTIVE_TANK_LABEL Grunk Tank
73 INTERACTIVE_TANK_VERB deposit
74
75 ITEM_EYEBALLS_NAME Eyeballs
76 ITEM_EYEBALLS_DESCRIPTION A pair of eyeballs, formerly belonging to the shift supervisor. Could be used with a retinal scanner.
77
78 SWITCH_BULKHEAD_LABEL Bulkhead Control
79 SWITCH_QUARANTINE_LABEL Quarantine Override
80 SWITCH_CARGOBAY_LABEL Cargo Bay Security Override

View File

@ -1482,6 +1482,7 @@ shape = SubResource("ConcavePolygonShape3D_p11ap")
[node name="SwitchA1" parent="BeastNav/Airlock/Bounds/FarWall" instance=ExtResource("17_0idgf")] [node name="SwitchA1" parent="BeastNav/Airlock/Bounds/FarWall" instance=ExtResource("17_0idgf")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1.5, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.5, 1.5, 0.1)
label = "SWITCH_BULKHEAD_LABEL"
[node name="Props" type="Node3D" parent="BeastNav/Airlock"] [node name="Props" type="Node3D" parent="BeastNav/Airlock"]
@ -1657,6 +1658,7 @@ process_material = SubResource("ParticleProcessMaterial_6giaa")
[node name="SwitchA2" parent="BeastNav/Corridor1/Hallway1" instance=ExtResource("17_0idgf")] [node name="SwitchA2" parent="BeastNav/Corridor1/Hallway1" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5)
label = "SWITCH_BULKHEAD_LABEL"
[node name="OverheadLight" parent="BeastNav/Corridor1/Hallway1" instance=ExtResource("39_kp5n7")] [node name="OverheadLight" parent="BeastNav/Corridor1/Hallway1" instance=ExtResource("39_kp5n7")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.5)
@ -1804,6 +1806,7 @@ process_material = SubResource("ParticleProcessMaterial_6giaa")
[node name="SwitchB1" parent="BeastNav/Corridor1/Hallway4" instance=ExtResource("17_0idgf")] [node name="SwitchB1" parent="BeastNav/Corridor1/Hallway4" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5)
label = "SWITCH_BULKHEAD_LABEL"
[node name="OverheadLight" parent="BeastNav/Corridor1/Hallway4" instance=ExtResource("39_kp5n7")] [node name="OverheadLight" parent="BeastNav/Corridor1/Hallway4" instance=ExtResource("39_kp5n7")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3, -1.5) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3, -1.5)
@ -2100,9 +2103,11 @@ shape = SubResource("ConcavePolygonShape3D_eaq62")
[node name="SwitchB2" parent="BeastNav/MessHall" instance=ExtResource("17_0idgf")] [node name="SwitchB2" parent="BeastNav/MessHall" instance=ExtResource("17_0idgf")]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -2.7, 1.5, 9.4) transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -2.7, 1.5, 9.4)
label = "SWITCH_BULKHEAD_LABEL"
[node name="SwitchC1" parent="BeastNav/MessHall" instance=ExtResource("17_0idgf")] [node name="SwitchC1" parent="BeastNav/MessHall" instance=ExtResource("17_0idgf")]
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, -6.3, 1.5, 0.599998) transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, -6.3, 1.5, 0.599998)
label = "SWITCH_BULKHEAD_LABEL"
[node name="FloatingDust" parent="BeastNav/MessHall" instance=ExtResource("25_6giaa")] [node name="FloatingDust" parent="BeastNav/MessHall" instance=ExtResource("25_6giaa")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 1.5, 5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -4.5, 1.5, 5)
@ -2316,6 +2321,7 @@ process_material = SubResource("ParticleProcessMaterial_6giaa")
[node name="SwitchC2" parent="BeastNav/Corridor2/Hallway1" instance=ExtResource("17_0idgf")] [node name="SwitchC2" parent="BeastNav/Corridor2/Hallway1" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.4, 1.5, -4.5) transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.4, 1.5, -4.5)
label = "SWITCH_BULKHEAD_LABEL"
[node name="BurnoutLight" parent="BeastNav/Corridor2/Hallway1" instance=ExtResource("29_lfacn")] [node name="BurnoutLight" parent="BeastNav/Corridor2/Hallway1" instance=ExtResource("29_lfacn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.2) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.2)
@ -2351,6 +2357,7 @@ process_material = SubResource("ParticleProcessMaterial_6giaa")
[node name="SwitchD1" parent="BeastNav/Corridor2/Hallway2" instance=ExtResource("17_0idgf")] [node name="SwitchD1" parent="BeastNav/Corridor2/Hallway2" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.4, 1.5, -4.5) transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 1.4, 1.5, -4.5)
label = "SWITCH_BULKHEAD_LABEL"
[node name="OverheadLight" parent="BeastNav/Corridor2/Hallway2" instance=ExtResource("39_kp5n7")] [node name="OverheadLight" parent="BeastNav/Corridor2/Hallway2" instance=ExtResource("39_kp5n7")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3, -1.5) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 3, -1.5)
@ -2544,9 +2551,11 @@ process_material = SubResource("ParticleProcessMaterial_otfxe")
[node name="SwitchD2" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("17_0idgf")] [node name="SwitchD2" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("17_0idgf")]
transform = Transform3D(1.31134e-07, 0, 1, 0, 1, 0, -1, 0, 1.31134e-07, -4.4, 1.5, -2.8) transform = Transform3D(1.31134e-07, 0, 1, 0, 1, 0, -1, 0, 1.31134e-07, -4.4, 1.5, -2.8)
label = "SWITCH_BULKHEAD_LABEL"
[node name="SwitchE1" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("17_0idgf")] [node name="SwitchE1" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 4.4, 1.5, 2.8) transform = Transform3D(-4.37114e-08, 0, -1, 0, 1, 0, 1, 0, -4.37114e-08, 4.4, 1.5, 2.8)
label = "SWITCH_BULKHEAD_LABEL"
[node name="BurnoutLight" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("29_lfacn")] [node name="BurnoutLight" parent="BeastNav/CrewQuarters/CommonArea" instance=ExtResource("29_lfacn")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, 0) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, 0)
@ -3155,6 +3164,7 @@ process_material = SubResource("ParticleProcessMaterial_6giaa")
[node name="SwitchE2" parent="BeastNav/Corridor3/Hallway" instance=ExtResource("17_0idgf")] [node name="SwitchE2" parent="BeastNav/Corridor3/Hallway" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -1.4, 1.5, 4.5)
label = "SWITCH_BULKHEAD_LABEL"
[node name="BurnoutLight" parent="BeastNav/Corridor3/Hallway" instance=ExtResource("29_lfacn")] [node name="BurnoutLight" parent="BeastNav/Corridor3/Hallway" instance=ExtResource("29_lfacn")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.5) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 3, -1.5)
@ -3451,6 +3461,7 @@ shape = SubResource("ConcavePolygonShape3D_ncghj")
[node name="SwitchH1" parent="BeastNav/Corridor3/ShortHallway3" instance=ExtResource("17_0idgf")] [node name="SwitchH1" parent="BeastNav/Corridor3/ShortHallway3" instance=ExtResource("17_0idgf")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -1.4) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.5, -1.4)
label = "SWITCH_BULKHEAD_LABEL"
[node name="MedbaySign" type="MeshInstance3D" parent="BeastNav/Corridor3/ShortHallway3"] [node name="MedbaySign" type="MeshInstance3D" parent="BeastNav/Corridor3/ShortHallway3"]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, 0) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, 0)
@ -4025,9 +4036,11 @@ process_material = SubResource("ParticleProcessMaterial_35kna")
[node name="SwitchH2" parent="BeastNav/Medbay" instance=ExtResource("17_0idgf")] [node name="SwitchH2" parent="BeastNav/Medbay" instance=ExtResource("17_0idgf")]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 3, 1.5, 4.4) transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, 3, 1.5, 4.4)
label = "SWITCH_BULKHEAD_LABEL"
[node name="SwitchX" parent="BeastNav/Medbay" instance=ExtResource("17_0idgf")] [node name="SwitchX" parent="BeastNav/Medbay" instance=ExtResource("17_0idgf")]
transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, -9, 1.5, -13.4) transform = Transform3D(1, 0, -1.74846e-07, 0, 1, 0, 1.74846e-07, 0, 1, -9, 1.5, -13.4)
label = "SWITCH_BULKHEAD_LABEL"
[node name="OverheadLight" parent="BeastNav/Medbay" instance=ExtResource("39_kp5n7")] [node name="OverheadLight" parent="BeastNav/Medbay" instance=ExtResource("39_kp5n7")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, -9) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, 0, 3, -9)
@ -4999,9 +5012,11 @@ skeleton = NodePath("../..")
[node name="SwitchF2" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")] [node name="SwitchF2" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")]
transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -3, 1.5, 4.4) transform = Transform3D(-1, 0, 8.74228e-08, 0, 1, 0, -8.74228e-08, 0, -1, -3, 1.5, 4.4)
label = "SWITCH_BULKHEAD_LABEL"
[node name="SwitchY" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")] [node name="SwitchY" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")]
transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -3, -1.5, 4.4) transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, -3, -1.5, 4.4)
label = "SWITCH_QUARANTINE_LABEL"
[node name="Label3D" type="Label3D" parent="BeastNav/OpsCenter/SwitchY"] [node name="Label3D" type="Label3D" parent="BeastNav/OpsCenter/SwitchY"]
transform = Transform3D(1, 0, -1.06581e-14, 0, 1, 0, -1.77636e-15, 0, 1, 0.165831, 0.071106, 0.101551) transform = Transform3D(1, 0, -1.06581e-14, 0, 1, 0, -1.77636e-15, 0, 1, 0.165831, 0.071106, 0.101551)
@ -5014,6 +5029,7 @@ outline_size = 10
[node name="SwitchG" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")] [node name="SwitchG" parent="BeastNav/OpsCenter" instance=ExtResource("17_0idgf")]
transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -4.4, 1.5, -12) transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -4.4, 1.5, -12)
enabled = false enabled = false
label = "SWITCH_CARGOBAY_LABEL"
[node name="Label3D" type="Label3D" parent="BeastNav/OpsCenter/SwitchG"] [node name="Label3D" type="Label3D" parent="BeastNav/OpsCenter/SwitchG"]
transform = Transform3D(1, 0, -1.06581e-14, 0, 1, 0, -1.77636e-15, 0, 1, 0.165831, 0.0319772, 0.101551) transform = Transform3D(1, 0, -1.06581e-14, 0, 1, 0, -1.77636e-15, 0, 1, 0.165831, 0.0319772, 0.101551)

View File

@ -4,6 +4,6 @@
[resource] [resource]
script = ExtResource("1_iey6h") script = ExtResource("1_iey6h")
name = "Eyeballs" name = "ITEM_EYEBALLS_NAME"
description = "A pair of eyeballs, formerly belonging to the shift supervisor. Could be used with a retinal scanner." description = "ITEM_EYEBALLS_DESCRIPTION"
metadata/_custom_type_script = "uid://btwfewn35d0hm" metadata/_custom_type_script = "uid://btwfewn35d0hm"

View File

@ -312,8 +312,8 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -0.85, 1.35, 4.5)
collision_layer = 2 collision_layer = 2
collision_mask = 0 collision_mask = 0
script = ExtResource("6_e4hmc") script = ExtResource("6_e4hmc")
label = "GRUNK TANK" label = "INTERACTIVE_TANK_LABEL"
verb = "deposit" verb = "INTERACTIVE_TANK_VERB"
metadata/_custom_type_script = "uid://deg5xd87cy8rg" metadata/_custom_type_script = "uid://deg5xd87cy8rg"
[node name="GrunkPumpSFX" type="AudioStreamPlayer3D" parent="TankInteractor"] [node name="GrunkPumpSFX" type="AudioStreamPlayer3D" parent="TankInteractor"]

View File

@ -97,8 +97,8 @@ process_material = SubResource("ParticleProcessMaterial_vwgy4")
draw_pass_1 = SubResource("QuadMesh_fgb4j") draw_pass_1 = SubResource("QuadMesh_fgb4j")
[node name="Decal" type="Decal" parent="Muzzle"] [node name="Decal" type="Decal" parent="Muzzle"]
transform = Transform3D(1, 0, 0, 0, -4.47035e-08, -1, 0, 1, -4.47035e-08, 0, 0, -1) transform = Transform3D(1, 0, 0, 0, -4.47035e-08, -1, 0, 1, -4.47035e-08, 0, 0, -1.5)
size = Vector3(0.2, 2, 0.2) size = Vector3(0.2, 3, 0.2)
texture_albedo = ExtResource("2_qcl8j") texture_albedo = ExtResource("2_qcl8j")
texture_emission = ExtResource("2_qcl8j") texture_emission = ExtResource("2_qcl8j")
cull_mask = 1048573 cull_mask = 1048573

View File

@ -1,6 +1,9 @@
class_name Game extends Node class_name Game extends Node
## Interface to the game as an application. ## Interface to the game as an application.
@export_category("Game Scenes")
@export var world_scene: PackedScene
## Handy typed singleton access. ## Handy typed singleton access.
static var manager: GameManagerType: static var manager: GameManagerType:
get(): get():

View File

@ -1,6 +1,8 @@
[gd_scene load_steps=2 format=3 uid="uid://qpq2cm1hgeha"] [gd_scene load_steps=3 format=3 uid="uid://qpq2cm1hgeha"]
[ext_resource type="Script" uid="uid://dxl25lkyped4" path="res://src/game/game.gd" id="1_qnjlk"] [ext_resource type="Script" uid="uid://dxl25lkyped4" path="res://src/game/game.gd" id="1_qnjlk"]
[ext_resource type="PackedScene" uid="uid://884jqafhtrv0" path="res://src/world/world.tscn" id="2_s6lek"]
[node name="Game" type="Node"] [node name="Game" type="Node"]
script = ExtResource("1_qnjlk") script = ExtResource("1_qnjlk")
world_scene = ExtResource("2_s6lek")

View File

@ -18,6 +18,9 @@ signal alert_cleared
## Emitted after the player's grunk vault reaches a new milestone. ## Emitted after the player's grunk vault reaches a new milestone.
signal milestone_reached(milestone: Milestone) signal milestone_reached(milestone: Milestone)
## Emitted as soon as the player dies.
signal player_dead
const MAX_ALERT := 6 const MAX_ALERT := 6
## Maximum amount of grunk the player can carry in their tank. ## Maximum amount of grunk the player can carry in their tank.
@ -118,3 +121,9 @@ func next_milestone_amount() -> int:
if grunk_vault < milestone_amt: if grunk_vault < milestone_amt:
return milestone_amt return milestone_amt
return -1 return -1
## Called by Player on death.
func on_player_death() -> void:
player_dead.emit()
# TODO reload from save?

View File

@ -11,7 +11,7 @@ const FOCUS_ACCELERATION := 8
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
if event is InputEventMouseMotion: if event is InputEventMouseMotion:
if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED: if Input.get_mouse_mode() == Input.MOUSE_MODE_CAPTURED and player.look_enabled:
camera_motion((event as InputEventMouseMotion).relative) camera_motion((event as InputEventMouseMotion).relative)
elif event is InputEventMouseButton: elif event is InputEventMouseButton:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
@ -35,6 +35,11 @@ func camera_motion(motion: Vector2) -> void:
) )
func reset_pitch(tween_duration: float) -> void:
var tween := create_tween()
tween.tween_property(self, "_target:x", 0, tween_duration)
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
var mouse_accel: float = Game.settings.mouse_acceleration var mouse_accel: float = Game.settings.mouse_acceleration
if player.firing: if player.firing:

View File

@ -2,6 +2,19 @@ class_name Player extends CharacterBody3D
#region Exported Properties #region Exported Properties
@export_category("Status")
@export var dead := false
@export var movement_enabled := true
@export var activity_enabled := true
@export var look_enabled := true
@export var camera_rumble: float:
set(value):
if Game.settings.enable_screen_shake:
cam_rumbler.intensity = value
get:
return cam_rumbler.intensity
@export_category("Movement") @export_category("Movement")
@export_group("Speed") @export_group("Speed")
@export var run_speed := 80.0 @export var run_speed := 80.0
@ -38,6 +51,7 @@ var _was_on_floor := false
@onready var hud: PlayerHUD = %PlayerHUD @onready var hud: PlayerHUD = %PlayerHUD
@onready var camera_pivot: CameraController = %CameraPivot @onready var camera_pivot: CameraController = %CameraPivot
@onready var cam_rumbler: Rumbler3D = %CamRumbler
@onready var interact_ray: RayCast3D = %InteractRay @onready var interact_ray: RayCast3D = %InteractRay
@ -48,6 +62,7 @@ var _was_on_floor := false
@onready var crouch_head_area: Area3D = %CrouchHeadArea @onready var crouch_head_area: Area3D = %CrouchHeadArea
@onready var crouch_animation: AnimationPlayer = %CrouchAnimation @onready var crouch_animation: AnimationPlayer = %CrouchAnimation
@onready var grab_animation: AnimationPlayer = %GrabAnimation
@onready var jump_game_sound_emitter: GameSoundEmitter = %JumpGameSoundEmitter @onready var jump_game_sound_emitter: GameSoundEmitter = %JumpGameSoundEmitter
@ -126,18 +141,44 @@ func toggle_crouch() -> void:
crouch() crouch()
## Get fuckign grabbed, idiot!
## Begin grab death sequence animation.
func get_grabbed() -> void:
if dead: # No double-grabsies
return
movement_enabled = false
activity_enabled = false
look_enabled = false
dead = true
uncrouch()
grab_animation.play("get_grabbed")
camera_pivot.reset_pitch(0.4)
func _signal_death() -> void:
# Called from the death animation
Game.manager.on_player_death()
#endregion #endregion
#region _physics_process #region _physics_process
func _physics_process(delta: float) -> void: func _physics_process(delta: float) -> void:
#REMOVEME
if Input.is_action_just_pressed("ui_page_down"):
get_grabbed()
# Will be null if no valid interactor is selected. # Will be null if no valid interactor is selected.
var interactive: Interactive = interact_ray.get_collider() as Interactive var interactive: Interactive = interact_ray.get_collider() as Interactive
hud.select_interactive(interactive) hud.select_interactive(interactive)
if interactive: if interactive:
interactive.select() interactive.select()
if activity_enabled:
# World interaction # World interaction
if interactive and Input.is_action_just_pressed("interact"): if interactive and Input.is_action_just_pressed("interact"):
interactive.activate() interactive.activate()
@ -175,6 +216,10 @@ func _physics_process(delta: float) -> void:
if Input.is_action_just_pressed("sneak"): if Input.is_action_just_pressed("sneak"):
toggle_crouch() toggle_crouch()
# Jumping
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = jump_force
if is_on_floor(): if is_on_floor():
if not _was_on_floor and not sneaking: if not _was_on_floor and not sneaking:
# just landed # just landed
@ -184,14 +229,13 @@ func _physics_process(delta: float) -> void:
velocity += gravity * delta velocity += gravity * delta
# Input movement # Input movement
if movement_enabled:
var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back") var input_dir := Input.get_vector("move_left", "move_right", "move_forward", "move_back")
var rel_input := input_dir.rotated(-camera_pivot.global_rotation.y) var rel_input := input_dir.rotated(-camera_pivot.global_rotation.y)
var direction := Vector3(rel_input.x, 0, rel_input.y).normalized() var direction := Vector3(rel_input.x, 0, rel_input.y).normalized()
var movement := direction * get_speed() * delta var movement := direction * get_speed() * delta
velocity.x += movement.x velocity.x += movement.x
velocity.z += movement.z velocity.z += movement.z
if Input.is_action_just_pressed("jump") and is_on_floor():
velocity.y = jump_force
# Friction # Friction
var friction := get_friction() var friction := get_friction()

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=57 format=3 uid="uid://bwe2jdmvinhqd"] [gd_scene load_steps=62 format=3 uid="uid://bwe2jdmvinhqd"]
[ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"] [ext_resource type="Script" uid="uid://buwh0g1ga2aka" path="res://src/player/player.gd" id="1_npueo"]
[ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"] [ext_resource type="Script" uid="uid://cx1yt0drthpw3" path="res://src/player/camera_controller.gd" id="2_veeqv"]
@ -7,6 +7,7 @@
[ext_resource type="Script" uid="uid://cwy3akimaeib" path="res://src/player/tool_mount.gd" id="3_jiejy"] [ext_resource type="Script" uid="uid://cwy3akimaeib" path="res://src/player/tool_mount.gd" id="3_jiejy"]
[ext_resource type="PackedScene" uid="uid://dq1x21tq06dud" path="res://src/ui/hud/player_hud.tscn" id="5_jvafu"] [ext_resource type="PackedScene" uid="uid://dq1x21tq06dud" path="res://src/ui/hud/player_hud.tscn" id="5_jvafu"]
[ext_resource type="PackedScene" uid="uid://qknkdy6aics1" path="res://src/equipment/toothbrush/toothbrush.tscn" id="6_o822w"] [ext_resource type="PackedScene" uid="uid://qknkdy6aics1" path="res://src/equipment/toothbrush/toothbrush.tscn" id="6_o822w"]
[ext_resource type="Script" uid="uid://b274q7uvn0cvp" path="res://src/ui/rumbler_3d.gd" id="7_p6grl"]
[ext_resource type="Script" uid="uid://b1vyq7e81nyt0" path="res://src/player/headbob_controller.gd" id="7_x42xx"] [ext_resource type="Script" uid="uid://b1vyq7e81nyt0" path="res://src/player/headbob_controller.gd" id="7_x42xx"]
[ext_resource type="Script" uid="uid://ecrhsueph7at" path="res://src/player/footsteps/footstep_controller.gd" id="9_hja65"] [ext_resource type="Script" uid="uid://ecrhsueph7at" path="res://src/player/footsteps/footstep_controller.gd" id="9_hja65"]
[ext_resource type="Script" uid="uid://brqa2wbtaspw4" path="res://src/player/footsteps/foot_controller.gd" id="9_l271a"] [ext_resource type="Script" uid="uid://brqa2wbtaspw4" path="res://src/player/footsteps/foot_controller.gd" id="9_l271a"]
@ -430,6 +431,167 @@ _data = {
[sub_resource type="SphereShape3D" id="SphereShape3D_p6grl"] [sub_resource type="SphereShape3D" id="SphereShape3D_p6grl"]
radius = 3.0 radius = 3.0
[sub_resource type="Animation" id="Animation_e7e1q"]
length = 0.001
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:position:z")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:x")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:y")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:z")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath(".:camera_rumble")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0)
}
[sub_resource type="Animation" id="Animation_p6grl"]
resource_name = "get_grabbed"
length = 6.0
tracks/0/type = "bezier"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:position:y")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.2, 0.00167316, -1.385, -0.0999666, 0.665918, 0.0333333, 0.566197, -1.385, -0.0416667, 0.6662, 0.0083333, 0.113592, -1.385, -0.0876723, -0.0501441, 0.25, 0),
"times": PackedFloat32Array(0, 0.333333, 0.566667, 0.8)
}
tracks/1/type = "bezier"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:position:z")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.333333, -0.39514, -0.254137, -0.0666667, -0.000457972, 0.25, 0, -0.254137, -0.0666667, -0.000457972, 0.0601447, 0.231214, 0.304548, -0.563731, -0.0123209, 0.25, 0, 0.304548, -0.25, 0, 0.06, 0.231, 0.885, -0.563731, -0.0123209, 0.25, 0),
"times": PackedFloat32Array(0, 0.366667, 2.96667, 3.56667, 5.26667, 5.86667)
}
tracks/2/type = "bezier"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:x")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.05, 0, 0.133333, 2.74114, 0, -0.1, 0.428854, 0.0666667, 0.168909, 0, -0.0666667, 0.178293, 0.0083333, 0.0844504, -1.20654e-08, -0.0876723, -0.0331565, 0.25, 0),
"times": PackedFloat32Array(0, 0.333333, 0.566667, 0.8)
}
tracks/3/type = "bezier"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:y")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.333333, -0.0229232, -1.0426, -0.933333, -0.279974, 0.25, 0, -1.043, -0.25, 0, 0.0333333, 0.158983, -0.878928, -0.25, 0, 0.25, 0, -0.878928, -0.25, 0, 0.033, 0.159, -0.758089, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.8, 2.96667, 3.56667, 5.26667, 5.86667)
}
tracks/4/type = "bezier"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath("CameraPosition/CameraPivot/TransformedPosition:rotation:z")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 1.5708, -0.0876722, 0.463211, 0.0344108, -0.0689299, 1.5708, -0.0322559, -0.00752902, 0.25, 0, 1.571, -0.25, 0, 0, 0.04, 1.68, -0.25, 0, 0.25, 0, 1.68, -0.25, 0, 0, 0.04, 1.71, -0.25, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.566667, 0.733333, 2.96667, 3.66667, 5.26667, 5.96667)
}
tracks/5/type = "bezier"
tracks/5/imported = false
tracks/5/enabled = true
tracks/5/path = NodePath(".:camera_rumble")
tracks/5/interp = 1
tracks/5/loop_wrap = true
tracks/5/keys = {
"handle_modes": PackedInt32Array(0, 0, 0, 0, 0, 0, 0),
"points": PackedFloat32Array(0, -0.25, 0, 0.25, 0, 0, -0.25, 0, 0, 0.161517, 0, -0.767, 0, 0.25, 0, 0, -0.25, 0, 0, 0.02, 0, -0.5, 0, 0.25, 0, 0, -0.25, 0, 0, 0.02, 0, -0.5, 0, 0.25, 0),
"times": PackedFloat32Array(0, 0.3, 1, 2.96667, 3.66667, 5.26667, 5.96667)
}
tracks/6/type = "method"
tracks/6/imported = false
tracks/6/enabled = true
tracks/6/path = NodePath(".")
tracks/6/interp = 1
tracks/6/loop_wrap = true
tracks/6/keys = {
"times": PackedFloat32Array(2.96667),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"_signal_death"
}]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_e7e1q"]
_data = {
&"RESET": SubResource("Animation_e7e1q"),
&"get_grabbed": SubResource("Animation_p6grl")
}
[sub_resource type="PlaneMesh" id="PlaneMesh_p6grl"]
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
collision_layer = 8 collision_layer = 8
collision_mask = 33 collision_mask = 33
@ -459,15 +621,23 @@ visible = false
unique_name_in_owner = true unique_name_in_owner = true
visible = false visible = false
[node name="Camera3D" type="Camera3D" parent="CameraPosition/CameraPivot"] [node name="TransformedPosition" type="Node3D" parent="CameraPosition/CameraPivot"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
[node name="CamRumbler" type="Node3D" parent="CameraPosition/CameraPivot/TransformedPosition"]
unique_name_in_owner = true
script = ExtResource("7_p6grl")
metadata/_custom_type_script = "uid://b274q7uvn0cvp"
[node name="Camera3D" type="Camera3D" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler"]
current = true current = true
[node name="InteractRay" type="RayCast3D" parent="CameraPosition/CameraPivot/Camera3D"] [node name="InteractRay" type="RayCast3D" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler/Camera3D"]
unique_name_in_owner = true unique_name_in_owner = true
target_position = Vector3(0, 0, -1.5) target_position = Vector3(0, 0, -1.5)
collision_mask = 2 collision_mask = 2
[node name="FarLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/Camera3D"] [node name="FarLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1)
light_energy = 0.05 light_energy = 0.05
light_specular = 0.01 light_specular = 0.01
@ -475,18 +645,18 @@ light_cull_mask = 4294967293
omni_range = 50.0 omni_range = 50.0
omni_attenuation = 0.0 omni_attenuation = 0.0
[node name="NearLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/Camera3D"] [node name="NearLight" type="OmniLight3D" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler/Camera3D"]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.1)
light_specular = 0.01 light_specular = 0.01
light_cull_mask = 4294967293 light_cull_mask = 4294967293
omni_range = 2.0 omni_range = 2.0
[node name="HeadbobAnimation" type="AnimationPlayer" parent="CameraPosition/CameraPivot/Camera3D"] [node name="HeadbobAnimation" type="AnimationPlayer" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler/Camera3D"]
libraries = { libraries = {
&"": SubResource("AnimationLibrary_l271a") &"": SubResource("AnimationLibrary_l271a")
} }
[node name="HeadbobController" type="AnimationTree" parent="CameraPosition/CameraPivot/Camera3D/HeadbobAnimation"] [node name="HeadbobController" type="AnimationTree" parent="CameraPosition/CameraPivot/TransformedPosition/CamRumbler/Camera3D/HeadbobAnimation"]
unique_name_in_owner = true unique_name_in_owner = true
root_node = NodePath("%HeadbobController/../..") root_node = NodePath("%HeadbobController/../..")
tree_root = SubResource("AnimationNodeBlendTree_ylhto") tree_root = SubResource("AnimationNodeBlendTree_ylhto")
@ -591,3 +761,14 @@ metadata/_custom_type_script = "uid://c5o1d2shq2qig"
[node name="CollisionShape3D" type="CollisionShape3D" parent="JumpGameSoundEmitter"] [node name="CollisionShape3D" type="CollisionShape3D" parent="JumpGameSoundEmitter"]
shape = SubResource("SphereShape3D_p6grl") shape = SubResource("SphereShape3D_p6grl")
[node name="GrabAnimation" type="AnimationPlayer" parent="."]
unique_name_in_owner = true
libraries = {
&"": SubResource("AnimationLibrary_e7e1q")
}
[node name="DebugFloor" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1, 0)
visible = false
mesh = SubResource("PlaneMesh_p6grl")

View File

@ -28,6 +28,8 @@ unique_name_in_owner = true
collision_layer = 3 collision_layer = 3
collision_mask = 0 collision_mask = 0
script = ExtResource("1_ldtbm") script = ExtResource("1_ldtbm")
label = "INTERACTIVE_SCANNER_LABEL"
verb = "INTERACTIVE_SCANNER_VERB"
metadata/_custom_type_script = "uid://deg5xd87cy8rg" metadata/_custom_type_script = "uid://deg5xd87cy8rg"
[node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive"]

View File

@ -8,6 +8,8 @@ const CLEAN_THRESHOLD := 1400
@export var clean := false @export var clean := false
@export var enabled := false @export var enabled := false
@export var label: String
@onready var animation_player: AnimationPlayer = %AnimationPlayer @onready var animation_player: AnimationPlayer = %AnimationPlayer
@onready var light_animation: AnimationPlayer = %LightAnimation @onready var light_animation: AnimationPlayer = %LightAnimation
@onready var gunk_body: GunkBody = %GunkBody @onready var gunk_body: GunkBody = %GunkBody
@ -19,6 +21,7 @@ const CLEAN_THRESHOLD := 1400
func _ready() -> void: func _ready() -> void:
interactive.label = label
if clean: if clean:
gunk_body.clear_all() gunk_body.clear_all()
_on_clean() _on_clean()

View File

@ -212,6 +212,7 @@ radius = 3.0
[node name="WallSwitch" instance=ExtResource("2_whafo")] [node name="WallSwitch" instance=ExtResource("2_whafo")]
script = ExtResource("2_kfvqd") script = ExtResource("2_kfvqd")
enabled = true enabled = true
label = "INTERACTIVE_SWITCH_LABEL"
[node name="WallSwitch_2" parent="Armature/Skeleton3D" index="0"] [node name="WallSwitch_2" parent="Armature/Skeleton3D" index="0"]
mesh = SubResource("ArrayMesh_6aabu") mesh = SubResource("ArrayMesh_6aabu")
@ -258,6 +259,8 @@ unique_name_in_owner = true
collision_layer = 2 collision_layer = 2
collision_mask = 0 collision_mask = 0
script = ExtResource("10_qw6jt") script = ExtResource("10_qw6jt")
label = "INTERACTIVE_SWITCH_LABEL"
verb = "INTERACTIVE_SWITCH_VERB"
[node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive" index="0"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive" index="0"]
shape = SubResource("BoxShape3D_6maql") shape = SubResource("BoxShape3D_6maql")

View File

@ -0,0 +1,66 @@
/* Gunk shader adapted to a canvas item */
shader_type canvas_item;
group_uniforms gunk_material;
uniform vec3 color_1: source_color = vec3(0.0, 0.03, 0.1);
uniform vec3 color_2: source_color = vec3(0.0, 0.1, 0.3);
uniform vec3 emission_color: source_color = vec3(0.25, 0.88, 1.0);
uniform float pixellation = 128.0;
uniform float time_pixellation = 30.0;
uniform float emission_strength = 0.05;
// Used ONLY by the gunk, does not affect the gunk mask.
uniform vec2 uv_scale = vec2(1.0);
uniform float time_scale = 1.0;
uniform sampler3D gunk_noise;
uniform sampler3D gunk_normal_map;
group_uniforms mask;
uniform float mask_progress : hint_range(0.0, 1.0, 0.01) = 0.0;
uniform sampler2D mask_noise : hint_default_white;
float hardstep(float value) {
float x = clamp(value, 0.0, 1.0);
return 0.5 * tanh( (20.0 * x - 10.0) * inversesqrt(x - x * x) ) + 0.5;
}
void fragment() {
vec2 aspect_ratio = vec2(SCREEN_PIXEL_SIZE.y / SCREEN_PIXEL_SIZE.x, 1.0);
vec2 scaled_pixellation = pixellation * aspect_ratio;
vec2 local_uv = floor(UV * uv_scale * scaled_pixellation) / scaled_pixellation;
float local_time = floor(TIME * time_scale * time_pixellation) / time_pixellation;
// swirl
vec3 uvt = vec3(local_uv.x, local_uv.y, local_time);
uvt.x += sin(uvt.y * 1.54 * PI + uvt.z) * cos(uvt.y * 1.31 * PI + uvt.z) * 0.2;
uvt.y += cos(uvt.x * 1.74 * PI + uvt.z) * -sin(uvt.y * 1.64 * PI + uvt.z) * 0.2;
float value = texture(gunk_noise, uvt).r;
vec3 color = mix(color_1, color_2, value);
vec3 emission = (1.0 - value) * emission_color * emission_strength;
color += emission;
NORMAL_MAP = texture(gunk_normal_map, uvt).xyz;
// Radial mask effect
float radius = 1.3 * length(local_uv - 0.5);
float offset = radius + texture(mask_noise, local_uv).r - 0.5;
float mask = 1.0 - clamp(offset - 1.0 + 2.0 * mask_progress, 0.0, 1.0);
//COLOR = vec4(mask, mask, mask, 1.0);
// soften edges
NORMAL_MAP *= smoothstep(1.0, 0.0, mask);
// Harderish edge
float alpha = hardstep(1.0 - mask);
COLOR = vec4(color, alpha);
// COLOR = vec4(mask, mask, mask, 1.0);
}

View File

@ -0,0 +1 @@
uid://dnytoirugot2e

View File

@ -31,6 +31,7 @@ const ACTION_HOLD_KEY := "ACTION_HOLD_MODIFIER"
func _ready() -> void: func _ready() -> void:
ProjectSettings.settings_changed.connect(_update)
_update() _update()

View File

@ -1,6 +1,7 @@
[gd_scene load_steps=2 format=3 uid="uid://b47goj32i6sdh"] [gd_scene load_steps=3 format=3 uid="uid://b47goj32i6sdh"]
[ext_resource type="Script" path="res://src/ui/elements/input_prompt/input_prompt.gd" id="1_qq6w5"] [ext_resource type="Theme" uid="uid://doq7ay6f7dgfo" path="res://src/ui/menus/menu.theme" id="1_br7b0"]
[ext_resource type="Script" uid="uid://dn50ip335p7oh" path="res://src/ui/elements/input_prompt/input_prompt.gd" id="1_qq6w5"]
[node name="InputPrompt" type="Label"] [node name="InputPrompt" type="Label"]
anchors_preset = 15 anchors_preset = 15
@ -8,7 +9,7 @@ anchor_right = 1.0
anchor_bottom = 1.0 anchor_bottom = 1.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme = ExtResource("1_br7b0")
theme_type_variation = &"InputPrompt" theme_type_variation = &"InputPrompt"
text = "❓ - ACTION_" text = "❓ - ACTION_"
script = ExtResource("1_qq6w5") script = ExtResource("1_qq6w5")
hold = null

View File

@ -1,8 +1,10 @@
[gd_scene load_steps=9 format=3 uid="uid://dq1x21tq06dud"] [gd_scene load_steps=11 format=3 uid="uid://dq1x21tq06dud"]
[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"] [ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="1_lirk3"]
[ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"] [ext_resource type="Script" uid="uid://lrsv0185bfu" path="res://src/ui/hud/player_hud.gd" id="2_j6lpx"]
[ext_resource type="Script" uid="uid://bdsv404evn4fk" path="res://src/ui/hud/interact_hud.gd" id="3_n6jee"] [ext_resource type="Script" uid="uid://bdsv404evn4fk" path="res://src/ui/hud/interact_hud.gd" id="3_n6jee"]
[ext_resource type="FontFile" uid="uid://qadtckvw0t3l" path="res://assets/fonts/fontawesome-free-6.7.2-desktop/otfs/Font Awesome 6 Free-Solid-900.otf" id="4_2q5it"]
[ext_resource type="PackedScene" uid="uid://b47goj32i6sdh" path="res://src/ui/elements/input_prompt/input_prompt.tscn" id="4_iwjh7"]
[ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_ud8na"] [ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_ud8na"]
[sub_resource type="Animation" id="Animation_n6jee"] [sub_resource type="Animation" id="Animation_n6jee"]
@ -152,10 +154,17 @@ offset_right = 85.0
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 0 grow_vertical = 0
[node name="Label" type="Label" parent="InteractHUD/HBoxContainer"] [node name="InputPrompt" parent="InteractHUD/HBoxContainer" instance=ExtResource("4_iwjh7")]
layout_mode = 2 layout_mode = 2
text = "Press [E] to " theme_override_colors/font_color = Color(1, 1, 1, 1)
horizontal_alignment = 2 theme_override_constants/outline_size = 16
text = "❓"
action = &"interact"
show_name = false
[node name="Spacer" type="Label" parent="InteractHUD/HBoxContainer"]
layout_mode = 2
text = " - "
[node name="InteractVerb" type="Label" parent="InteractHUD/HBoxContainer"] [node name="InteractVerb" type="Label" parent="InteractHUD/HBoxContainer"]
unique_name_in_owner = true unique_name_in_owner = true
@ -189,22 +198,41 @@ offset_right = 268.0
offset_bottom = 88.0 offset_bottom = 88.0
grow_horizontal = 2 grow_horizontal = 2
theme_type_variation = &"AlertLabel" theme_type_variation = &"AlertLabel"
text = "TANK FULL text = "HUD_TANK_WARNING"
RETURN TO SHIP"
horizontal_alignment = 1 horizontal_alignment = 1
[node name="GrunkAlertWarning" type="Label" parent="AlertHUD"] [node name="GrunkAlertWarning" type="HBoxContainer" parent="AlertHUD"]
modulate = Color(1, 1, 1, 0) modulate = Color(1, 1, 1, 0)
layout_mode = 1 layout_mode = 1
anchors_preset = 5 anchors_preset = 5
anchor_left = 0.5 anchor_left = 0.5
anchor_right = 0.5 anchor_right = 0.5
offset_left = -20.0 offset_left = -264.0
offset_right = 20.0 offset_right = 264.0
offset_bottom = 45.0 offset_bottom = 82.0
grow_horizontal = 2 grow_horizontal = 2
theme_type_variation = &"AlertLabel" theme_type_variation = &"AlertLabel"
text = " WARNING " theme_override_constants/separation = 32
alignment = 1
[node name="Icon" type="Label" parent="AlertHUD/GrunkAlertWarning"]
layout_mode = 2
theme_type_variation = &"AlertLabel"
theme_override_fonts/font = ExtResource("4_2q5it")
text = ""
horizontal_alignment = 1
[node name="Warning" type="Label" parent="AlertHUD/GrunkAlertWarning"]
layout_mode = 2
theme_type_variation = &"AlertLabel"
text = "HUD_WARNING"
horizontal_alignment = 1
[node name="Icon2" type="Label" parent="AlertHUD/GrunkAlertWarning"]
layout_mode = 2
theme_type_variation = &"AlertLabel"
theme_override_fonts/font = ExtResource("4_2q5it")
text = ""
horizontal_alignment = 1 horizontal_alignment = 1
[node name="Rumbler" type="Control" parent="AlertHUD"] [node name="Rumbler" type="Control" parent="AlertHUD"]
@ -214,14 +242,14 @@ anchor_left = 0.5
anchor_top = 0.5 anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
offset_left = -400.393 offset_left = -406.72
offset_top = -300.207 offset_top = -295.754
offset_right = -400.393 offset_right = -406.72
offset_bottom = -300.207 offset_bottom = -295.754
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
script = ExtResource("4_ud8na") script = ExtResource("4_ud8na")
intensity = 1.0 intensity = 2.0
metadata/_custom_type_script = "uid://cjs2fen6jo0g0" metadata/_custom_type_script = "uid://cjs2fen6jo0g0"
[node name="GrunkAlert2" type="Control" parent="AlertHUD/Rumbler"] [node name="GrunkAlert2" type="Control" parent="AlertHUD/Rumbler"]
@ -272,8 +300,7 @@ offset_bottom = 431.03
grow_horizontal = 2 grow_horizontal = 2
grow_vertical = 2 grow_vertical = 2
theme_type_variation = &"AlertLabel" theme_type_variation = &"AlertLabel"
text = "ALERT LEVEL SURGE DETECTED text = "HUD_ALERT_MSG"
EXERCISE EXTREME CAUTION"
horizontal_alignment = 1 horizontal_alignment = 1
[node name="AlertPlayer" type="AnimationPlayer" parent="AlertHUD"] [node name="AlertPlayer" type="AnimationPlayer" parent="AlertHUD"]

View File

@ -0,0 +1,221 @@
[gd_scene load_steps=13 format=3 uid="uid://c0uitm5cg88h1"]
[ext_resource type="Shader" uid="uid://dnytoirugot2e" path="res://src/shaders/canvas_grunk.gdshader" id="1_28vyc"]
[ext_resource type="FastNoiseLite" uid="uid://cnlvdtx68giv6" path="res://assets/materials/gunk_noise.tres" id="2_qsvii"]
[ext_resource type="Theme" uid="uid://b07fevr214mmr" path="res://src/ui/hud/hud_theme.tres" id="3_a6m17"]
[ext_resource type="Script" uid="uid://cjs2fen6jo0g0" path="res://src/ui/rumbler.gd" id="4_sv5d8"]
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_et0xc"]
width = 256
height = 256
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("2_qsvii")
[sub_resource type="NoiseTexture3D" id="NoiseTexture3D_a6m17"]
width = 256
height = 256
seamless = true
seamless_blend_skirt = 0.5
noise = ExtResource("2_qsvii")
[sub_resource type="FastNoiseLite" id="FastNoiseLite_qsvii"]
frequency = 0.0006
fractal_type = 2
fractal_octaves = 4
fractal_gain = 0.667
domain_warp_type = 2
[sub_resource type="NoiseTexture2D" id="NoiseTexture2D_et0xc"]
width = 1024
height = 1024
noise = SubResource("FastNoiseLite_qsvii")
[sub_resource type="ShaderMaterial" id="ShaderMaterial_qsvii"]
shader = ExtResource("1_28vyc")
shader_parameter/color_1 = Color(0, 0.03, 0.1, 1)
shader_parameter/color_2 = Color(0, 0.1, 0.3, 1)
shader_parameter/emission_color = Color(0.25, 0.88, 1, 1)
shader_parameter/pixellation = 50.0
shader_parameter/time_pixellation = 30.0
shader_parameter/emission_strength = 0.0
shader_parameter/uv_scale = Vector2(1, 1)
shader_parameter/time_scale = 0.2
shader_parameter/gunk_noise = SubResource("NoiseTexture3D_et0xc")
shader_parameter/gunk_normal_map = SubResource("NoiseTexture3D_a6m17")
shader_parameter/mask_progress = 0.0
shader_parameter/mask_noise = SubResource("NoiseTexture2D_et0xc")
[sub_resource type="Animation" id="Animation_qsvii"]
resource_name = "transition_in"
length = 14.0
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Grunk:material:shader_parameter/mask_progress")
tracks/0/interp = 2
tracks/0/loop_wrap = false
tracks/0/keys = {
"times": PackedFloat32Array(0, 8),
"transitions": PackedFloat32Array(1, 1),
"update": 0,
"values": [0.0, 1.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Grunk/Rumbler:visible")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0, 11.4667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/path = NodePath("Blackout:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0, 13.9667),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [false, true]
}
tracks/3/type = "method"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath(".")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(14),
"transitions": PackedFloat32Array(1),
"values": [{
"args": [],
"method": &"queue_free"
}]
}
[sub_resource type="Animation" id="Animation_et0xc"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Grunk:material:shader_parameter/mask_progress")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [0.0]
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/path = NodePath("Grunk/Rumbler: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("Blackout:visible")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [false]
}
[sub_resource type="AnimationLibrary" id="AnimationLibrary_a6m17"]
_data = {
&"RESET": SubResource("Animation_et0xc"),
&"transition_in": SubResource("Animation_qsvii")
}
[node name="KillScreen" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="Grunk" type="ColorRect" parent="."]
clip_children = 2
material = SubResource("ShaderMaterial_qsvii")
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
[node name="Rumbler" type="Control" parent="Grunk"]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
offset_left = 3.04544
offset_top = -0.292352
offset_right = 3.04541
offset_bottom = -0.292358
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
script = ExtResource("4_sv5d8")
intensity = 6.0
metadata/_custom_type_script = "uid://cjs2fen6jo0g0"
[node name="DeathMessage" type="Label" parent="Grunk/Rumbler"]
layout_mode = 1
anchors_preset = 8
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
offset_left = -2519.0
offset_top = -930.0
offset_right = 2519.0
offset_bottom = 734.0
grow_horizontal = 2
grow_vertical = 2
scale = Vector2(0.3, 1)
pivot_offset = Vector2(2519, 930)
theme = ExtResource("3_a6m17")
theme_type_variation = &"AlertLabel"
theme_override_font_sizes/font_size = 1300
text = "GRUNK"
horizontal_alignment = 1
vertical_alignment = 1
[node name="Blackout" type="ColorRect" parent="."]
visible = false
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
mouse_filter = 2
color = Color(0, 0, 0, 1)
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
libraries = {
&"": SubResource("AnimationLibrary_a6m17")
}
autoplay = "transition_in"

View File

@ -16,5 +16,7 @@ func tick(_actor: Node, blackboard: Blackboard) -> int:
# TODO # TODO
print_debug("GET FUCKIGN GRABBED IDIOT!! ", target) print_debug("GET FUCKIGN GRABBED IDIOT!! ", target)
if target is Player:
(target as Player).get_grabbed()
return SUCCESS return SUCCESS

View File

@ -16,7 +16,6 @@ var state := State.WAITING
func activate() -> void: func activate() -> void:
print_debug(self, " spotted!")
state = State.FREEZE state = State.FREEZE
get_tree().create_timer(freeze_time).timeout.connect(_unfreeze) get_tree().create_timer(freeze_time).timeout.connect(_unfreeze)
get_tree().create_timer(lifespan).timeout.connect(destroy) get_tree().create_timer(lifespan).timeout.connect(destroy)
@ -50,5 +49,4 @@ func _physics_process(delta: float) -> void:
func destroy() -> void: func destroy() -> void:
print_debug("Destroying ", self)
queue_free() queue_free()

View File

@ -53,7 +53,6 @@ func _on_alert_raised(new_level: int) -> void:
# LEVEL 1: PASSIVE # LEVEL 1: PASSIVE
# Beast avoids the player. # Beast avoids the player.
# Set up meet-spook. # Set up meet-spook.
print_debug("Preparing meet-spook...")
# Get closest MeetSpook point to player. # Get closest MeetSpook point to player.
if Player.instance: if Player.instance:
var closest := SceneTools.closest_in_group(Player.instance, MeetSpook.GROUP) var closest := SceneTools.closest_in_group(Player.instance, MeetSpook.GROUP)

View File

@ -1,6 +1,8 @@
class_name World extends Node class_name World extends Node
## Access and flow control for the game world. ## Access and flow control for the game world.
@export var pause_enabled := true
@export var spook_manager: SpookManager @export var spook_manager: SpookManager
@export_category("Game Scenes") @export_category("Game Scenes")
@ -8,6 +10,10 @@ class_name World extends Node
@export var pause_scene: PackedScene @export var pause_scene: PackedScene
@export var kill_screen_scene: PackedScene
var current_level: PackedScene
@onready var level_root: Node3D = %LevelRoot @onready var level_root: Node3D = %LevelRoot
@onready var ui_root: Control = %UIRoot @onready var ui_root: Control = %UIRoot
@ -16,11 +22,12 @@ static var instance: World
func _ready() -> void: func _ready() -> void:
World.instance = self World.instance = self
Game.manager.player_dead.connect(on_player_death)
load_level(initial_level) load_level(initial_level)
func _unhandled_input(event: InputEvent) -> void: func _unhandled_input(event: InputEvent) -> void:
if event.is_action_pressed("pause"): if event.is_action_pressed("pause") and pause_enabled:
pause() pause()
@ -38,4 +45,17 @@ func unpause() -> void:
func load_level(level: PackedScene) -> void: func load_level(level: PackedScene) -> void:
for c: Node in level_root.get_children(): for c: Node in level_root.get_children():
c.queue_free() c.queue_free()
current_level = level
level_root.add_child(level.instantiate()) level_root.add_child(level.instantiate())
func on_player_death() -> void:
var kill_screen: Control = kill_screen_scene.instantiate()
kill_screen.tree_exiting.connect(on_game_over)
ui_root.add_child(kill_screen)
func on_game_over() -> void:
# TODO: reload from last checkpoint
# in the mean time, just reload the level
load_level(current_level)

View File

@ -1,10 +1,11 @@
[gd_scene load_steps=7 format=3 uid="uid://884jqafhtrv0"] [gd_scene load_steps=8 format=3 uid="uid://884jqafhtrv0"]
[ext_resource type="Script" uid="uid://cgqmhtemibxc5" path="res://src/world/world.gd" id="1_1k4gi"] [ext_resource type="Script" uid="uid://cgqmhtemibxc5" path="res://src/world/world.gd" id="1_1k4gi"]
[ext_resource type="PackedScene" uid="uid://byvjsvavbg5xe" path="res://src/ui/menus/pause_menu/pause_menu.tscn" id="2_6fy3g"] [ext_resource type="PackedScene" uid="uid://byvjsvavbg5xe" path="res://src/ui/menus/pause_menu/pause_menu.tscn" id="2_6fy3g"]
[ext_resource type="PackedScene" uid="uid://ehf5sg3ahvbf" path="res://src/world/grunk_beast/grunk_beast.tscn" id="2_43c6p"] [ext_resource type="PackedScene" uid="uid://ehf5sg3ahvbf" path="res://src/world/grunk_beast/grunk_beast.tscn" id="2_43c6p"]
[ext_resource type="Script" uid="uid://bsn026pxqwkbc" path="res://src/world/spook_manager/spook_manager.gd" id="2_bsf3i"] [ext_resource type="Script" uid="uid://bsn026pxqwkbc" path="res://src/world/spook_manager/spook_manager.gd" id="2_bsf3i"]
[ext_resource type="PackedScene" uid="uid://bov4ok76woyc" path="res://levels/ghost_ship/ghost_ship.tscn" id="2_jte2u"] [ext_resource type="PackedScene" uid="uid://bov4ok76woyc" path="res://levels/ghost_ship/ghost_ship.tscn" id="2_jte2u"]
[ext_resource type="PackedScene" uid="uid://c0uitm5cg88h1" path="res://src/ui/menus/kill_screen/kill_screen.tscn" id="6_l0av5"]
[sub_resource type="Resource" id="Resource_43c6p"] [sub_resource type="Resource" id="Resource_43c6p"]
script = ExtResource("2_bsf3i") script = ExtResource("2_bsf3i")
@ -16,6 +17,7 @@ script = ExtResource("1_1k4gi")
spook_manager = SubResource("Resource_43c6p") spook_manager = SubResource("Resource_43c6p")
initial_level = ExtResource("2_jte2u") initial_level = ExtResource("2_jte2u")
pause_scene = ExtResource("2_6fy3g") pause_scene = ExtResource("2_6fy3g")
kill_screen_scene = ExtResource("6_l0av5")
[node name="LevelRoot" type="Node3D" parent="."] [node name="LevelRoot" type="Node3D" parent="."]
unique_name_in_owner = true unique_name_in_owner = true

View File

@ -15,7 +15,7 @@ collision_layer = 2
collision_mask = 0 collision_mask = 0
script = ExtResource("2_ngll7") script = ExtResource("2_ngll7")
enabled = true enabled = true
verb = "pick up" verb = "INTERACTIVE_WORLDITEM_VERB"
metadata/_custom_type_script = "uid://deg5xd87cy8rg" metadata/_custom_type_script = "uid://deg5xd87cy8rg"
[node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive"] [node name="CollisionShape3D" type="CollisionShape3D" parent="Interactive"]