split temperature protection into heating and cooling (#30662)

* split temperature protection into heating and cooling

* fugg

* weh
This commit is contained in:
Nemanja
2024-09-07 01:37:17 -04:00
committed by GitHub
parent 9ba59d9636
commit a197baac17
15 changed files with 68 additions and 32 deletions

View File

@@ -7,10 +7,16 @@ namespace Content.Server.Temperature.Components;
public sealed partial class TemperatureProtectionComponent : Component
{
/// <summary>
/// How much to multiply temperature deltas by.
/// Multiplier for the transferred heat when heating up
/// </summary>
[DataField]
public float Coefficient = 1.0f;
public float HeatingCoefficient = 1.0f;
/// <summary>
/// Multiplier for the transferred heat when cooling down
/// </summary>
[DataField]
public float CoolingCoefficient = 1.0f;
}
/// <summary>

View File

@@ -299,7 +299,11 @@ public sealed class TemperatureSystem : EntitySystem
private void OnTemperatureChangeAttempt(EntityUid uid, TemperatureProtectionComponent component,
InventoryRelayedEvent<ModifyChangedTemperatureEvent> args)
{
var ev = new GetTemperatureProtectionEvent(component.Coefficient);
var coefficient = args.Args.TemperatureDelta < 0
? component.CoolingCoefficient
: component.HeatingCoefficient;
var ev = new GetTemperatureProtectionEvent(coefficient);
RaiseLocalEvent(uid, ref ev);
args.Args.TemperatureDelta *= ev.Coefficient;

View File

@@ -126,7 +126,8 @@
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.2
heatingCoefficient: 0.2
coolingCoefficient: 0.2
- type: IngestionBlocker
- type: Clothing
#Copies ClothingHeadHardsuitBase behavior
@@ -168,7 +169,8 @@
highPressureMultiplier: 0.3
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.1
heatingCoefficient: 0.1
coolingCoefficient: 0.1
- type: Armor
modifiers:
coefficients:
@@ -258,7 +260,8 @@
quickEquip: false
slots: [ HEAD ]
- type: TemperatureProtection
coefficient: 0.7
heatingCoefficient: 1.05
coolingCoefficient: 0.7
- type: GroupExamine
- type: HideLayerClothing
slots:

View File

@@ -62,7 +62,8 @@
- type: Clothing
sprite: Clothing/Head/Helmets/paramedhelm.rsi
- type: TemperatureProtection
coefficient: 0.1
heatingCoefficient: 0.1
coolingCoefficient: 0.1
- type: Armor
modifiers:
coefficients:

View File

@@ -60,7 +60,8 @@
highPressureMultiplier: 0.08
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.005
coolingCoefficient: 0.005
- type: FireProtection
reduction: 0.2
@@ -407,7 +408,8 @@
highPressureMultiplier: 0.08
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.005
coolingCoefficient: 0.005
- type: FireProtection
reduction: 0.2
- type: Armor
@@ -670,7 +672,8 @@
highPressureMultiplier: 0.08
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.005
coolingCoefficient: 0.005
- type: Armor
modifiers:
coefficients:

View File

@@ -232,7 +232,8 @@
quickEquip: true
- type: IngestionBlocker
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.01
coolingCoefficient: 0.2
- type: FireProtection
reduction: 0.15 # not fully sealed so less protection
- type: IdentityBlocker
@@ -260,7 +261,8 @@
quickEquip: true
- type: IngestionBlocker
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.01
coolingCoefficient: 0.2
- type: FireProtection
reduction: 0.2
- type: PressureProtection

View File

@@ -220,7 +220,8 @@
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.2
heatingCoefficient: 0.2
coolingCoefficient: 0.2
- type: BreathMask
# this is on the hood so you only fool the fish if you wear the whole set
# wear carp suit and security helmet, they'll know you are fake

View File

@@ -109,7 +109,8 @@
highPressureMultiplier: 0.3
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.01
heatingCoefficient: 0.01
coolingCoefficient: 0.01
- type: ClothingSpeedModifier
walkModifier: 0.4
sprintModifier: 0.6
@@ -152,7 +153,8 @@
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.01 # Not complete protection from fire
heatingCoefficient: 0.01 # Not complete protection from fire
coolingCoefficient: 0.01
- type: ClothingSpeedModifier
walkModifier: 0.8
sprintModifier: 0.8

View File

@@ -124,7 +124,8 @@
- type: Clothing
sprite: Clothing/OuterClothing/Coats/trenchcoat.rsi
- type: TemperatureProtection
coefficient: 0.1
heatingCoefficient: 0.1
coolingCoefficient: 0.1
- type: Armor
modifiers:
coefficients:

View File

@@ -43,7 +43,8 @@
highPressureMultiplier: 0.02
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.001
- type: FireProtection
reduction: 0.8
- type: ExplosionResistance
@@ -182,7 +183,8 @@
- type: ExplosionResistance
damageCoefficient: 0.2
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.001
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitMaxim
@@ -543,7 +545,8 @@
highPressureMultiplier: 0.02
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.001
- type: ExplosionResistance
damageCoefficient: 0.2
- type: FireProtection
@@ -861,7 +864,8 @@
highPressureMultiplier: 0.02
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.001
- type: ExplosionResistance
damageCoefficient: 0.2
- type: FireProtection
@@ -897,7 +901,8 @@
highPressureMultiplier: 0.02
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.001
- type: ExplosionResistance
damageCoefficient: 0.7
- type: Armor

View File

@@ -300,7 +300,7 @@
- state: equipped-OUTERCLOTHING-lines
color: "#000000"
- type: TemperatureProtection
coefficient: 0.3
coolingCoefficient: 0.3
- type: entity
parent: ClothingOuterBase
@@ -336,7 +336,7 @@
- state: equipped-OUTERCLOTHING-lines
color: "#000000"
- type: TemperatureProtection
coefficient: 0.3
coolingCoefficient: 0.3
- type: entity
parent: ClothingOuterBase
@@ -372,7 +372,7 @@
- state: equipped-OUTERCLOTHING-lines
color: "#000000"
- type: TemperatureProtection
coefficient: 0.3
coolingCoefficient: 0.3
- type: entity
parent: ClothingOuterBase

View File

@@ -48,7 +48,8 @@
sprintModifier: 0.7
- type: HeldSpeedModifier
- type: TemperatureProtection
coefficient: 0.5
heatingCoefficient: 0.75
coolingCoefficient: 0.5
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetEVALarge
slot: head
@@ -109,7 +110,8 @@
sprintModifier: 0.9
- type: HeldSpeedModifier
- type: TemperatureProtection
coefficient: 0.1
heatingCoefficient: 0.1
coolingCoefficient: 0.1
- type: Armor
modifiers:
coefficients:

View File

@@ -53,7 +53,8 @@
- type: PressureProtection
highPressureMultiplier: 0.04
- type: TemperatureProtection
coefficient: 0.005
heatingCoefficient: 0.005
coolingCoefficient: 0.05
- type: FireProtection
reduction: 0.65 # doesnt have a full seal so not as good
- type: Armor
@@ -84,7 +85,8 @@
highPressureMultiplier: 0.02
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.001
heatingCoefficient: 0.001
coolingCoefficient: 0.05
- type: FireProtection
reduction: 0.8 # atmos firesuit offers best protection, hardsuits are a little vulnerable
- type: Armor
@@ -141,7 +143,8 @@
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.01
heatingCoefficient: 0.01
coolingCoefficient: 0.01
- type: Armor
modifiers:
coefficients:
@@ -287,6 +290,7 @@
highPressureMultiplier: 0.6
lowPressureMultiplier: 1000
- type: TemperatureProtection
coefficient: 0.01
heatingCoefficient: 0.01
coolingCoefficient: 0.01
- type: ToggleableClothing
clothingPrototype: ClothingHeadHelmetHardsuitCarp

View File

@@ -9,7 +9,8 @@
- type: Clothing
sprite: Clothing/OuterClothing/WinterCoats/coat.rsi
- type: TemperatureProtection
coefficient: 0.1
heatingCoefficient: 1.1
coolingCoefficient: 0.1
- type: Item
size: Normal
- type: Armor

View File

@@ -69,4 +69,5 @@
description: Fluffy boots to help survive even the coldest of winters.
components:
- type: TemperatureProtection
coefficient: 0.2
heatingCoefficient: 1.025
coolingCoefficient: 0.5