Skip to content

Commit

Permalink
полтергей
Browse files Browse the repository at this point in the history
  • Loading branch information
FaDeOkno committed Aug 14, 2024
1 parent a8959e1 commit 99e8808
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 13 deletions.
24 changes: 12 additions & 12 deletions Content.Server/ADT/Poltergeist/Systems/PoltergeistSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,19 @@ public override void Initialize()

SubscribeLocalEvent<PoltergeistComponent, AlternativeSpeechEvent>(OnTrySpeak);
SubscribeLocalEvent<PoltergeistComponent, EventHorizonAttemptConsumeEntityEvent>(OnSinguloConsumeAttempt);
SubscribeLocalEvent<PotentialPoltergeistComponent, MobStateChangedEvent>(OnMobState);
}
private void OnMobState(EntityUid uid, PotentialPoltergeistComponent component, MobStateChangedEvent args)
{
if (args.NewMobState == MobState.Dead);
{
if (_mindSystem.TryGetMind(uid, out var mindId, out var mind))
{
var poltergei = Spawn("ADTMobPoltergeist", Transform(uid).Coordinates);
_mindSystem.TransferTo(mindId, poltergei);
}
}
// SubscribeLocalEvent<PotentialPoltergeistComponent, MobStateChangedEvent>(OnMobState);
}
// private void OnMobState(EntityUid uid, PotentialPoltergeistComponent component, MobStateChangedEvent args)
// {
// if (args.NewMobState == MobState.Dead);
// {
// if (_mindSystem.TryGetMind(uid, out var mindId, out var mind))
// {
// var poltergei = Spawn("ADTMobPoltergeist", Transform(uid).Coordinates);
// _mindSystem.TransferTo(mindId, poltergei);
// }
// }
// }

private void OnMapInit(EntityUid uid, PoltergeistComponent component, MapInitEvent args)
{
Expand Down
10 changes: 9 additions & 1 deletion Content.Server/Ghost/GhostSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Content.Server.Roles.Jobs;
using Content.Server.Warps;
using Content.Shared.Actions;
using Content.Shared.ADT.Poltergeist;
using Content.Shared.Examine;
using Content.Shared.Eye;
using Content.Shared.Follower;
Expand Down Expand Up @@ -447,7 +448,14 @@ private bool IsValidSpawnPosition(EntityCoordinates? spawnPosition)
_minds.TransferTo(mind.Owner, null, createGhost: false, mind: mind.Comp);
return null;
}

// ADT Poltergeist start
if (HasComp<PotentialPoltergeistComponent>(mind.Comp.OwnedEntity))
{
var polter = SpawnAtPosition("ADTMobPoltergeist", spawnPosition.Value);
_minds.TransferTo(mind.Owner, polter, mind: mind.Comp);
return polter;
}
// ADT Poltergeist end
var ghost = SpawnAtPosition(GameTicker.ObserverPrototypeName, spawnPosition.Value);
var ghostComponent = Comp<GhostComponent>(ghost);

Expand Down

0 comments on commit 99e8808

Please sign in to comment.