diff --git a/Content.Server/Speech/EntitySystems/VocalSystem.cs b/Content.Server/Speech/EntitySystems/VocalSystem.cs index 76d90e5f948..48236d3ea9e 100644 --- a/Content.Server/Speech/EntitySystems/VocalSystem.cs +++ b/Content.Server/Speech/EntitySystems/VocalSystem.cs @@ -31,6 +31,7 @@ public sealed class VocalSystem : EntitySystem SubscribeLocalEvent(OnSexChanged); SubscribeLocalEvent(OnEmote); SubscribeLocalEvent(OnScreamAction); + SubscribeLocalEvent(OnSoundsChanged); // DeltaV - support for changing vocal sounds on the go. Why it wasn't there in the first place is beyond me. } private void OnMapInit(EntityUid uid, VocalComponent component, MapInitEvent args) @@ -54,6 +55,13 @@ public sealed class VocalSystem : EntitySystem LoadSounds(uid, component, args.NewSex); } +// Begin DeltaV additions + private void OnSoundsChanged(EntityUid uid, VocalComponent component, ref SoundsChangedEvent args) + { + LoadSounds(uid, component); + } +// End DeltaV additions + private void OnEmote(EntityUid uid, VocalComponent component, ref EmoteEvent args) { if (args.Handled || !args.Emote.Category.HasFlag(EmoteCategory.Vocal)) diff --git a/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs b/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs index f7095b405c5..7de40a1f516 100644 --- a/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs +++ b/Content.Server/_DV/CosmicCult/CosmicCultSystem.cs @@ -18,6 +18,7 @@ using Content.Shared.Eye; using Content.Shared.Hands; using Content.Shared.Inventory.Events; using Content.Shared.Movement.Systems; +using Content.Shared.Speech.Components; using Content.Shared.StatusEffect; using Robust.Server.GameObjects; using Robust.Shared.Audio.Systems; @@ -78,8 +79,8 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem SubscribeLocalEvent(OnStartCultLead); SubscribeLocalEvent(OnGetVisMask); - SubscribeLocalEvent(OnGotEquipped); - SubscribeLocalEvent(OnGotUnequipped); + SubscribeLocalEvent(OnGotCosmicItemEquipped); + SubscribeLocalEvent(OnGotCosmicItemUnequipped); SubscribeLocalEvent(OnGotHeld); SubscribeLocalEvent(OnGotUnheld); @@ -98,6 +99,9 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem SubscribeLocalEvent(OnRadioSendAttempt); SubscribeLocalEvent(OnJammerAnchorStateChange); + SubscribeLocalEvent(OnGotSpeechOverrideEquipped); + SubscribeLocalEvent(OnGotSpeechOverrideUnequipped); + SubscribeFinale(); //Hook up the cosmic cult finale system } @@ -170,7 +174,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem #endregion #region Equipment Pickup - private void OnGotEquipped(Entity ent, ref GotEquippedEvent args) + private void OnGotCosmicItemEquipped(Entity ent, ref GotEquippedEvent args) { if (!EntityIsCultist(args.Equipee)) { @@ -179,7 +183,7 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem } } - private void OnGotUnequipped(Entity ent, ref GotUnequippedEvent args) + private void OnGotCosmicItemUnequipped(Entity ent, ref GotUnequippedEvent args) { if (!EntityIsCultist(args.Equipee)) _statusEffects.TryRemoveStatusEffect(args.Equipee, EntropicDegen); @@ -199,6 +203,24 @@ public sealed partial class CosmicCultSystem : SharedCosmicCultSystem if (!EntityIsCultist(args.User)) _statusEffects.TryRemoveStatusEffect(args.User, EntropicDegen); } + + private void OnGotSpeechOverrideEquipped(Entity ent, ref GotEquippedEvent args) + { + if (ent.Comp.OverrideIDs is not { } overrides || !TryComp(args.Equipee, out var vocalComp)) return; + ent.Comp.StoredIDs = vocalComp.Sounds; + vocalComp.Sounds = overrides; + var ev = new SoundsChangedEvent(); + RaiseLocalEvent(args.Equipee, ref ev); + } + + private void OnGotSpeechOverrideUnequipped(Entity ent, ref GotUnequippedEvent args) + { + if (ent.Comp.StoredIDs is not { } stored || !TryComp(args.Equipee, out var vocalComp)) return; + ent.Comp.StoredIDs = null; + vocalComp.Sounds = stored; + var ev = new SoundsChangedEvent(); + RaiseLocalEvent(args.Equipee, ref ev); + } #endregion #region Movespeed diff --git a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicChantrySystem.cs b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicChantrySystem.cs index d308a08aac1..e0ed23c8b00 100644 --- a/Content.Server/_DV/CosmicCult/EntitySystems/CosmicChantrySystem.cs +++ b/Content.Server/_DV/CosmicCult/EntitySystems/CosmicChantrySystem.cs @@ -6,6 +6,7 @@ using Content.Server.Popups; using Content.Shared._DV.CosmicCult.Components; using Content.Shared.Mind; using Content.Shared.Roles; +using Robust.Shared.Audio; using Robust.Shared.Audio.Systems; using Robust.Shared.Prototypes; using Robust.Shared.Timing; @@ -30,6 +31,7 @@ public sealed class CosmicChantrySystem : EntitySystem /// Mind role to add to colossi. /// public static readonly EntProtoId MindRole = "MindRoleCosmicColossus"; + private readonly SoundSpecifier _briefingSound = new SoundPathSpecifier("/Audio/_DV/CosmicCult/antag_cosmic_AI_briefing.ogg"); public override void Initialize() { base.Initialize(); @@ -61,7 +63,7 @@ public sealed class CosmicChantrySystem : EntitySystem _mind.TransferTo(mindEnt, colossus); _mind.TryAddObjective(mindEnt, mind, "CosmicFinalityObjective"); _role.MindAddRole(mindEnt, MindRole, mind, true); - _antag.SendBriefing(colossus, Loc.GetString("cosmiccult-silicon-colossus-briefing"), Color.FromHex("#4cabb3"), null); + _antag.SendBriefing(colossus, Loc.GetString("cosmiccult-silicon-colossus-briefing"), Color.FromHex("#4cabb3"), _briefingSound); Spawn(comp.SpawnVFX, tgtpos); QueueDel(comp.InternalVictim); QueueDel(uid); diff --git a/Content.Shared/Speech/Components/VocalComponent.cs b/Content.Shared/Speech/Components/VocalComponent.cs index a520da4354a..8ade5e1152c 100644 --- a/Content.Shared/Speech/Components/VocalComponent.cs +++ b/Content.Shared/Speech/Components/VocalComponent.cs @@ -51,3 +51,9 @@ public sealed partial class VocalComponent : Component [AutoNetworkedField] public EmoteSoundsPrototype? EmoteSounds = null; } + +/// +/// DeltaV: raised when the component's Sounds field changes. +/// +[ByRefEvent] +public record struct SoundsChangedEvent(); diff --git a/Content.Shared/_DV/CosmicCult/Components/SpeechOverrideComponent.cs b/Content.Shared/_DV/CosmicCult/Components/SpeechOverrideComponent.cs new file mode 100644 index 00000000000..0e16d87b8e8 --- /dev/null +++ b/Content.Shared/_DV/CosmicCult/Components/SpeechOverrideComponent.cs @@ -0,0 +1,27 @@ +using Content.Shared.Chat.Prototypes; +using Content.Shared.Humanoid; +using Robust.Shared.GameStates; +using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype.Dictionary; + +namespace Content.Shared._DV.CosmicCult.Components; + +/// +/// Component for overriding an entity's vocal sounds through equipment. +/// +[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] +public sealed partial class SpeechOverrideComponent : Component +{ + /// + /// Sounds to assign to the entity equipping this item. + /// + [DataField(customTypeSerializer: typeof(PrototypeIdValueDictionarySerializer))] + [AutoNetworkedField] + public Dictionary? OverrideIDs = null; + + /// + /// Entity's original sounds to use when the item is unequipped. + /// + [DataField(customTypeSerializer: typeof(PrototypeIdValueDictionarySerializer))] + [AutoNetworkedField] + public Dictionary? StoredIDs = null; +} diff --git a/Resources/Audio/_DV/CosmicCult/Emotes/attributions.yml b/Resources/Audio/_DV/CosmicCult/Emotes/attributions.yml new file mode 100644 index 00000000000..bb3730c9aa7 --- /dev/null +++ b/Resources/Audio/_DV/CosmicCult/Emotes/attributions.yml @@ -0,0 +1,8 @@ +- files: + - cosmic_laugh.ogg + - cosmic_scream.ogg + - cosmic_crying.ogg + - colossus_laugh.ogg + license: "CC-BY-SA-3.0" + copyright: "By NoElkaTheGod(GitHub) for Cosmic Cult. Made using a combination of (Creative Commons 0) samples from freesound.org." + source: "https://freesound.org/" diff --git a/Resources/Audio/_DV/CosmicCult/Emotes/colossus_laugh.ogg b/Resources/Audio/_DV/CosmicCult/Emotes/colossus_laugh.ogg new file mode 100644 index 00000000000..e870813a384 Binary files /dev/null and b/Resources/Audio/_DV/CosmicCult/Emotes/colossus_laugh.ogg differ diff --git a/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_crying.ogg b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_crying.ogg new file mode 100644 index 00000000000..f4928235bc9 Binary files /dev/null and b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_crying.ogg differ diff --git a/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_laugh.ogg b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_laugh.ogg new file mode 100644 index 00000000000..b4f80783e93 Binary files /dev/null and b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_laugh.ogg differ diff --git a/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_scream.ogg b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_scream.ogg new file mode 100644 index 00000000000..0cd9ce0ce5b Binary files /dev/null and b/Resources/Audio/_DV/CosmicCult/Emotes/cosmic_scream.ogg differ diff --git a/Resources/Prototypes/_DV/CosmicCult/Clothing/cosmiccult_armor.yml b/Resources/Prototypes/_DV/CosmicCult/Clothing/cosmiccult_armor.yml index 0120adf4529..61daaca8e34 100644 --- a/Resources/Prototypes/_DV/CosmicCult/Clothing/cosmiccult_armor.yml +++ b/Resources/Prototypes/_DV/CosmicCult/Clothing/cosmiccult_armor.yml @@ -84,8 +84,6 @@ - type: BatterySelfRecharger autoRecharge: true autoRechargeRate: 5 - - type: TypingIndicatorClothing - proto: CosmicTyping # COSMIC CULT HARDSUIT HELMET - type: entity @@ -112,3 +110,10 @@ Piercing: 0.90 Heat: 0.90 - type: EyeProtection + - type: TypingIndicatorClothing + proto: CosmicTyping + - type: SpeechOverride + overrideIDs: + Male: CosmicEmotesMale + Female: CosmicEmotesFemale + Unsexed: CosmicEmotesMale # Humans use male soudns for unsexed so here we are. diff --git a/Resources/Prototypes/_DV/CosmicCult/events.yml b/Resources/Prototypes/_DV/CosmicCult/events.yml index eebf5f0a6e3..1219c61b6f6 100644 --- a/Resources/Prototypes/_DV/CosmicCult/events.yml +++ b/Resources/Prototypes/_DV/CosmicCult/events.yml @@ -29,7 +29,7 @@ briefing: text: ghost-role-colossus-briefing color: CadetBlue - sound: /Audio/_DV/CosmicCult/antag_cosmic_briefing.ogg + sound: /Audio/_DV/CosmicCult/antag_cosmic_AI_briefing.ogg components: - type: CosmicColossus timed: true diff --git a/Resources/Prototypes/_DV/CosmicCult/speech_emote_sounds.yml b/Resources/Prototypes/_DV/CosmicCult/speech_emote_sounds.yml new file mode 100644 index 00000000000..9493e1f5949 --- /dev/null +++ b/Resources/Prototypes/_DV/CosmicCult/speech_emote_sounds.yml @@ -0,0 +1,55 @@ +- type: emoteSounds + id: CosmicEmotesMale + params: + variation: 0.125 + sounds: + Scream: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_scream.ogg + Laugh: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_laugh.ogg + Crying: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_crying.ogg # The urge to use minecraft ghast sounds + Cough: + collection: MaleCoughs + Yawn: + collection: MaleYawn + Sigh: + collection: MaleSigh + Whistle: + collection: TrenchWhistle # Kinda creepy, I think it fits well + Snore: + collection: Snores + Weh: + collection: Weh + Hew: + collection: Hew + Honk: + collection: BikeHorn + +- type: emoteSounds + id: CosmicEmotesFemale + params: + variation: 0.125 + sounds: + Scream: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_scream.ogg + Laugh: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_laugh.ogg + Crying: + path: /Audio/_DV/CosmicCult/Emotes/cosmic_crying.ogg + Cough: + collection: FemaleCoughs + Yawn: + collection: FemaleYawn + Sigh: + collection: FemaleSigh + Whistle: + collection: TrenchWhistle + Snore: + collection: Snores + Weh: + collection: Weh + Hew: + collection: Hew + Honk: + collection: BikeHorn