Even more resolve removals.
This commit is contained in:
@@ -34,6 +34,8 @@ namespace Content.Server.Toilet
|
||||
IInteractHand, IMapInit, IExamine, ISuicideAct
|
||||
#pragma warning restore 618
|
||||
{
|
||||
[Dependency] private readonly IEntityManager _entMan = default!;
|
||||
|
||||
public sealed override string Name => "Toilet";
|
||||
|
||||
private const float PryLidTime = 1f;
|
||||
@@ -67,7 +69,7 @@ namespace Content.Server.Toilet
|
||||
async Task<bool> IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs)
|
||||
{
|
||||
// are player trying place or lift of cistern lid?
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(eventArgs.Using, out ToolComponent? tool)
|
||||
if (_entMan.TryGetComponent(eventArgs.Using, out ToolComponent? tool)
|
||||
&& tool.Qualities.Contains(_pryingQuality))
|
||||
{
|
||||
// check if someone is already prying this toilet
|
||||
@@ -111,7 +113,7 @@ namespace Content.Server.Toilet
|
||||
|
||||
// just want to up/down seat?
|
||||
// check that nobody seats on seat right now
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out StrapComponent? strap))
|
||||
if (_entMan.TryGetComponent(Owner, out StrapComponent? strap))
|
||||
{
|
||||
if (strap.BuckledEntities.Count != 0)
|
||||
return false;
|
||||
@@ -142,7 +144,7 @@ namespace Content.Server.Toilet
|
||||
|
||||
private void UpdateSprite()
|
||||
{
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(Owner, out AppearanceComponent? appearance))
|
||||
if (_entMan.TryGetComponent(Owner, out AppearanceComponent? appearance))
|
||||
{
|
||||
appearance.SetData(ToiletVisuals.LidOpen, LidOpen);
|
||||
appearance.SetData(ToiletVisuals.SeatUp, IsSeatUp);
|
||||
@@ -152,23 +154,23 @@ namespace Content.Server.Toilet
|
||||
SuicideKind ISuicideAct.Suicide(EntityUid victim, IChatManager chat)
|
||||
{
|
||||
// check that victim even have head
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<SharedBodyComponent?>(victim, out var body) &&
|
||||
if (_entMan.TryGetComponent<SharedBodyComponent?>(victim, out var body) &&
|
||||
body.HasPartOfType(BodyPartType.Head))
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-head-message-others", ("victim",Name: _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-head-message", ("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessage(selfMessage);
|
||||
|
||||
return SuicideKind.Asphyxiation;
|
||||
}
|
||||
else
|
||||
{
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var othersMessage = Loc.GetString("toilet-component-suicide-message-others",("victim", Name: _entMan.GetComponent<MetaDataComponent>(victim).EntityName),("owner", Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessageOtherClients(othersMessage);
|
||||
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner",Name: IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
var selfMessage = Loc.GetString("toilet-component-suicide-message", ("owner",Name: _entMan.GetComponent<MetaDataComponent>(Owner).EntityName));
|
||||
victim.PopupMessage(selfMessage);
|
||||
|
||||
return SuicideKind.Blunt;
|
||||
|
||||
Reference in New Issue
Block a user