From 9e6c00340f284460d376be370c1024775d050d20 Mon Sep 17 00:00:00 2001 From: V <97265903+formlessnameless@users.noreply.github.com> Date: Wed, 11 Dec 2024 18:27:38 -0600 Subject: [PATCH] last resort updates --- .../GameTicking/Rules/TraitorRuleSystem.cs | 2 +- .../Changeling/ChangelingEggSystem.cs | 8 +++---- .../Changeling/ChangelingSystem.Abilities.cs | 8 +++---- .../Changeling/ChangelingSystem.cs | 22 +++++++++++-------- .../Changeling/ChangelingEggComponent.cs | 2 +- .../Changeling/Actions/changeling.yml | 2 ++ .../Changeling/Entities/Mobs/headcrab.yml | 1 + 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs index 5dcc662dea7915..92c070958447cf 100644 --- a/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/TraitorRuleSystem.cs @@ -45,7 +45,7 @@ public override void Initialize() base.Initialize(); Log.Level = LogLevel.Debug; - + SubscribeLocalEvent(AdditionalSetup); SubscribeLocalEvent(AfterEntitySelected); SubscribeLocalEvent(OnObjectivesTextPrepend); diff --git a/Content.Server/_Goobstation/Changeling/ChangelingEggSystem.cs b/Content.Server/_Goobstation/Changeling/ChangelingEggSystem.cs index 35b661422400cd..4f337969d7ae6f 100644 --- a/Content.Server/_Goobstation/Changeling/ChangelingEggSystem.cs +++ b/Content.Server/_Goobstation/Changeling/ChangelingEggSystem.cs @@ -42,15 +42,15 @@ public void Cycle(EntityUid uid, ChangelingEggComponent comp) } var newUid = Spawn("MobMonkey", Transform(uid).Coordinates); - + var mind = EnsureComp(newUid); _mind.TransferTo(comp.lingMind, newUid); var ling = EnsureComp(newUid); ling = comp.lingComp; - + EntityManager.AddComponent(newUid, comp.lingStore); - _bodySystem.GibBody((EntityUid) uid); + _bodySystem.GibBody((EntityUid)uid); } -} \ No newline at end of file +} diff --git a/Content.Server/_Goobstation/Changeling/ChangelingSystem.Abilities.cs b/Content.Server/_Goobstation/Changeling/ChangelingSystem.Abilities.cs index a0e8564a17ab93..34eee943bce64e 100644 --- a/Content.Server/_Goobstation/Changeling/ChangelingSystem.Abilities.cs +++ b/Content.Server/_Goobstation/Changeling/ChangelingSystem.Abilities.cs @@ -19,8 +19,6 @@ using Content.Shared.Stealth; using Content.Shared.Stealth.Components; using Content.Shared.Damage.Components; -using Content.Server.Radio.Components; -using Robust.Shared.Configuration; using Robust.Shared.Player; using Robust.Shared.Prototypes; @@ -657,15 +655,15 @@ public void OnLastResort(EntityUid uid, ChangelingComponent comp, ref ActionLast } _explosionSystem.QueueExplosion( - (EntityUid) newUid, + (EntityUid)newUid, typeId: "Default", totalIntensity: 1, slope: 4, maxTileIntensity: 2); - _actions.AddAction((EntityUid) newUid, "ActionLayEgg"); + _actions.AddAction((EntityUid)newUid, "ActionLayEgg"); - PlayMeatySound((EntityUid) newUid, comp); + PlayMeatySound((EntityUid)newUid, comp); } public void OnLesserForm(EntityUid uid, ChangelingComponent comp, ref ActionLesserFormEvent args) { diff --git a/Content.Server/_Goobstation/Changeling/ChangelingSystem.cs b/Content.Server/_Goobstation/Changeling/ChangelingSystem.cs index f6a10daa3e2cc4..8f0f821677874e 100644 --- a/Content.Server/_Goobstation/Changeling/ChangelingSystem.cs +++ b/Content.Server/_Goobstation/Changeling/ChangelingSystem.cs @@ -178,6 +178,7 @@ private void UpdateChemicals(EntityUid uid, ChangelingComponent comp, float? amo Dirty(uid, comp); _alerts.ShowAlert(uid, "ChangelingChemicals"); } + private void UpdateBiomass(EntityUid uid, ChangelingComponent comp, float? amount = null) { comp.Biomass += amount ?? -1; @@ -525,7 +526,7 @@ public bool TryStealDNA(EntityUid uid, EntityUid target, ChangelingComponent com var config = new PolymorphConfiguration() { - Entity = (EntProtoId) pid, + Entity = (EntProtoId)pid, TransferDamage = transferDamage, Forced = true, Inventory = (dropInventory) ? PolymorphInventoryChange.Drop : PolymorphInventoryChange.Transfer, @@ -555,15 +556,18 @@ public bool TryStealDNA(EntityUid uid, EntityUid target, ChangelingComponent com { // copy our stuff var newLingComp = CopyChangelingComponent(newEnt, comp); - if (!persistentDna && data != null) - newLingComp?.AbsorbedDNA.Remove(data); - RemCompDeferred(uid); - - if (TryComp(uid, out var storeComp)) + if (newLingComp != null) { - var storeCompCopy = _serialization.CreateCopy(storeComp, notNullableOverride: true); - RemComp(newUid.Value); - EntityManager.AddComponent(newUid.Value, storeCompCopy); + if (!persistentDna && data != null) + newLingComp.AbsorbedDNA.Remove(data); + RemCompDeferred(uid); + + if (TryComp(uid, out var storeComp)) + { + var storeCompCopy = _serialization.CreateCopy(storeComp, notNullableOverride: true); + RemComp(newUid.Value); + EntityManager.AddComponent(newUid.Value, storeCompCopy); + } } } diff --git a/Content.Shared/_Goobstation/Changeling/ChangelingEggComponent.cs b/Content.Shared/_Goobstation/Changeling/ChangelingEggComponent.cs index ed82c3546d7fad..95b163a71cc471 100644 --- a/Content.Shared/_Goobstation/Changeling/ChangelingEggComponent.cs +++ b/Content.Shared/_Goobstation/Changeling/ChangelingEggComponent.cs @@ -16,6 +16,6 @@ public sealed partial class ChangelingEggComponent : Component /// Countdown before spawning monkey. /// public TimeSpan UpdateTimer = TimeSpan.Zero; - public float UpdateCooldown = 120f; + public float UpdateCooldown = 60f; public bool active = false; } diff --git a/Resources/Prototypes/_Goobstation/Changeling/Actions/changeling.yml b/Resources/Prototypes/_Goobstation/Changeling/Actions/changeling.yml index 3590e0ab8132db..90eff670402a5a 100644 --- a/Resources/Prototypes/_Goobstation/Changeling/Actions/changeling.yml +++ b/Resources/Prototypes/_Goobstation/Changeling/Actions/changeling.yml @@ -512,6 +512,7 @@ - type: entity id: ActionLastResort name: Last Resort + parent: BaseSuicideAction description: We abandon our vessel, escaping in our vulnerable true self, to find a new body to occupy. Costs a small amount of chemicals. categories: [ HideSpawnMenu ] components: @@ -525,6 +526,7 @@ event: !type:ActionLastResortEvent {} - type: ChangelingAction chemicalCost: 20 + biomassCost: -30 # absorbing the rest of the current body on use useInLesserForm: true - type: entity diff --git a/Resources/Prototypes/_Goobstation/Changeling/Entities/Mobs/headcrab.yml b/Resources/Prototypes/_Goobstation/Changeling/Entities/Mobs/headcrab.yml index 6e61a75271deb3..9883bed4dd4676 100644 --- a/Resources/Prototypes/_Goobstation/Changeling/Entities/Mobs/headcrab.yml +++ b/Resources/Prototypes/_Goobstation/Changeling/Entities/Mobs/headcrab.yml @@ -5,6 +5,7 @@ description: You don't want to touch it. components: - type: VentCrawler + - type: NoSlip - type: Sprite drawdepth: SmallMobs layers: