diff --git a/assets/first_party/sounds/throwing_enemy/attackSound.wav b/assets/first_party/sounds/throwing_enemy/attackSound.wav new file mode 100644 index 0000000000..ea2094e60b --- /dev/null +++ b/assets/first_party/sounds/throwing_enemy/attackSound.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11a6a6513668df2c3b9b0e0106cbb2c9e65f34e3550ddeecb7f999d2ebc3ce51 +size 93490 diff --git a/assets/first_party/sounds/throwing_enemy/attackSound.wav.import b/assets/first_party/sounds/throwing_enemy/attackSound.wav.import new file mode 100644 index 0000000000..e476d1ba50 --- /dev/null +++ b/assets/first_party/sounds/throwing_enemy/attackSound.wav.import @@ -0,0 +1,24 @@ +[remap] + +importer="wav" +type="AudioStreamWAV" +uid="uid://c5nln8i3amtlt" +path="res://.godot/imported/attackSound.wav-5330013a6325690f9475e4388885002d.sample" + +[deps] + +source_file="res://assets/first_party/sounds/throwing_enemy/attackSound.wav" +dest_files=["res://.godot/imported/attackSound.wav-5330013a6325690f9475e4388885002d.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_mode=2 +edit/loop_begin=0 +edit/loop_end=-1 +compress/mode=2 diff --git a/scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn b/scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn index 14ec1ac61c..ea40aac76b 100644 --- a/scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn +++ b/scenes/game_elements/characters/enemies/mothsache/Mothsache.tscn @@ -7,6 +7,7 @@ [ext_resource type="Script" uid="uid://cx0sk4uhvnii0" path="res://scenes/game_logic/walk_behaviors/erratic_walk_behavior.gd" id="3_xxd2s"] [ext_resource type="Script" uid="uid://csev4hv57utxv" path="res://scenes/game_logic/walk_behaviors/character_speeds.gd" id="4_xxd2s"] [ext_resource type="Texture2D" uid="uid://c75ofhy3swhj3" path="res://scenes/game_elements/characters/enemies/guard/components/exclamation_mark.png" id="7_8q7cb"] +[ext_resource type="AudioStream" uid="uid://c5nln8i3amtlt" path="res://assets/first_party/sounds/throwing_enemy/attackSound.wav" id="8_e2qj4"] [sub_resource type="CapsuleShape2D" id="CapsuleShape2D_0607a"] @@ -151,6 +152,12 @@ volume_db = -2.0 max_distance = 500.0 bus = &"SFX" +[node name="AttackSound" type="AudioStreamPlayer2D" parent="Sounds" unique_id=441928978] +unique_name_in_owner = true +stream = ExtResource("8_e2qj4") +volume_db = 5.0 +bus = &"SFX" + [connection signal="animation_finished" from="AnimatedSprite2D" to="." method="_on_animated_sprite_animation_finished"] [connection signal="timeout" from="BehaviorTimer" to="." method="_on_BehaviorTimer_timeout"] [connection signal="body_entered" from="AttackRadius" to="." method="_on_attack_radius_body_entered"] diff --git a/scenes/game_elements/characters/enemies/mothsache/mothsache.gd b/scenes/game_elements/characters/enemies/mothsache/mothsache.gd index 5016a9917b..46564a147c 100644 --- a/scenes/game_elements/characters/enemies/mothsache/mothsache.gd +++ b/scenes/game_elements/characters/enemies/mothsache/mothsache.gd @@ -37,6 +37,7 @@ const MAX_SPEED: float = 300 ## Sound played when entering DETECTING or ALERTED states. @export var alert_sound_stream: AudioStream: set = _set_alert_sound_stream +## Sound played when entering ATTACKING state. var state: State = State.IDLE: set = _set_state @@ -61,6 +62,7 @@ var _previous_non_detecting_state: State = State.IDLE @onready var animated_sprite: AnimatedSprite2D = %AnimatedSprite2D @onready var char_sprite_behavior: CharacterSpriteBehavior = %CharacterSpriteBehavior @onready var _alert_sound: AudioStreamPlayer = %AlertSound +@onready var _attack_sound: AudioStreamPlayer2D = %AttackSound func _ready() -> void: @@ -72,7 +74,6 @@ func _ready() -> void: awareness_bar.visible = false _set_alert_sound_stream(alert_sound_stream) _initial_position = global_position - state = State.IDLE @@ -264,6 +265,8 @@ func _set_state(new_state: State) -> void: State.ALERTED: if not _alert_sound.playing: _alert_sound.play() + if not _attack_sound.playing: + _attack_sound.play() awareness_bar.value = awareness_bar.max_value awareness_bar.tint_progress = Color.RED awareness_bar.modulate.a = 1.0