Skip to content

Commit

Permalink
MindSlave pacifism && death fix (SerbiaStrong-220#1026)
Browse files Browse the repository at this point in the history
  • Loading branch information
DexlerXD authored May 18, 2024
1 parent 59795e2 commit cccbbd3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions Content.Server/SS220/MindSlave/MindSlaveSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using Content.Server.SS220.MindSlave.UI;
using Content.Shared.Alert;
using Content.Shared.Cloning;
using Content.Shared.CombatMode.Pacification;
using Content.Shared.Implants;
using Content.Shared.Implants.Components;
using Content.Shared.Mindshield.Components;
Expand Down Expand Up @@ -77,7 +78,6 @@ public override void Initialize()

SubscribeLocalEvent<MindSlaveMasterComponent, MobStateChangedEvent>(OnMasterDeadOrCrit);
SubscribeLocalEvent<MindSlaveMasterComponent, BeingGibbedEvent>(OnMasterGibbed);
SubscribeLocalEvent<MindSlaveComponent, MobStateChangedEvent>(OnDead);
SubscribeLocalEvent<MindSlaveComponent, CloningEvent>(OnCloned);
SubscribeLocalEvent<SubdermalImplantComponent, MindSlaveRemoved>(OnMindSlaveRemoved);
}
Expand Down Expand Up @@ -107,14 +107,6 @@ private void OnMasterDeadOrCrit(Entity<MindSlaveMasterComponent> entity, ref Mob
}
}

private void OnDead(Entity<MindSlaveComponent> entity, ref MobStateChangedEvent args)
{
if (args.NewMobState != MobState.Dead)
return;

TryRemoveSlave(entity);
}

private void OnCloned(Entity<MindSlaveComponent> entity, ref CloningEvent args)
{
TryRemoveSlave(entity);
Expand Down Expand Up @@ -221,6 +213,10 @@ public bool TryMakeSlave(EntityUid slave, EntityUid master)
if (mindComp.UserId != null && _playerManager.TryGetSessionById(mindComp.UserId.Value, out var session))
_eui.OpenEui(new MindSlaveNotificationEui(masterName, true), session);

//Remove pacifism from slave, because if the slave is pacified they becomes pretty useless.
if (TryComp<PacifiedComponent>(slave, out var pacified))
RemComp(slave, pacified);

return true;
}

Expand Down Expand Up @@ -248,7 +244,7 @@ public bool TryRemoveSlave(EntityUid slave)
if (master != null && TryComp<MindSlaveMasterComponent>(master.Value, out var masterComponent))
{
var briefingMaster = mindComp.CharacterName != null ? Loc.GetString("mindslave-removed-slave-master", ("name", mindComp.CharacterName), ("ent", slave)) :
"mindslave-removed-slave-master-unknown";
Loc.GetString("mindslave-removed-slave-master-unknown");

_antagSelection.SendBriefing(master.Value, briefingMaster, Color.Red, null);
_popup.PopupEntity(briefingMaster, master.Value, master.Value, Shared.Popups.PopupType.MediumCaution);
Expand Down

0 comments on commit cccbbd3

Please sign in to comment.