Skip to content

Commit

Permalink
Revenant plushies and ectoplasm now talk with their trapped revenant'…
Browse files Browse the repository at this point in the history
…s name
  • Loading branch information
TGRCdev committed Sep 15, 2024
1 parent af84083 commit 855b25a
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions Content.Server/Revenant/EntitySystems/RevenantStasisSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Server.Ghost.Roles.Components;
using Content.Server.Mind;
using Content.Server.Revenant.Components;
using Content.Server.VoiceMask;
using Content.Shared.Alert;
using Content.Shared.DoAfter;
using Content.Shared.Examine;
Expand Down Expand Up @@ -43,7 +44,6 @@ public override void Initialize()
SubscribeLocalEvent<RevenantStasisComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<RevenantStasisComponent, ConstructionConsumedObjectEvent>(OnCrafted);

// TODO: This code should be in a shared system
SubscribeLocalEvent<RevenantStasisComponent, AfterInteractUsingEvent>(OnBibleInteract, before: [typeof(BibleSystem)]);
SubscribeLocalEvent<RevenantStasisComponent, ExorciseRevenantDoAfterEvent>(OnExorcise);
}
Expand All @@ -63,6 +63,9 @@ private void OnStartup(EntityUid uid, RevenantStasisComponent component, Compone
speech.SpeechVerb = "Ghost";
Dirty(uid, speech);

var voice = EnsureComp<VoiceMaskComponent>(uid);
voice.VoiceName = Comp<MetaDataComponent>(component.Revenant).EntityName;

if (TryComp<GhostRoleComponent>(uid, out var ghostRole))
_ghostRoles.UnregisterGhostRole((uid, ghostRole));
}
Expand Down Expand Up @@ -103,9 +106,10 @@ private void OnCrafted(EntityUid uid, RevenantStasisComponent comp, Construction
speech.SpeechVerb = "Ghost";
Dirty(args.New, speech);

var mover = EnsureComp<InputMoverComponent>(uid);
mover.CanMove = false;
Dirty(uid, mover);
EnsureComp<InputMoverComponent>(args.New);

var voice = EnsureComp<VoiceMaskComponent>(args.New);
voice.VoiceName = Comp<MetaDataComponent>(comp.Revenant).EntityName;

if (_mind.TryGetMind(uid, out var mindId, out var _))
_mind.TransferTo(mindId, args.New);
Expand Down

0 comments on commit 855b25a

Please sign in to comment.