diff --git a/Asset Sources/Audio/SFX/moans.flac b/Asset Sources/Audio/SFX/moans.flac new file mode 100644 index 0000000..a3b4bd3 Binary files /dev/null and b/Asset Sources/Audio/SFX/moans.flac differ diff --git a/Game/Assets/Characters/Player.gd b/Game/Assets/Characters/Player.gd index 47b4f37..9c38789 100644 --- a/Game/Assets/Characters/Player.gd +++ b/Game/Assets/Characters/Player.gd @@ -276,6 +276,10 @@ func _process(delta): # weapon spread weapon.spread = max(lerp(weapon.spread, weapon.spread_min, weapon.spread_lerp), weapon.spread_min) +@rpc(sync, any, reliable) func moan(): + var anims = ["01", "02", "03", "04"] + $Pain.play(anims[randi() % 4]) + func damage(hp: int): var target = main.player_list.players[self.get_multiplayer_authority()] target.health -= hp diff --git a/Game/Assets/Characters/Player.tscn b/Game/Assets/Characters/Player.tscn index d568303..f834652 100644 --- a/Game/Assets/Characters/Player.tscn +++ b/Game/Assets/Characters/Player.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=30 format=3 uid="uid://cwuys43c7ak61"] +[gd_scene load_steps=38 format=3 uid="uid://cwuys43c7ak61"] [ext_resource type="Script" path="res://Assets/Characters/Player.gd" id="1"] [ext_resource type="PackedScene" uid="uid://bemrov0tiy08n" path="res://Assets/Weapons/Weapon.tscn" id="3"] @@ -6,8 +6,12 @@ [ext_resource type="AudioStream" uid="uid://bmjh522fpxeee" path="res://Assets/SFX/Player_Jetpack.wav" id="4_k24if"] [ext_resource type="AudioStream" uid="uid://3kb1cqt6lcaq" path="res://Assets/SFX/Player_Spawn.wav" id="5_bmajs"] [ext_resource type="PackedScene" uid="uid://c5cwnfuw4go1b" path="res://Assets/Audio/SoundPlayer.tscn" id="5_yiom2"] +[ext_resource type="AudioStream" uid="uid://dnffb1xcdi2u5" path="res://Assets/SFX/Player_Pain_01.wav" id="6_a4nh8"] [ext_resource type="AudioStream" uid="uid://dpxtkvkdj2ri3" path="res://Assets/SFX/Player_Jump_02.wav" id="6_s024f"] +[ext_resource type="AudioStream" uid="uid://gqypp5xk2ka7" path="res://Assets/SFX/Player_Pain_02.wav" id="7_0tfg5"] [ext_resource type="Texture2D" uid="uid://w2koos4gq0r8" path="res://Assets/Effects/Busy.png" id="8_0hice"] +[ext_resource type="AudioStream" uid="uid://ddj28v4w4whkg" path="res://Assets/SFX/Player_Pain_03.wav" id="8_n5il5"] +[ext_resource type="AudioStream" uid="uid://xe0bppsq0wef" path="res://Assets/SFX/Player_Pain_04.wav" id="9_bobut"] [sub_resource type="StandardMaterial3D" id="4"] albedo_color = Color(0.545098, 0.545098, 0.545098, 1) @@ -124,6 +128,78 @@ sections = 7 section_length = 0.418 curve = SubResource( "Curve_gq708" ) +[sub_resource type="Animation" id="Animation_r1ffi"] +resource_name = "01" +length = 0.5 +tracks/0/type = "audio" +tracks/0/path = NodePath("PainSFX") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( "6_a4nh8" ) +}], +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_dc3si"] +resource_name = "02" +length = 0.5 +tracks/0/type = "audio" +tracks/0/path = NodePath("PainSFX") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"clips": [{ +"end_offset": 0.271473, +"start_offset": 0.0, +"stream": ExtResource( "7_0tfg5" ) +}], +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_uiuci"] +resource_name = "03" +length = 0.5 +tracks/0/type = "audio" +tracks/0/path = NodePath("PainSFX") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"clips": [{ +"end_offset": 0.216568, +"start_offset": 0.0, +"stream": ExtResource( "8_n5il5" ) +}], +"times": PackedFloat32Array(0) +} + +[sub_resource type="Animation" id="Animation_66hai"] +resource_name = "04" +length = 0.5 +tracks/0/type = "audio" +tracks/0/path = NodePath("PainSFX") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/keys = { +"clips": [{ +"end_offset": 0.0, +"start_offset": 0.0, +"stream": ExtResource( "9_bobut" ) +}], +"times": PackedFloat32Array(0) +} + [sub_resource type="StandardMaterial3D" id="StandardMaterial3D_ctb51"] transparency = 1 no_depth_test = true @@ -284,6 +360,23 @@ process_material = SubResource( "ParticlesMaterial_lo734" ) draw_pass_1 = SubResource( "RibbonTrailMesh_34621" ) script = null +[node name="Pain" type="AnimationPlayer" parent="."] +root_node = NodePath(".") +anims/01 = SubResource( "Animation_r1ffi" ) +anims/02 = SubResource( "Animation_dc3si" ) +anims/03 = SubResource( "Animation_uiuci" ) +anims/04 = SubResource( "Animation_66hai" ) +blend_times = [] +script = null + +[node name="PainSFX" type="AudioStreamPlayer3D" parent="Pain"] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.29486, 0) +stream = ExtResource( "9_bobut" ) +max_db = 0.0 +attenuation_filter_cutoff_hz = 10000.0 +attenuation_filter_db = -8.0 +script = null + [node name="JumpSFX" parent="." instance=ExtResource( "5_yiom2" )] [node name="AudioStreamPlayer3D" parent="JumpSFX" index="0"] diff --git a/Game/Assets/SFX/Player_Pain_04.wav b/Game/Assets/SFX/Player_Pain_04.wav new file mode 100644 index 0000000..534ec17 --- /dev/null +++ b/Game/Assets/SFX/Player_Pain_04.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0d273ede8a2222e2305018bbb8142db578d58ab53fcf433aeb90f6cbaaf1258f +size 34482 diff --git a/Game/Assets/SFX/Player_Pain_04.wav.import b/Game/Assets/SFX/Player_Pain_04.wav.import new file mode 100644 index 0000000..033aeaa --- /dev/null +++ b/Game/Assets/SFX/Player_Pain_04.wav.import @@ -0,0 +1,22 @@ +[remap] + +importer="wav" +type="AudioStreamSample" +uid="uid://xe0bppsq0wef" +path="res://.godot/imported/Player_Pain_04.wav-2594881f5d224984095069380c662afa.sample" + +[deps] + +source_file="res://Assets/SFX/Player_Pain_04.wav" +dest_files=["res://.godot/imported/Player_Pain_04.wav-2594881f5d224984095069380c662afa.sample"] + +[params] + +force/8_bit=false +force/mono=false +force/max_rate=false +force/max_rate_hz=44100 +edit/trim=false +edit/normalize=false +edit/loop=false +compress/mode=0 diff --git a/Game/Assets/Weapons/Weapon.gd b/Game/Assets/Weapons/Weapon.gd index df53705..dd1b1f0 100644 --- a/Game/Assets/Weapons/Weapon.gd +++ b/Game/Assets/Weapons/Weapon.gd @@ -87,9 +87,9 @@ var spread = spread_min if main.player_list.players.size() > 2 and ray['collider'].get_multiplayer_authority() == player.revenge_pid: main.get_node("Announcer").speak(main.get_node("Announcer").payback) player.revenge_pid = -1 # reset revenge - else: hud.get_node("Crosshair").hit() + ray['collider'].rpc(&'moan') # boardcast the new health value to all peers main.rpc(&'player_list_update', main.player_list.get(ray['collider'].get_multiplayer_authority()).serialize(), ray['collider'].get_multiplayer_authority())