From 8b699052d2814f705212f42e38c9de4b3905a118 Mon Sep 17 00:00:00 2001 From: Rane <60792108+Elijahrane@users.noreply.github.com> Date: Mon, 27 Jun 2022 00:08:08 -0400 Subject: [PATCH] Remove starvation damage (#9024) * Remove starvation damage * remove more * Even more cleanup --- .../Nutrition/Components/HungerComponent.cs | 29 ------------------- .../Nutrition/Components/ThirstComponent.cs | 6 ---- .../Nutrition/EntitySystems/ThirstSystem.cs | 15 ---------- .../Entities/Mobs/NPCs/simplemob.yml | 6 ---- .../Entities/Mobs/Species/human.yml | 6 ---- 5 files changed, 62 deletions(-) diff --git a/Content.Server/Nutrition/Components/HungerComponent.cs b/Content.Server/Nutrition/Components/HungerComponent.cs index f52c28b203..8a9a17d093 100644 --- a/Content.Server/Nutrition/Components/HungerComponent.cs +++ b/Content.Server/Nutrition/Components/HungerComponent.cs @@ -1,8 +1,4 @@ -using Content.Server.Administration.Logs; using Content.Shared.Alert; -using Content.Shared.Damage; -using Content.Shared.Database; -using Content.Shared.MobState.Components; using Content.Shared.Movement.Components; using Content.Shared.Movement.Systems; using Content.Shared.Nutrition.Components; @@ -70,10 +66,6 @@ namespace Content.Server.Nutrition.Components { HungerThreshold.Starving, AlertType.Starving }, }; - [DataField("damage", required: true)] - [ViewVariables(VVAccess.ReadWrite)] - public DamageSpecifier Damage = default!; - public void HungerThresholdEffect(bool force = false) { if (_currentHungerThreshold != _lastHungerThreshold || force) @@ -173,21 +165,6 @@ namespace Content.Server.Nutrition.Components if (_currentHungerThreshold != HungerThreshold.Dead) return; - // --> Current Hunger is below dead threshold - - if (!_entMan.TryGetComponent(Owner, out MobStateComponent? mobState)) - return; - - if (!mobState.IsDead()) - { - // --> But they are not dead yet. - _accumulatedFrameTime += frametime; - if (_accumulatedFrameTime >= 1) - { - EntitySystem.Get().TryChangeDamage(Owner, Damage * (int) _accumulatedFrameTime, true); - _accumulatedFrameTime -= (int) _accumulatedFrameTime; - } - } } private void UpdateCurrentThreshold() @@ -196,12 +173,6 @@ namespace Content.Server.Nutrition.Components // _trySound(calculatedThreshold); if (calculatedHungerThreshold != _currentHungerThreshold) { - var logManager = IoCManager.Resolve(); - if (_currentHungerThreshold == HungerThreshold.Dead) - logManager.Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has stopped starving"); - else if (calculatedHungerThreshold == HungerThreshold.Dead) - logManager.Add(LogType.Hunger, $"{_entMan.ToPrettyString(Owner):entity} has started starving"); - _currentHungerThreshold = calculatedHungerThreshold; HungerThresholdEffect(); Dirty(); diff --git a/Content.Server/Nutrition/Components/ThirstComponent.cs b/Content.Server/Nutrition/Components/ThirstComponent.cs index f046077866..04e8af2147 100644 --- a/Content.Server/Nutrition/Components/ThirstComponent.cs +++ b/Content.Server/Nutrition/Components/ThirstComponent.cs @@ -1,5 +1,4 @@ using Content.Shared.Alert; -using Content.Shared.Damage; namespace Content.Server.Nutrition.Components { @@ -50,10 +49,5 @@ namespace Content.Server.Nutrition.Components {ThirstThreshold.Thirsty, AlertType.Thirsty}, {ThirstThreshold.Parched, AlertType.Parched}, }; - - - [DataField("damage", required: true)] - [ViewVariables(VVAccess.ReadWrite)] - public DamageSpecifier Damage = default!; } } diff --git a/Content.Server/Nutrition/EntitySystems/ThirstSystem.cs b/Content.Server/Nutrition/EntitySystems/ThirstSystem.cs index f31ccc4446..03db94acd2 100644 --- a/Content.Server/Nutrition/EntitySystems/ThirstSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/ThirstSystem.cs @@ -135,24 +135,9 @@ namespace Content.Server.Nutrition.EntitySystems var calculatedThirstThreshold = GetThirstThreshold(component, component.CurrentThirst); if (calculatedThirstThreshold != component.CurrentThirstThreshold) { - if (component.CurrentThirstThreshold == ThirstThreshold.Dead) - _adminLogger.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has stopped taking dehydration damage"); - else if (calculatedThirstThreshold == ThirstThreshold.Dead) - _adminLogger.Add(LogType.Thirst, $"{EntityManager.ToPrettyString(component.Owner):entity} has started taking dehydration damage"); - component.CurrentThirstThreshold = calculatedThirstThreshold; UpdateEffects(component); } - if (component.CurrentThirstThreshold == ThirstThreshold.Dead) - { - if (!EntityManager.TryGetComponent(component.Owner, out MobStateComponent? mobState)) - return; - - if (!mobState.IsDead()) - { - _damage.TryChangeDamage(component.Owner, component.Damage, true); - } - } } _accumulatedFrameTime -= 1; } diff --git a/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml b/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml index 08afc66df1..bc35c09d75 100644 --- a/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml +++ b/Resources/Prototypes/Entities/Mobs/NPCs/simplemob.yml @@ -167,13 +167,7 @@ # - Hunger TODO: eating on the floor and fix weird AI endless stomach # - Thirst - type: Hunger - damage: - types: - Blunt: 2 - type: Thirst - damage: - types: - Blunt: 2 - type: Barotrauma damage: types: diff --git a/Resources/Prototypes/Entities/Mobs/Species/human.yml b/Resources/Prototypes/Entities/Mobs/Species/human.yml index 46d90c0643..74bb80fee4 100644 --- a/Resources/Prototypes/Entities/Mobs/Species/human.yml +++ b/Resources/Prototypes/Entities/Mobs/Species/human.yml @@ -46,13 +46,7 @@ soundHit: path: /Audio/Effects/hit_kick.ogg - type: Hunger - damage: - types: - Blunt: 2 - type: Thirst - damage: - types: - Blunt: 2 # Organs - type: InjectableSolution solution: chemicals