Add dizziness as a symptom of bloodloss (#10172)

This commit is contained in:
Rane
2022-07-30 22:24:24 -04:00
committed by GitHub
parent 68a5fcb7f8
commit 95bf54af7a
3 changed files with 19 additions and 3 deletions

View File

@@ -10,13 +10,15 @@ public abstract class SharedDrunkSystem : EntitySystem
[Dependency] private readonly StatusEffectsSystem _statusEffectsSystem = default!;
[Dependency] private readonly SharedSlurredSystem _slurredSystem = default!;
public void TryApplyDrunkenness(EntityUid uid, float boozePower,
public void TryApplyDrunkenness(EntityUid uid, float boozePower, bool applySlur = true,
StatusEffectsComponent? status = null)
{
if (!Resolve(uid, ref status, false))
return;
_slurredSystem.DoSlur(uid, TimeSpan.FromSeconds(boozePower), status);
if (applySlur)
_slurredSystem.DoSlur(uid, TimeSpan.FromSeconds(boozePower), status);
if (!_statusEffectsSystem.HasStatusEffect(uid, DrunkKey, status))
{
_statusEffectsSystem.TryAddStatusEffect<DrunkComponent>(uid, DrunkKey, TimeSpan.FromSeconds(boozePower), true, status);