Small changes for crit mobs to be able to gasp and dead mobs to show dead on examine (#5828)

* [ADD] changes to be able to identify living downed players

* [FIX] format of tryGetComponent, fixed string

* [CHANGE] PR mind component suggestions

* [CHANGE] trycomp based on qa feedback

* [CHANGE] Condensed mindcomponent as per feedback

Co-authored-by: fishfish458 <fishfish458>
This commit is contained in:
Fishfish458
2021-12-19 16:45:47 -06:00
committed by GitHub
parent a51b102949
commit 026f2ee313
4 changed files with 23 additions and 22 deletions

View File

@@ -38,7 +38,7 @@ public class LungSystem : EntitySystem
LungComponent? lung=null,
SharedMechanismComponent? mech=null)
{
if (!Resolve(uid, ref lung))
if (!Resolve(uid, ref lung, ref mech))
return;
if (_gameTiming.CurTime >= lung.LastGaspPopupTime + lung.GaspPopupCooldown)
@@ -47,6 +47,9 @@ public class LungSystem : EntitySystem
_popupSystem.PopupEntity(Loc.GetString("lung-behavior-gasp"), uid, Filter.Pvs(uid));
}
if (mech.Body != null && TryComp((mech.Body).Owner, out MobStateComponent? mobState) && !mobState.IsAlive())
return;
Inhale(uid, lung.CycleDelay);
}