some SFX
This commit is contained in:
109
player_controller/Audio/InteractiveSFX.tres
Normal file
109
player_controller/Audio/InteractiveSFX.tres
Normal file
@@ -0,0 +1,109 @@
|
||||
[gd_resource type="AudioStreamInteractive" load_steps=30 format=3 uid="uid://clfggn87oeg1s"]
|
||||
|
||||
[ext_resource type="AudioStream" uid="uid://dedx5ronjavvh" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Run 1.ogg" id="1_tkpjh"]
|
||||
[ext_resource type="AudioStream" uid="uid://gihwx3xm7qoq" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Run 2.ogg" id="2_npc7y"]
|
||||
[ext_resource type="AudioStream" uid="uid://qr5qyql01rf5" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Run 3.ogg" id="3_xfjxc"]
|
||||
[ext_resource type="AudioStream" uid="uid://blbvci0fvniy3" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Run 4.ogg" id="4_ycvo6"]
|
||||
[ext_resource type="AudioStream" uid="uid://d01n6qtsadqvm" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Run 5.ogg" id="5_5bvpy"]
|
||||
[ext_resource type="AudioStream" uid="uid://2joty7h4guqs" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Jump.ogg" id="6_w27l5"]
|
||||
[ext_resource type="AudioStream" uid="uid://d0pwtd271fukd" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Land.ogg" id="7_5j00h"]
|
||||
[ext_resource type="AudioStream" uid="uid://co335a0d00667" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Attack 1.ogg" id="8_r7v0u"]
|
||||
[ext_resource type="AudioStream" uid="uid://dtl4blkueud3n" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Attack 2.ogg" id="9_l756u"]
|
||||
[ext_resource type="AudioStream" uid="uid://bd8n4slwggxrq" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Attack 3.ogg" id="10_7b65l"]
|
||||
[ext_resource type="AudioStream" uid="uid://jwy682rlwm2v" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Impact Hit 1.ogg" id="11_447ch"]
|
||||
[ext_resource type="AudioStream" uid="uid://cn6j83octlmg1" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Impact Hit 2.ogg" id="12_1yt5p"]
|
||||
[ext_resource type="AudioStream" uid="uid://buqmqota12r4g" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Impact Hit 3.ogg" id="13_t5u7s"]
|
||||
[ext_resource type="AudioStream" uid="uid://cm4332loplxmb" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Blocked 1.ogg" id="14_qnngs"]
|
||||
[ext_resource type="AudioStream" uid="uid://dhw1imlbuu7nl" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Blocked 2.ogg" id="15_3j1dm"]
|
||||
[ext_resource type="AudioStream" uid="uid://bis0qp2jqrwl7" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Attacks/Sword Attacks Hits and Blocks/Sword Blocked 3.ogg" id="16_hln0b"]
|
||||
[ext_resource type="AudioStream" uid="uid://dka35ab4pudfn" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Footsteps/Dirt/Dirt Chain Jump.ogg" id="17_npc7y"]
|
||||
[ext_resource type="AudioStream" uid="uid://4rhskycj4qqp" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Spells/Fireball 1.ogg" id="18_ycvo6"]
|
||||
[ext_resource type="AudioStream" uid="uid://bk03bbt0bbdu4" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Waterfalls Rivers and Streams/Waterfall Loop.ogg" id="19_5bvpy"]
|
||||
[ext_resource type="AudioStream" uid="uid://dn04ssm4qonxs" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Spells/Fireball 2.ogg" id="19_5j00h"]
|
||||
[ext_resource type="AudioStream" uid="uid://bsb2crsm8gkmc" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Spells/Fireball 3.ogg" id="20_r7v0u"]
|
||||
[ext_resource type="AudioStream" uid="uid://4mx3c0ercvu1" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Spells/Rock Wall 1.ogg" id="21_r7v0u"]
|
||||
[ext_resource type="AudioStream" uid="uid://bg4ujtrihj1jl" path="res://assets/audio/sfx/Free Fantasy SFX Pack By TomMusic/OGG Files/SFX/Spells/Rock Wall 2.ogg" id="22_l756u"]
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_rs8q3"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 5
|
||||
stream_0/stream = ExtResource("1_tkpjh")
|
||||
stream_1/stream = ExtResource("2_npc7y")
|
||||
stream_2/stream = ExtResource("3_xfjxc")
|
||||
stream_3/stream = ExtResource("4_ycvo6")
|
||||
stream_4/stream = ExtResource("5_5bvpy")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_i5yri"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 3
|
||||
stream_0/stream = ExtResource("8_r7v0u")
|
||||
stream_1/stream = ExtResource("9_l756u")
|
||||
stream_2/stream = ExtResource("10_7b65l")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_5cmm3"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 3
|
||||
stream_0/stream = ExtResource("11_447ch")
|
||||
stream_1/stream = ExtResource("12_1yt5p")
|
||||
stream_2/stream = ExtResource("13_t5u7s")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_jjm4g"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 3
|
||||
stream_0/stream = ExtResource("14_qnngs")
|
||||
stream_1/stream = ExtResource("15_3j1dm")
|
||||
stream_2/stream = ExtResource("16_hln0b")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_l756u"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 3
|
||||
stream_0/stream = ExtResource("18_ycvo6")
|
||||
stream_1/stream = ExtResource("19_5j00h")
|
||||
stream_2/stream = ExtResource("20_r7v0u")
|
||||
|
||||
[sub_resource type="AudioStreamRandomizer" id="AudioStreamRandomizer_7b65l"]
|
||||
random_pitch = 1.1
|
||||
streams_count = 2
|
||||
stream_0/stream = ExtResource("21_r7v0u")
|
||||
stream_1/stream = ExtResource("22_l756u")
|
||||
|
||||
[resource]
|
||||
clip_count = 10
|
||||
clip_0/name = &"footsteps"
|
||||
clip_0/stream = SubResource("AudioStreamRandomizer_rs8q3")
|
||||
clip_0/auto_advance = 0
|
||||
clip_1/name = &"jump"
|
||||
clip_1/stream = ExtResource("6_w27l5")
|
||||
clip_1/auto_advance = 0
|
||||
clip_2/name = &"land"
|
||||
clip_2/stream = ExtResource("7_5j00h")
|
||||
clip_2/auto_advance = 0
|
||||
clip_3/name = &"mantle"
|
||||
clip_3/stream = ExtResource("17_npc7y")
|
||||
clip_3/auto_advance = 0
|
||||
clip_4/name = &"attacks"
|
||||
clip_4/stream = SubResource("AudioStreamRandomizer_i5yri")
|
||||
clip_4/auto_advance = 0
|
||||
clip_5/name = &"hits"
|
||||
clip_5/stream = SubResource("AudioStreamRandomizer_5cmm3")
|
||||
clip_5/auto_advance = 0
|
||||
clip_6/name = &"damage_taken"
|
||||
clip_6/stream = SubResource("AudioStreamRandomizer_jjm4g")
|
||||
clip_6/auto_advance = 0
|
||||
clip_7/name = &"dash"
|
||||
clip_7/stream = SubResource("AudioStreamRandomizer_l756u")
|
||||
clip_7/auto_advance = 0
|
||||
clip_8/name = &"slam"
|
||||
clip_8/stream = SubResource("AudioStreamRandomizer_7b65l")
|
||||
clip_8/auto_advance = 0
|
||||
clip_9/name = &"glide"
|
||||
clip_9/stream = ExtResource("19_5bvpy")
|
||||
clip_9/auto_advance = 0
|
||||
_transitions = {
|
||||
Vector2i(-1, -1): {
|
||||
"fade_beats": 1.0,
|
||||
"fade_mode": 4,
|
||||
"from_time": 0,
|
||||
"to_time": 1
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
[gd_scene load_steps=55 format=3 uid="uid://bei4nhkf8lwdo"]
|
||||
[gd_scene load_steps=56 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="PackedScene" uid="uid://cf3rrgr1imvv4" path="res://scenes/path/path.tscn" id="2_6lejt"]
|
||||
@@ -19,6 +19,7 @@
|
||||
[ext_resource type="Resource" uid="uid://bs8b0oojixm4q" path="res://player_controller/resources/player_knockback.tres" id="8_m8gvy"]
|
||||
[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="AudioStream" uid="uid://clfggn87oeg1s" path="res://player_controller/Audio/InteractiveSFX.tres" id="9_jb43f"]
|
||||
[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://b5gx3q8nvu72e" path="res://systems/inputs/base_mode/hit.tres" id="11_cresl"]
|
||||
@@ -126,6 +127,11 @@ DamageModifiers = Array[Object]([ExtResource("6_cmijs")])
|
||||
[node name="CKnockback" parent="." instance=ExtResource("7_x835q")]
|
||||
RKnockback = ExtResource("8_m8gvy")
|
||||
|
||||
[node name="SFXPlayer" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("9_jb43f")
|
||||
autoplay = true
|
||||
bus = &"SFX"
|
||||
|
||||
[node name="WallRunSnapper" type="RayCast3D" parent="."]
|
||||
unique_name_in_owner = true
|
||||
transform = Transform3D(0.99999994, 0, 0, 0, 1, 0, 0, 0, 0.99999994, 0, 0, 0)
|
||||
|
||||
@@ -65,6 +65,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
public ShapeCast3D CeilingDetector;
|
||||
public RayCast3D DirectGroundDetector;
|
||||
public Area3D WeaponHitbox;
|
||||
public AudioStreamPlayer3D SFXPlayer;
|
||||
|
||||
// Inspector stuff
|
||||
[Export] public Marker3D TutorialWeaponTarget;
|
||||
@@ -226,6 +227,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
private float _lastFrameWasOnFloor = -Mathf.Inf;
|
||||
private const int NUM_OF_HEAD_COLLISION_DETECTORS = 4;
|
||||
private RayCast3D[] _headCollisionDetectors;
|
||||
private AudioStreamPlaybackInteractive _audioStream;
|
||||
|
||||
// Basic movement
|
||||
private bool _movementEnabled = true;
|
||||
@@ -359,6 +361,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
DashIndicatorMeshCylinder = DashIndicatorMesh.Mesh as CylinderMesh;
|
||||
DashIndicatorMesh.Visible = false;
|
||||
|
||||
SFXPlayer = GetNode<AudioStreamPlayer3D>("SFXPlayer");
|
||||
_audioStream = SFXPlayer.GetStreamPlayback() as AudioStreamPlaybackInteractive;
|
||||
|
||||
// Camera stuff
|
||||
HeadSystem = GetNode<HeadSystem>("HeadSystem");
|
||||
Camera3D camera = GetNode<Camera3D>("HeadSystem/CameraSmooth/Camera3D");
|
||||
@@ -467,6 +472,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
HeadSystem.Init();
|
||||
HeadSystem.HitboxActivated += OnHitboxActivated;
|
||||
HeadSystem.HitboxDeactivated += OnHitboxDeactivated;
|
||||
HeadSystem.StepFoot += OnFootStepped;
|
||||
|
||||
// Movement stuff
|
||||
// Getting universal setting from GODOT editor to be in sync
|
||||
@@ -528,8 +534,11 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_slideCanceled.StateEntered += OnSlideCanceled;
|
||||
_slideCanceled.StatePhysicsProcessing += HandleSlideCanceled;
|
||||
_groundSliding.StatePhysicsProcessing += HandleGroundSlide;
|
||||
_groundSliding.StateEntered += OnGroundSlideStarted;
|
||||
_airGliding.StatePhysicsProcessing += HandleAirGlide;
|
||||
_airGlidingDoubleJump.StatePhysicsProcessing += HandleAirGlide;
|
||||
_airGliding.StateEntered += OnAirGlideStarted;
|
||||
_airGlidingDoubleJump.StateEntered += OnAirGlideStarted;
|
||||
|
||||
_onGroundSlideJump.Taken += JumpFromGroundSlide;
|
||||
_onAirGlideDoubleJump.Taken += JumpFromAirGlide;
|
||||
@@ -651,6 +660,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
public void OnAirborneToGrounded()
|
||||
{
|
||||
HeadSystem.OnJumpEnded();
|
||||
_audioStream!.SwitchToClipByName("land");
|
||||
}
|
||||
|
||||
public bool IsGroundLike()
|
||||
@@ -993,6 +1003,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
public void SimpleDash(float strength = -1)
|
||||
{
|
||||
_audioStream.SwitchToClipByName("dash");
|
||||
SimpleDashInDirection(GetInputGlobalHDirection(), strength);
|
||||
}
|
||||
|
||||
@@ -1164,7 +1175,6 @@ public partial class PlayerController : CharacterBody3D,
|
||||
return;
|
||||
}
|
||||
|
||||
HeadSystem.OnJumpStarted();
|
||||
if (WallHugSystem.IsWallHugging())
|
||||
{
|
||||
_playerState.SendEvent("wall_jump");
|
||||
@@ -1175,6 +1185,9 @@ public partial class PlayerController : CharacterBody3D,
|
||||
private float _jumpStrengthMultiplier = 1.0f;
|
||||
public void OnJumpStarted(float verticalVelocity)
|
||||
{
|
||||
HeadSystem.OnJumpStarted();
|
||||
_audioStream!.SwitchToClipByName("jump");
|
||||
|
||||
_framesSinceJumpAtApex = 0;
|
||||
var angle = GetFloorAngle();
|
||||
var floorAngleFactor = angle > 1 ? 1 : 1 + angle;
|
||||
@@ -1273,6 +1286,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
public void OnMantleStarted()
|
||||
{
|
||||
HeadSystem.OnMantle();
|
||||
_audioStream!.SwitchToClipByName("mantle");
|
||||
|
||||
_mantlePath = MantlePath.Instantiate() as Path;
|
||||
if (_mantlePath == null)
|
||||
@@ -1379,6 +1393,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
{
|
||||
_targetSpeed = Velocity.Length();
|
||||
SetupSlideCollision();
|
||||
_audioStream!.SwitchToClipByName("glide");
|
||||
}
|
||||
|
||||
public bool CanStandUpFromSlide()
|
||||
@@ -1461,7 +1476,13 @@ public partial class PlayerController : CharacterBody3D,
|
||||
if (!isOnFloorCustom() && !DirectGroundDetector.IsColliding()) _playerState.SendEvent("start_falling");
|
||||
if (CanStandUpFromSlide() && !_isSlideInputDown) _playerState.SendEvent("slide_released");
|
||||
}
|
||||
|
||||
|
||||
public void OnGroundSlideStarted()
|
||||
{
|
||||
}
|
||||
public void OnAirGlideStarted()
|
||||
{
|
||||
}
|
||||
public void GlideInAir(float delta)
|
||||
{
|
||||
if (AllowForVelocityRedirection)
|
||||
@@ -1498,6 +1519,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
public void SlideEnded()
|
||||
{
|
||||
_audioStream!.SwitchToClipByName("footsteps");
|
||||
SetupStandingCollision();
|
||||
_targetSpeed = WalkSpeed;
|
||||
}
|
||||
@@ -1524,6 +1546,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
{
|
||||
SetHorizontalVelocity(Vector2.Zero);
|
||||
SetVerticalVelocity(-SlamSpeed);
|
||||
_audioStream!.SwitchToClipByName("dash");
|
||||
}
|
||||
public void HandleSlam(float delta)
|
||||
{
|
||||
@@ -1531,6 +1554,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
}
|
||||
public void SlamEnded()
|
||||
{
|
||||
HeadSystem.OnGetHit();
|
||||
_audioStream!.SwitchToClipByName("slam");
|
||||
}
|
||||
|
||||
///////////////////////////
|
||||
@@ -1647,6 +1672,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
///////////////////////////
|
||||
public void OnAimedDashStarted()
|
||||
{
|
||||
_audioStream.SwitchToClipByName("dash");
|
||||
|
||||
// Adjusting for player height, where the middle of the capsule should get to the dash location instead of the
|
||||
// feet of the capsule
|
||||
var correction = DashSystem.CollisionNormal == Vector3.Down ? _playerHeight : DashSystem.DashCastRadius;
|
||||
@@ -1678,6 +1705,8 @@ public partial class PlayerController : CharacterBody3D,
|
||||
// Weapon dashing
|
||||
public void ThrowWeapon()
|
||||
{
|
||||
_audioStream.SwitchToClipByName("attacks");
|
||||
|
||||
_playerState.SendEvent("cancel_aim");
|
||||
RemoveChildNode(WeaponSystem);
|
||||
HeadSystem.HideWeapon();
|
||||
@@ -1703,6 +1732,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_playerState.SendEvent("cancel_aim");
|
||||
_playerState.SendEvent("weapon_dash");
|
||||
PerformEmpoweredAction();
|
||||
_audioStream.SwitchToClipByName("dash");
|
||||
|
||||
DashSystem.ShouldMantle = false;
|
||||
_dashDirection = (WeaponSystem.GlobalPosition - GlobalPosition).Normalized();
|
||||
@@ -1724,6 +1754,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_playerState.SendEvent("cancel_aim");
|
||||
_playerState.SendEvent("weapon_dash");
|
||||
PerformEmpoweredAction();
|
||||
_audioStream.SwitchToClipByName("dash");
|
||||
|
||||
DashSystem.ShouldMantle = false;
|
||||
var dashLocation = WeaponSystem.PlantLocation;
|
||||
@@ -1788,6 +1819,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
DamageTaken?.Invoke(this, finalDamage);
|
||||
|
||||
HeadSystem.OnGetHit();
|
||||
_audioStream!.SwitchToClipByName("damage_taken");
|
||||
TriggerHitstop();
|
||||
OnHitInvincibility();
|
||||
|
||||
@@ -1823,6 +1855,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
public void PerformHit()
|
||||
{
|
||||
HeadSystem.OnHit();
|
||||
_audioStream!.SwitchToClipByName("attacks");
|
||||
}
|
||||
|
||||
public void OnHitboxActivated()
|
||||
@@ -1850,6 +1883,7 @@ public partial class PlayerController : CharacterBody3D,
|
||||
_hitEnemies.Clear();
|
||||
|
||||
HeadSystem.OnHitTarget();
|
||||
_audioStream!.SwitchToClipByName("hits");
|
||||
TriggerHitstop();
|
||||
}
|
||||
|
||||
@@ -1888,4 +1922,10 @@ public partial class PlayerController : CharacterBody3D,
|
||||
{
|
||||
_isInvincible = false;
|
||||
}
|
||||
|
||||
// Sound
|
||||
public void OnFootStepped()
|
||||
{
|
||||
_audioStream!.SwitchToClipByName("footsteps");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user