]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
split temperature protection into heating and cooling (#30662)
authorNemanja <98561806+EmoGarbage404@users.noreply.github.com>
Sat, 7 Sep 2024 05:37:17 +0000 (01:37 -0400)
committerGitHub <noreply@github.com>
Sat, 7 Sep 2024 05:37:17 +0000 (15:37 +1000)
* split temperature protection into heating and cooling

* fugg

* weh

15 files changed:
Content.Server/Temperature/Components/TemperatureProtectionComponent.cs
Content.Server/Temperature/Systems/TemperatureSystem.cs
Resources/Prototypes/Entities/Clothing/Head/base_clothinghead.yml
Resources/Prototypes/Entities/Clothing/Head/eva-helmets.yml
Resources/Prototypes/Entities/Clothing/Head/hardsuit-helmets.yml
Resources/Prototypes/Entities/Clothing/Head/helmets.yml
Resources/Prototypes/Entities/Clothing/Head/hoods.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/base_clothingouter.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/coats.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/hardsuits.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/misc.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/softsuits.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/suits.yml
Resources/Prototypes/Entities/Clothing/OuterClothing/wintercoats.yml
Resources/Prototypes/Entities/Clothing/Shoes/base_clothingshoes.yml

index 437f0f89405286b4122e6f8c2864a9a2881e1a93..01e46cfc8d92464cb79ccd9f6e68ef5eba477cc8 100644 (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>
index c6fa213ccb7a1710084443283ac39331ebb22f78..ccd981bbbc32c4399964526efe963984803e68c5 100644 (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;
index 66356afacfc19a081264b5c150c3db4c2c832f5f..e6c8ada7dc00edc6b14e15dbbd4b796127c32bee 100644 (file)
     highPressureMultiplier: 0.6
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.2
+    heatingCoefficient: 0.2
+    coolingCoefficient: 0.2
   - type: IngestionBlocker
   - type: Clothing
     #Copies ClothingHeadHardsuitBase behavior
     highPressureMultiplier: 0.3
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.1
+    heatingCoefficient: 0.1
+    coolingCoefficient: 0.1
   - type: Armor
     modifiers:
       coefficients:
     quickEquip: false
     slots: [ HEAD ]
   - type: TemperatureProtection
-    coefficient: 0.7
+    heatingCoefficient: 1.05
+    coolingCoefficient: 0.7
   - type: GroupExamine
   - type: HideLayerClothing
     slots:
index 827d28265a03053fa029c8512a58ce4af49debbf..c38c869f2e9139ed0ca7dfe1f85bd79dbabe008c 100644 (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:
index a9785ef9281b9ee4280559be017e166881b8e2a4..42075b1cf1b854ce8a97a1a18f6f6ca0e3fee716 100644 (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
 
     highPressureMultiplier: 0.08
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.005
+    heatingCoefficient: 0.005
+    coolingCoefficient: 0.005
   - type: FireProtection
     reduction: 0.2
   - type: Armor
     highPressureMultiplier: 0.08
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.005
+    heatingCoefficient: 0.005
+    coolingCoefficient: 0.005
   - type: Armor
     modifiers:
       coefficients:
index e8415c3801ff2a119379e52452fefdc2bb227cc0..cd9013dfec27255fa8a7a4c3299f2bb4d62c6dab 100644 (file)
     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
     quickEquip: true
   - type: IngestionBlocker
   - type: TemperatureProtection
-    coefficient: 0.005
+    heatingCoefficient: 0.01
+    coolingCoefficient: 0.2
   - type: FireProtection
     reduction: 0.2
   - type: PressureProtection
index 96c4197bdccb8668bb0347a0bac6b165f25586d7..82cff81c22b59926519c73ca5d30371e896dc376 100644 (file)
     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
index 5df6adffec96104bb357073a06f55ff01dd954c0..66579f296b5201df4f3858fd484f766c154a06de 100644 (file)
     highPressureMultiplier: 0.3
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.01
+    heatingCoefficient: 0.01
+    coolingCoefficient: 0.01
   - type: ClothingSpeedModifier
     walkModifier: 0.4
     sprintModifier: 0.6
     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
index 532cf93d1505450089081f26abcdf8fe05b66d56..973af5222168131e219a3e405b976ff09438c068 100644 (file)
   - type: Clothing
     sprite: Clothing/OuterClothing/Coats/trenchcoat.rsi
   - type: TemperatureProtection
-    coefficient: 0.1
+    heatingCoefficient: 0.1
+    coolingCoefficient: 0.1
   - type: Armor
     modifiers:
       coefficients:
index 314d6b3eae142238f7eabf8d28685406f68ba78e..c6e3383931985103fb59d75e6782ff3680f28de0 100644 (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
   - type: ExplosionResistance
     damageCoefficient: 0.2
   - type: TemperatureProtection
-    coefficient: 0.001
+    heatingCoefficient: 0.001
+    coolingCoefficient: 0.001
   - type: ToggleableClothing
     clothingPrototype: ClothingHeadHelmetHardsuitMaxim
 
     highPressureMultiplier: 0.02
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.001
+    heatingCoefficient: 0.001
+    coolingCoefficient: 0.001
   - type: ExplosionResistance
     damageCoefficient: 0.2
   - type: FireProtection
     highPressureMultiplier: 0.02
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.001
+    heatingCoefficient: 0.001
+    coolingCoefficient: 0.001
   - type: ExplosionResistance
     damageCoefficient: 0.2
   - type: FireProtection
     highPressureMultiplier: 0.02
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.001
+    heatingCoefficient: 0.001
+    coolingCoefficient: 0.001
   - type: ExplosionResistance
     damageCoefficient: 0.7
   - type: Armor
index 112637cdd3d00f4cf5a268d72a99d637493beedb..c8c83f9db80afafcbff5693e2cebc13f84f12cf3 100644 (file)
       - state: equipped-OUTERCLOTHING-lines
         color: "#000000"
   - type: TemperatureProtection
-    coefficient: 0.3
+    coolingCoefficient: 0.3
 
 - type: entity
   parent: ClothingOuterBase
       - state: equipped-OUTERCLOTHING-lines
         color: "#000000"
   - type: TemperatureProtection
-    coefficient: 0.3
+    coolingCoefficient: 0.3
 
 - type: entity
   parent: ClothingOuterBase
       - state: equipped-OUTERCLOTHING-lines
         color: "#000000"
   - type: TemperatureProtection
-    coefficient: 0.3
+    coolingCoefficient: 0.3
 
 - type: entity
   parent: ClothingOuterBase
index 27ee1d5a6a1b05611392a0cf3e7868849ce46f65..a60d9bc75c26b8605c90afb7a51ba61c6f7ad125 100644 (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
     sprintModifier: 0.9
   - type: HeldSpeedModifier
   - type: TemperatureProtection
-    coefficient: 0.1
+    heatingCoefficient: 0.1
+    coolingCoefficient: 0.1
   - type: Armor
     modifiers:
       coefficients:
index 0f1b9536da611809ae186e56704d131c31d66822..334e87ebf6ed05effdb9290febd1138c7f5c3f71 100644 (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
     highPressureMultiplier: 0.6
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.01
+    heatingCoefficient: 0.01
+    coolingCoefficient: 0.01
   - type: Armor
     modifiers:
       coefficients:
     highPressureMultiplier: 0.6
     lowPressureMultiplier: 1000
   - type: TemperatureProtection
-    coefficient: 0.01
+    heatingCoefficient: 0.01
+    coolingCoefficient: 0.01
   - type: ToggleableClothing
     clothingPrototype: ClothingHeadHelmetHardsuitCarp
index 378e10d32205c07ee75eb6532a0d8675e5114201..ec38b79370a102ba0e3b65b65887619c2cfa3010 100644 (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
index d096ee3ff177936133ff2dd6ae796d93b964f1d5..e9b8431707bc2bd77e369b6ee95973c66bffdaa9 100644 (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