-
Notifications
You must be signed in to change notification settings - Fork 404
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replaces fire damage with overheating code
- Loading branch information
Showing
5 changed files
with
54 additions
and
5 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
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"; | ||
} |
30 changes: 30 additions & 0 deletions
30
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,30 @@ | ||
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; | ||
|
||
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) | ||
continue; | ||
|
||
var msg = Loc.GetString(comp.OverheatPopup, ("name", Identity.Name(uid, EntityManager))); | ||
_popup.PopupEntity(msg, uid, PopupType.LargeCaution); | ||
_mob.ChangeMobState(uid, MobState.Dead, mob); | ||
} | ||
} | ||
} |
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 @@ | ||
ipc-overheat-popup = {$name}'s circuits shut down from overheating! |
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