1
0

BodySystem.VitalOrgans.cs 1.0 KB

12345678910111213141516171819202122232425262728293031
  1. // SPDX-FileCopyrightText: 2025 Aiden <28298836+Aidenkrz@users.noreply.github.com>
  2. // SPDX-FileCopyrightText: 2025 Aiden <aiden@djkraz.com>
  3. // SPDX-FileCopyrightText: 2025 deltanedas <39013340+deltanedas@users.noreply.github.com>
  4. // SPDX-FileCopyrightText: 2025 deltanedas <@deltanedas:kde.org>
  5. //
  6. // SPDX-License-Identifier: AGPL-3.0-or-later
  7. using Content.Server.Body.Components;
  8. using Content.Shared._Shitmed.Body.Organ;
  9. using Content.Shared.Body.Components;
  10. namespace Content.Server.Body.Systems;
  11. public partial class BodySystem
  12. {
  13. /// <summary>
  14. /// Returns whether an entity is missing a brain and heart.
  15. /// If it does not have a body this returns false.
  16. /// </summary>
  17. public bool MissingVitalOrgans(EntityUid uid)
  18. {
  19. if (!TryComp<BodyComponent>(uid, out var body))
  20. return false; // no organs to be missing
  21. var ent = (uid, body);
  22. if (!TryGetBodyOrganEntityComps<BrainComponent>(ent, out _))
  23. return false;
  24. return TryGetBodyOrganEntityComps<HeartComponent>(ent, out _);
  25. }
  26. }