Skip to content

Commit

Permalink
Revert "Merge pull request Simple-Station#16 from Tropica1Owl/Pogmed"
Browse files Browse the repository at this point in the history
This reverts commit 86a829e, reversing
changes made to 2747975.
  • Loading branch information
gluesniffler committed Oct 26, 2024
1 parent 2f202d1 commit 3e66ce9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 87 deletions.
45 changes: 13 additions & 32 deletions Content.Server/Palmtree/Surgery/SurgerySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Content.Server.Body.Systems;
using Content.Server.Popups;
using Content.Server.Mind;
using Content.Shared.Inventory;
using Content.Shared.Atmos.Rotting;
using Content.Shared.Palmtree.Surgery;
using Content.Shared.Interaction;
Expand Down Expand Up @@ -64,7 +63,7 @@ public class PSurgerySystem : SharedSurgerySystem
[Dependency] private readonly SharedMindSystem _sharedmind = default!;
[Dependency] private readonly MindSystem _mind = default!;
[Dependency] private readonly StandingStateSystem _standing = default!;
[Dependency] private readonly InventorySystem _inventory = default!;
//[Dependency] private readonly IPlayerManager _player = default!;
[Dependency] private readonly SharedRottingSystem _rot = default!;
[Dependency] private readonly BloodstreamSystem _blood = default!;
[Dependency] private readonly IGameTiming _timing = default!;
Expand Down Expand Up @@ -255,54 +254,36 @@ private void OnProcedureFinished(EntityUid uid, PSurgeryToolComponent tool, Surg
}
private void OnAfterInteract(EntityUid uid, PSurgeryToolComponent tool, AfterInteractEvent args) // Turn this into FTL strings later
{
int surgeryTimeMultiplier = 1;
bool messageShown = false; // Avoid pop up stacking
bool patientHasState = TryComp(args.Target, out MobStateComponent? patientState);
if (!args.CanReach || args.Target == null) // We already check if target is null, it's okay to perform direct conversion to non-nullable
{
return;
}
if (!TryComp(args.Target, out PPatientComponent? patient) && patientHasState)
{
_popupSystem.PopupEntity("You cannot perform surgery on this!", args.User, PopupType.Small);
return;
}
if (_inventory.TryGetSlotEntity((EntityUid) args.Target, "outerClothing", out var outer) || _inventory.TryGetSlotEntity((EntityUid) args.Target, "jumpsuit", out var jumpsuit))
if (!_standing.IsDown((EntityUid) args.Target))
{
_popupSystem.PopupEntity("Remove the patient's clothes first!", args.User, PopupType.MediumCaution);
_popupSystem.PopupEntity("The patient must be laying down and asleep!", args.User, PopupType.Small);
return;
}
if (args.User == args.Target) // I've reordered the checks so that the most important modifiers are warned about first.
{
if (!messageShown)
{
_popupSystem.PopupEntity("You begin operating yourself, this isn't exactly ideal.", args.User, PopupType.MediumCaution);
messageShown = true;
}
surgeryTimeMultiplier += 3;
}
if (!_standing.IsDown((EntityUid) args.Target))
if (!TryComp(args.Target, out SleepingComponent? sleep) && !_mobState.IsIncapacitated((EntityUid) args.Target, patientState))
{
if (!messageShown)
{
_popupSystem.PopupEntity("The patient should be laying down!", args.User, PopupType.MediumCaution);
messageShown = true;
}
surgeryTimeMultiplier += 3;
_popupSystem.PopupEntity("The patient must be asleep!", args.User, PopupType.Small);
return;
}
if (!TryComp(args.Target, out SleepingComponent? sleep) && !_mobState.IsIncapacitated((EntityUid) args.Target, patientState))
if (args.User == args.Target)
{
if (!messageShown)
{
_popupSystem.PopupEntity("You begin the procedure with them awake, this is gonna hurt.", args.User, PopupType.MediumCaution);
messageShown = true;
}
surgeryTimeMultiplier += 1;
_popupSystem.PopupEntity("You cannot operate yourself!", args.User, PopupType.Small);
return;
}
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, tool.useDelay * surgeryTimeMultiplier, new SurgeryDoAfterEvent(), uid, target: args.Target)
var doAfterEventArgs = new DoAfterArgs(EntityManager, args.User, tool.useDelay, new SurgeryDoAfterEvent(), uid, target: args.Target)
{
NeedHand = true,
BreakOnUserMove = true,
BreakOnTargetMove = true,
//BreakOnMove = true,
//BreakOnWeightlessMove = true,
};
_audio.PlayPvs(tool.audioStart, args.User);
_doAfter.TryStartDoAfter(doAfterEventArgs);
Expand Down
7 changes: 0 additions & 7 deletions Resources/Prototypes/Guidebook/medical.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
- Chemist
- Cloning
- Cryogenics
- Surgery # Syndicate change

- type: guideEntry
id: Medical Doctor
Expand Down Expand Up @@ -49,9 +48,3 @@
id: AdvancedBrute
name: guide-entry-brute
text: "/ServerInfo/Guidebook/Medical/AdvancedBrute.xml"
# Syndicate change start
- type: guideEntry
id: Surgery
name: Surgery
text: "/ServerInfo/Palmtree/Medical/Surgery.xml"
# Syndicate change end
48 changes: 0 additions & 48 deletions Resources/ServerInfo/Palmtree/Medical/Surgery.xml

This file was deleted.

0 comments on commit 3e66ce9

Please sign in to comment.