Skip to content

Commit

Permalink
Merge pull request #1557 from formlessnameless/dev
Browse files Browse the repository at this point in the history
Changelings Enter Stasis Automatically On Death
  • Loading branch information
Darkmajia authored Feb 5, 2025
2 parents eb78b68 + cf03907 commit b85b42c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,15 @@ private void OnTransform(EntityUid uid, ChangelingComponent comp, ref Changeling

private void OnEnterStasis(EntityUid uid, ChangelingComponent comp, ref EnterStasisEvent args)
{
if (comp.IsInStasis || HasComp<AbsorbedComponent>(uid))
if (comp.IsInStasis)
{
_popup.PopupEntity(Loc.GetString("changeling-stasis-enter-fail"), uid, uid);
_popup.PopupEntity(Loc.GetString("changeling-stasis-enter-fail-already"), uid, uid);
return;
}

if (HasComp<AbsorbedComponent>(uid))
{
_popup.PopupEntity(Loc.GetString("changeling-stasis-enter-fail-eaten"), uid, uid);
return;
}

Expand Down
10 changes: 10 additions & 0 deletions Content.Server/_Goobstation/Changeling/ChangelingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,17 @@ private void OnStartup(EntityUid uid, ChangelingComponent comp, ref ComponentSta
private void OnMobStateChange(EntityUid uid, ChangelingComponent comp, ref MobStateChangedEvent args)
{
if (args.NewMobState == MobState.Dead)
{
RemoveAllChangelingEquipment(uid, comp);
// Automatically put the ling into stasis on death if there's enough biomass
if (!comp.IsInStasis && !HasComp<AbsorbedComponent>(uid) && comp.Biomass > 1)
{
comp.Chemicals = 0f;
comp.Biomass -= 1;
comp.IsInStasis = true;
}
}

}

private void OnDamageChange(Entity<ChangelingComponent> ent, ref DamageChangedEvent args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,8 @@ changeling-sting-extract-fail = {CAPITALIZE(THE($target))} lacks extractable DNA
changeling-sting-extract-max = We cannot extract more DNA until we assume a new form.
changeling-stasis-enter = We enter regenerative stasis.
changeling-stasis-enter-fail = We cannot enter stasis.
changeling-stasis-enter-fail-already = We are already in stasis.
changeling-stasis-enter-fail-eaten = We have been consumed, and cannot enter stasis.
changeling-stasis-exit = We rise from stasis.
changeling-stasis-exit-fail = We are not in stasis.
changeling-stasis-exit-fail-dead = We have been hollowed, and cannot rise from stasis.
Expand Down

0 comments on commit b85b42c

Please sign in to comment.