From 504a626da665cc3a4b0649ebc939c26929d5df93 Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 17:39:16 -0400 Subject: [PATCH 01/13] loc + resources --- Resources/Locale/en-US/psionics/psionic-powers.ftl | 6 ++++++ Resources/Prototypes/Psionics/psionics.yml | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/Resources/Locale/en-US/psionics/psionic-powers.ftl b/Resources/Locale/en-US/psionics/psionic-powers.ftl index e8f8d991af5..9ef10b541a4 100644 --- a/Resources/Locale/en-US/psionics/psionic-powers.ftl +++ b/Resources/Locale/en-US/psionics/psionic-powers.ftl @@ -74,4 +74,10 @@ xenoglossy-power-initialization-feedback = psionic-language-power-metapsionic-feedback = The noösphere flows freely through {CAPITALIZE($entity)}, who seems to digest it and pass it back out undisturbed. +# Psychognomy +psychognomy-power-description = You have some vague sense of the form of the source of telepathic messages. +psychognomy-power-initialization-feedback = + I have pierced the veil, and I know I'm not alone. More concerning, the piercing I made seems to be still indefinitely permeable. + When energy passes through the perforations in the noösphere, I get a faint glimpse of the material origin. + mindbreaking-feedback = The light of life vanishes from {CAPITALIZE($entity)}'s eyes, leaving behind a husk pretending at sapience diff --git a/Resources/Prototypes/Psionics/psionics.yml b/Resources/Prototypes/Psionics/psionics.yml index 9d4b770ad62..c21148126a8 100644 --- a/Resources/Prototypes/Psionics/psionics.yml +++ b/Resources/Prototypes/Psionics/psionics.yml @@ -119,3 +119,12 @@ - type: UniversalLanguageSpeaker initializationFeedback: xenoglossy-power-initialization-feedback metapsionicFeedback: psionic-language-power-feedback # Reuse for telepathy, clairaudience, etc + +- type: psionicPower + id: PsychognomyPower #i.e. reverse physiognomy + name: Psychognomy #psycho- + -gnomy. I reccomend starting with your language's equilvalent of "physiognomy" and working backwards. i.e. психо(г)номика + description: psychognomy-power-description + # components: + # - type: Psychognomist + initializationFeedback: psychognomy-power-initialization-feedback + metapsionicFeedback: psionic-language-power-feedback \ No newline at end of file From 0faaac6651190911e41c44f8ab9f758d67ba186d Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 21:12:03 -0400 Subject: [PATCH 02/13] component and basic functionality --- Content.Server/Chat/TelepathicChatSystem.cs | 33 ++++++++++++++----- .../Psychognomy/PsychognomistComponent.cs | 8 +++++ .../Locale/en-US/psionics/psionic-chat.ftl | 1 + 3 files changed, 33 insertions(+), 9 deletions(-) create mode 100644 Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index 8d44ead9d07..21ebc3dadac 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -3,6 +3,7 @@ using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Shared.Abilities.Psionics; +using Content.Shared.Abilities.Psionics.Passives; using Content.Shared.Bed.Sleep; using Content.Shared.Chat; using Content.Shared.Database; @@ -30,12 +31,16 @@ public sealed class TelepathicChatSystem : EntitySystem [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly GlimmerSystem _glimmerSystem = default!; [Dependency] private readonly ChatSystem _chatSystem = default!; - private IEnumerable GetPsionicChatClients() + private (IEnumerable normal, IEnumerable psychog) GetPsionicChatClients() { - return Filter.Empty() + var psions = Filter.Empty() .AddWhereAttachedEntity(IsEligibleForTelepathy) - .Recipients - .Select(p => p.ConnectedClient); + .Recipients; + + var normalSessions = psions.Where(p => !HasComp(p.AttachedEntity)).Select(p => p.Channel); + var psychogSessions = psions.Where(p => HasComp(p.AttachedEntity)).Select(p => p.Channel); + + return (normalSessions, psychogSessions); } private IEnumerable GetAdminClients() @@ -64,7 +69,7 @@ private bool IsEligibleForTelepathy(EntityUid entity) return HasComp(entity) && !HasComp(entity) && !HasComp(entity) - && (!TryComp(entity, out var mobstate) || mobstate.CurrentState == MobState.Alive); + && (!TryComp(entity, out var mobstate) || mobstate.CurrentState != MobState.Dead); } public void SendTelepathicChat(EntityUid source, string message, bool hideChat) @@ -85,18 +90,28 @@ public void SendTelepathicChat(EntityUid source, string message, bool hideChat) _adminLogger.Add(LogType.Chat, LogImpact.Low, $"Telepathic chat from {ToPrettyString(source):Player}: {message}"); - _chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, messageWrap, source, hideChat, true, clients.ToList(), Color.PaleVioletRed); + _chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, messageWrap, source, hideChat, true, clients.normal.ToList(), Color.PaleVioletRed); _chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, adminMessageWrap, source, hideChat, true, admins, Color.PaleVioletRed); + if (clients.psychog.Count() > 0) + { + string psychogMessageWrap; + + psychogMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-psychognomy", + ("source", source), ("message", message)); + + _chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, psychogMessageWrap, source, hideChat, true, clients.psychog.ToList(), Color.PaleVioletRed); + } + if (_random.Prob(0.1f)) _glimmerSystem.Glimmer++; - if (_random.Prob(Math.Min(0.33f + ((float) _glimmerSystem.Glimmer / 1500), 1))) + if (_random.Prob(Math.Min(0.33f + (float) _glimmerSystem.Glimmer / 1500, 1))) { - float obfuscation = (0.25f + (float) _glimmerSystem.Glimmer / 2000); + float obfuscation = 0.25f + (float) _glimmerSystem.Glimmer / 2000; var obfuscated = ObfuscateMessageReadability(message, obfuscation); - _chatManager.ChatMessageToMany(ChatChannel.Telepathic, obfuscated, messageWrap, source, hideChat, false, GetDreamers(clients), Color.PaleVioletRed); + _chatManager.ChatMessageToMany(ChatChannel.Telepathic, obfuscated, messageWrap, source, hideChat, false, GetDreamers(clients.normal.Concat(clients.psychog)), Color.PaleVioletRed); } foreach (var repeater in EntityQuery()) diff --git a/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs new file mode 100644 index 00000000000..9f7d29593fe --- /dev/null +++ b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs @@ -0,0 +1,8 @@ +namespace Content.Shared.Abilities.Psionics.Passives +{ + [RegisterComponent] + public sealed partial class PsychognomistComponent : Component + { + } +} + diff --git a/Resources/Locale/en-US/psionics/psionic-chat.ftl b/Resources/Locale/en-US/psionics/psionic-chat.ftl index b7fe23b7510..45444d0d10a 100644 --- a/Resources/Locale/en-US/psionics/psionic-chat.ftl +++ b/Resources/Locale/en-US/psionics/psionic-chat.ftl @@ -1,4 +1,5 @@ chat-manager-send-telepathic-chat-wrap-message = {$telepathicChannelName}: {$message} +chat-manager-send-telepathic-chat-wrap-message-psychognomy = {$source}: {$message} chat-manager-send-telepathic-chat-wrap-message-admin = {$source} (Ψ): {$message} chat-manager-telepathic-channel-name = TELEPATHIC hud-chatbox-select-channel-Telepathic = Telepathic From f82e172a710a52287155938dbbb2491663a00630 Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 21:44:11 -0400 Subject: [PATCH 03/13] Working, just need to add descriptors --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 23 +++++++++++++++++++ Content.Server/Chat/TelepathicChatSystem.cs | 19 +++++++++++++-- .../psionics/psychognomic-descriptors.ftl | 3 +++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs create mode 100644 Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs new file mode 100644 index 00000000000..b4271d16912 --- /dev/null +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -0,0 +1,23 @@ +using Content.Shared.Humanoid; + +namespace Content.Server.Chat +{ + public sealed partial class TelepathicChatSystem + { + private void InitializePsychognomy() + { + SubscribeLocalEvent(DescribeHumanoid); + } + + private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Sex != Sex.Unsexed) + ev.Descriptors.Add(component.Sex == Sex.Male ? Loc.GetString("p-descriptor-male") : Loc.GetString("p-descriptor-female")); + } + + } + public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs + { + public List Descriptors = new List(); + } +} \ No newline at end of file diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index 21ebc3dadac..dcd49c89364 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -23,7 +23,7 @@ namespace Content.Server.Chat /// Extensions for Telepathic chat stuff /// - public sealed class TelepathicChatSystem : EntitySystem + public sealed partial class TelepathicChatSystem : EntitySystem { [Dependency] private readonly IAdminManager _adminManager = default!; [Dependency] private readonly IChatManager _chatManager = default!; @@ -31,6 +31,12 @@ public sealed class TelepathicChatSystem : EntitySystem [Dependency] private readonly IAdminLogManager _adminLogger = default!; [Dependency] private readonly GlimmerSystem _glimmerSystem = default!; [Dependency] private readonly ChatSystem _chatSystem = default!; + + public override void Initialize() + { + base.Initialize(); + InitializePsychognomy(); + } private (IEnumerable normal, IEnumerable psychog) GetPsionicChatClients() { var psions = Filter.Empty() @@ -96,10 +102,19 @@ public void SendTelepathicChat(EntityUid source, string message, bool hideChat) if (clients.psychog.Count() > 0) { + var ev = new GetPsychognomicDescriptorEvent(); + RaiseLocalEvent(source, ev); + string psychogMessageWrap; + string descriptor; + + if (ev.Descriptors.Count == 0) + descriptor = Loc.GetString("p-descriptor-mysterious"); + else + descriptor = _random.Pick(ev.Descriptors); psychogMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-psychognomy", - ("source", source), ("message", message)); + ("source", descriptor.ToUpper()), ("message", message)); _chatManager.ChatMessageToMany(ChatChannel.Telepathic, message, psychogMessageWrap, source, hideChat, true, clients.psychog.ToList(), Color.PaleVioletRed); } diff --git a/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl new file mode 100644 index 00000000000..dcf4d11156e --- /dev/null +++ b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl @@ -0,0 +1,3 @@ +p-descriptor-mysterious = Mysterious +p-descriptor-male = Male +p-descriptor-female = Female \ No newline at end of file From 19dee43686406ec850355b0357f36d4f5dfee28b Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 22:55:55 -0400 Subject: [PATCH 04/13] finished --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 154 ++++++++++++++++++ Content.Server/Chat/TelepathicChatSystem.cs | 6 +- .../psionics/psychognomic-descriptors.ftl | 24 ++- .../Entities/Structures/Specific/oracle.yml | 6 + .../Structures/Research/sophicscribe.yml | 8 +- .../Prototypes/Nyanotrasen/psionicPowers.yml | 1 + 6 files changed, 191 insertions(+), 8 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index b4271d16912..2f01df54f69 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -1,4 +1,23 @@ using Content.Shared.Humanoid; +using Content.Shared.Damage; +using Content.Shared.Mobs.Components; +using Content.Shared.Physics; +using Content.Shared.Psionics; +using Content.Server.Bible.Components; +using Content.Server.Research.Oracle; +using Robust.Shared.GameObjects.Components.Localization; +using Robust.Shared.Enums; +using Content.Server.Nyanotrasen.Research.SophicScribe; +using Content.Server.Nyanotrasen.Cloning; +using Content.Server.Psionics.Glimmer; +using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Content.Shared.Nutrition.Components; +using Content.Server.Vampiric; +using Content.Shared.Revenant.Components; +using Content.Shared.Abilities.Psionics; +using Content.Server.Abilities.Psionics; +using System.ComponentModel; namespace Content.Server.Chat { @@ -7,14 +26,149 @@ public sealed partial class TelepathicChatSystem private void InitializePsychognomy() { SubscribeLocalEvent(DescribeHumanoid); + SubscribeLocalEvent(DescribeGrammar); + SubscribeLocalEvent(DescribeDamage); + SubscribeLocalEvent(DescribeMobState); + SubscribeLocalEvent(DescribeHunger); + SubscribeLocalEvent(DescribePhysics); + SubscribeLocalEvent(DescribeFixtures); + SubscribeLocalEvent(DescribeKarma); + SubscribeLocalEvent(DescribeGlimmerSource); + SubscribeLocalEvent(DescribePsion); + SubscribeLocalEvent(DescribeInnatePsionics); + SubscribeLocalEvent(DescribeBloodsucker); + SubscribeLocalEvent(DescribeRevenant); + // SubscribeLocalEvent(DescribeGlimmerWisp); + SubscribeLocalEvent(DescribeFamiliar); + // SubscribeLocalEvent(DescribeGolem); + SubscribeLocalEvent(DescribeOracle); + SubscribeLocalEvent(DescribeSophia); } private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) { if (component.Sex != Sex.Unsexed) ev.Descriptors.Add(component.Sex == Sex.Male ? Loc.GetString("p-descriptor-male") : Loc.GetString("p-descriptor-female")); + + // Deliberately obfuscating a bit; psionic signatures use different standards + ev.Descriptors.Add(component.Age >= 100 ? Loc.GetString("p-descriptor-old") : Loc.GetString("p-descriptor-young")); + } + + private void DescribeGrammar(EntityUid uid, GrammarComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Gender == Gender.Male || component.Gender == Gender.Female) + ev.Descriptors.Add(component.Gender == Gender.Male ? Loc.GetString("p-descriptor-masculine") : Loc.GetString("p-descriptor-feminine")); + } + + private void DescribeDamage(EntityUid uid, DamageableComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.DamageContainerID == "CorporealSpirit") + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); + if (!HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + return; + } + + ev.Descriptors.Add(Loc.GetString("p-descriptor-hylic")); + } + + private void DescribeMobState(EntityUid uid, MobStateComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.CurrentState == Shared.Mobs.MobState.Critical) + ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); + } + + private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.CurrentThreshold <= HungerThreshold.Peckish) + ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); + } + + private void DescribeFixtures(EntityUid uid, FixturesComponent component, GetPsychognomicDescriptorEvent ev) + { + foreach (var fixture in component.Fixtures.Values) + { + if (fixture.CollisionMask == (int) CollisionGroup.GhostImpassable) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-pneumatic")); + return; + } + } + } + + private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.FixturesMass < 45) + ev.Descriptors.Add(Loc.GetString("p-descriptor-light")); + else if (component.FixturesMass > 70) + ev.Descriptors.Add(Loc.GetString("p-descriptor-heavy")); + } + + private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Score > 0) + { + ev.Descriptors.Add(Loc.GetString("cyclic")); + } } + private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.AddToGlimmer) + ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); + else + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); + } + } + + private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) + { + foreach (var power in component.ActivePowers) + { + // TODO: Mime counts too and isn't added back to psions yet + if (power.ID == "PyrokinesisPower" || power.ID == "NoosphericZapPower") + ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); + + return; + } + } + + private void DescribeInnatePsionics(EntityUid uid, InnatePsionicPowersComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-gnostic")); + } + private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + } + + private void DescribeRevenant(EntityUid uid, RevenantComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + } + + private void DescribeFamiliar(EntityUid uid, FamiliarComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-bound")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); + } + + private void DescribeOracle(EntityUid uid, OracleComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + } + + private void DescribeSophia(EntityUid uid, SophicScribeComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + } } public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs { diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index dcd49c89364..fb7617d4a21 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -105,13 +105,11 @@ public void SendTelepathicChat(EntityUid source, string message, bool hideChat) var ev = new GetPsychognomicDescriptorEvent(); RaiseLocalEvent(source, ev); + ev.Descriptors.Add("p-descriptor-ignorant"); string psychogMessageWrap; string descriptor; - if (ev.Descriptors.Count == 0) - descriptor = Loc.GetString("p-descriptor-mysterious"); - else - descriptor = _random.Pick(ev.Descriptors); + descriptor = _random.Pick(ev.Descriptors); psychogMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-psychognomy", ("source", descriptor.ToUpper()), ("message", message)); diff --git a/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl index dcf4d11156e..22a71527a71 100644 --- a/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl +++ b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl @@ -1,3 +1,21 @@ -p-descriptor-mysterious = Mysterious -p-descriptor-male = Male -p-descriptor-female = Female \ No newline at end of file +p-descriptor-mysterious = mysterious +p-descriptor-male = male +p-descriptor-female = female +p-descriptor-young = young +p-descriptor-old = old +p-descriptor-masculine = masculine +p-descriptor-feminine = feminine +p-descriptor-hylic = hylic +p-descriptor-pneumatic = pneumatic +p-descriptor-liminal = liminal +p-descriptor-bound = bound +p-descriptor-ignorant = ignorant +p-descriptor-demiurgic = demiurgic +p-descriptor-emanative = emanative +p-descriptor-light = light +p-descriptor-heavy = heavy +p-descriptor-cyclic = cyclic +p-descriptor-hungry = hungry +p-descriptor-vampiric = vampiric +p-descriptor-kinetic = kinetic +p-descriptor-gnostic = gnostic \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml index 51a25bffcdc..c074cd89537 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml @@ -16,6 +16,12 @@ - type: Speech speechSounds: Tenor - type: Psionic + removable: false + - type: InnatePsionicPowers + powersToAdd: + - XenoglossyPower + - PsychognomyPower + - NoosphericZapPower - type: SolutionContainerManager solutions: fountain: diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml index 24aa3eba08f..b6c209b443e 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml @@ -1,7 +1,7 @@ - type: entity parent: BaseStructure id: SophicScribe - name: sophie + name: Sophia description: Latest reports on the Noösphere! components: - type: Sprite @@ -28,6 +28,12 @@ - Common - Science - type: Psionic + removable: false + - type: InnatePsionicPowers + powersToAdd: + - XenoglossyPower + - PsychognomyPower + - NoosphericZapPower - type: Grammar attributes: gender: female diff --git a/Resources/Prototypes/Nyanotrasen/psionicPowers.yml b/Resources/Prototypes/Nyanotrasen/psionicPowers.yml index 8a67cd319d7..b1e5f836c2c 100644 --- a/Resources/Prototypes/Nyanotrasen/psionicPowers.yml +++ b/Resources/Prototypes/Nyanotrasen/psionicPowers.yml @@ -6,6 +6,7 @@ TelegnosisPower: 1 PsionicRegenerationPower: 1 XenoglossyPower: 0.75 + PsychognomyPower: 0.75 MassSleepPower: 0.3 # PsionicInvisibilityPower: 0.15 MindSwapPower: 0.15 From 4432bfe7ae6ca31e9eb750b8b958f9c467be5942 Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 23:03:26 -0400 Subject: [PATCH 05/13] more descriptors --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 14 ++++++++++++-- .../en-US/psionics/psychognomic-descriptors.ftl | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index 2f01df54f69..29aebe7d411 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -2,7 +2,10 @@ using Content.Shared.Damage; using Content.Shared.Mobs.Components; using Content.Shared.Physics; -using Content.Shared.Psionics; +using Content.Shared.Speech; +using Content.Shared.Speech.Muting; +using Content.Shared.CombatMode.Pacification; +using Content.Shared.CombatMode; using Content.Server.Bible.Components; using Content.Server.Research.Oracle; using Robust.Shared.GameObjects.Components.Localization; @@ -17,7 +20,6 @@ using Content.Shared.Revenant.Components; using Content.Shared.Abilities.Psionics; using Content.Server.Abilities.Psionics; -using System.ComponentModel; namespace Content.Server.Chat { @@ -124,8 +126,15 @@ private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent compone } } + // This one's also a bit of a catch-all for "lacks component" private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) { + if (!HasComp(uid) || HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-dumb")); + + if (!HasComp(uid) || HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-passive")); + foreach (var power in component.ActivePowers) { // TODO: Mime counts too and isn't added back to psions yet @@ -161,6 +170,7 @@ private void DescribeOracle(EntityUid uid, OracleComponent component, GetPsychog ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); } private void DescribeSophia(EntityUid uid, SophicScribeComponent component, GetPsychognomicDescriptorEvent ev) diff --git a/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl index 22a71527a71..d91f0f25245 100644 --- a/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl +++ b/Resources/Locale/en-US/psionics/psychognomic-descriptors.ftl @@ -18,4 +18,6 @@ p-descriptor-cyclic = cyclic p-descriptor-hungry = hungry p-descriptor-vampiric = vampiric p-descriptor-kinetic = kinetic -p-descriptor-gnostic = gnostic \ No newline at end of file +p-descriptor-gnostic = gnostic +p-descriptor-dumb = dumb +p-descriptor-passive = passive \ No newline at end of file From 33181472228515dbd13018a401739ea6831b3507 Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 23:42:17 -0400 Subject: [PATCH 06/13] migration --- Resources/Migrations/eeMigration.yml | 4 +++ .../Entities/Markers/Spawners/statues.yml | 25 +++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 Resources/Prototypes/Entities/Markers/Spawners/statues.yml diff --git a/Resources/Migrations/eeMigration.yml b/Resources/Migrations/eeMigration.yml index 26713f6cbac..8d95da53bcb 100644 --- a/Resources/Migrations/eeMigration.yml +++ b/Resources/Migrations/eeMigration.yml @@ -1,3 +1,7 @@ # 2024-06-08 CrateFunPlushie: CrateFunToyBox CrateFunLizardPlushieBulk: CrateFunToyBox + +# 2024-08-27 +Oracle: OracleSpawner +SophicScribe: SophicScribeSpawner \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Markers/Spawners/statues.yml b/Resources/Prototypes/Entities/Markers/Spawners/statues.yml new file mode 100644 index 00000000000..4a3b89e4019 --- /dev/null +++ b/Resources/Prototypes/Entities/Markers/Spawners/statues.yml @@ -0,0 +1,25 @@ +- type: entity + name: Oracle Spawner + id: OracleSpawner + parent: MarkerBase + components: + - type: Sprite + sprite: Markers/jobs.rsi + layers: + - state: green + - type: ConditionalSpawner + prototypes: + - Oracle + +- type: entity + name: Sophia Spawner + id: SophicScribeSpawner + parent: MarkerBase + components: + - type: Sprite + sprite: Markers/jobs.rsi + layers: + - state: green + - type: ConditionalSpawner + prototypes: + - SophicScribe From fe742dd97190b507743098c0f8abadba75fd48ac Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 23:51:42 -0400 Subject: [PATCH 07/13] magil review + some preemptive fixes for oracle + scribe --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 22 ++++++++++--------- Content.Server/Chat/TelepathicChatSystem.cs | 1 + .../Psychognomy/PsychognomistComponent.cs | 4 +--- .../Entities/Structures/Specific/oracle.yml | 1 + .../Structures/Research/sophicscribe.yml | 2 ++ 5 files changed, 17 insertions(+), 13 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index 29aebe7d411..96e651e941f 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -77,8 +77,10 @@ private void DescribeDamage(EntityUid uid, DamageableComponent component, GetPsy private void DescribeMobState(EntityUid uid, MobStateComponent component, GetPsychognomicDescriptorEvent ev) { - if (component.CurrentState == Shared.Mobs.MobState.Critical) - ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); + if (component.CurrentState != Shared.Mobs.MobState.Critical) + return; + + ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); } private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychognomicDescriptorEvent ev) @@ -90,13 +92,11 @@ private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychog private void DescribeFixtures(EntityUid uid, FixturesComponent component, GetPsychognomicDescriptorEvent ev) { foreach (var fixture in component.Fixtures.Values) - { if (fixture.CollisionMask == (int) CollisionGroup.GhostImpassable) { ev.Descriptors.Add(Loc.GetString("p-descriptor-pneumatic")); return; } - } } private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsychognomicDescriptorEvent ev) @@ -109,10 +109,10 @@ private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsych private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component, GetPsychognomicDescriptorEvent ev) { - if (component.Score > 0) - { - ev.Descriptors.Add(Loc.GetString("cyclic")); - } + if (component.Score == 0) + return; + + ev.Descriptors.Add(Loc.GetString("cyclic")); } private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) @@ -138,9 +138,10 @@ private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychog foreach (var power in component.ActivePowers) { // TODO: Mime counts too and isn't added back to psions yet - if (power.ID == "PyrokinesisPower" || power.ID == "NoosphericZapPower") - ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); + if (power.ID != "PyrokinesisPower" && power.ID != "NoosphericZapPower") + continue; + ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); return; } } @@ -149,6 +150,7 @@ private void DescribeInnatePsionics(EntityUid uid, InnatePsionicPowersComponent { ev.Descriptors.Add(Loc.GetString("p-descriptor-gnostic")); } + private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, GetPsychognomicDescriptorEvent ev) { ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index fb7617d4a21..12b144477d6 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -37,6 +37,7 @@ public override void Initialize() base.Initialize(); InitializePsychognomy(); } + private (IEnumerable normal, IEnumerable psychog) GetPsionicChatClients() { var psions = Filter.Empty() diff --git a/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs index 9f7d29593fe..83b1a28435c 100644 --- a/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs +++ b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs @@ -1,8 +1,6 @@ namespace Content.Shared.Abilities.Psionics.Passives { [RegisterComponent] - public sealed partial class PsychognomistComponent : Component - { - } + public sealed partial class PsychognomistComponent : Component { } } diff --git a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml index c074cd89537..d8a5c141a11 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml @@ -15,6 +15,7 @@ state: oracle-0 - type: Speech speechSounds: Tenor + - type: Actions - type: Psionic removable: false - type: InnatePsionicPowers diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml index b6c209b443e..69f29e7297a 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml @@ -27,6 +27,7 @@ channels: - Common - Science + - type: Actions - type: Psionic removable: false - type: InnatePsionicPowers @@ -42,3 +43,4 @@ - type: GuideHelp guides: - Psionics + - type: Prayable \ No newline at end of file From ca79630c0a651cff29cb2b5d8859ec03e87d646d Mon Sep 17 00:00:00 2001 From: Rane Date: Tue, 27 Aug 2024 23:59:01 -0400 Subject: [PATCH 08/13] filespace --- Content.Server/Chat/TelepathicChatSystem.cs | 2 +- .../Passives/Psychognomy/PsychognomistComponent.cs | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index 12b144477d6..407d79fc3c0 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -3,7 +3,7 @@ using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Shared.Abilities.Psionics; -using Content.Shared.Abilities.Psionics.Passives; +using Content.Shared.Psionics.Passives; using Content.Shared.Bed.Sleep; using Content.Shared.Chat; using Content.Shared.Database; diff --git a/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs index 83b1a28435c..5108ef5b410 100644 --- a/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs +++ b/Content.Shared/Psionics/Passives/Psychognomy/PsychognomistComponent.cs @@ -1,6 +1,5 @@ -namespace Content.Shared.Abilities.Psionics.Passives -{ - [RegisterComponent] - public sealed partial class PsychognomistComponent : Component { } -} +namespace Content.Shared.Psionics.Passives; + +[RegisterComponent] +public sealed partial class PsychognomistComponent : Component { } From a2a23edf82daef8050fc8a3a3901c531877cd63b Mon Sep 17 00:00:00 2001 From: Rane Date: Wed, 28 Aug 2024 00:00:25 -0400 Subject: [PATCH 09/13] more magil reformatting --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 266 +++++++++--------- 1 file changed, 133 insertions(+), 133 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index 96e651e941f..50e44041de7 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -21,169 +21,169 @@ using Content.Shared.Abilities.Psionics; using Content.Server.Abilities.Psionics; -namespace Content.Server.Chat +namespace Content.Server.Chat; +public sealed partial class TelepathicChatSystem { - public sealed partial class TelepathicChatSystem + private void InitializePsychognomy() { - private void InitializePsychognomy() - { - SubscribeLocalEvent(DescribeHumanoid); - SubscribeLocalEvent(DescribeGrammar); - SubscribeLocalEvent(DescribeDamage); - SubscribeLocalEvent(DescribeMobState); - SubscribeLocalEvent(DescribeHunger); - SubscribeLocalEvent(DescribePhysics); - SubscribeLocalEvent(DescribeFixtures); - SubscribeLocalEvent(DescribeKarma); - SubscribeLocalEvent(DescribeGlimmerSource); - SubscribeLocalEvent(DescribePsion); - SubscribeLocalEvent(DescribeInnatePsionics); - SubscribeLocalEvent(DescribeBloodsucker); - SubscribeLocalEvent(DescribeRevenant); - // SubscribeLocalEvent(DescribeGlimmerWisp); - SubscribeLocalEvent(DescribeFamiliar); - // SubscribeLocalEvent(DescribeGolem); - SubscribeLocalEvent(DescribeOracle); - SubscribeLocalEvent(DescribeSophia); - } - - private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.Sex != Sex.Unsexed) - ev.Descriptors.Add(component.Sex == Sex.Male ? Loc.GetString("p-descriptor-male") : Loc.GetString("p-descriptor-female")); - - // Deliberately obfuscating a bit; psionic signatures use different standards - ev.Descriptors.Add(component.Age >= 100 ? Loc.GetString("p-descriptor-old") : Loc.GetString("p-descriptor-young")); - } + SubscribeLocalEvent(DescribeHumanoid); + SubscribeLocalEvent(DescribeGrammar); + SubscribeLocalEvent(DescribeDamage); + SubscribeLocalEvent(DescribeMobState); + SubscribeLocalEvent(DescribeHunger); + SubscribeLocalEvent(DescribePhysics); + SubscribeLocalEvent(DescribeFixtures); + SubscribeLocalEvent(DescribeKarma); + SubscribeLocalEvent(DescribeGlimmerSource); + SubscribeLocalEvent(DescribePsion); + SubscribeLocalEvent(DescribeInnatePsionics); + SubscribeLocalEvent(DescribeBloodsucker); + SubscribeLocalEvent(DescribeRevenant); + // SubscribeLocalEvent(DescribeGlimmerWisp); + SubscribeLocalEvent(DescribeFamiliar); + // SubscribeLocalEvent(DescribeGolem); + SubscribeLocalEvent(DescribeOracle); + SubscribeLocalEvent(DescribeSophia); + } - private void DescribeGrammar(EntityUid uid, GrammarComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.Gender == Gender.Male || component.Gender == Gender.Female) - ev.Descriptors.Add(component.Gender == Gender.Male ? Loc.GetString("p-descriptor-masculine") : Loc.GetString("p-descriptor-feminine")); - } + private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Sex != Sex.Unsexed) + ev.Descriptors.Add(component.Sex == Sex.Male ? Loc.GetString("p-descriptor-male") : Loc.GetString("p-descriptor-female")); - private void DescribeDamage(EntityUid uid, DamageableComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.DamageContainerID == "CorporealSpirit") - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); - if (!HasComp(uid)) - ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); - return; - } + // Deliberately obfuscating a bit; psionic signatures use different standards + ev.Descriptors.Add(component.Age >= 100 ? Loc.GetString("p-descriptor-old") : Loc.GetString("p-descriptor-young")); + } - ev.Descriptors.Add(Loc.GetString("p-descriptor-hylic")); - } + private void DescribeGrammar(EntityUid uid, GrammarComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Gender == Gender.Male || component.Gender == Gender.Female) + ev.Descriptors.Add(component.Gender == Gender.Male ? Loc.GetString("p-descriptor-masculine") : Loc.GetString("p-descriptor-feminine")); + } - private void DescribeMobState(EntityUid uid, MobStateComponent component, GetPsychognomicDescriptorEvent ev) + private void DescribeDamage(EntityUid uid, DamageableComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.DamageContainerID == "CorporealSpirit") { - if (component.CurrentState != Shared.Mobs.MobState.Critical) - return; - ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); + if (!HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + return; } - private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.CurrentThreshold <= HungerThreshold.Peckish) - ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); - } + ev.Descriptors.Add(Loc.GetString("p-descriptor-hylic")); + } - private void DescribeFixtures(EntityUid uid, FixturesComponent component, GetPsychognomicDescriptorEvent ev) - { - foreach (var fixture in component.Fixtures.Values) - if (fixture.CollisionMask == (int) CollisionGroup.GhostImpassable) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-pneumatic")); - return; - } - } + private void DescribeMobState(EntityUid uid, MobStateComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.CurrentState != Shared.Mobs.MobState.Critical) + return; - private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.FixturesMass < 45) - ev.Descriptors.Add(Loc.GetString("p-descriptor-light")); - else if (component.FixturesMass > 70) - ev.Descriptors.Add(Loc.GetString("p-descriptor-heavy")); - } + ev.Descriptors.Add(Loc.GetString("p-descriptor-liminal")); + } - private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.Score == 0) - return; + private void DescribeHunger(EntityUid uid, HungerComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.CurrentThreshold > HungerThreshold.Peckish) + return; - ev.Descriptors.Add(Loc.GetString("cyclic")); - } + ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); + } - private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) - { - if (component.AddToGlimmer) - ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); - else + private void DescribeFixtures(EntityUid uid, FixturesComponent component, GetPsychognomicDescriptorEvent ev) + { + foreach (var fixture in component.Fixtures.Values) + if (fixture.CollisionMask == (int) CollisionGroup.GhostImpassable) { - ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-pneumatic")); + return; } - } - - // This one's also a bit of a catch-all for "lacks component" - private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) - { - if (!HasComp(uid) || HasComp(uid)) - ev.Descriptors.Add(Loc.GetString("p-descriptor-dumb")); - - if (!HasComp(uid) || HasComp(uid)) - ev.Descriptors.Add(Loc.GetString("p-descriptor-passive")); + } - foreach (var power in component.ActivePowers) - { - // TODO: Mime counts too and isn't added back to psions yet - if (power.ID != "PyrokinesisPower" && power.ID != "NoosphericZapPower") - continue; + private void DescribePhysics(EntityUid uid, PhysicsComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.FixturesMass < 45) + ev.Descriptors.Add(Loc.GetString("p-descriptor-light")); + else if (component.FixturesMass > 70) + ev.Descriptors.Add(Loc.GetString("p-descriptor-heavy")); + } - ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); - return; - } - } + private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.Score == 0) + return; - private void DescribeInnatePsionics(EntityUid uid, InnatePsionicPowersComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-gnostic")); - } + ev.Descriptors.Add(Loc.GetString("cyclic")); + } - private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, GetPsychognomicDescriptorEvent ev) + private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) + { + if (component.AddToGlimmer) + ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); + else { ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-hungry")); } + } - private void DescribeRevenant(EntityUid uid, RevenantComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); - } + // This one's also a bit of a catch-all for "lacks component" + private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) + { + if (!HasComp(uid) || HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-dumb")); - private void DescribeFamiliar(EntityUid uid, FamiliarComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-bound")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); - } + if (!HasComp(uid) || HasComp(uid)) + ev.Descriptors.Add(Loc.GetString("p-descriptor-passive")); - private void DescribeOracle(EntityUid uid, OracleComponent component, GetPsychognomicDescriptorEvent ev) + foreach (var power in component.ActivePowers) { - ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); - } + // TODO: Mime counts too and isn't added back to psions yet + if (power.ID != "PyrokinesisPower" && power.ID != "NoosphericZapPower") + continue; - private void DescribeSophia(EntityUid uid, SophicScribeComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-kinetic")); + return; } } - public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs + + private void DescribeInnatePsionics(EntityUid uid, InnatePsionicPowersComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-gnostic")); + } + + private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + } + + private void DescribeRevenant(EntityUid uid, RevenantComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); + } + + private void DescribeFamiliar(EntityUid uid, FamiliarComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-bound")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); + } + + private void DescribeOracle(EntityUid uid, OracleComponent component, GetPsychognomicDescriptorEvent ev) { - public List Descriptors = new List(); + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); } -} \ No newline at end of file + + private void DescribeSophia(EntityUid uid, SophicScribeComponent component, GetPsychognomicDescriptorEvent ev) + { + ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); + } +} +public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs +{ + public List Descriptors = new List(); +} From 9ec4ff83c69804e8b567acff5bdaecac3fb68fb3 Mon Sep 17 00:00:00 2001 From: Rane Date: Wed, 28 Aug 2024 00:01:16 -0400 Subject: [PATCH 10/13] fix loc string --- Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index 50e44041de7..1311a2387bd 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -113,7 +113,7 @@ private void DescribeKarma(EntityUid uid, MetempsychosisKarmaComponent component if (component.Score == 0) return; - ev.Descriptors.Add(Loc.GetString("cyclic")); + ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); } private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent component, GetPsychognomicDescriptorEvent ev) From 919f384fc6f5684c0be5e1ab96ea9c35a1b94b79 Mon Sep 17 00:00:00 2001 From: Rane Date: Fri, 30 Aug 2024 16:44:15 -0400 Subject: [PATCH 11/13] revert changes --- .../Prototypes/Entities/Structures/Specific/oracle.yml | 7 ------- .../Entities/Structures/Research/sophicscribe.yml | 10 +--------- 2 files changed, 1 insertion(+), 16 deletions(-) diff --git a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml index d8a5c141a11..51a25bffcdc 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml @@ -15,14 +15,7 @@ state: oracle-0 - type: Speech speechSounds: Tenor - - type: Actions - type: Psionic - removable: false - - type: InnatePsionicPowers - powersToAdd: - - XenoglossyPower - - PsychognomyPower - - NoosphericZapPower - type: SolutionContainerManager solutions: fountain: diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml index 69f29e7297a..24aa3eba08f 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml @@ -1,7 +1,7 @@ - type: entity parent: BaseStructure id: SophicScribe - name: Sophia + name: sophie description: Latest reports on the Noösphere! components: - type: Sprite @@ -27,14 +27,7 @@ channels: - Common - Science - - type: Actions - type: Psionic - removable: false - - type: InnatePsionicPowers - powersToAdd: - - XenoglossyPower - - PsychognomyPower - - NoosphericZapPower - type: Grammar attributes: gender: female @@ -43,4 +36,3 @@ - type: GuideHelp guides: - Psionics - - type: Prayable \ No newline at end of file From e79371bd04dfbfe0aafd7d78266c0f64bfecf405 Mon Sep 17 00:00:00 2001 From: Rane Date: Fri, 30 Aug 2024 17:29:12 -0400 Subject: [PATCH 12/13] raistlin review --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 42 ++++--------------- Content.Server/Chat/TelepathicChatSystem.cs | 2 +- .../DeltaV/Entities/Mobs/NPCs/familiars.yml | 4 ++ .../Entities/Mobs/NPCs/revenant.yml | 7 ++++ .../Entities/Mobs/Player/familiars.yml | 8 +++- .../Entities/Structures/Specific/oracle.yml | 6 +++ .../Structures/Research/sophicscribe.yml | 5 +++ 7 files changed, 38 insertions(+), 36 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index 1311a2387bd..ce89fdddaf3 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -7,10 +7,8 @@ using Content.Shared.CombatMode.Pacification; using Content.Shared.CombatMode; using Content.Server.Bible.Components; -using Content.Server.Research.Oracle; using Robust.Shared.GameObjects.Components.Localization; using Robust.Shared.Enums; -using Content.Server.Nyanotrasen.Research.SophicScribe; using Content.Server.Nyanotrasen.Cloning; using Content.Server.Psionics.Glimmer; using Robust.Shared.Physics; @@ -38,12 +36,6 @@ private void InitializePsychognomy() SubscribeLocalEvent(DescribePsion); SubscribeLocalEvent(DescribeInnatePsionics); SubscribeLocalEvent(DescribeBloodsucker); - SubscribeLocalEvent(DescribeRevenant); - // SubscribeLocalEvent(DescribeGlimmerWisp); - SubscribeLocalEvent(DescribeFamiliar); - // SubscribeLocalEvent(DescribeGolem); - SubscribeLocalEvent(DescribeOracle); - SubscribeLocalEvent(DescribeSophia); } private void DescribeHumanoid(EntityUid uid, HumanoidAppearanceComponent component, GetPsychognomicDescriptorEvent ev) @@ -130,6 +122,14 @@ private void DescribeGlimmerSource(EntityUid uid, GlimmerSourceComponent compone // This one's also a bit of a catch-all for "lacks component" private void DescribePsion(EntityUid uid, PsionicComponent component, GetPsychognomicDescriptorEvent ev) { + if (component.PsychognomicDescriptors != null) + { + foreach (var descriptor in component.PsychognomicDescriptors) + { + ev.Descriptors.Add(Loc.GetString(descriptor)); + } + } + if (!HasComp(uid) || HasComp(uid)) ev.Descriptors.Add(Loc.GetString("p-descriptor-dumb")); @@ -156,32 +156,6 @@ private void DescribeBloodsucker(EntityUid uid, BloodSuckerComponent component, { ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); } - - private void DescribeRevenant(EntityUid uid, RevenantComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-vampiric")); - } - - private void DescribeFamiliar(EntityUid uid, FamiliarComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-bound")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-cyclic")); - } - - private void DescribeOracle(EntityUid uid, OracleComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-emanative")); - } - - private void DescribeSophia(EntityUid uid, SophicScribeComponent component, GetPsychognomicDescriptorEvent ev) - { - ev.Descriptors.Add(Loc.GetString("p-descriptor-old")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-demiurgic")); - ev.Descriptors.Add(Loc.GetString("p-descriptor-mysterious")); - } } public sealed class GetPsychognomicDescriptorEvent : EntityEventArgs { diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index 1a3107461d0..da2b13518b9 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -108,7 +108,7 @@ public void SendTelepathicChat(EntityUid source, string message, bool hideChat) var ev = new GetPsychognomicDescriptorEvent(); RaiseLocalEvent(source, ev); - ev.Descriptors.Add("p-descriptor-ignorant"); + ev.Descriptors.Add(Loc.GetString("p-descriptor-ignorant")); string psychogMessageWrap; string descriptor; diff --git a/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/familiars.yml b/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/familiars.yml index 173c7e43ec4..364907ff9c4 100644 --- a/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/familiars.yml +++ b/Resources/Prototypes/DeltaV/Entities/Mobs/NPCs/familiars.yml @@ -92,9 +92,13 @@ nameSegments: [names_golem] - type: Psionic removable: false + psychognomicDescriptors: + - p-descriptor-bound + - p-descriptor-cyclic - type: InnatePsionicPowers powersToAdd: - PyrokinesisPower + - TelepathyPower - type: Grammar attributes: proper: true diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml index 1c6bda6fd3c..094e205dd3e 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml @@ -98,3 +98,10 @@ - type: Speech speechVerb: Ghost - type: UniversalLanguageSpeaker + - type: Psionic + removable: false + psychognomicDescriptors: + - p-descriptor-vampiric + - type: InnatePsionicPowers + powersToAdd: + - TelepathyPower \ No newline at end of file diff --git a/Resources/Prototypes/Entities/Mobs/Player/familiars.yml b/Resources/Prototypes/Entities/Mobs/Player/familiars.yml index 6510c8af99b..6014cae24f3 100644 --- a/Resources/Prototypes/Entities/Mobs/Player/familiars.yml +++ b/Resources/Prototypes/Entities/Mobs/Player/familiars.yml @@ -34,8 +34,14 @@ - PsionicInterloper #Nyano - Summary: makes a part of the psionic faction. - type: Alerts - type: Familiar - - type: Psionic #Nyano - Summary: Makes psionic on creation. + - type: Psionic removable: false + psychognomicDescriptors: + - p-descriptor-bound + - p-descriptor-cyclic + - type: InnatePsionicPowers + powersToAdd: + - TelepathyPower - type: entity name: Cerberus diff --git a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml index 51a25bffcdc..cff92909ebf 100644 --- a/Resources/Prototypes/Entities/Structures/Specific/oracle.yml +++ b/Resources/Prototypes/Entities/Structures/Specific/oracle.yml @@ -16,6 +16,12 @@ - type: Speech speechSounds: Tenor - type: Psionic + removable: false + psychognomicDescriptors: + - p-descriptor-old + - p-descriptor-demiurgic + - p-descriptor-mysterious + - p-descriptor-emanative - type: SolutionContainerManager solutions: fountain: diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml index 24aa3eba08f..657efa9960c 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Structures/Research/sophicscribe.yml @@ -28,6 +28,11 @@ - Common - Science - type: Psionic + removable: false + psychognomicDescriptors: + - p-descriptor-old + - p-descriptor-demiurgic + - p-descriptor-mysterious - type: Grammar attributes: gender: female From 872c7cf8b96bf930c8684888b27a6d5858025764 Mon Sep 17 00:00:00 2001 From: Rane Date: Fri, 30 Aug 2024 17:42:52 -0400 Subject: [PATCH 13/13] finish up --- .../Chat/TelepathicChatSystem.Psychognomy.cs | 24 ++++++++++----- Content.Server/Chat/TelepathicChatSystem.cs | 8 +---- .../Research/Oracle/OracleSystem.cs | 30 ++++++++++++++----- Content.Shared/Psionics/PsionicComponent.cs | 7 +++++ 4 files changed, 46 insertions(+), 23 deletions(-) diff --git a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs index ce89fdddaf3..a794329d9b1 100644 --- a/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs +++ b/Content.Server/Chat/TelepathicChatSystem.Psychognomy.cs @@ -6,22 +6,30 @@ using Content.Shared.Speech.Muting; using Content.Shared.CombatMode.Pacification; using Content.Shared.CombatMode; -using Content.Server.Bible.Components; -using Robust.Shared.GameObjects.Components.Localization; -using Robust.Shared.Enums; -using Content.Server.Nyanotrasen.Cloning; -using Content.Server.Psionics.Glimmer; -using Robust.Shared.Physics; -using Robust.Shared.Physics.Components; using Content.Shared.Nutrition.Components; using Content.Server.Vampiric; -using Content.Shared.Revenant.Components; using Content.Shared.Abilities.Psionics; using Content.Server.Abilities.Psionics; +using Content.Server.Nyanotrasen.Cloning; +using Content.Server.Psionics.Glimmer; +using Robust.Shared.GameObjects.Components.Localization; +using Robust.Shared.Enums; +using Robust.Shared.Physics; +using Robust.Shared.Physics.Components; +using Robust.Shared.Random; namespace Content.Server.Chat; public sealed partial class TelepathicChatSystem { + public string SourceToDescriptor(EntityUid source) + { + var ev = new GetPsychognomicDescriptorEvent(); + RaiseLocalEvent(source, ev); + + ev.Descriptors.Add(Loc.GetString("p-descriptor-ignorant")); + + return _random.Pick(ev.Descriptors); + } private void InitializePsychognomy() { SubscribeLocalEvent(DescribeHumanoid); diff --git a/Content.Server/Chat/TelepathicChatSystem.cs b/Content.Server/Chat/TelepathicChatSystem.cs index da2b13518b9..b1338035adb 100644 --- a/Content.Server/Chat/TelepathicChatSystem.cs +++ b/Content.Server/Chat/TelepathicChatSystem.cs @@ -105,14 +105,8 @@ public void SendTelepathicChat(EntityUid source, string message, bool hideChat) if (clients.psychog.Count() > 0) { - var ev = new GetPsychognomicDescriptorEvent(); - RaiseLocalEvent(source, ev); - - ev.Descriptors.Add(Loc.GetString("p-descriptor-ignorant")); + var descriptor = SourceToDescriptor(source); string psychogMessageWrap; - string descriptor; - - descriptor = _random.Pick(ev.Descriptors); psychogMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-psychognomy", ("source", descriptor.ToUpper()), ("message", message)); diff --git a/Content.Server/Research/Oracle/OracleSystem.cs b/Content.Server/Research/Oracle/OracleSystem.cs index a93627dbd3a..15f0a474470 100644 --- a/Content.Server/Research/Oracle/OracleSystem.cs +++ b/Content.Server/Research/Oracle/OracleSystem.cs @@ -1,6 +1,7 @@ using System.Diagnostics.CodeAnalysis; using System.Linq; using Content.Server.Botany; +using Content.Server.Chat; using Content.Server.Chat.Managers; using Content.Server.Chat.Systems; using Content.Server.Chemistry.Containers.EntitySystems; @@ -13,6 +14,7 @@ using Content.Shared.Interaction; using Content.Shared.Mobs.Components; using Content.Shared.Psionics.Glimmer; +using Content.Shared.Psionics.Passives; using Content.Shared.Random.Helpers; using Content.Shared.Research.Components; using Content.Shared.Research.Prototypes; @@ -29,6 +31,7 @@ namespace Content.Server.Research.Oracle; public sealed class OracleSystem : EntitySystem { [Dependency] private readonly ChatSystem _chat = default!; + [Dependency] private readonly TelepathicChatSystem _tChat = default!; [Dependency] private readonly IChatManager _chatMan = default!; [Dependency] private readonly GlimmerSystem _glimmer = default!; [Dependency] private readonly IPrototypeManager _protoMan = default!; @@ -78,11 +81,11 @@ private void OnInteractHand(Entity oracle, ref InteractHandEven return; SendTelepathicInfo(oracle, actor.PlayerSession.Channel, - Loc.GetString("oracle-current-item", ("item", oracle.Comp.DesiredPrototype.Name))); + Loc.GetString("oracle-current-item", ("item", oracle.Comp.DesiredPrototype.Name)), HasComp(args.User)); if (oracle.Comp.LastDesiredPrototype != null) SendTelepathicInfo(oracle, actor.PlayerSession.Channel, - Loc.GetString("oracle-previous-item", ("item", oracle.Comp.LastDesiredPrototype.Name))); + Loc.GetString("oracle-previous-item", ("item", oracle.Comp.LastDesiredPrototype.Name)), HasComp(args.User)); } private void OnInteractUsing(Entity oracle, ref InteractUsingEvent args) @@ -123,14 +126,25 @@ private void OnInteractUsing(Entity oracle, ref InteractUsingEv NextItem(oracle); } - private void SendTelepathicInfo(Entity oracle, INetChannel client, string message) + private void SendTelepathicInfo(Entity oracle, INetChannel client, string message, bool psychognomist = false) { - var messageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message", - ("telepathicChannelName", Loc.GetString("chat-manager-telepathic-channel-name")), - ("message", message)); + if (!psychognomist) + { + var messageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message", + ("telepathicChannelName", Loc.GetString("chat-manager-telepathic-channel-name")), + ("message", message)); - _chatMan.ChatMessageToOne(ChatChannel.Telepathic, - message, messageWrap, oracle, false, client, Color.PaleVioletRed); + _chatMan.ChatMessageToOne(ChatChannel.Telepathic, + message, messageWrap, oracle, false, client, Color.PaleVioletRed); + } + else + { + var descriptor = _tChat.SourceToDescriptor(oracle); + var psychogMessageWrap = Loc.GetString("chat-manager-send-telepathic-chat-wrap-message-psychognomy", + ("source", descriptor.ToUpper()), ("message", message)); + + _chatMan.ChatMessageToOne(ChatChannel.Telepathic, message, psychogMessageWrap, oracle, false, client, Color.PaleVioletRed); + } } private bool IsCorrectItem(EntityPrototype given, EntityPrototype target) diff --git a/Content.Shared/Psionics/PsionicComponent.cs b/Content.Shared/Psionics/PsionicComponent.cs index 9ff332327a4..63529576152 100644 --- a/Content.Shared/Psionics/PsionicComponent.cs +++ b/Content.Shared/Psionics/PsionicComponent.cs @@ -140,5 +140,12 @@ private set /// [ViewVariables(VVAccess.ReadWrite)] public float CurrentDampening; + + /// + /// List of descriptors this entity will bring up for psychognomy. Used to remove + /// unneccesary subs for unique psionic entities like e.g. Oracle. + /// + [DataField] + public List? PsychognomicDescriptors = null; } }