Skip to content

Commit

Permalink
last resort updates
Browse files Browse the repository at this point in the history
  • Loading branch information
formlessnameless committed Dec 12, 2024
1 parent 6ae0896 commit 9e6c003
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Content.Server/GameTicking/Rules/TraitorRuleSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public override void Initialize()
base.Initialize();

Log.Level = LogLevel.Debug;

SubscribeLocalEvent<TraitorRuleComponent, AntagPrereqSetupEvent>(AdditionalSetup);
SubscribeLocalEvent<TraitorRuleComponent, AfterAntagEntitySelectedEvent>(AfterEntitySelected);
SubscribeLocalEvent<TraitorRuleComponent, ObjectivesTextPrependEvent>(OnObjectivesTextPrepend);
Expand Down
8 changes: 4 additions & 4 deletions Content.Server/_Goobstation/Changeling/ChangelingEggSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@ public void Cycle(EntityUid uid, ChangelingEggComponent comp)
}

var newUid = Spawn("MobMonkey", Transform(uid).Coordinates);

var mind = EnsureComp<MindComponent>(newUid);
_mind.TransferTo(comp.lingMind, newUid);

var ling = EnsureComp<ChangelingComponent>(newUid);
ling = comp.lingComp;

EntityManager.AddComponent(newUid, comp.lingStore);

_bodySystem.GibBody((EntityUid) uid);
_bodySystem.GibBody((EntityUid)uid);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
{
Expand Down
22 changes: 13 additions & 9 deletions Content.Server/_Goobstation/Changeling/ChangelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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<ChangelingComponent>(uid);

if (TryComp<StoreComponent>(uid, out var storeComp))
if (newLingComp != null)
{
var storeCompCopy = _serialization.CreateCopy(storeComp, notNullableOverride: true);
RemComp<StoreComponent>(newUid.Value);
EntityManager.AddComponent(newUid.Value, storeCompCopy);
if (!persistentDna && data != null)
newLingComp.AbsorbedDNA.Remove(data);
RemCompDeferred<ChangelingComponent>(uid);

if (TryComp<StoreComponent>(uid, out var storeComp))
{
var storeCompCopy = _serialization.CreateCopy(storeComp, notNullableOverride: true);
RemComp<StoreComponent>(newUid.Value);
EntityManager.AddComponent(newUid.Value, storeCompCopy);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,6 @@ public sealed partial class ChangelingEggComponent : Component
/// Countdown before spawning monkey.
/// </summary>
public TimeSpan UpdateTimer = TimeSpan.Zero;
public float UpdateCooldown = 120f;
public float UpdateCooldown = 60f;
public bool active = false;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
description: You don't want to touch it.
components:
- type: VentCrawler
- type: NoSlip
- type: Sprite
drawdepth: SmallMobs
layers:
Expand Down

0 comments on commit 9e6c003

Please sign in to comment.