Remove starvation damage (#9024)
* Remove starvation damage * remove more * Even more cleanup
This commit is contained in:
@@ -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<DamageableSystem>().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<IAdminLogManager>();
|
||||
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();
|
||||
|
||||
Reference in New Issue
Block a user