6 Commits

Author SHA1 Message Date
77c62c74de changing acceleration factors 2025-07-28 17:27:23 +02:00
3df89c6d28 i dunno man 2025-07-22 16:18:43 +02:00
9d29ec8ee4 trying other setup 2025-07-22 11:51:48 +02:00
4c16ad4f9a dash and jump 2025-07-21 14:40:48 +02:00
374012569b fix: forgot to commit curve resource
All checks were successful
Create tag and build when new code gets to main / BumpTag (push) Successful in 9s
Create tag and build when new code gets to main / Export (push) Successful in 4m4s
2025-07-11 10:34:46 +02:00
98b6537fdd feat: time dilation and indicator 2025-07-11 10:34:20 +02:00
13 changed files with 626 additions and 295 deletions

View File

@ -2,12 +2,12 @@
[ext_resource type="Texture2D" uid="uid://bgw8xgbwc2flx" path="res://godot_state_charts_examples/history_states/white_rectangle.svg" id="1_3v23e"] [ext_resource type="Texture2D" uid="uid://bgw8xgbwc2flx" path="res://godot_state_charts_examples/history_states/white_rectangle.svg" id="1_3v23e"]
[ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_fgw1q"] [ext_resource type="PackedScene" uid="uid://bcwkugn6v3oy7" path="res://addons/godot_state_charts/utilities/state_chart_debugger.tscn" id="2_fgw1q"]
[ext_resource type="Script" path="res://addons/godot_state_charts/state_chart.gd" id="2_pqmip"] [ext_resource type="Script" uid="uid://couw105c3bde4" path="res://addons/godot_state_charts/state_chart.gd" id="2_pqmip"]
[ext_resource type="Script" path="res://godot_state_charts_examples/history_states/history_demo.gd" id="2_vphtk"] [ext_resource type="Script" uid="uid://bad613wfktgah" path="res://godot_state_charts_examples/history_states/history_demo.gd" id="2_vphtk"]
[ext_resource type="Script" path="res://addons/godot_state_charts/compound_state.gd" id="3_nsw2j"] [ext_resource type="Script" uid="uid://jk2jm1g6q853" path="res://addons/godot_state_charts/compound_state.gd" id="3_nsw2j"]
[ext_resource type="Script" path="res://addons/godot_state_charts/history_state.gd" id="4_0qaqv"] [ext_resource type="Script" uid="uid://b4dwolbvt8our" path="res://addons/godot_state_charts/history_state.gd" id="4_0qaqv"]
[ext_resource type="Script" path="res://addons/godot_state_charts/atomic_state.gd" id="5_lh5sp"] [ext_resource type="Script" uid="uid://cytafq8i1y8qm" path="res://addons/godot_state_charts/atomic_state.gd" id="5_lh5sp"]
[ext_resource type="Script" path="res://addons/godot_state_charts/transition.gd" id="6_xvm5g"] [ext_resource type="Script" uid="uid://cf1nsco3w0mf6" path="res://addons/godot_state_charts/transition.gd" id="6_xvm5g"]
[ext_resource type="Theme" uid="uid://s2bj74tt0y7f" path="res://godot_state_charts_examples/new_theme.tres" id="8_najew"] [ext_resource type="Theme" uid="uid://s2bj74tt0y7f" path="res://godot_state_charts_examples/new_theme.tres" id="8_najew"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_kl3ga"] [sub_resource type="RectangleShape2D" id="RectangleShape2D_kl3ga"]

View File

@ -1,26 +1,30 @@
[gd_scene load_steps=38 format=3 uid="uid://bei4nhkf8lwdo"] [gd_scene load_steps=45 format=3 uid="uid://bei4nhkf8lwdo"]
[ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"] [ext_resource type="Script" uid="uid://bbbrf5ckydfna" path="res://player_controller/Scripts/PlayerController.cs" id="1_poq2x"]
[ext_resource type="Curve" uid="uid://c2a8soliruf35" path="res://systems/dash/dash_time_dilation.tres" id="2_2q0ik"]
[ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"] [ext_resource type="Resource" uid="uid://bl5crtu1gkrtr" path="res://systems/inputs/base_mode/base_mode.tres" id="3_cresl"]
[ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"] [ext_resource type="Resource" uid="uid://cpdaw41ah5gic" path="res://systems/inputs/base_mode/rotate_y.tres" id="4_rxwoh"]
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"] [ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="5_4u7i3"]
[ext_resource type="Script" uid="uid://dv7v1ywmbvvcd" path="res://player_controller/Scripts/HealthSystem.cs" id="5_umw0l"] [ext_resource type="Script" uid="uid://dv7v1ywmbvvcd" path="res://player_controller/Scripts/HealthSystem.cs" id="5_umw0l"]
[ext_resource type="Script" uid="uid://vuq8rjq3vegn" path="res://player_controller/Scripts/Stamina.cs" id="6_lxtc4"] [ext_resource type="Script" uid="uid://vuq8rjq3vegn" path="res://player_controller/Scripts/Stamina.cs" id="6_lxtc4"]
[ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"] [ext_resource type="Script" uid="uid://cwbvxlfvmocc1" path="res://player_controller/Scripts/StairsSystem.cs" id="7_bmt5a"]
[ext_resource type="Resource" uid="uid://dgfww8118d8gj" path="res://systems/inputs/base_mode/aim.tres" id="7_cresl"]
[ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/base_mode/aim_release.tres" id="8_lhb11"] [ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/base_mode/aim_release.tres" id="8_lhb11"]
[ext_resource type="Script" uid="uid://dd1yrt7eiiyf4" path="res://player_controller/Scripts/CapsuleCollider.cs" id="8_lmtjd"] [ext_resource type="Script" uid="uid://dd1yrt7eiiyf4" path="res://player_controller/Scripts/CapsuleCollider.cs" id="8_lmtjd"]
[ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="8_obsfv"] [ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="8_obsfv"]
[ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"] [ext_resource type="PackedScene" uid="uid://wq1okogkhc5l" path="res://systems/mantle/mantle_system.tscn" id="8_qu4wy"]
[ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="9_5p2qc"] [ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="9_5p2qc"]
[ext_resource type="Script" uid="uid://bt0xv2q8iv1vn" path="res://player_controller/Scripts/Gravity.cs" id="9_lsueh"] [ext_resource type="Script" uid="uid://bt0xv2q8iv1vn" path="res://player_controller/Scripts/Gravity.cs" id="9_lsueh"]
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="9_nob5r"]
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"] [ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="10_4u7i3"]
[ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"] [ext_resource type="Script" uid="uid://g8idirw62qe0" path="res://player_controller/Scripts/Bobbing.cs" id="10_7wk1w"]
[ext_resource type="Resource" uid="uid://b334rau1yxmm7" path="res://systems/inputs/base_mode/empower_down.tres" id="10_nodcl"]
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"] [ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"]
[ext_resource type="Resource" uid="uid://bbce5wfwxpns1" path="res://systems/inputs/base_mode/empower_release.tres" id="11_ruloh"]
[ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"] [ext_resource type="PackedScene" uid="uid://0ysqmqphq6mq" path="res://systems/head/head_system.tscn" id="11_rxwoh"]
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/drop.tres" id="12_34snm"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="12_34snm"]
[ext_resource type="Script" uid="uid://b6k73aj5povgv" path="res://player_controller/Scripts/FieldOfView.cs" id="12_m2mxi"] [ext_resource type="Script" uid="uid://b6k73aj5povgv" path="res://player_controller/Scripts/FieldOfView.cs" id="12_m2mxi"]
[ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"] [ext_resource type="Shape3D" uid="uid://keseacdcooot" path="res://player_controller/resources/PlayerShape.tres" id="13_r7i3q"]
[ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="16_nob5r"]
[ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"] [ext_resource type="Script" uid="uid://b5nk6ntlps3x0" path="res://systems/inputs/input_system.gd" id="16_v31n3"]
[ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="17_h6vvl"] [ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="17_h6vvl"]
[ext_resource type="PackedScene" uid="uid://cqduhd4opgwvm" path="res://systems/dash/dash_system.tscn" id="18_q5h8a"] [ext_resource type="PackedScene" uid="uid://cqduhd4opgwvm" path="res://systems/dash/dash_system.tscn" id="18_q5h8a"]
@ -36,15 +40,23 @@
[ext_resource type="PackedScene" uid="uid://ckm3d6k08a72u" path="res://systems/weapon/weapon.tscn" id="29_wv70j"] [ext_resource type="PackedScene" uid="uid://ckm3d6k08a72u" path="res://systems/weapon/weapon.tscn" id="29_wv70j"]
[ext_resource type="Script" uid="uid://bhuwv2nlcrunt" path="res://player_controller/PlayerUi.cs" id="30_2ghaa"] [ext_resource type="Script" uid="uid://bhuwv2nlcrunt" path="res://player_controller/PlayerUi.cs" id="30_2ghaa"]
[ext_resource type="Texture2D" uid="uid://bnwj7ltdfximr" path="res://icon.svg" id="30_h23go"] [ext_resource type="Texture2D" uid="uid://bnwj7ltdfximr" path="res://icon.svg" id="30_h23go"]
[ext_resource type="Texture2D" uid="uid://chvt6g0xn5c2m" path="res://systems/dash/light-ring.jpg" id="32_lgpc8"]
[ext_resource type="Script" uid="uid://b4dwolbvt8our" path="res://addons/godot_state_charts/history_state.gd" id="41_ruloh"]
[sub_resource type="CapsuleMesh" id="CapsuleMesh_xc2g5"] [sub_resource type="CapsuleMesh" id="CapsuleMesh_xc2g5"]
height = 1.7 height = 1.7
[sub_resource type="CanvasItemMaterial" id="CanvasItemMaterial_2q0ik"]
blend_mode = 1
[node name="Player" type="CharacterBody3D"] [node name="Player" type="CharacterBody3D"]
script = ExtResource("1_poq2x") script = ExtResource("1_poq2x")
TimeScaleAimInAir = 0.15 TimeScaleAimInAir = 0.15
MaxJumpBoostAfterDashing = 0.7 MaxJumpBoostAfterDashing = 0.7
MaxNumberOfDashActions = 2 MaxNumberOfDashActions = 2
PerfectlyTimedActionTimer = 0.3
BasicDashStrength = 15.0
DashTimeDilationCurve = ExtResource("2_2q0ik")
[node name="InputController" type="Node3D" parent="."] [node name="InputController" type="Node3D" parent="."]
script = ExtResource("16_v31n3") script = ExtResource("16_v31n3")
@ -52,13 +64,16 @@ base_mode = ExtResource("3_cresl")
move = ExtResource("17_h6vvl") move = ExtResource("17_h6vvl")
rotate_y = ExtResource("4_rxwoh") rotate_y = ExtResource("4_rxwoh")
rotate_floorplane = ExtResource("5_4u7i3") rotate_floorplane = ExtResource("5_4u7i3")
aim_pressed = ExtResource("7_cresl")
aim_down = ExtResource("8_obsfv") aim_down = ExtResource("8_obsfv")
aim_pressed = ExtResource("9_nob5r")
aim_released = ExtResource("8_lhb11") aim_released = ExtResource("8_lhb11")
empower_down = ExtResource("10_nodcl")
empower_released = ExtResource("11_ruloh")
aim_canceled = ExtResource("9_5p2qc") aim_canceled = ExtResource("9_5p2qc")
jump = ExtResource("10_4u7i3") jump = ExtResource("10_4u7i3")
hit = ExtResource("11_cresl") hit = ExtResource("11_cresl")
drop = ExtResource("12_34snm") dash = ExtResource("12_34snm")
throw = ExtResource("16_nob5r")
[node name="MeshInstance3D" type="MeshInstance3D" parent="."] [node name="MeshInstance3D" type="MeshInstance3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.85, 0) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.85, 0)
@ -122,9 +137,11 @@ target_position = Vector3(0, 1, 0)
[node name="MoveSystem" type="Node3D" parent="."] [node name="MoveSystem" type="Node3D" parent="."]
script = ExtResource("20_rxwoh") script = ExtResource("20_rxwoh")
WalkSpeed = 7.2 WalkSpeed = 7.0
DecelerationSpeedFactorFloor = 7.0 SprintSpeed = 7.0
ApexHoldTime = 0.1 AccelerationSpeedFactorFloor = 3.0
ApexHoldTime = 0.2
WallHugGravityReducingFactor = 0.2
[node name="Gravity" type="Node3D" parent="."] [node name="Gravity" type="Node3D" parent="."]
script = ExtResource("9_lsueh") script = ExtResource("9_lsueh")
@ -182,6 +199,10 @@ ignore_time_scale = true
wait_time = 0.3 wait_time = 0.3
one_shot = true one_shot = true
[node name="EmpowerTimeDownscale" type="Timer" parent="."]
one_shot = true
ignore_time_scale = true
[node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")] [node name="StateChartDebugger" parent="." instance=ExtResource("24_q5h8a")]
offset_left = 1524.0 offset_left = 1524.0
offset_top = 1.0 offset_top = 1.0
@ -220,6 +241,25 @@ layout_mode = 2
texture = ExtResource("30_h23go") texture = ExtResource("30_h23go")
expand_mode = 2 expand_mode = 2
[node name="CenterContainer" type="CenterContainer" parent="UI"]
custom_minimum_size = Vector2(1920, 1080)
offset_right = 1919.0
offset_bottom = 1080.0
[node name="CenterIcon" type="TextureRect" parent="UI/CenterContainer"]
material = SubResource("CanvasItemMaterial_2q0ik")
custom_minimum_size = Vector2(5, 5)
layout_mode = 2
texture = ExtResource("32_lgpc8")
expand_mode = 1
[node name="DashIndicator" type="TextureRect" parent="UI/CenterContainer"]
unique_name_in_owner = true
material = SubResource("CanvasItemMaterial_2q0ik")
layout_mode = 2
texture = ExtResource("32_lgpc8")
expand_mode = 1
[node name="StateChart" type="Node" parent="."] [node name="StateChart" type="Node" parent="."]
script = ExtResource("25_wv70j") script = ExtResource("25_wv70j")
metadata/_custom_type_script = "uid://couw105c3bde4" metadata/_custom_type_script = "uid://couw105c3bde4"
@ -227,99 +267,132 @@ metadata/_custom_type_script = "uid://couw105c3bde4"
[node name="Root" type="Node" parent="StateChart"] [node name="Root" type="Node" parent="StateChart"]
script = ExtResource("27_infe6") script = ExtResource("27_infe6")
[node name="Actions" type="Node" parent="StateChart/Root"] [node name="Aim" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("WeaponInHand") initial_state = NodePath("Off")
metadata/_custom_type_script = "uid://c1vp0ojjvaby1"
[node name="AimCanceled" type="Node" parent="StateChart/Root/Actions"] [node name="ToOff" type="Node" parent="StateChart/Root/Aim"]
script = ExtResource("27_34snm")
[node name="ToWeaponInHand" type="Node" parent="StateChart/Root/Actions/AimCanceled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand") to = NodePath("../Off")
event = &"aim_released" event = &"aim_released"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="WeaponInHand" type="Node" parent="StateChart/Root/Actions"] [node name="Off" type="Node" parent="StateChart/Root/Aim"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="ToAiming" type="Node" parent="StateChart/Root/Actions/WeaponInHand"] [node name="ToOn" type="Node" parent="StateChart/Root/Aim/Off"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Aiming") to = NodePath("../../On")
event = &"aim_down" event = &"aim_down"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Aiming" type="Node" parent="StateChart/Root/Actions"] [node name="On" type="Node" parent="StateChart/Root/Aim"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="ToWeaponInHand" type="Node" parent="StateChart/Root/Actions/Aiming"] [node name="ToCancel" type="Node" parent="StateChart/Root/Aim/On"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../AimCanceled") to = NodePath("../../Canceled")
event = &"aim_canceled" event = &"cancel_aim"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="ToDashing" type="Node" parent="StateChart/Root/Actions/Aiming"] [node name="Canceled" type="Node" parent="StateChart/Root/Aim"]
script = ExtResource("27_34snm")
[node name="Empower" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6")
initial_state = NodePath("Off")
[node name="Off" type="Node" parent="StateChart/Root/Empower"]
script = ExtResource("27_34snm")
[node name="ToOn" type="Node" parent="StateChart/Root/Empower/Off"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Dashing") to = NodePath("../../On")
event = &"aim_released" event = &"empower_down"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="ToWeaponThrown" type="Node" parent="StateChart/Root/Actions/Aiming"] [node name="On" type="Node" parent="StateChart/Root/Empower"]
script = ExtResource("27_34snm")
[node name="ToOff" type="Node" parent="StateChart/Root/Empower/On"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponThrown") to = NodePath("../../Off")
event = &"hit_pressed" event = &"empower_released"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Actions" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6")
initial_state = NodePath("Default")
[node name="Default" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm")
[node name="Jumping" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm")
[node name="Dashing" type="Node" parent="StateChart/Root/Actions"] [node name="Dashing" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="ToWeaponInHand" type="Node" parent="StateChart/Root/Actions/Dashing"] [node name="Hitting" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand")
event = &"dash_ended"
delay_in_seconds = "0.0"
[node name="ToHanging" type="Node" parent="StateChart/Root/Actions/Dashing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Hanging")
event = &"dash_to_planted"
delay_in_seconds = "0.0"
[node name="WeaponThrown" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnAim" type="Node" parent="StateChart/Root/Actions/WeaponThrown"] [node name="Throwing" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Dashing")
event = &"aim_pressed"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Actions"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Actions/Hanging"] [node name="WeaponState" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6")
initial_state = NodePath("InHand")
metadata/_custom_type_script = "uid://c1vp0ojjvaby1"
[node name="ToPlanted" type="Node" parent="StateChart/Root/WeaponState"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand") to = NodePath("../Planted")
event = &"jump" event = &"plant_weapon"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnDrop" type="Node" parent="StateChart/Root/Actions/Hanging"] [node name="ToHand" type="Node" parent="StateChart/Root/WeaponState"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand") to = NodePath("../InHand")
event = &"crouch" event = &"recover_weapond"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Actions/Hanging"] [node name="InHand" type="Node" parent="StateChart/Root/WeaponState"]
script = ExtResource("27_34snm")
[node name="ToThrown" type="Node" parent="StateChart/Root/WeaponState/InHand"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../WeaponInHand") to = NodePath("../../Flying")
event = &"mantle" event = &"throw"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Flying" type="Node" parent="StateChart/Root/WeaponState"]
script = ExtResource("27_34snm")
[node name="ToPlanted" type="Node" parent="StateChart/Root/WeaponState/Flying"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Planted")
event = &"plant_weapon"
delay_in_seconds = "0.0"
[node name="Planted" type="Node" parent="StateChart/Root/WeaponState"]
script = ExtResource("27_34snm")
[node name="Movement" type="Node" parent="StateChart/Root"] [node name="Movement" type="Node" parent="StateChart/Root"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Grounded") initial_state = NodePath("Grounded")
[node name="OnFall" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Airborne/Falling")
event = &"falling"
delay_in_seconds = "0.0"
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Grounded/Standing")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="OnMantle" type="Node" parent="StateChart/Root/Movement"] [node name="OnMantle" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../Mantling") to = NodePath("../Mantling")
@ -328,10 +401,41 @@ delay_in_seconds = "0.0"
[node name="OnHang" type="Node" parent="StateChart/Root/Movement"] [node name="OnHang" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../Hanging") to = NodePath("../OnWall/Hanging")
event = &"dash_to_planted" event = &"dash_to_planted"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnDash" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("28_n7qhm")
to = NodePath("../Dashing")
event = &"dash"
delay_in_seconds = "0.0"
[node name="Dashing" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnDashEnded" type="Node" parent="StateChart/Root/Movement/Dashing"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/Reset")
event = &"dash_ended"
delay_in_seconds = "0.0"
[node name="Mantling" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="Jump" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6")
initial_state = NodePath("Normal")
[node name="Normal" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm")
[node name="Double" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm")
[node name="Empowered" type="Node" parent="StateChart/Root/Movement/Jump"]
script = ExtResource("27_34snm")
[node name="Grounded" type="Node" parent="StateChart/Root/Movement"] [node name="Grounded" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("Standing") initial_state = NodePath("Standing")
@ -341,7 +445,7 @@ script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Standing"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Jump") to = NodePath("../../../Airborne/DoubleJumpEnabled")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
@ -362,7 +466,7 @@ script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Grounded/Crouched"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/Jump") to = NodePath("../../../Airborne/DoubleJumpEnabled")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
@ -378,67 +482,26 @@ to = NodePath("../../Standing")
event = &"crouch" event = &"crouch"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Mantling" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="ToGrounded" type="Node" parent="StateChart/Root/Movement/Mantling"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Grounded/Standing")
event = &"to_grounded"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/JumpFromWall")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/CoyoteEnabled")
event = &"crouch"
delay_in_seconds = "0.0"
[node name="Airborne" type="Node" parent="StateChart/Root/Movement"] [node name="Airborne" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6") script = ExtResource("26_infe6")
initial_state = NodePath("CoyoteEnabled") initial_state = NodePath("CoyoteEnabled")
[node name="OnGrounded" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="Reset" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm") script = ExtResource("41_ruloh")
to = NodePath("../../Grounded/Standing") default_state = NodePath("../CoyoteEnabled")
event = &"grounded"
delay_in_seconds = "0.0"
[node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="OnWallHug" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../WallHugging") to = NodePath("../../OnWall/Hugging")
event = &"wall_hug" event = &"wall_hug"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="WallHugging" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/WallHugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../JumpFromWall")
event = &"jump"
delay_in_seconds = "0.0"
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/Airborne/WallHugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
event = &"start_falling"
delay_in_seconds = "0.0"
[node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="CoyoteEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/CoyoteEnabled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../Jump") to = NodePath("../../DoubleJumpEnabled")
event = &"jump" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
@ -448,52 +511,13 @@ to = NodePath("../../DoubleJumpEnabled")
event = &"coyote_expired" event = &"coyote_expired"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Jump" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="ToDoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne/Jump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJumpEnabled")
event = &"to_double_jump"
delay_in_seconds = "0.0"
[node name="ToFalling" type="Node" parent="StateChart/Root/Movement/Airborne/Jump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
event = &"jump_from_dash"
delay_in_seconds = "0.0"
[node name="JumpFromWall" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="JumpedFromWall" type="Node" parent="StateChart/Root/Movement/Airborne/JumpFromWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
event = &"jump_from_wall"
delay_in_seconds = "0.0"
[node name="ToFalling" type="Node" parent="StateChart/Root/Movement/Airborne/JumpFromWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling")
event = &"jump_from_dash"
delay_in_seconds = "0.0"
[node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="DoubleJumpEnabled" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm") script = ExtResource("27_34snm")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"] [node name="OnJump" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJumpEnabled"]
script = ExtResource("28_n7qhm") script = ExtResource("28_n7qhm")
to = NodePath("../../DoubleJump")
event = &"jump"
delay_in_seconds = "0.0"
[node name="DoubleJump" type="Node" parent="StateChart/Root/Movement/Airborne"]
script = ExtResource("27_34snm")
[node name="ToFalling" type="Node" parent="StateChart/Root/Movement/Airborne/DoubleJump"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Falling") to = NodePath("../../Falling")
event = &"to_falling" event = &"jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"] [node name="Falling" type="Node" parent="StateChart/Root/Movement/Airborne"]
@ -505,13 +529,44 @@ to = NodePath("../../DoubleJumpEnabled")
event = &"enable_double_jump" event = &"enable_double_jump"
delay_in_seconds = "0.0" delay_in_seconds = "0.0"
[node name="OnWall" type="Node" parent="StateChart/Root/Movement"]
script = ExtResource("26_infe6")
initial_state = NodePath("Hugging")
[node name="OnJump" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("28_n7qhm")
to = NodePath("../../Airborne/DoubleJumpEnabled")
event = &"jump"
delay_in_seconds = "0.0"
[node name="Hugging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm")
[node name="OnLeaveWall" type="Node" parent="StateChart/Root/Movement/OnWall/Hugging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"start_falling"
delay_in_seconds = "0.0"
[node name="Hanging" type="Node" parent="StateChart/Root/Movement/OnWall"]
script = ExtResource("27_34snm")
[node name="OnDrop" type="Node" parent="StateChart/Root/Movement/OnWall/Hanging"]
script = ExtResource("28_n7qhm")
to = NodePath("../../../Airborne/CoyoteEnabled")
event = &"cancel"
delay_in_seconds = "0.0"
[connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"] [connection signal="input_aim_canceled" from="InputController" to="." method="OnInputAimCanceled"]
[connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"] [connection signal="input_aim_down" from="InputController" to="." method="OnInputAimDown"]
[connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"] [connection signal="input_aim_pressed" from="InputController" to="." method="OnInputAimPressed"]
[connection signal="input_aim_released" from="InputController" to="." method="OnInputAimReleased"] [connection signal="input_aim_released" from="InputController" to="." method="OnInputAimReleased"]
[connection signal="input_drop" from="InputController" to="." method="OnInputDropPressed"] [connection signal="input_dash" from="InputController" to="." method="OnInputDashPressed"]
[connection signal="input_empower_down" from="InputController" to="." method="OnInputEmpowerDown"]
[connection signal="input_empower_released" from="InputController" to="." method="OnInputEmpowerReleased"]
[connection signal="input_hit" from="InputController" to="." method="OnInputHitPressed"] [connection signal="input_hit" from="InputController" to="." method="OnInputHitPressed"]
[connection signal="input_jump" from="InputController" to="." method="OnInputJumpPressed"] [connection signal="input_jump" from="InputController" to="." method="OnInputJumpPressed"]
[connection signal="input_move" from="InputController" to="." method="OnInputMove"] [connection signal="input_move" from="InputController" to="." method="OnInputMove"]
[connection signal="input_rotate_floorplane" from="InputController" to="." method="OnInputRotateFloorplane"] [connection signal="input_rotate_floorplane" from="InputController" to="." method="OnInputRotateFloorplane"]
[connection signal="input_rotate_y" from="InputController" to="." method="OnInputRotateY"] [connection signal="input_rotate_y" from="InputController" to="." method="OnInputRotateY"]
[connection signal="input_throw" from="InputController" to="." method="OnInputThrowPressed"]

View File

@ -24,6 +24,7 @@ public partial class PlayerController : CharacterBody3D
public WeaponSystem WeaponSystem; public WeaponSystem WeaponSystem;
public WallHugSystem WallHugSystem; public WallHugSystem WallHugSystem;
public PlayerUi PlayerUi; public PlayerUi PlayerUi;
public TextureRect DashIndicator;
private bool _movementEnabled = true; private bool _movementEnabled = true;
@ -45,6 +46,7 @@ public partial class PlayerController : CharacterBody3D
private Timer _timeScaleAimInAirTimer; private Timer _timeScaleAimInAirTimer;
private Timer _timeAfterDashingTimer; private Timer _timeAfterDashingTimer;
private Timer _dashCooldownTimer; private Timer _dashCooldownTimer;
private Timer _empowerTimeDownscale;
[Export(PropertyHint.Range, "0,1,0.01,or_greater")] [Export(PropertyHint.Range, "0,1,0.01,or_greater")]
public float TimeScaleAimInAir { get; set; } = 0.2f; public float TimeScaleAimInAir { get; set; } = 0.2f;
@ -53,40 +55,52 @@ public partial class PlayerController : CharacterBody3D
[Export(PropertyHint.Range, "0,5,1,or_greater")] [Export(PropertyHint.Range, "0,5,1,or_greater")]
public int MaxNumberOfDashActions { get; set; } = 1; public int MaxNumberOfDashActions { get; set; } = 1;
[Export(PropertyHint.Range, "0,200,1,or_greater")]
public int DashIndicatorStartSize { get; set; } = 100;
[Export(PropertyHint.Range, "0,1,0.01")]
public float PerfectlyTimedActionTimer { get; set; } = 0.8f;
[Export(PropertyHint.Range, "0,50,0.1")]
public float BasicDashStrength { get; set; } = 10f;
private int _dashActionsLeft; [Export]
public int DashActionsLeft public Curve DashTimeDilationCurve { get; set; }
private bool _canDash = true;
private int _empoweredActionsLeft;
public int EmpoweredActionsLeft
{ {
get => _dashActionsLeft; get => _empoweredActionsLeft;
set set
{ {
_dashActionsLeft = value; _empoweredActionsLeft = value;
PlayerUi.SetNumberOfDashesLeft(value); PlayerUi.SetNumberOfDashesLeft(value);
} }
} }
private bool _isWallJumpAvailable = true; private bool _isWallJumpAvailable = true;
private bool _isActionPerfectlyTimed = false;
private StateChart _playerState; private StateChart _playerState;
// Actions state
private StateChartState _weaponInHand; private StateChartState _weaponInHand;
private StateChartState _aiming; private StateChartState _aiming;
private StateChartState _dashing; private StateChartState _dashing;
private StateChartState _weaponThrown; private StateChartState _weaponThrown;
private StateChartState _actionHanging; private StateChartState _actionHanging;
// Movement state private StateChartState _empowerOn;
private StateChartState _empowerOff;
private StateChartState _grounded; private StateChartState _grounded;
private StateChartState _crouched; private StateChartState _crouched;
private StateChartState _standing; private StateChartState _standing;
private StateChartState _mantling; private StateChartState _mantling;
private StateChartState _movHanging; private StateChartState _movHanging;
private StateChartState _wallHugging;
private StateChartState _airborne; private StateChartState _airborne;
private StateChartState _coyoteEnabled; private StateChartState _coyoteEnabled;
private StateChartState _jump;
private StateChartState _jumpFromWall;
private StateChartState _doubleJumpEnabled; private StateChartState _doubleJumpEnabled;
private StateChartState _doubleJump; private StateChartState _onWall;
private StateChartState _onWallHugging;
private StateChartState _onWallHanging;
private StateChartState _falling; private StateChartState _falling;
public override void _Ready() public override void _Ready()
@ -98,6 +112,8 @@ public partial class PlayerController : CharacterBody3D
// General use stuff // General use stuff
TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem"); TweenQueueSystem = GetNode<TweenQueueSystem>("TweenQueueSystem");
PlayerUi = GetNode<PlayerUi>("UI"); PlayerUi = GetNode<PlayerUi>("UI");
DashIndicator = GetNode<TextureRect>("%DashIndicator");
// Node3D mapNode = GetTree().Root.FindChild("Map", true, false) as Node3D; // Node3D mapNode = GetTree().Root.FindChild("Map", true, false) as Node3D;
// Camera stuff // Camera stuff
@ -137,31 +153,33 @@ public partial class PlayerController : CharacterBody3D
// State management // State management
_playerState = StateChart.Of(GetNode("StateChart")); _playerState = StateChart.Of(GetNode("StateChart"));
// Actions states
_weaponInHand = StateChartState.Of(GetNode("StateChart/Root/Actions/WeaponInHand")); _weaponInHand = StateChartState.Of(GetNode("StateChart/Root/WeaponState/InHand"));
_aiming = StateChartState.Of(GetNode("StateChart/Root/Actions/Aiming")); _weaponThrown = StateChartState.Of(GetNode("StateChart/Root/WeaponState/Flying"));
_dashing = StateChartState.Of(GetNode("StateChart/Root/Actions/Dashing")); _aiming = StateChartState.Of(GetNode("StateChart/Root/Aim/On"));
_weaponThrown = StateChartState.Of(GetNode("StateChart/Root/Actions/WeaponThrown")); _dashing = StateChartState.Of(GetNode("StateChart/Root/Movement/Dashing"));
_actionHanging = StateChartState.Of(GetNode("StateChart/Root/Actions/Hanging")); // _actionHanging = StateChartState.Of(GetNode("StateChart/Root/Actions/Hanging"));
// Movement states _empowerOn = StateChartState.Of(GetNode("StateChart/Root/Empower/On"));
_empowerOff = StateChartState.Of(GetNode("StateChart/Root/Empower/Off"));
_grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded")); _grounded = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded"));
_standing = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Standing")); _standing = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Standing"));
_crouched = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Crouched")); _crouched = StateChartState.Of(GetNode("StateChart/Root/Movement/Grounded/Crouched"));
_mantling = StateChartState.Of(GetNode("StateChart/Root/Movement/Mantling")); _mantling = StateChartState.Of(GetNode("StateChart/Root/Movement/Mantling"));
_movHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/Hanging")); _movHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
_airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne")); _airborne = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne"));
_wallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/WallHugging"));
_coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled")); _coyoteEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/CoyoteEnabled"));
_jump = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/Jump"));
_jumpFromWall = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/JumpFromWall"));
_doubleJumpEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJumpEnabled")); _doubleJumpEnabled = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJumpEnabled"));
_doubleJump = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/DoubleJump")); _onWall = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall"));
_onWallHugging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hugging"));
_onWallHanging = StateChartState.Of(GetNode("StateChart/Root/Movement/OnWall/Hanging"));
_falling = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/Falling")); _falling = StateChartState.Of(GetNode("StateChart/Root/Movement/Airborne/Falling"));
// State timers // State timers
_coyoteTimer = GetNode<Timer>("CoyoteTime"); _coyoteTimer = GetNode<Timer>("CoyoteTime");
_dashCooldownTimer = GetNode<Timer>("DashCooldown"); _dashCooldownTimer = GetNode<Timer>("DashCooldown");
_timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir"); _timeScaleAimInAirTimer = GetNode<Timer>("TimeScaleAimInAir");
_timeAfterDashingTimer = GetNode<Timer>("TimeAfterDashing"); _timeAfterDashingTimer = GetNode<Timer>("TimeAfterDashing");
_empowerTimeDownscale = GetNode<Timer>("EmpowerTimeDownscale");
/////////////////////////// ///////////////////////////
// Initialize components // // Initialize components //
@ -202,36 +220,61 @@ public partial class PlayerController : CharacterBody3D
HealthSystem.Init(healthSystemParams); HealthSystem.Init(healthSystemParams);
Stamina.SetSpeeds(MoveSystem.WalkSpeed, MoveSystem.SprintSpeed); Stamina.SetSpeeds(MoveSystem.WalkSpeed, MoveSystem.SprintSpeed);
DashActionsLeft = MaxNumberOfDashActions; EmpoweredActionsLeft = MaxNumberOfDashActions;
/////////////////////////// ///////////////////////////
// Signal setup /////////// // Signal setup ///////////
/////////////////////////// ///////////////////////////
DashSystem.DashEnded += OnDashEnded; DashSystem.DashEnded += OnDashEnded;
DashSystem.DashProgress += OnDashProgress;
_weaponInHand.StateProcessing += HandleWeaponInHand; _weaponInHand.StateProcessing += HandleWeaponInHand;
_aiming.StateProcessing += HandleAiming; _aiming.StateProcessing += HandleAiming;
_aiming.StateEntered += OnAimingEntered; _aiming.StateEntered += OnAimingEntered;
_aiming.StateExited += ResetTimeScale; _aiming.StateExited += ResetTimeScale;
_aiming.StateExited += OnAimingExited;
/*_crouched.StatePhysicsProcessing += HandleGroundedCrouched;
_standing.StatePhysicsProcessing += HandleGroundedStanding;*/
_grounded.StateEntered += OnGrounded; _grounded.StateEntered += OnGrounded;
_grounded.StatePhysicsProcessing += HandleGrounded; _grounded.StatePhysicsProcessing += HandleGrounded;
_airborne.StatePhysicsProcessing += HandleAirborne; _airborne.StatePhysicsProcessing += HandleAirborne;
_wallHugging.StatePhysicsProcessing += HandleWallHugging; _onWallHugging.StatePhysicsProcessing += HandleWallHugging;
_coyoteEnabled.StateEntered += StartCoyoteTime; _coyoteEnabled.StateEntered += StartCoyoteTime;
_coyoteTimer.Timeout += CoyoteExpired; _coyoteTimer.Timeout += CoyoteExpired;
_timeScaleAimInAirTimer.Timeout += ResetTimeScale; _timeScaleAimInAirTimer.Timeout += ResetTimeScale;
_jump.StateEntered += Jump;
_jumpFromWall.StateEntered += JumpFromWall;
_doubleJump.StateEntered += DoubleJump;
_mantling.StateEntered += Mantle;
_dashing.StateEntered += OnDashStarted; _dashing.StatePhysicsProcessing += Dashing;
_weaponThrown.StateEntered += OnWeaponThrown; // _weaponThrown.StateEntered += OnWeaponThrown;
_empowerOn.StateEntered += OnEmpowerStarted;
_empowerOn.StateProcessing += HandleEmpower;
_empowerTimeDownscale.Timeout += EmpowerStopped;
}
public void OnEmpowerStarted()
{
_empowerTimeDownscale.Start();
_isActionPerfectlyTimed = true;
Engine.SetTimeScale(0.1f);
}
public void HandleEmpower(float delta)
{
var progress = (float) (_empowerTimeDownscale.TimeLeft / _empowerTimeDownscale.WaitTime);
_isActionPerfectlyTimed = progress < PerfectlyTimedActionTimer;
var indicatorColor = _isActionPerfectlyTimed ? Colors.Green : Colors.White;
DashIndicator.SetCustomMinimumSize(Vector2.One * DashIndicatorStartSize * progress);
DashIndicator.SetModulate(indicatorColor);
DashIndicator.Visible = true;
}
public void EmpowerStopped()
{
DashIndicator.Visible = false;
ResetTimeScale();
_isActionPerfectlyTimed = false;
} }
/////////////////////////// ///////////////////////////
@ -253,6 +296,10 @@ public partial class PlayerController : CharacterBody3D
public void OnInputAimPressed() public void OnInputAimPressed()
{ {
_playerState.SendEvent("aim_pressed"); _playerState.SendEvent("aim_pressed");
if (!WeaponSystem.InHandState.Active)
{
OnDashStarted();
}
} }
public void OnInputAimDown() public void OnInputAimDown()
{ {
@ -264,27 +311,92 @@ public partial class PlayerController : CharacterBody3D
} }
public void OnInputAimCanceled() public void OnInputAimCanceled()
{ {
_playerState.SendEvent("aim_canceled"); _playerState.SendEvent("cancel");
DashSystem.CancelDash(); DashSystem.CancelDash();
} }
public void OnInputHitPressed() public void OnInputHitPressed()
{ {
_playerState.SendEvent("hit_pressed"); if (_aiming.Active)
{
OnWeaponThrown();
}
} }
public void OnInputJumpPressed() public void OnInputJumpPressed()
{ {
if (MoveSystem.CanMantle()) if (MoveSystem.CanMantle())
{ {
_playerState.SendEvent("mantle"); Mantle();
return;
}
if (_grounded.Active || _coyoteEnabled.Active)
if (_empowerOn.Active && CanPerformEmpoweredAction())
{
PerformEmpoweredAction();
PerformJump(MoveSystem.JumpTypes.JumpFromDash);
}
else
PerformJump(MoveSystem.JumpTypes.SimpleJump);
else if (_doubleJumpEnabled.Active)
if (_empowerOn.Active && CanPerformEmpoweredAction())
{
PerformEmpoweredAction();
PerformJump(MoveSystem.JumpTypes.JumpFromDash);
}
else
PerformJump(MoveSystem.JumpTypes.DoubleJump);
else if (_onWall.Active)
JumpFromWall(_empowerOn.Active);
_playerState.SendEvent("jump");
}
public void OnInputDashPressed()
{
_playerState.SendEvent("dash");
PerformDash(_empowerOn.Active);
}
public void OnInputThrowPressed()
{
}
public void OnInputEmpowerDown()
{
_playerState.SendEvent("empower_down");
}
public void OnInputEmpowerReleased()
{
_playerState.SendEvent("empower_released");
}
public void PerformDash(bool isEmpowered)
{
if (_aiming.Active)
{
OnDashStarted();
return; return;
} }
_playerState.SendEvent("jump"); if (!_canDash)
return;
_canDash = false;
var dashStrength = BasicDashStrength;
if (isEmpowered && CanPerformEmpoweredAction())
{
PerformEmpoweredAction();
dashStrength *= 2.5f;
}
var direction = HeadSystem.Transform.Basis * _inputMove;
var planarDirection = new Vector3(direction.X, 0, direction.Z).Normalized();
SetVelocity(planarDirection * dashStrength);
} }
public void OnInputDropPressed()
public void Dashing(float delta)
{ {
_playerState.SendEvent("crouch"); _playerState.SendEvent("dash_ended");
} }
/////////////////////////// ///////////////////////////
// Stateful logic ///////// // Stateful logic /////////
@ -293,20 +405,31 @@ public partial class PlayerController : CharacterBody3D
// Simple states // Simple states
public void OnGrounded() public void OnGrounded()
{ {
DashActionsLeft = MaxNumberOfDashActions; RestoreEmpoweredActions();
}
private void RestoreEmpoweredActions()
{
EmpoweredActionsLeft = MaxNumberOfDashActions;
_isWallJumpAvailable = true; _isWallJumpAvailable = true;
} }
public bool CanPerformDashAction() public bool CanPerformEmpoweredAction()
{ {
return DashActionsLeft > 0 && _dashCooldownTimer.IsStopped(); return EmpoweredActionsLeft > 0;
} }
public void PerformDashAction() public void PerformEmpoweredAction()
{ {
_isWallJumpAvailable = true; _isWallJumpAvailable = true;
_dashCooldownTimer.Start(); _dashCooldownTimer.Start();
DashActionsLeft--;
if (!_isActionPerfectlyTimed)
{
EmpoweredActionsLeft--;
}
_empowerTimeDownscale.Stop();
EmpowerStopped();
} }
// Jumping // Jumping
@ -318,48 +441,23 @@ public partial class PlayerController : CharacterBody3D
{ {
_playerState.SendEvent("coyote_expired"); _playerState.SendEvent("coyote_expired");
} }
public void Jump() public void JumpFromWall(bool isEmpowered)
{
if (_aiming.Active && CanPerformDashAction())
{
_playerState.SendEvent("jump_from_dash");
PerformDashAction();
PerformJump(MoveSystem.JumpTypes.JumpFromDash);
return;
}
_playerState.SendEvent("to_double_jump");
PerformJump(MoveSystem.JumpTypes.SimpleJump);
}
public void JumpFromWall()
{ {
if (!_isWallJumpAvailable) if (!_isWallJumpAvailable)
return; return;
_isWallJumpAvailable = false; _isWallJumpAvailable = false;
var wallNormal = WallHugSystem.GetWallNormal().UnwrapOr(Vector3.Up); var wallNormal = WallHugSystem.GetWallNormal().UnwrapOr(Vector3.Up);
var isLookingTowardsWall = HeadSystem.GetForwardHorizontalVector().Dot(wallNormal) > 0.7; var isLookingTowardsWall = HeadSystem.GetForwardHorizontalVector().Dot(wallNormal) > 0.5;
var jumpDirection = isLookingTowardsWall ? Vector3.Up : wallNormal; var jumpDirection = isLookingTowardsWall ? Vector3.Up : wallNormal;
if (_aiming.Active && CanPerformDashAction()) if (isEmpowered && CanPerformEmpoweredAction())
{ {
_playerState.SendEvent("jump_from_dash"); PerformEmpoweredAction();
PerformDashAction();
PerformJump(MoveSystem.JumpTypes.JumpFromDash, jumpDirection); PerformJump(MoveSystem.JumpTypes.JumpFromDash, jumpDirection);
return; return;
} }
_playerState.SendEvent("jump_from_wall");
PerformJump(MoveSystem.JumpTypes.JumpFromWall, jumpDirection); PerformJump(MoveSystem.JumpTypes.JumpFromWall, jumpDirection);
} }
public void DoubleJump()
{
_playerState.SendEvent("to_falling");
if (_aiming.Active && CanPerformDashAction())
{
PerformDashAction();
PerformJump(MoveSystem.JumpTypes.JumpFromDash);
return;
}
PerformJump(MoveSystem.JumpTypes.DoubleJump);
}
private void PerformJump(MoveSystem.JumpTypes jumpType, Vector3? jumpDirection = null) private void PerformJump(MoveSystem.JumpTypes jumpType, Vector3? jumpDirection = null)
{ {
var effectiveJumpDirection = jumpDirection ?? Vector3.Up; var effectiveJumpDirection = jumpDirection ?? Vector3.Up;
@ -381,19 +479,20 @@ public partial class PlayerController : CharacterBody3D
// Mantling // Mantling
public void Mantle() public void Mantle()
{ {
_playerState.SendEvent("mantle");
var optionTween = MoveSystem.Mantle(); var optionTween = MoveSystem.Mantle();
if (optionTween.IsSome(out var tween)) if (optionTween.IsSome(out var tween))
tween.Finished += MantleFinished; tween.Finished += MantleFinished;
} }
public void MantleFinished() public void MantleFinished()
{ {
_playerState.SendEvent("to_grounded"); _playerState.SendEvent("grounded");
} }
// Dashing and weapon throwing // Dashing and weapon throwing
public void OnDashStarted() public void OnDashStarted()
{ {
if (!CanPerformDashAction()) if (!CanPerformEmpoweredAction())
{ {
_playerState.SendEvent("aim_canceled"); _playerState.SendEvent("aim_canceled");
_playerState.SendEvent("dash_ended"); _playerState.SendEvent("dash_ended");
@ -401,7 +500,7 @@ public partial class PlayerController : CharacterBody3D
return; return;
} }
PerformDashAction(); PerformEmpoweredAction();
_timeAfterDashingTimer.Start(); _timeAfterDashingTimer.Start();
if (WeaponSystem.FlyingState.Active) if (WeaponSystem.FlyingState.Active)
{ {
@ -427,6 +526,17 @@ public partial class PlayerController : CharacterBody3D
_dashDirection = (DashSystem.PlannedPlayerLocation - GlobalPosition).Normalized(); _dashDirection = (DashSystem.PlannedPlayerLocation - GlobalPosition).Normalized();
DashSystem.Dash(); DashSystem.Dash();
} }
public void OnDashProgress(float progress)
{
return;
Engine.SetTimeScale(DashTimeDilationCurve.Sample(progress));
DashIndicator.SetCustomMinimumSize(Vector2.One * DashIndicatorStartSize * (1 - progress));
var indicatorColor = progress < PerfectlyTimedActionTimer ? new Color(1, 1, 1) : new Color(0, 1, 0);
DashIndicator.SetModulate(indicatorColor);
}
public void OnDashEnded() public void OnDashEnded()
{ {
// _playerState.SendEvent("enable_double_jump"); // Allow for double jump after dash -- OP ? // _playerState.SendEvent("enable_double_jump"); // Allow for double jump after dash -- OP ?
@ -465,15 +575,18 @@ public partial class PlayerController : CharacterBody3D
// Weapon planted anywhere else // Weapon planted anywhere else
_playerState.SendEvent("dash_ended"); _playerState.SendEvent("dash_ended");
if (isOnFloorCustom())
RestoreEmpoweredActions(); // Make sure to restore actions if we're still on the ground
} }
public void OnWeaponThrown() public void OnWeaponThrown()
{ {
DashSystem.CancelDash();
_playerState.SendEvent("cancel_aim");
RemoveChild(WeaponRoot); RemoveChild(WeaponRoot);
GetTree().GetRoot().AddChild(WeaponRoot); GetTree().GetRoot().AddChild(WeaponRoot);
WeaponRoot.SetGlobalPosition(GlobalPosition); WeaponRoot.SetGlobalPosition(GlobalPosition);
DashSystem.CancelDash();
var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.TargetLocation; var weaponTargetLocation = DashSystem.HasHit ? DashSystem.CollisionPoint : DashSystem.TargetLocation;
WeaponSystem.ThrowWeapon( WeaponSystem.ThrowWeapon(
weaponTargetLocation, weaponTargetLocation,
@ -483,32 +596,38 @@ public partial class PlayerController : CharacterBody3D
} }
public void OnAimingEntered() public void OnAimingEntered()
{ {
if (!isOnFloorCustom() && CanPerformDashAction()) if (!WeaponSystem.InHandState.Active)
{
OnDashStarted();
return;
}
if (!isOnFloorCustom() && CanPerformEmpoweredAction())
ReduceTimeScaleWhileAiming(); ReduceTimeScaleWhileAiming();
} }
public void OnAimingExited()
{
DashSystem.CancelDash();
}
// Regular processes // Regular processes
public void HandleWeaponInHand(float delta) public void HandleWeaponInHand(float delta)
{ {
RotateWeaponWithPlayer(); if (WeaponSystem.InHandState.Active)
RotateWeaponWithPlayer();
} }
public void HandleAiming(float delta) public void HandleAiming(float delta)
{ {
RotateWeaponWithPlayer(); RotateWeaponWithPlayer();
if (isOnFloorCustom())
ResetTimeScale(); if (CanPerformEmpoweredAction())
if (CanPerformDashAction())
DashSystem.PrepareDash(); DashSystem.PrepareDash();
else
{
_playerState.SendEvent("aim_canceled");
DashSystem.CancelDash();
}
} }
// Physics processes // Physics processes
public void HandleGrounded(float delta) public void HandleGrounded(float delta)
{ {
_canDash = true;
if (!isOnFloorCustom()) if (!isOnFloorCustom())
_playerState.SendEvent("start_falling"); _playerState.SendEvent("start_falling");
} }
@ -531,6 +650,8 @@ public partial class PlayerController : CharacterBody3D
} }
public void HandleWallHugging(float delta) public void HandleWallHugging(float delta)
{ {
if (isOnFloorCustom())
_playerState.SendEvent("grounded");
if (!WallHugSystem.IsWallHugging()) if (!WallHugSystem.IsWallHugging())
_playerState.SendEvent("start_falling"); _playerState.SendEvent("start_falling");
} }
@ -552,8 +673,8 @@ public partial class PlayerController : CharacterBody3D
isOnFloorCustom(), isOnFloorCustom(),
HealthSystem.IsDead(), HealthSystem.IsDead(),
IsHeadTouchingCeiling(), IsHeadTouchingCeiling(),
_actionHanging.Active, _onWallHanging.Active,
_wallHugging.Active); _onWallHugging.Active);
MoveSystem.MoveAround(moveAroundParams); MoveSystem.MoveAround(moveAroundParams);
} }

View File

@ -37,6 +37,10 @@ public partial class DashSystem: Node3D
public delegate void DashStartedEventHandler(); public delegate void DashStartedEventHandler();
[Signal] [Signal]
public delegate void DashEndedEventHandler(); public delegate void DashEndedEventHandler();
[Signal]
public delegate void DashProgressEventHandler(float progress);
private Vector3 _globalDashPosition = Vector3.Zero;
public void Init(Node3D head, Camera3D camera, TweenQueueSystem tweenQueueSystem) public void Init(Node3D head, Camera3D camera, TweenQueueSystem tweenQueueSystem)
{ {
@ -121,14 +125,18 @@ public partial class DashSystem: Node3D
public void DashTweenEnded() public void DashTweenEnded()
{ {
EmitSignal(SignalName.DashEnded); EmitSignal(SignalName.DashEnded);
_dashTarget.SetVisible(false);
} }
public void Dash() public void Dash()
{ {
EmitSignal(SignalName.DashStarted); EmitSignal(SignalName.DashStarted);
_dashTarget.SetVisible(false);
var dashTweenInputs = new TweenQueueSystem.TweenInputs(PlannedPlayerLocation, DashSpeed); var dashTweenInputs = new TweenQueueSystem.TweenInputs(PlannedPlayerLocation, DashSpeed);
var dashTween = _tweenQueueSystem.TweenToLocation(dashTweenInputs); var dashTween = _tweenQueueSystem.TweenToLocation(dashTweenInputs);
// dashTween.SetTrans(Tween.TransitionType.Cubic);
// dashTween.SetEase(Tween.EaseType.Out);
dashTween.TweenMethod(Callable.From<float>(Dashing), 0.0f, 1.0f, DashSpeed);
dashTween.Finished += DashTweenEnded; dashTween.Finished += DashTweenEnded;
if (ShouldMantle) if (ShouldMantle)
{ {
@ -136,10 +144,17 @@ public partial class DashSystem: Node3D
return; return;
} }
var dashIndicator = (CpuParticles3D) DashIndicatorScene.Instantiate(); // var dashIndicator = (CpuParticles3D) DashIndicatorScene.Instantiate();
GetTree().GetRoot().AddChild(dashIndicator); // GetTree().GetRoot().AddChild(dashIndicator);
dashIndicator.GlobalPosition = _dashTarget.GlobalPosition; // _globalDashPosition = _dashTarget.GlobalPosition + 1.5f*Vector3.Up;
dashIndicator.SetEmitting(true); // dashIndicator.GlobalPosition = _globalDashPosition;
// dashIndicator.SetEmitting(true);
}
public void Dashing(float proportion)
{
_dashTarget.SetGlobalPosition(_globalDashPosition);
EmitSignalDashProgress(proportion);
} }
public void DashToThrownWeapon() public void DashToThrownWeapon()

View File

@ -0,0 +1,5 @@
[gd_resource type="Curve" format=3 uid="uid://c2a8soliruf35"]
[resource]
_data = [Vector2(0, 1), 0.0, 0.0, 0, 0, Vector2(0.5, 1), -1.89032e-07, -1.89032e-07, 0, 0, Vector2(0.8, 0.05), -9.56219, 0.0, 0, 1, Vector2(0.995, 0.05), 0.0, 0.0, 0, 0, Vector2(1, 1), -0.0540619, -0.0540619, 0, 0]
point_count = 5

View File

@ -1,9 +1,9 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://dgfww8118d8gj"] [gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bebstkm608wxx"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_tm2gl"] [ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_bvbvh"]
[resource] [resource]
script = ExtResource("1_tm2gl") script = ExtResource("1_bvbvh")
name = &"" name = &""
action_value_type = 0 action_value_type = 0
block_lower_priority_actions = true block_lower_priority_actions = true

View File

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=71 format=3 uid="uid://bl5crtu1gkrtr"] [gd_resource type="Resource" script_class="GUIDEMappingContext" load_steps=86 format=3 uid="uid://bl5crtu1gkrtr"]
[ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_qmhk6"] [ext_resource type="Script" uid="uid://cpplm41b5bt6m" path="res://addons/guide/guide_action_mapping.gd" id="1_qmhk6"]
[ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="2_g6bbx"] [ext_resource type="Resource" uid="uid://htqvokm8mufq" path="res://systems/inputs/base_mode/move.tres" id="2_g6bbx"]
@ -13,18 +13,21 @@
[ext_resource type="Script" uid="uid://bjm4myqxg4phm" path="res://addons/guide/modifiers/guide_modifier_scale.gd" id="11_j3axn"] [ext_resource type="Script" uid="uid://bjm4myqxg4phm" path="res://addons/guide/modifiers/guide_modifier_scale.gd" id="11_j3axn"]
[ext_resource type="Script" uid="uid://ckggy40lm0vjc" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="12_kxb2c"] [ext_resource type="Script" uid="uid://ckggy40lm0vjc" path="res://addons/guide/modifiers/guide_modifier_negate.gd" id="12_kxb2c"]
[ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="13_v2ywt"] [ext_resource type="Resource" uid="uid://ccrb5xsnphc8" path="res://systems/inputs/base_mode/rotate_floorplane.tres" id="13_v2ywt"]
[ext_resource type="Resource" uid="uid://dgfww8118d8gj" path="res://systems/inputs/base_mode/aim.tres" id="14_vtk18"]
[ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="14_yp12v"] [ext_resource type="Resource" uid="uid://c3e0ivgaxrsyb" path="res://systems/inputs/base_mode/aim_down.tres" id="14_yp12v"]
[ext_resource type="Script" uid="uid://b52rqq28tuqpg" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="15_fykw6"] [ext_resource type="Script" uid="uid://b52rqq28tuqpg" path="res://addons/guide/triggers/guide_trigger_pressed.gd" id="15_fykw6"]
[ext_resource type="Script" uid="uid://b4cdrn4paoj3i" path="res://addons/guide/triggers/guide_trigger_down.gd" id="15_g6bbx"] [ext_resource type="Script" uid="uid://b4cdrn4paoj3i" path="res://addons/guide/triggers/guide_trigger_down.gd" id="15_g6bbx"]
[ext_resource type="Resource" uid="uid://b334rau1yxmm7" path="res://systems/inputs/base_mode/empower_down.tres" id="16_0qat1"]
[ext_resource type="Resource" uid="uid://bebstkm608wxx" path="res://systems/inputs/base_mode/aim_pressed.tres" id="16_li5ak"]
[ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/base_mode/aim_release.tres" id="16_rvpjj"] [ext_resource type="Resource" uid="uid://j1o5ud0plk4" path="res://systems/inputs/base_mode/aim_release.tres" id="16_rvpjj"]
[ext_resource type="Script" uid="uid://biiggjw6tv4uq" path="res://addons/guide/triggers/guide_trigger_released.gd" id="17_s8kjn"] [ext_resource type="Script" uid="uid://biiggjw6tv4uq" path="res://addons/guide/triggers/guide_trigger_released.gd" id="17_s8kjn"]
[ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="18_vibkn"] [ext_resource type="Resource" uid="uid://7wm8ywvujwf" path="res://systems/inputs/base_mode/aim_cancel.tres" id="18_vibkn"]
[ext_resource type="Resource" uid="uid://bbce5wfwxpns1" path="res://systems/inputs/base_mode/empower_release.tres" id="19_li5ak"]
[ext_resource type="Script" uid="uid://rvttn472ix6v" path="res://addons/guide/inputs/guide_input_joy_button.gd" id="19_qkgmj"] [ext_resource type="Script" uid="uid://rvttn472ix6v" path="res://addons/guide/inputs/guide_input_joy_button.gd" id="19_qkgmj"]
[ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="21_818lq"] [ext_resource type="Resource" uid="uid://bdit2jy5gbpts" path="res://systems/inputs/base_mode/jump.tres" id="21_818lq"]
[ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="22_2hs2y"] [ext_resource type="Resource" uid="uid://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="22_2hs2y"]
[ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/drop.tres" id="22_qmhk6"] [ext_resource type="Resource" uid="uid://d2r0ur8k3cuu3" path="res://systems/inputs/base_mode/dash.tres" id="23_g6bbx"]
[ext_resource type="Script" uid="uid://dsa1dnifd6w32" path="res://addons/guide/guide_mapping_context.gd" id="23_llfhp"] [ext_resource type="Script" uid="uid://dsa1dnifd6w32" path="res://addons/guide/guide_mapping_context.gd" id="23_llfhp"]
[ext_resource type="Resource" uid="uid://bw5k2gsv3jqcv" path="res://systems/inputs/base_mode/throw.tres" id="24_yp12v"]
[sub_resource type="Resource" id="Resource_vkvga"] [sub_resource type="Resource" id="Resource_vkvga"]
script = ExtResource("4_1rw8g") script = ExtResource("4_1rw8g")
@ -131,32 +134,6 @@ action = ExtResource("13_v2ywt")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_qu2wi")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_qu2wi")])
metadata/_guide_input_mappings_collapsed = true metadata/_guide_input_mappings_collapsed = true
[sub_resource type="Resource" id="Resource_ufouq"]
script = ExtResource("10_cvxqo")
axis = 4
joy_index = -1
[sub_resource type="Resource" id="Resource_li5ak"]
script = ExtResource("15_fykw6")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_qbthx"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_ufouq")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_li5ak")])
metadata/_guide_triggers_collapsed = false
[sub_resource type="Resource" id="Resource_0hmrk"]
script = ExtResource("1_qmhk6")
action = ExtResource("14_vtk18")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_qbthx")])
metadata/_guide_input_mappings_collapsed = false
[sub_resource type="Resource" id="Resource_si4d4"] [sub_resource type="Resource" id="Resource_si4d4"]
script = ExtResource("10_cvxqo") script = ExtResource("10_cvxqo")
axis = 4 axis = 4
@ -180,6 +157,55 @@ triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_2tfaw")])
script = ExtResource("1_qmhk6") script = ExtResource("1_qmhk6")
action = ExtResource("14_yp12v") action = ExtResource("14_yp12v")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_q86qg")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_q86qg")])
metadata/_guide_input_mappings_collapsed = false
[sub_resource type="Resource" id="Resource_llfhp"]
script = ExtResource("10_cvxqo")
axis = 4
joy_index = -1
[sub_resource type="Resource" id="Resource_ib0yi"]
script = ExtResource("15_fykw6")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_r6kml"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_llfhp")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_ib0yi")])
[sub_resource type="Resource" id="Resource_tb8ii"]
script = ExtResource("1_qmhk6")
action = ExtResource("16_li5ak")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_r6kml")])
[sub_resource type="Resource" id="Resource_fykw6"]
script = ExtResource("10_cvxqo")
axis = 5
joy_index = -1
[sub_resource type="Resource" id="Resource_rvpjj"]
script = ExtResource("15_g6bbx")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_s8kjn"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_fykw6")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_rvpjj")])
[sub_resource type="Resource" id="Resource_vibkn"]
script = ExtResource("1_qmhk6")
action = ExtResource("16_0qat1")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_s8kjn")])
[sub_resource type="Resource" id="Resource_cqc4k"] [sub_resource type="Resource" id="Resource_cqc4k"]
script = ExtResource("10_cvxqo") script = ExtResource("10_cvxqo")
@ -206,6 +232,30 @@ action = ExtResource("16_rvpjj")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_bkx7d")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_bkx7d")])
metadata/_guide_input_mappings_collapsed = false metadata/_guide_input_mappings_collapsed = false
[sub_resource type="Resource" id="Resource_qkgmj"]
script = ExtResource("10_cvxqo")
axis = 5
joy_index = -1
[sub_resource type="Resource" id="Resource_st2ej"]
script = ExtResource("17_s8kjn")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_818lq"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_qkgmj")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_st2ej")])
[sub_resource type="Resource" id="Resource_2hs2y"]
script = ExtResource("1_qmhk6")
action = ExtResource("19_li5ak")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_818lq")])
[sub_resource type="Resource" id="Resource_lfx76"] [sub_resource type="Resource" id="Resource_lfx76"]
script = ExtResource("19_qkgmj") script = ExtResource("19_qkgmj")
button = 2 button = 2
@ -255,7 +305,7 @@ script = ExtResource("1_qmhk6")
action = ExtResource("21_818lq") action = ExtResource("21_818lq")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_8w5gu")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_8w5gu")])
[sub_resource type="Resource" id="Resource_nf3uo"] [sub_resource type="Resource" id="Resource_li5ak"]
script = ExtResource("19_qkgmj") script = ExtResource("19_qkgmj")
button = 10 button = 10
joy_index = -1 joy_index = -1
@ -270,7 +320,7 @@ override_action_settings = false
is_remappable = false is_remappable = false
display_name = "" display_name = ""
display_category = "" display_category = ""
input = SubResource("Resource_nf3uo") input = SubResource("Resource_li5ak")
modifiers = Array[ExtResource("5_0qat1")]([]) modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_paxxe")]) triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_paxxe")])
@ -300,12 +350,36 @@ triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_yp12v")])
[sub_resource type="Resource" id="Resource_0qat1"] [sub_resource type="Resource" id="Resource_0qat1"]
script = ExtResource("1_qmhk6") script = ExtResource("1_qmhk6")
action = ExtResource("22_qmhk6") action = ExtResource("23_g6bbx")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_1rw8g")]) input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_1rw8g")])
metadata/_guide_input_mappings_collapsed = false metadata/_guide_input_mappings_collapsed = false
[sub_resource type="Resource" id="Resource_j3axn"]
script = ExtResource("19_qkgmj")
button = 3
joy_index = -1
[sub_resource type="Resource" id="Resource_kxb2c"]
script = ExtResource("15_fykw6")
actuation_threshold = 0.5
[sub_resource type="Resource" id="Resource_v2ywt"]
script = ExtResource("3_yp12v")
override_action_settings = false
is_remappable = false
display_name = ""
display_category = ""
input = SubResource("Resource_j3axn")
modifiers = Array[ExtResource("5_0qat1")]([])
triggers = Array[ExtResource("8_2tfaw")]([SubResource("Resource_kxb2c")])
[sub_resource type="Resource" id="Resource_vtk18"]
script = ExtResource("1_qmhk6")
action = ExtResource("24_yp12v")
input_mappings = Array[ExtResource("3_yp12v")]([SubResource("Resource_v2ywt")])
[resource] [resource]
script = ExtResource("23_llfhp") script = ExtResource("23_llfhp")
display_name = "" display_name = ""
mappings = Array[ExtResource("1_qmhk6")]([SubResource("Resource_88x08"), SubResource("Resource_tgr2g"), SubResource("Resource_iarn8"), SubResource("Resource_0hmrk"), SubResource("Resource_cvxqo"), SubResource("Resource_iihs4"), SubResource("Resource_0s4kt"), SubResource("Resource_xt1x5"), SubResource("Resource_ew1hw"), SubResource("Resource_0qat1")]) mappings = Array[ExtResource("1_qmhk6")]([SubResource("Resource_88x08"), SubResource("Resource_tgr2g"), SubResource("Resource_iarn8"), SubResource("Resource_cvxqo"), SubResource("Resource_tb8ii"), SubResource("Resource_vibkn"), SubResource("Resource_iihs4"), SubResource("Resource_2hs2y"), SubResource("Resource_0s4kt"), SubResource("Resource_xt1x5"), SubResource("Resource_ew1hw"), SubResource("Resource_0qat1"), SubResource("Resource_vtk18")])
metadata/_custom_type_script = "uid://dsa1dnifd6w32" metadata/_custom_type_script = "uid://dsa1dnifd6w32"

View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://b334rau1yxmm7"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_06ocg"]
[resource]
script = ExtResource("1_06ocg")
name = &""
action_value_type = 0
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bbce5wfwxpns1"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_v6tj6"]
[resource]
script = ExtResource("1_v6tj6")
name = &""
action_value_type = 0
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

View File

@ -0,0 +1,14 @@
[gd_resource type="Resource" script_class="GUIDEAction" load_steps=2 format=3 uid="uid://bw5k2gsv3jqcv"]
[ext_resource type="Script" uid="uid://cluhc11vixkf1" path="res://addons/guide/guide_action.gd" id="1_7f0q6"]
[resource]
script = ExtResource("1_7f0q6")
name = &""
action_value_type = 0
block_lower_priority_actions = true
emit_as_godot_actions = false
is_remappable = false
display_name = ""
display_category = ""
metadata/_custom_type_script = "uid://cluhc11vixkf1"

View File

@ -10,39 +10,51 @@ class_name InputController
@export var rotate_floorplane:GUIDEAction @export var rotate_floorplane:GUIDEAction
@export_group("Trigger actions") @export_group("Trigger actions")
@export var aim_pressed:GUIDEAction
@export var aim_down:GUIDEAction @export var aim_down:GUIDEAction
@export var aim_pressed:GUIDEAction
@export var aim_released:GUIDEAction @export var aim_released:GUIDEAction
@export var empower_down:GUIDEAction
@export var empower_released:GUIDEAction
@export var aim_canceled:GUIDEAction @export var aim_canceled:GUIDEAction
@export var jump:GUIDEAction @export var jump:GUIDEAction
@export var hit:GUIDEAction @export var hit:GUIDEAction
@export var drop:GUIDEAction @export var dash:GUIDEAction
@export var throw:GUIDEAction
signal input_move(value: Vector3) signal input_move(value: Vector3)
signal input_rotate_y(value: float) signal input_rotate_y(value: float)
signal input_rotate_floorplane(value: float) signal input_rotate_floorplane(value: float)
signal input_aim_pressed
signal input_aim_down signal input_aim_down
signal input_aim_pressed
signal input_aim_released signal input_aim_released
signal input_empower_down
signal input_empower_released
signal input_aim_canceled signal input_aim_canceled
signal input_jump signal input_jump
signal input_hit signal input_hit
signal input_drop signal input_dash
signal input_throw
func _ready() -> void: func _ready() -> void:
GUIDE.enable_mapping_context(base_mode) GUIDE.enable_mapping_context(base_mode)
aim_pressed.triggered.connect(on_input_aim_pressed)
aim_down.triggered.connect(on_input_aim_down) aim_down.triggered.connect(on_input_aim_down)
aim_pressed.triggered.connect(on_input_aim_pressed)
aim_released.triggered.connect(on_input_aim_released) aim_released.triggered.connect(on_input_aim_released)
empower_down.triggered.connect(on_input_empower_down)
empower_released.triggered.connect(on_input_empower_released)
aim_canceled.triggered.connect(on_input_aim_canceled) aim_canceled.triggered.connect(on_input_aim_canceled)
jump.triggered.connect(on_input_jump) jump.triggered.connect(on_input_jump)
hit.triggered.connect(on_input_hit) hit.triggered.connect(on_input_hit)
drop.triggered.connect(on_input_drop) dash.triggered.connect(on_input_dash)
throw.triggered.connect(on_input_throw)
func on_input_drop(): func on_input_dash():
input_drop.emit() input_dash.emit()
func on_input_throw():
input_throw.emit()
func on_input_hit(): func on_input_hit():
input_hit.emit() input_hit.emit()
@ -50,15 +62,21 @@ func on_input_hit():
func on_input_jump(): func on_input_jump():
input_jump.emit() input_jump.emit()
func on_input_aim_down():
input_aim_down.emit()
func on_input_aim_pressed(): func on_input_aim_pressed():
input_aim_pressed.emit() input_aim_pressed.emit()
func on_input_aim_down():
input_aim_down.emit()
func on_input_aim_released(): func on_input_aim_released():
input_aim_released.emit() input_aim_released.emit()
func on_input_empower_down():
input_empower_down.emit()
func on_input_empower_released():
input_empower_released.emit()
func on_input_aim_canceled(): func on_input_aim_canceled():
input_aim_canceled.emit() input_aim_canceled.emit()

View File

@ -28,6 +28,7 @@ public partial class TweenQueueSystem : Node3D
var (location, duration) = inputs; var (location, duration) = inputs;
var tween = GetTree().CreateTween(); var tween = GetTree().CreateTween();
tween.SetParallel(true);
tween.TweenProperty(_tweenObject, "global_position", location, duration); tween.TweenProperty(_tweenObject, "global_position", location, duration);
tween.TweenCallback(_tweenEndedCallback); tween.TweenCallback(_tweenEndedCallback);
_isTweening = true; _isTweening = true;