-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Port] Surgery Fixes: Popup Walker (#923)
* Megasquached Surgery Updates Megasquached Surgery Updates Quick patch to see if tests shut up Please do not cherrypick this one yet. Refactored body parts to use damageablecomponent newmed health analyzer real, also refactors and some bugfixes * added solidus's comments, pending removal of namespace thingies for this repo, also fixed some healing thingies * fixes? * fix gib torso * fix prototypes * oops * Shitmed Update 1 (#1240) First in a series of PRs to introduce bugfixes and updates to Shitmed, this will generally feature PRs from Goobstation or Backmen as well since they are actively helping me maintain the code. Usual Shoutouts: Deltanedas: Goob-Station/Goob-Station#882 --- :cl: Mocho, Deltanedas - add: You can now perform surgery as a monke. Rejoice. - add: You can perform surgery on a lot of animals now, I missed a lot of them so just ask if you want any particular critter to get it. - tweak: Entities now perish after 60 seconds of losing their heart and/or brain. - fix: Entities properly take asphyxiation damage after losing their brain. - fix: Torsos being gibbable, which would break surgery or just about anything. - fix: Items not being removed from their respective slots if the parts were gibbed rather than dropped. - fix: Animal organs not being usable properly in surgeries - fix: Cyborg limbs are now usable as pseudo-peg arm/legs. --------- Signed-off-by: gluesniffler <[email protected]> Co-authored-by: FoxxoTrystan <[email protected]> Co-authored-by: goet <[email protected]> Co-authored-by: Saphire Lattice <[email protected]> * Shitmed Surgery Popups (#1241) Adds popups for surgery steps in Shitmed that every player within PVS range can see. This allows other players to see if the correct procedure is being performed. This PR also includes locale text for the new procedures and steps in #1240. **Remove Brain / Insert Brain** https://github.com/user-attachments/assets/ac20afa1-df74-48ab-b1d5-2e9a273dfba2 <details><summary>See more</summary> **Amputate Right Arm** https://github.com/user-attachments/assets/17f78683-6d3b-44ee-aea3-bb6987844fdc **Attach Right Arm** https://github.com/user-attachments/assets/584d4da2-d8b0-4c82-a323-26636e7fa4b8 </details> :cl: Skubman - add: Surgery step descriptions (like making an incision, removing/attaching limbs and organs) are now shown as popups to everyone in range upon the start of the step. This makes it clear which surgical procedure is being done and to which body part. No more stealthy brain-stealing in front of everyone! * fix the things + locale --------- Signed-off-by: gluesniffler <[email protected]> Co-authored-by: gluesniffler <[email protected]> Co-authored-by: Zack Backmen <[email protected]> Co-authored-by: gluesniffler <[email protected]> Co-authored-by: FoxxoTrystan <[email protected]> Co-authored-by: goet <[email protected]> Co-authored-by: Saphire Lattice <[email protected]> Co-authored-by: Skubman <[email protected]>
- Loading branch information
1 parent
c26f254
commit 0327a35
Showing
82 changed files
with
857 additions
and
112 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using Content.Shared.Body.Components; | ||
using Content.Shared.Body.Systems; | ||
using Content.Shared.Body.Events; | ||
using Content.Shared.Body.Organ; | ||
using Content.Server.Backmen.DelayedDeath; | ||
using Content.Server.Body.Components; | ||
using Content.Shared.Backmen.Surgery.Body.Organs; | ||
|
||
namespace Content.Server.Backmen.Body.Systems; | ||
|
||
public sealed class HeartSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly SharedBodySystem _bodySystem = default!; | ||
public override void Initialize() | ||
{ | ||
base.Initialize(); | ||
|
||
SubscribeLocalEvent<HeartComponent, OrganAddedToBodyEvent>(HandleAddition); | ||
SubscribeLocalEvent<HeartComponent, OrganRemovedFromBodyEvent>(HandleRemoval); | ||
} | ||
|
||
private void HandleRemoval(EntityUid uid, HeartComponent _, ref OrganRemovedFromBodyEvent args) | ||
{ | ||
if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.OldBody)) | ||
return; | ||
|
||
// TODO: Add some form of very violent bleeding effect. | ||
EnsureComp<DelayedDeathComponent>(args.OldBody); | ||
} | ||
|
||
private void HandleAddition(EntityUid uid, HeartComponent _, ref OrganAddedToBodyEvent args) | ||
{ | ||
if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.Body)) | ||
return; | ||
|
||
if (_bodySystem.TryGetBodyOrganEntityComps<BrainComponent>(args.Body, out var _)) | ||
RemComp<DelayedDeathComponent>(args.Body); | ||
} | ||
// Shitmed-End | ||
} |
16 changes: 16 additions & 0 deletions
16
Content.Server/Backmen/DelayedDeath/DelayedDeathComponent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Content.Server.Backmen.DelayedDeath; | ||
|
||
[RegisterComponent] | ||
public sealed partial class DelayedDeathComponent : Component | ||
{ | ||
/// <summary> | ||
/// How long it takes to kill the entity. | ||
/// </summary> | ||
[DataField] | ||
public float DeathTime = 60; | ||
|
||
/// <summary> | ||
/// How long it has been since the delayed death timer started. | ||
/// </summary> | ||
public float DeathTimer; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using Content.Shared.Body.Organ; | ||
using Content.Shared.Body.Events; | ||
using Content.Shared.Damage; | ||
using Content.Shared.Damage.Prototypes; | ||
using Content.Shared.Mobs.Systems; | ||
using Robust.Shared.Timing; | ||
using Robust.Shared.Prototypes; | ||
|
||
namespace Content.Server.Backmen.DelayedDeath; | ||
|
||
public partial class DelayedDeathSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly DamageableSystem _damageable = default!; | ||
[Dependency] private readonly MobStateSystem _mobState = default!; | ||
[Dependency] private readonly IPrototypeManager _prototypes = default!; | ||
public override void Update(float frameTime) | ||
{ | ||
base.Update(frameTime); | ||
|
||
using var query = EntityQueryEnumerator<DelayedDeathComponent>(); | ||
while (query.MoveNext(out var ent, out var component)) | ||
{ | ||
component.DeathTimer += frameTime; | ||
|
||
if (component.DeathTimer >= component.DeathTime && !_mobState.IsDead(ent)) | ||
{ | ||
var damage = new DamageSpecifier(_prototypes.Index<DamageTypePrototype>("Bloodloss"), 150); | ||
_damageable.TryChangeDamage(ent, damage, partMultiplier: 0f); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
Content.Shared/Backmen/Surgery/SurgeryStepDamageChangeEvent.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
using Content.Shared.Damage; | ||
|
||
namespace Content.Shared.Medical.Surgery; | ||
|
||
/// <summary> | ||
/// Raised on the target entity. | ||
/// </summary> | ||
[ByRefEvent] | ||
public record struct SurgeryStepDamageChangeEvent(EntityUid User, EntityUid Body, EntityUid Part, EntityUid Step); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.