forked from DeltaV-Station/Delta-v
-
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 (DeltaV-Station#1235)
- Loading branch information
1 parent
d5dc384
commit dc16cad
Showing
25 changed files
with
261 additions
and
50 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.