Skip to content

Commit

Permalink
replaces fire damage with overheating code
Browse files Browse the repository at this point in the history
  • Loading branch information
Spielern committed Jan 25, 2025
1 parent 929bcae commit 4cc1d06
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,9 @@ private float SiliconHeatEffects(EntityUid silicon, SiliconComponent siliconComp
if (!_random.Prob(Math.Clamp(temperComp.CurrentTemperature / (upperThresh * 5), 0.001f, 0.9f)))
return hotTempMulti;

_flammable.AdjustFireStacks(silicon, Math.Clamp(siliconComp.FireStackMultiplier, -10, 10), flamComp);
_flammable.Ignite(silicon, silicon, flamComp);
// GoobStation: Replaced by KillOnOverheatSystem
//_flammable.AdjustFireStacks(silicon, Math.Clamp(siliconComp.FireStackMultiplier, -10, 10), flamComp);
//_flammable.Ignite(silicon, silicon, flamComp);
return hotTempMulti;
}

Expand All @@ -197,4 +198,4 @@ private float SiliconHeatEffects(EntityUid silicon, SiliconComponent siliconComp

return 0;
}
}
}
16 changes: 16 additions & 0 deletions Content.Server/_Goobstation/Temperature/KillOnOverheatComponent.cs
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 Content.Server/_Goobstation/Temperature/KillOnOverheatSystem.cs
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);
}
}
}
1 change: 1 addition & 0 deletions Resources/Locale/en-US/_Goobstation/power/silicons.ftl
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ipc-overheat-popup = {$name}'s circuits shut down from overheating!
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
1: 0.45
0: 0.00
- type: Temperature
heatDamageThreshold: 325
heatDamageThreshold: 1800 # GoobStation: Roughly the melting point of mild steels
coldDamageThreshold: 260
currentTemperature: 310.15
specificHeat: 42
Expand All @@ -62,6 +62,7 @@
types:
Heat: 3 #per second, scales with temperature & other constants
atmosTemperatureTransferEfficiency: 0.05
- type: KillOnOverheat # GoobStation
- type: Deathgasp
prototype: SiliconDeathgasp
needsCritical: false
Expand Down Expand Up @@ -158,7 +159,7 @@
canResistFire: true
damage:
types:
Heat: 0.75 #per second, scales with number of fire 'stacks'
Heat: 0 # GoobStation: Replaced fire damage with overheating shutdown
# - type: Barotrauma # Not particularly modifiable. In the future, some response to pressure changes would be nice.
# damage:
# types:
Expand Down

0 comments on commit 4cc1d06

Please sign in to comment.