From 3c317713ecca08b4b1a696174490c6788221673f Mon Sep 17 00:00:00 2001 From: DEATHB4DEFEAT <77995199+DEATHB4DEFEAT@users.noreply.github.com> Date: Thu, 14 Nov 2024 12:02:02 -0800 Subject: [PATCH 1/3] Fix Trait Component Removal (#1221) Caused a debug assert due to the component not being real. --- Content.Server/Traits/TraitSystem.Functions.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Content.Server/Traits/TraitSystem.Functions.cs b/Content.Server/Traits/TraitSystem.Functions.cs index 528cb4f9183..07794903d3e 100644 --- a/Content.Server/Traits/TraitSystem.Functions.cs +++ b/Content.Server/Traits/TraitSystem.Functions.cs @@ -74,7 +74,7 @@ public override void OnPlayerSpawn(EntityUid uid, ISerializationManager serializationManager) { foreach (var (name, _) in Components) - entityManager.RemoveComponent(uid, (Component) factory.GetComponent(name)); + entityManager.RemoveComponentDeferred(uid, factory.GetComponent(name).GetType()); } } From 387a362ae9658b60f72db390b420998aea7bf8b0 Mon Sep 17 00:00:00 2001 From: Mnemotechnican <69920617+Mnemotechnician@users.noreply.github.com> Date: Thu, 14 Nov 2024 23:03:33 +0300 Subject: [PATCH 2/3] Some Language Fixes (#1223) # Description 1. Adds languages to... penguins, cockroaches, snakes, mmis, pdas, mail packages. Positronic brains now only speak/understand the borg language. 2. Adds an explicitly defined universal language to revenants and wisps 3. Makes polymorphs copy over a list of components defined in the polymorph proto, thus copying languages and grammar of the original entity to its polymorphed version.

Media

![image](https://github.com/user-attachments/assets/111c3f91-f077-431f-bcd9-f60fa7a1ba26) ![image](https://github.com/user-attachments/assets/80f939d3-b615-4235-a511-82238758788e) ![image](https://github.com/user-attachments/assets/dce99b55-c8b1-4cbe-8769-b82151b3d404) ![image](https://github.com/user-attachments/assets/6b9b962d-c73c-42b9-b240-aa07601de879)

# Changelog :cl: - tweak: Added languages to certain entities that lacked them, including MMIs and positronic brains. - add: Polymorphing into another entity now preserves your languages and grammar. --- Content.Server/Chat/Systems/ChatSystem.cs | 2 +- .../Polymorph/Systems/PolymorphSystem.cs | 15 +++++++++++++++ Content.Shared/Polymorph/PolymorphPrototype.cs | 11 +++++++++++ .../Prototypes/Entities/Mobs/NPCs/animals.yml | 9 +++++++++ .../Entities/Mobs/NPCs/glimmer_creatures.yml | 3 +++ .../Prototypes/Entities/Mobs/NPCs/revenant.yml | 2 ++ .../Prototypes/Entities/Objects/Devices/pda.yml | 4 ++++ .../Entities/Objects/Specific/Robotics/mmi.yml | 8 ++++++++ Resources/Prototypes/Language/animal.yml | 13 +++++++++++++ .../Entities/Objects/Specific/Mail/base_mail.yml | 4 ++++ 10 files changed, 70 insertions(+), 1 deletion(-) diff --git a/Content.Server/Chat/Systems/ChatSystem.cs b/Content.Server/Chat/Systems/ChatSystem.cs index d743a83ef40..bbca6f4d153 100644 --- a/Content.Server/Chat/Systems/ChatSystem.cs +++ b/Content.Server/Chat/Systems/ChatSystem.cs @@ -43,7 +43,7 @@ namespace Content.Server.Chat.Systems; // Dear contributor. When I was introducing changes to this system only god and I knew what I was doing. // Now only god knows. Please don't touch this code ever again. If you do have to, increment this counter as a warning for others: -// TOTAL_HOURS_WASTED_HERE_EE = 17 +// TOTAL_HOURS_WASTED_HERE_EE = 18 // TODO refactor whatever active warzone this class and chatmanager have become /// diff --git a/Content.Server/Polymorph/Systems/PolymorphSystem.cs b/Content.Server/Polymorph/Systems/PolymorphSystem.cs index e6ba1d02afd..5c970b1a748 100644 --- a/Content.Server/Polymorph/Systems/PolymorphSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphSystem.cs @@ -20,6 +20,7 @@ using Robust.Server.GameObjects; using Robust.Shared.Map; using Robust.Shared.Prototypes; +using Robust.Shared.Serialization.Manager; using Robust.Shared.Timing; using Robust.Shared.Utility; @@ -31,6 +32,7 @@ public sealed partial class PolymorphSystem : EntitySystem [Dependency] private readonly IMapManager _mapManager = default!; [Dependency] private readonly IPrototypeManager _proto = default!; [Dependency] private readonly IGameTiming _gameTiming = default!; + [Dependency] private readonly ISerializationManager _serialization = default!; [Dependency] private readonly ActionsSystem _actions = default!; [Dependency] private readonly AudioSystem _audio = default!; [Dependency] private readonly SharedBuckleSystem _buckle = default!; @@ -201,6 +203,19 @@ private void OnDestruction(Entity ent, ref Destructi var child = Spawn(configuration.Entity, _transform.GetMapCoordinates(uid, targetTransformComp), rotation: _transform.GetWorldRotation(uid)); + // Copy specified components over + foreach (var compName in configuration.CopiedComponents) + { + if (!_compFact.TryGetRegistration(compName, out var reg) + || !EntityManager.TryGetComponent(uid, reg.Idx, out var comp)) + continue; + + var copy = _serialization.CreateCopy(comp, notNullableOverride: true); + copy.Owner = child; + AddComp(child, copy, true); + } + + // Ensure the resulting entity is sentient (why? this sucks) MakeSentientCommand.MakeSentient(child, EntityManager); var polymorphedComp = _compFact.GetComponent(); diff --git a/Content.Shared/Polymorph/PolymorphPrototype.cs b/Content.Shared/Polymorph/PolymorphPrototype.cs index 6d010711d2e..e1bc3b0ba03 100644 --- a/Content.Shared/Polymorph/PolymorphPrototype.cs +++ b/Content.Shared/Polymorph/PolymorphPrototype.cs @@ -115,6 +115,17 @@ public sealed partial record PolymorphConfiguration [DataField(serverOnly: true)] [ViewVariables(VVAccess.ReadWrite)] public TimeSpan Cooldown = TimeSpan.Zero; + + /// + /// The exact names of components to copy over when this polymorph is applied. + /// + [DataField(serverOnly: true)] + public HashSet CopiedComponents = new() + { + "LanguageKnowledge", + "LanguageSpeaker", + "Grammar" + }; } public enum PolymorphInventoryChange : byte diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml index 8dd348f47ec..d192794ea95 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/animals.yml @@ -399,6 +399,9 @@ behaviors: - !type:GibBehavior { } - type: NonSpreaderZombie + - type: LanguageKnowledge + speaks: [Hissing] + understands: [Hissing] - type: entity name: glockroach @@ -2104,6 +2107,9 @@ - type: RandomBark barkType: penguin barkMultiplier: 0.6 + - type: LanguageKnowledge + speaks: [Penguin] + understands: [Penguin] - type: entity name: grenade penguin @@ -2224,6 +2230,9 @@ minTime: 10 maxTime: 50 # It's a sssnake... barkType: hissing + - type: LanguageKnowledge + speaks: [Hissing] + understands: [Hissing] # Code unique spider prototypes or combine them all into one spider and get a # random sprite state when you spawn it. diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/glimmer_creatures.yml b/Resources/Prototypes/Entities/Mobs/NPCs/glimmer_creatures.yml index 33e4ecee260..c2219d7fae3 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/glimmer_creatures.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/glimmer_creatures.yml @@ -161,3 +161,6 @@ - type: NPCRetaliation attackMemoryLength: 10 - type: NPCRangedCombat + # other + - type: LanguageSpeaker + - type: UniversalLanguageSpeaker # Should it speak unversal or some other language? diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml index c16816b5e44..d466a34383d 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/revenant.yml @@ -107,3 +107,5 @@ powersToAdd: - XenoglossyPower - TelepathyPower + - type: LanguageSpeaker + - type: UniversalLanguageSpeaker diff --git a/Resources/Prototypes/Entities/Objects/Devices/pda.yml b/Resources/Prototypes/Entities/Objects/Devices/pda.yml index bad1a8099ec..e32271f4cd9 100644 --- a/Resources/Prototypes/Entities/Objects/Devices/pda.yml +++ b/Resources/Prototypes/Entities/Objects/Devices/pda.yml @@ -104,6 +104,10 @@ - DoorBumpOpener - type: Input context: "human" + - type: LanguageSpeaker + - type: LanguageKnowledge + speaks: [TauCetiBasic, RobotTalk] + understands: [TauCetiBasic, RobotTalk] - type: entity parent: BasePDA diff --git a/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml b/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml index 85333e98df5..ac125d36bd1 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/Robotics/mmi.yml @@ -48,6 +48,10 @@ - type: GuideHelp guides: - Cyborgs + - type: LanguageSpeaker + - type: LanguageKnowledge + speaks: [TauCetiBasic, RobotTalk] + understands: [TauCetiBasic, RobotTalk] - type: entity parent: MMI @@ -124,3 +128,7 @@ guides: - Cyborgs - type: Organ # Estacao Pirata - IPCs + - type: LanguageSpeaker + - type: LanguageKnowledge + speaks: [RobotTalk] + understands: [RobotTalk] diff --git a/Resources/Prototypes/Language/animal.yml b/Resources/Prototypes/Language/animal.yml index 46178200011..82f4d627497 100644 --- a/Resources/Prototypes/Language/animal.yml +++ b/Resources/Prototypes/Language/animal.yml @@ -184,3 +184,16 @@ - iss - ss - is + +- type: language + id: Penguin + obfuscation: + !type:SyllableObfuscation + minSyllables: 2 + maxSyllables: 3 + replacement: # I'm out of ideas + - pen + - peng + - won + - wonk + - wong diff --git a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml index bee514917a3..75007db11ca 100644 --- a/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml +++ b/Resources/Prototypes/Nyanotrasen/Entities/Objects/Specific/Mail/base_mail.yml @@ -103,6 +103,10 @@ reagents: - ReagentId: Nothing Quantity: 1 + - type: LanguageSpeaker + - type: LanguageKnowledge + speaks: [TauCetiBasic] # So that them foreigners can't understand what the broken mail is saying + understands: [] # This empty parcel is allowed to exist and evade the tests for the admin # mailto command. From 873909685081153aa2fda98dc48f8c0e1297aa28 Mon Sep 17 00:00:00 2001 From: SimpleStation Changelogs Date: Thu, 14 Nov 2024 20:03:58 +0000 Subject: [PATCH 3/3] Automatic Changelog Update (#1223) --- Resources/Changelog/Changelog.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Resources/Changelog/Changelog.yml b/Resources/Changelog/Changelog.yml index 034cfb4991b..3e56d6acfb5 100644 --- a/Resources/Changelog/Changelog.yml +++ b/Resources/Changelog/Changelog.yml @@ -7892,3 +7892,16 @@ Entries: id: 6519 time: '2024-11-14T02:05:45.0000000+00:00' url: https://github.com/Simple-Station/Einstein-Engines/pull/1213 +- author: Mnemotechnician + changes: + - type: Tweak + message: >- + Added languages to certain entities that lacked them, including MMIs and + positronic brains. + - type: Add + message: >- + Polymorphing into another entity now preserves your languages and + grammar. + id: 6520 + time: '2024-11-14T20:03:33.0000000+00:00' + url: https://github.com/Simple-Station/Einstein-Engines/pull/1223