forked from Simple-Station/Einstein-Engines
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Load o' Fixes for IPCs and Mechs (Simple-Station#1235)
- Loading branch information
1 parent
21c56e0
commit 9910fcb
Showing
22 changed files
with
276 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
Content.Server/_Goobstation/Temperature/KillOnOverheatComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using Content.Shared.Atmos; | ||
|
||
namespace Content.Server._Goobstation.Temperature; | ||
|
||
/// <summary> | ||
/// Kills an entity when its temperature goes over a threshold. | ||
/// </summary> | ||
[RegisterComponent, Access(typeof(KillOnOverheatSystem))] | ||
public sealed partial class KillOnOverheatComponent : Component | ||
{ | ||
[DataField] | ||
public float OverheatThreshold = Atmospherics.T0C + 110f; | ||
|
||
[DataField] | ||
public LocId OverheatPopup = "ipc-overheat-popup"; | ||
} |
33 changes: 33 additions & 0 deletions
33
Content.Server/_Goobstation/Temperature/KillOnOverheatSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
using Content.Server.Temperature.Components; | ||
using Content.Shared.IdentityManagement; | ||
using Content.Shared.Mobs; | ||
using Content.Shared.Mobs.Components; | ||
using Content.Shared.Mobs.Systems; | ||
using Content.Shared.Popups; | ||
using Content.Shared.Damage.Components; | ||
|
||
namespace Content.Server._Goobstation.Temperature; | ||
|
||
public sealed class KillOnOverheatSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly MobStateSystem _mob = default!; | ||
[Dependency] private readonly SharedPopupSystem _popup = default!; | ||
|
||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
var query = EntityQueryEnumerator<KillOnOverheatComponent, TemperatureComponent, MobStateComponent>(); | ||
while (query.MoveNext(out var uid, out var comp, out var temp, out var mob)) | ||
{ | ||
if (mob.CurrentState == MobState.Dead | ||
|| temp.CurrentTemperature < comp.OverheatThreshold | ||
|| HasComp<GodmodeComponent>(uid)) | ||
continue; | ||
|
||
var msg = Loc.GetString(comp.OverheatPopup, ("name", Identity.Name(uid, EntityManager))); | ||
_popup.PopupEntity(msg, uid, PopupType.LargeCaution); | ||
_mob.ChangeMobState(uid, MobState.Dead, mob); | ||
} | ||
} | ||
} |
Oops, something went wrong.