diff --git a/Content.Client/ADT/Bark/Systems/HumanoidProfileEditor.Barks.cs b/Content.Client/ADT/Bark/Systems/HumanoidProfileEditor.Barks.cs index 19be7e5a125..a3b1dde043f 100644 --- a/Content.Client/ADT/Bark/Systems/HumanoidProfileEditor.Barks.cs +++ b/Content.Client/ADT/Bark/Systems/HumanoidProfileEditor.Barks.cs @@ -8,7 +8,7 @@ public sealed partial class HumanoidProfileEditor { private List _barkList = new(); - private void InitializeBarks() + private void InitializeBarks() // У меня случился небольшой затуп. Оно барки в обход кнопки сохраняет, но хотя бы работает ы { _barkList = _prototypeManager .EnumeratePrototypes() @@ -20,6 +20,7 @@ private void InitializeBarks() { BarkProtoButton.SelectId(args.Id); SetBarkProto(_barkList[args.Id].ID); + UpdateSaveButton(); }; PitchEdit.OnTextChanged += args => @@ -28,6 +29,7 @@ private void InitializeBarks() return; SetBarkPitch(newPitch); + UpdateSaveButton(); }; DelayVariationMinEdit.OnTextChanged += args => @@ -36,6 +38,7 @@ private void InitializeBarks() return; SetBarkMinVariation(newVar); + UpdateSaveButton(); }; DelayVariationMaxEdit.OnTextChanged += args => @@ -44,6 +47,7 @@ private void InitializeBarks() return; SetBarkMaxVariation(newVar); + UpdateSaveButton(); }; BarkPlayButton.OnPressed += _ => PlayPreviewBark(); @@ -56,9 +60,9 @@ private void UpdateBarkVoicesControls() BarkProtoButton.Clear(); - PitchEdit.Text = Profile.BarkPitch.ToString(); - DelayVariationMinEdit.Text = Profile.BarkLowVar.ToString(); - DelayVariationMaxEdit.Text = Profile.BarkHighVar.ToString(); + PitchEdit.Text = Profile.Bark.Pitch.ToString(); + DelayVariationMinEdit.Text = Profile.Bark.MinVar.ToString(); + DelayVariationMaxEdit.Text = Profile.Bark.MaxVar.ToString(); var firstVoiceChoiceId = 1; for (var i = 0; i < _barkList.Count; i++) @@ -72,7 +76,7 @@ private void UpdateBarkVoicesControls() firstVoiceChoiceId = i; } - var voiceChoiceId = _barkList.FindIndex(x => x.ID == Profile.BarkProto); + var voiceChoiceId = _barkList.FindIndex(x => x.ID == Profile.Bark.Proto); if (!BarkProtoButton.TrySelectId(voiceChoiceId) && BarkProtoButton.TrySelectId(firstVoiceChoiceId)) { @@ -85,6 +89,6 @@ private void PlayPreviewBark() if (Profile is null) return; - _entManager.System().PlayDataPrewiew(Profile.BarkProto, Profile.BarkPitch, Profile.BarkLowVar, Profile.BarkHighVar); + _entManager.System().PlayDataPrewiew(Profile.Bark.Proto, Profile.Bark.Pitch, Profile.Bark.MinVar, Profile.Bark.MaxVar); } } diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml index 7173b830f82..dd805a504c4 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml @@ -91,7 +91,7 @@ - + - + diff --git a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs index 267922f9bba..cdee2c31154 100644 --- a/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Lobby/UI/HumanoidProfileEditor.xaml.cs @@ -1237,7 +1237,7 @@ private void SetVoice(string newVoice) IsDirty = true; } // Corvax-TTS-End - + // ADT Barks start private void SetBarkProto(string prototype) { Profile = Profile?.WithBarkProto(prototype); @@ -1254,17 +1254,18 @@ private void SetBarkPitch(float pitch) private void SetBarkMinVariation(float variation) { - Profile = Profile?.WithBarkMinVariation(Math.Clamp(variation, _cfgManager.GetCVar(ADTCCVars.BarksMinDelay), Profile.BarkHighVar)); + Profile = Profile?.WithBarkMinVariation(Math.Clamp(variation, _cfgManager.GetCVar(ADTCCVars.BarksMinDelay), Profile.Bark.MaxVar)); ReloadPreview(); SetDirty(); } private void SetBarkMaxVariation(float variation) { - Profile = Profile?.WithBarkMaxVariation(Math.Clamp(variation, Profile.BarkLowVar, _cfgManager.GetCVar(ADTCCVars.BarksMaxDelay))); + Profile = Profile?.WithBarkMaxVariation(Math.Clamp(variation, Profile.Bark.MinVar, _cfgManager.GetCVar(ADTCCVars.BarksMaxDelay))); ReloadPreview(); SetDirty(); } + // ADT Barks end private void SetSpecies(string newSpecies) { diff --git a/Content.Server/ADT/Bark/Systems/SpeechBarksSystem.cs b/Content.Server/ADT/Bark/Systems/SpeechBarksSystem.cs index 7fee5af0360..29736c2c5d9 100644 --- a/Content.Server/ADT/Bark/Systems/SpeechBarksSystem.cs +++ b/Content.Server/ADT/Bark/Systems/SpeechBarksSystem.cs @@ -39,11 +39,9 @@ public override void Initialize() } private void OnMapInit(EntityUid uid, SpeechBarksComponent comp, MapInitEvent args) { - if (comp.BarkPrototype != null && comp.BarkPrototype != String.Empty) - { - var proto = _proto.Index(comp.BarkPrototype.Value); - comp.Sound = proto.Sound; - } + if (comp.Data.Sound != String.Empty) + return; + comp.Data.Sound = _proto.Index(comp.Data.Proto).Sound; } private void OnEntitySpoke(EntityUid uid, SpeechBarksComponent component, EntitySpokeEvent args) @@ -51,7 +49,7 @@ private void OnEntitySpoke(EntityUid uid, SpeechBarksComponent component, Entity if (!_isEnabled) return; - var ev = new TransformSpeakerBarkEvent(uid, component.Sound, component.BarkPitch); + var ev = new TransformSpeakerBarkEvent(uid, component.Data.Copy()); RaiseLocalEvent(uid, ev); var message = args.ObfuscatedMessage ?? args.Message; @@ -64,10 +62,10 @@ private void OnEntitySpoke(EntityUid uid, SpeechBarksComponent component, Entity RaiseNetworkEvent(new PlaySpeechBarksEvent( GetNetEntity(uid), message, - ev.Sound, - ev.Pitch, - component.BarkLowVar, - component.BarkHighVar, + ev.Data.Sound, + ev.Data.Pitch, + ev.Data.MinVar, + ev.Data.MaxVar, args.Whisper), mind.Session); } } diff --git a/Content.Server/ADT/Bark/Systems/VoiceMaskSystem.Barks.cs b/Content.Server/ADT/Bark/Systems/VoiceMaskSystem.Barks.cs index 7a5ccc7dc78..56b474a6672 100644 --- a/Content.Server/ADT/Bark/Systems/VoiceMaskSystem.Barks.cs +++ b/Content.Server/ADT/Bark/Systems/VoiceMaskSystem.Barks.cs @@ -19,12 +19,11 @@ private void InitializeBarks() private void OnSpeakerVoiceTransform(EntityUid uid, VoiceMaskComponent component, ref InventoryRelayedEvent args) { - args.Args.Pitch = Math.Clamp(component.BarkPitch, _cfg.GetCVar(ADTCCVars.BarksMinPitch), _cfg.GetCVar(ADTCCVars.BarksMaxPitch)); - if (!_proto.TryIndex(component.BarkId, out var proto)) return; - args.Args.Sound = proto.Sound; + args.Args.Data.Pitch = Math.Clamp(component.BarkPitch, _cfg.GetCVar(ADTCCVars.BarksMinPitch), _cfg.GetCVar(ADTCCVars.BarksMaxPitch)); + args.Args.Data.Sound = proto.Sound; } private void OnChangeBark(EntityUid uid, VoiceMaskComponent component, VoiceMaskChangeBarkMessage message) diff --git a/Content.Server/ADT/Bark/Systems/VoiceOverrideSystem.Barks.cs b/Content.Server/ADT/Bark/Systems/VoiceOverrideSystem.Barks.cs index b42badde00a..a655f9c5821 100644 --- a/Content.Server/ADT/Bark/Systems/VoiceOverrideSystem.Barks.cs +++ b/Content.Server/ADT/Bark/Systems/VoiceOverrideSystem.Barks.cs @@ -16,7 +16,6 @@ private void OnTransformSpeakerBark(Entity entity, ref T if (!entity.Comp.Enabled) return; - args.Sound = entity.Comp.BarkSound ?? args.Sound; - args.Pitch = entity.Comp.BarkPitch ?? args.Pitch; + args.Data = entity.Comp.Bark ?? args.Data; } } diff --git a/Content.Server/ADT/Changeling/Systems/ChangelingSystem.Useful.cs b/Content.Server/ADT/Changeling/Systems/ChangelingSystem.Useful.cs index 499188f2546..a08061d8530 100644 --- a/Content.Server/ADT/Changeling/Systems/ChangelingSystem.Useful.cs +++ b/Content.Server/ADT/Changeling/Systems/ChangelingSystem.Useful.cs @@ -184,6 +184,7 @@ private void OnAbsorbDoAfter(EntityUid uid, ChangelingComponent component, Absor { _store.TryAddCurrency(new Dictionary { { "EvolutionPoints", component.AbsorbedChangelingPointsAmount } }, uid, store); _store.UpdateUserInterface(uid, uid, store); + component.ChangelingsAbsorbed++; } } else // Если это не был генокрад, получаем возможность "сброса" @@ -191,7 +192,7 @@ private void OnAbsorbDoAfter(EntityUid uid, ChangelingComponent component, Absor var selfMessage = Loc.GetString("changeling-dna-success", ("target", Identity.Entity(target, EntityManager))); _popup.PopupEntity(selfMessage, uid, uid, PopupType.Medium); component.CanRefresh = true; - component.AbsorbedDnaModifier += 1; + component.AbsorbedDnaModifier++; } } diff --git a/Content.Server/ADT/Changeling/Systems/ChangelingSystem.cs b/Content.Server/ADT/Changeling/Systems/ChangelingSystem.cs index 3cb86d6b46d..c3a25bc5e64 100644 --- a/Content.Server/ADT/Changeling/Systems/ChangelingSystem.cs +++ b/Content.Server/ADT/Changeling/Systems/ChangelingSystem.cs @@ -5,7 +5,6 @@ using Content.Shared.Changeling.Components; using Content.Shared.Popups; using Content.Shared.Store; -using Content.Server.Traitor.Uplink; using Content.Shared.Mobs.Systems; using Content.Shared.FixedPoint; using Content.Shared.Humanoid; @@ -29,7 +28,6 @@ using Robust.Shared.Player; using System.Linq; using Content.Shared.Preferences; -using Content.Server.Humanoid; using Robust.Shared.Utility; using Content.Shared.Humanoid.Markings; using Content.Shared.Store.Components; @@ -43,13 +41,12 @@ using Content.Server.Cuffs; using Robust.Shared.Timing; using Content.Server.ADT.Hallucinations; -using Content.Shared.Gibbing.Systems; using Content.Shared.Mobs; using Content.Server.Stealth; using Content.Server.ADT.Store; using Robust.Server.Containers; -using Content.Server.Ghost; using Content.Shared.ADT.Stealth.Components; +using Content.Shared.Sirena.CollectiveMind; namespace Content.Server.Changeling.EntitySystems; @@ -59,25 +56,20 @@ public sealed partial class ChangelingSystem : EntitySystem [Dependency] private readonly SharedPopupSystem _popup = default!; [Dependency] private readonly StoreSystem _store = default!; [Dependency] private readonly ActionsSystem _action = default!; - [Dependency] private readonly UplinkSystem _uplink = default!; [Dependency] private readonly MobStateSystem _mobState = default!; [Dependency] private readonly PolymorphSystem _polymorph = default!; - [Dependency] private readonly MetaDataSystem _metaData = default!; [Dependency] private readonly ISerializationManager _serialization = default!; [Dependency] private readonly ActionContainerSystem _actionContainer = default!; [Dependency] private readonly AlertsSystem _alerts = default!; [Dependency] private readonly TagSystem _tagSystem = default!; [Dependency] private readonly StatusEffectsSystem _status = default!; - [Dependency] private readonly EntityManager _entityManager = default!; [Dependency] private readonly MovementSpeedModifierSystem _movementSpeedModifierSystem = default!; [Dependency] private readonly StaminaSystem _stamina = default!; [Dependency] private readonly DamageableSystem _damageableSystem = default!; [Dependency] private readonly EntityLookupSystem _lookup = default!; [Dependency] private readonly SharedMindSystem _mindSystem = default!; - [Dependency] private readonly AlertsSystem _alertsSystem = default!; [Dependency] private readonly StunSystem _stun = default!; [Dependency] private readonly FlashSystem _flashSystem = default!; - [Dependency] private readonly HumanoidAppearanceSystem _humanoid = default!; [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly HandsSystem _handsSystem = default!; [Dependency] private readonly InventorySystem _inventorySystem = default!; @@ -140,9 +132,6 @@ public override void Update(float frameTime) private void OnStartup(EntityUid uid, ChangelingComponent component, ComponentStartup args) { - //RemComp(uid); // TODO: Исправить проблему с волосами слаймов - //RemComp(uid); - //RemComp(uid); StealDNA(uid, component); RemComp(uid); @@ -156,6 +145,7 @@ private void OnStartup(EntityUid uid, ChangelingComponent component, ComponentSt private void OnMapInit(EntityUid uid, ChangelingComponent component, MapInitEvent args) { + EnsureComp(uid); if (component.GainedActions) return; _action.AddAction(uid, ref component.ChangelingEvolutionMenuActionEntity, component.ChangelingEvolutionMenuAction); @@ -282,7 +272,7 @@ private void OnRefresh(EntityUid uid, ChangelingComponent component, ChangelingR component.BoughtActions.Clear(); - _store.TrySetCurrency(new Dictionary, FixedPoint2> { { "EvolutionPoints", 10 } }, uid); + _store.TrySetCurrency(new Dictionary, FixedPoint2> { { "EvolutionPoints", 10 + (5 * component.ChangelingsAbsorbed) } }, uid); _store.TryRefreshStoreStock(uid); component.CanRefresh = false; @@ -341,6 +331,7 @@ public void CopyLing(EntityUid from, EntityUid to, ChangelingComponent? comp = n newLingComponent.AbsorbedDnaModifier = comp.AbsorbedDnaModifier; newLingComponent.DNAStolen = comp.DNAStolen; + newLingComponent.ChangelingsAbsorbed = comp.ChangelingsAbsorbed; newLingComponent.LastResortUsed = comp.LastResortUsed; newLingComponent.CanRefresh = comp.CanRefresh; diff --git a/Content.Server/ADT/TapeRecorder/TapeRecorderSystem.cs b/Content.Server/ADT/TapeRecorder/TapeRecorderSystem.cs index 8712dd2e7de..a15c67e1c02 100644 --- a/Content.Server/ADT/TapeRecorder/TapeRecorderSystem.cs +++ b/Content.Server/ADT/TapeRecorder/TapeRecorderSystem.cs @@ -49,8 +49,7 @@ protected override void ReplayMessagesInSegment(Entity en if (message.Bark != null) { var barkOverride = EnsureComp(ent); - barkOverride.BarkPrototype = message.Bark; - barkOverride.BarkPitch = message.BarkPitch; + barkOverride.Data = message.Bark; } if (message.TTS.HasValue) { @@ -97,15 +96,14 @@ private void OnListen(Entity ent, ref ListenEvent args) //Add a new entry to the tape var name = nameEv.VoiceName; var verb = _chat.GetSpeechVerb(args.Source, args.Message); - var barkPitch = 1f; - string? bark = null; + + BarkData? bark = null; ProtoId? tts = null; if (TryComp(args.Source, out var barksComponent)) { - var barkEv = new TransformSpeakerBarkEvent(args.Source, barksComponent.Sound, barksComponent.BarkPitch); + var barkEv = new TransformSpeakerBarkEvent(args.Source, barksComponent.Data.Copy()); RaiseLocalEvent(args.Source, barkEv); - bark = barkEv.Sound; - barkPitch = barkEv.Pitch; + bark = barkEv.Data; } if (TryComp(args.Source, out var ttsComp) && ttsComp.VoicePrototypeId != null) { @@ -114,7 +112,7 @@ private void OnListen(Entity ent, ref ListenEvent args) tts = ttsEv.VoiceId; } - cassette.Comp.Buffer.Add(new TapeCassetteRecordedMessage(cassette.Comp.CurrentPosition, name, verb, bark, barkPitch, tts, _language.GetCurrentLanguage(args.Source), args.Message)); + cassette.Comp.Buffer.Add(new TapeCassetteRecordedMessage(cassette.Comp.CurrentPosition, name, verb, bark, tts, _language.GetCurrentLanguage(args.Source), args.Message)); } private void OnPrintMessage(Entity ent, ref PrintTapeRecorderMessage args) diff --git a/Content.Server/Database/ServerDbBase.cs b/Content.Server/Database/ServerDbBase.cs index 44622bd81cb..ba2cedfcb4a 100644 --- a/Content.Server/Database/ServerDbBase.cs +++ b/Content.Server/Database/ServerDbBase.cs @@ -271,10 +271,7 @@ private static HumanoidCharacterProfile ConvertProfiles(Profile profile) traits.ToHashSet(), loadouts, // ADT Barks start - profile.BarkProto, - profile.BarkPitch, - profile.LowBarkVar, - profile.HighBarkVar + new BarkData(profile.BarkProto, profile.BarkPitch, profile.LowBarkVar, profile.HighBarkVar) // ADT Barks end ); } @@ -357,10 +354,10 @@ private static Profile ConvertProfiles(HumanoidCharacterProfile humanoid, int sl profile.Loadouts.Add(dz); } // ADT Barks start - profile.BarkProto = humanoid.BarkProto; - profile.BarkPitch = humanoid.BarkPitch; - profile.LowBarkVar = humanoid.BarkLowVar; - profile.HighBarkVar = humanoid.BarkHighVar; + profile.BarkProto = humanoid.Bark.Proto; + profile.BarkPitch = humanoid.Bark.Pitch; + profile.LowBarkVar = humanoid.Bark.MinVar; + profile.HighBarkVar = humanoid.Bark.MaxVar; // ADT Barks end return profile; diff --git a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs index 0407628e1d6..70af8419c38 100644 --- a/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs +++ b/Content.Server/Humanoid/Systems/HumanoidAppearanceSystem.cs @@ -59,6 +59,7 @@ public void SetAppearance(HumanoidAppearanceComponent sourceHumanoid, HumanoidAp targetHumanoid.CustomBaseLayers = new(sourceHumanoid.CustomBaseLayers); targetHumanoid.MarkingSet = new(sourceHumanoid.MarkingSet); SetTTSVoice(targetHumanoid.Owner, sourceHumanoid.Voice, targetHumanoid); // Corvax-TTS + SetBarkData(targetHumanoid.Owner, sourceHumanoid.Bark, targetHumanoid); // ADT Barks targetHumanoid.Gender = sourceHumanoid.Gender; if (TryComp(targetHumanoid.Owner, out var grammar)) diff --git a/Content.Server/Speech/Components/VoiceOverrideComponent.cs b/Content.Server/Speech/Components/VoiceOverrideComponent.cs index d8e15f442b8..f1d19b5d6b2 100644 --- a/Content.Server/Speech/Components/VoiceOverrideComponent.cs +++ b/Content.Server/Speech/Components/VoiceOverrideComponent.cs @@ -1,3 +1,4 @@ +using Content.Shared.ADT.SpeechBarks; using Content.Shared.Corvax.TTS; using Content.Shared.Speech; using Robust.Shared.Prototypes; @@ -36,11 +37,7 @@ public sealed partial class VoiceOverrideComponent : Component // ADT start [DataField] - public string? BarkSound; - - [DataField] - [ViewVariables(VVAccess.ReadWrite)] - public float? BarkPitch; + public BarkData? Bark; [DataField] public ProtoId? TTS; diff --git a/Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs b/Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs index daaad099d65..0a99bf358db 100644 --- a/Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs +++ b/Content.Server/Speech/EntitySystems/VoiceOverrideSystem.cs @@ -9,6 +9,9 @@ public override void Initialize() { base.Initialize(); SubscribeLocalEvent(OnTransformSpeakerName); + + InitializeTTS(); // ADT TTS + InitializeBarks(); // ADT Barks } private void OnTransformSpeakerName(Entity entity, ref TransformSpeakerNameEvent args) diff --git a/Content.Shared/ADT/Bark/BarkPrototype.cs b/Content.Shared/ADT/Bark/BarkPrototype.cs index ab3a8d75a94..a318d494c6c 100644 --- a/Content.Shared/ADT/Bark/BarkPrototype.cs +++ b/Content.Shared/ADT/Bark/BarkPrototype.cs @@ -1,4 +1,7 @@ +using Content.Shared.Humanoid; +using JetBrains.Annotations; using Robust.Shared.Prototypes; +using Robust.Shared.Serialization; namespace Content.Shared.ADT.SpeechBarks; @@ -17,3 +20,84 @@ public sealed partial class BarkPrototype : IPrototype [DataField(required: true)] public string Sound = "/Audio/Voice/Talk/speak_1.ogg"; } + +[DataDefinition] +[Serializable, NetSerializable] +public sealed partial class BarkData +{ + [DataField] + public ProtoId Proto = "Human1"; + + /// + /// Данное поле заполняется после инициализации барка, если не было задано в прототипе. + /// + [DataField, ViewVariables(VVAccess.ReadWrite)] + public string Sound = ""; + + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float MinVar = 0.1f; + + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float MaxVar = 0.5f; + + [DataField, ViewVariables(VVAccess.ReadWrite)] + public float Pitch = 1f; + + public BarkData WithProto(string proto) + { + var data = this; + data.Proto = proto; + return data; + } + + public BarkData WithPitch(float pitch) + { + var data = this; + data.Pitch = pitch; + return data; + } + + public BarkData WithMinVar(float var) + { + var data = this; + data.MinVar = var; + return data; + } + + public BarkData WithMaxVar(float var) + { + var data = this; + data.MaxVar = var; + return data; + } + + public BarkData(ProtoId proto, float pitch, float minVar, float maxVar) + { + Proto = proto; + Pitch = pitch; + MinVar = minVar; + MaxVar = maxVar; + } + + public BarkData Copy() + { + return new BarkData() + { + Proto = Proto, + Sound = Sound, + Pitch = Pitch, + MinVar = MinVar, + MaxVar = MaxVar + }; + } + + public bool MemberwiseEquals(BarkData other) + { + if (Proto != other.Proto) return false; + if (Sound != other.Sound) return false; + if (Pitch != other.Pitch) return false; + if (MinVar != other.MinVar) return false; + if (MaxVar != other.MaxVar) return false; + return true; + } +} diff --git a/Content.Shared/ADT/Bark/Components/SpeechBarksComponent.cs b/Content.Shared/ADT/Bark/Components/SpeechBarksComponent.cs index 825cbcd6c83..9b5b4807dfb 100644 --- a/Content.Shared/ADT/Bark/Components/SpeechBarksComponent.cs +++ b/Content.Shared/ADT/Bark/Components/SpeechBarksComponent.cs @@ -6,29 +6,7 @@ namespace Content.Shared.ADT.SpeechBarks; [RegisterComponent, NetworkedComponent] public sealed partial class SpeechBarksComponent : Component { - [DataField] - [ViewVariables(VVAccess.ReadWrite)] - public ProtoId? BarkPrototype; - - [DataField] - public string Sound = "/Audio/Voice/Talk/speak_1.ogg"; - - // [DataField] - // public string ExclaimSound = "/Audio/Voice/Talk/speak_1_exclaim.ogg"; - - // [DataField] - // public string AskSound = "/Audio/Voice/Talk/speak_1_ask.ogg"; - - [DataField] - [ViewVariables(VVAccess.ReadWrite)] - public float BarkPitch = 1f; - - [DataField] - [ViewVariables(VVAccess.ReadWrite)] - public float BarkLowVar = 0.1f; - - [DataField] - [ViewVariables(VVAccess.ReadWrite)] - public float BarkHighVar = 0.5f; + [DataField, ViewVariables(VVAccess.ReadWrite)] + public BarkData Data = new(); } diff --git a/Content.Shared/ADT/Bark/Events/TransformSpeakerBarkEvent.cs b/Content.Shared/ADT/Bark/Events/TransformSpeakerBarkEvent.cs index 2c139303b77..16ea39638b7 100644 --- a/Content.Shared/ADT/Bark/Events/TransformSpeakerBarkEvent.cs +++ b/Content.Shared/ADT/Bark/Events/TransformSpeakerBarkEvent.cs @@ -5,15 +5,13 @@ namespace Content.Shared.ADT.SpeechBarks; public sealed class TransformSpeakerBarkEvent : EntityEventArgs, IInventoryRelayEvent { public EntityUid Sender; - public string Sound; - public float Pitch; + public BarkData Data; public SlotFlags TargetSlots { get; } = SlotFlags.WITHOUT_POCKET; - public TransformSpeakerBarkEvent(EntityUid sender, string sound, float pitch) + public TransformSpeakerBarkEvent(EntityUid sender, BarkData data) { Sender = sender; - Sound = sound; - Pitch = pitch; + Data = data; } } diff --git a/Content.Shared/ADT/Changeling/Components/ChangelingComponent.cs b/Content.Shared/ADT/Changeling/Components/ChangelingComponent.cs index b25ae13b089..480792aa377 100644 --- a/Content.Shared/ADT/Changeling/Components/ChangelingComponent.cs +++ b/Content.Shared/ADT/Changeling/Components/ChangelingComponent.cs @@ -1,11 +1,7 @@ using Robust.Shared.Audio; using Content.Shared.Polymorph; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; -using Content.Shared.Chemistry.Reagent; using Robust.Shared.Prototypes; -using Content.Shared.Actions; using Robust.Shared.GameStates; -using System.Diagnostics.CodeAnalysis; using Content.Shared.DoAfter; namespace Content.Shared.Changeling.Components; @@ -107,6 +103,8 @@ public sealed partial class ChangelingComponent : Component public List BoughtActions = new(); public List BasicTransferredActions = new(); + + public bool GainedActions = false; #endregion #region DNA Absorb Ability @@ -311,6 +309,7 @@ public sealed partial class ChangelingComponent : Component public TimeSpan BlindStingDuration = TimeSpan.FromSeconds(18); #endregion + #region Other /// /// Refresh ability /// @@ -323,5 +322,7 @@ public sealed partial class ChangelingComponent : Component [ViewVariables(VVAccess.ReadWrite)] public int DNAStolen = 0; - public bool GainedActions = false; + [ViewVariables(VVAccess.ReadWrite)] + public int ChangelingsAbsorbed = 0; + #endregion } diff --git a/Content.Shared/ADT/TapeRecorder/TapeCassetteRecordedMessage.cs b/Content.Shared/ADT/TapeRecorder/TapeCassetteRecordedMessage.cs index 61b12e09d92..bda34293fd8 100644 --- a/Content.Shared/ADT/TapeRecorder/TapeCassetteRecordedMessage.cs +++ b/Content.Shared/ADT/TapeRecorder/TapeCassetteRecordedMessage.cs @@ -37,10 +37,7 @@ public sealed partial class TapeCassetteRecordedMessage : IComparable? TTS; @@ -48,13 +45,12 @@ public sealed partial class TapeCassetteRecordedMessage : IComparable? Language; - public TapeCassetteRecordedMessage(float timestamp, string name, ProtoId verb, string? bark, float barkPitch, ProtoId? tts, ProtoId language, string message) + public TapeCassetteRecordedMessage(float timestamp, string name, ProtoId verb, BarkData? bark, ProtoId? tts, ProtoId language, string message) { Timestamp = timestamp; Name = name; Verb = verb; Bark = bark; - BarkPitch = barkPitch; TTS = tts; Language = language; Message = message; diff --git a/Content.Shared/Humanoid/HumanoidAppearanceComponent.cs b/Content.Shared/Humanoid/HumanoidAppearanceComponent.cs index 7eb5986091c..3962a167333 100644 --- a/Content.Shared/Humanoid/HumanoidAppearanceComponent.cs +++ b/Content.Shared/Humanoid/HumanoidAppearanceComponent.cs @@ -98,6 +98,14 @@ public sealed partial class HumanoidAppearanceComponent : Component /// [DataField] public HashSet HideLayersOnEquip = [HumanoidVisualLayers.Hair]; + + // ADT Barks start + /// + /// Current voice. Used for correct cloning. + /// + [DataField("bark")] + public BarkData Bark = new(); + // ADT Barks end } [DataDefinition] diff --git a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs index 50986eff4f2..059cf28ed95 100644 --- a/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs +++ b/Content.Shared/Humanoid/SharedHumanoidAppearanceSystem.cs @@ -390,8 +390,7 @@ public virtual void LoadProfile(EntityUid uid, HumanoidCharacterProfile? profile EnsureDefaultMarkings(uid, humanoid); SetTTSVoice(uid, profile.Voice, humanoid); // Corvax-TTS - var bark = _proto.Index(profile.BarkProto); // ADT Barks - SetBarkData(uid, bark.Sound, profile.BarkPitch, profile.BarkLowVar, profile.BarkHighVar); // ADT Barks + SetBarkData(uid, profile.Bark, humanoid); // ADT Barks humanoid.Gender = profile.Gender; if (TryComp(uid, out var grammar)) { @@ -486,15 +485,14 @@ public void SetTTSVoice(EntityUid uid, string voiceId, HumanoidAppearanceCompone // Corvax-TTS-End // ADT Barks start - public void SetBarkData(EntityUid uid, string sound, float pitch, float lowVar, float highVar) + public void SetBarkData(EntityUid uid, BarkData data, HumanoidAppearanceComponent humanoid) { if (!TryComp(uid, out var comp)) return; - comp.Sound = sound; - comp.BarkPitch = pitch; - comp.BarkLowVar = lowVar; - comp.BarkHighVar = highVar; + comp.Data = data; + comp.Data.Sound = _proto.Index(comp.Data.Proto).Sound; + humanoid.Bark = data; } // ADT Barks end diff --git a/Content.Shared/Preferences/HumanoidCharacterProfile.cs b/Content.Shared/Preferences/HumanoidCharacterProfile.cs index baf1fabaecb..3fbad0dc2ea 100644 --- a/Content.Shared/Preferences/HumanoidCharacterProfile.cs +++ b/Content.Shared/Preferences/HumanoidCharacterProfile.cs @@ -109,13 +109,7 @@ public sealed partial class HumanoidCharacterProfile : ICharacterProfile public SpawnPriorityPreference SpawnPriority { get; private set; } = SpawnPriorityPreference.None; // ADT Barks start - public string BarkProto = "Human1"; - - public float BarkPitch = 1f; - - public float BarkLowVar = 0.1f; - - public float BarkHighVar = 0.5f; + public BarkData Bark = new(); // ADT Barks end /// @@ -155,10 +149,7 @@ public HumanoidCharacterProfile( HashSet> traitPreferences, Dictionary loadouts, // ADT Barks start - string barkProto, - float barkPitch, - float barkLowVar, - float barkHighVar) + BarkData bark) // ADT Barks end { Name = name; @@ -176,10 +167,7 @@ public HumanoidCharacterProfile( _traitPreferences = traitPreferences; _loadouts = loadouts; // ADT Barks start - BarkProto = barkProto; - BarkPitch = barkPitch; - BarkLowVar = barkLowVar; - BarkHighVar = barkHighVar; + Bark = bark; // ADT Barks end var hasHighPrority = false; @@ -214,10 +202,7 @@ public HumanoidCharacterProfile(HumanoidCharacterProfile other) new HashSet>(other.TraitPreferences), new Dictionary(other.Loadouts), // ADT Barks start - other.BarkProto, - other.BarkPitch, - other.BarkLowVar, - other.BarkHighVar) + other.Bark) // ADT Barks end { } @@ -347,7 +332,7 @@ public HumanoidCharacterProfile WithBarkProto(string bark) { return new(this) { - BarkProto = bark, + Bark = Bark.WithProto(bark), }; } @@ -355,7 +340,7 @@ public HumanoidCharacterProfile WithBarkPitch(float pitch) { return new(this) { - BarkPitch = pitch, + Bark = Bark.WithPitch(pitch), }; } @@ -363,7 +348,7 @@ public HumanoidCharacterProfile WithBarkMinVariation(float variation) { return new(this) { - BarkLowVar = variation, + Bark = Bark.WithMinVar(variation), }; } @@ -371,7 +356,7 @@ public HumanoidCharacterProfile WithBarkMaxVariation(float variation) { return new(this) { - BarkHighVar = variation, + Bark = Bark.WithMaxVar(variation), }; } // ADT Barks end @@ -553,10 +538,7 @@ public bool MemberwiseEquals(ICharacterProfile maybeOther) if (!Loadouts.SequenceEqual(other.Loadouts)) return false; if (FlavorText != other.FlavorText) return false; // ADT Barks start - if (BarkProto != other.BarkProto) return false; - if (BarkPitch != other.BarkPitch) return false; - if (BarkLowVar != other.BarkLowVar) return false; - if (BarkHighVar != other.BarkHighVar) return false; + if (!Bark.MemberwiseEquals(other.Bark)) return false; // ADT Barks end return Appearance.MemberwiseEquals(other.Appearance); } diff --git a/Resources/Prototypes/ADT/Entities/Objects/Devices/handheld.yml b/Resources/Prototypes/ADT/Entities/Objects/Devices/handheld.yml index 98a438f78b6..b2c97d39480 100644 --- a/Resources/Prototypes/ADT/Entities/Objects/Devices/handheld.yml +++ b/Resources/Prototypes/ADT/Entities/Objects/Devices/handheld.yml @@ -30,7 +30,8 @@ spriteLayer: radio - type: ItemToggle - type: SpeechBarks - barkPrototype: GhostRadio + data: + proto: GhostRadio - type: entity id: ADTGhostRadio diff --git a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml index 006607e8c90..1aa04b5aa51 100644 --- a/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml +++ b/Resources/Prototypes/Entities/Mobs/Cyborgs/base_borg_chassis.yml @@ -297,7 +297,8 @@ maxIntensity: 20 canCreateVacuum: false # its for killing the borg not the station - type: SpeechBarks - sound: /Audio/ADT/Voice/Vocal-Barks/bloop.ogg + data: + proto: Synth3 - type: entity id: BaseBorgChassisNT