Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shitmed Update 2 - [Insert Snarky Remark] #1271

Merged
merged 64 commits into from
Nov 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
9ba5958
this might be the biggest piece of shitmed drama
gluesniffler Oct 5, 2024
cd6c0ce
Added layout for the proper bodydoll
gluesniffler Oct 6, 2024
0f6c2ab
Merge branch 'master' of https://github.com/Simple-Station/Einstein-E…
gluesniffler Oct 6, 2024
989d831
Added body doll, and currently broken status doll.
gluesniffler Oct 6, 2024
06e2a1c
forgor to add this shit
gluesniffler Oct 7, 2024
c4ff6b5
Added body status doll, added real squares to doll, tweaked part removal
gluesniffler Oct 9, 2024
87e45f3
Update 2, body doll, severing drops, healing and command binds
gluesniffler Oct 12, 2024
2e0b0bb
Changed canTarget for a multiplier that can go on calls to TryChangeD…
gluesniffler Oct 13, 2024
da41313
surgery real
gluesniffler Oct 14, 2024
fa5a39d
Small checkpoint save
gluesniffler Oct 16, 2024
8c24925
Bunch o updates for the weekend.
gluesniffler Oct 21, 2024
c9cb2b8
Added malpractice penalties, repeatable tend wounds surgeries, body p…
gluesniffler Oct 23, 2024
a1fec38
insertion surgery, some fixes to wound tending
gluesniffler Oct 25, 2024
d20684e
Busting bugs
gluesniffler Oct 26, 2024
6ccc751
buggymed
gluesniffler Oct 26, 2024
2e785a2
Draft PR commit.
gluesniffler Oct 28, 2024
285c468
this is all shitcode
gluesniffler Oct 28, 2024
87a2520
another attempt?
gluesniffler Oct 28, 2024
57563a9
saving before switching to master
gluesniffler Oct 28, 2024
3ea0335
fixed part reattachment slots and cavity implant surgery
gluesniffler Oct 29, 2024
fd206e8
removed loggers trol
gluesniffler Oct 29, 2024
990fa8a
leaving some tests running
gluesniffler Oct 30, 2024
716811d
Fixed a buncho crap
gluesniffler Oct 31, 2024
917ade3
Added some experimental lag fixes to surgery. Might have crashes
gluesniffler Nov 2, 2024
3ca30f8
defelinization almost real
gluesniffler Nov 6, 2024
1d38934
Merge pull request #169 from XavierSomething/HealthAnalyzerUIWizden
FoxxoTrystan Sep 3, 2024
f3af74f
Fix medical PDA/health analyzer long range intel bug (#31879)
goet Sep 21, 2024
bd11689
Add health analyzer unrevivability warning (#32636)
SaphireLattice Oct 26, 2024
4c17800
helth
gluesniffler Nov 7, 2024
86eac6e
fixed some rich text issues
gluesniffler Nov 7, 2024
42c77fa
Merge branch 'health' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 7, 2024
56317c9
health analyzer real
gluesniffler Nov 7, 2024
1a0e84a
Update genericNegativeEffects.yml
gluesniffler Nov 8, 2024
8a7d372
Merge branch 'master' into SHITMED
gluesniffler Nov 11, 2024
553cd05
Please do not cherrypick this one yet.
gluesniffler Nov 12, 2024
ed03916
Merge branch 'SHITMED' of https://github.com/gluesniffler/Einstein-En…
gluesniffler Nov 12, 2024
c78d43c
guh forgot to merge upstream
gluesniffler Nov 12, 2024
7c49056
Merge branch 'master' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 12, 2024
243c93e
test change to see if rt shuts up
gluesniffler Nov 12, 2024
b1fe563
Refactored body parts to use damageablecomponent
gluesniffler Nov 13, 2024
db84845
fixed the funny detachment exception lmao, need to refactor some shit…
gluesniffler Nov 13, 2024
b3c8941
newmed health analyzer real, also refactors and some bugfixes
gluesniffler Nov 14, 2024
85964e4
somewhat stable release
gluesniffler Nov 14, 2024
e58d88a
Quick patch to see if tests shut up
gluesniffler Nov 14, 2024
9c84e11
added solidus's comments, pending removal of namespace thingies for t…
gluesniffler Nov 16, 2024
2a5e36e
One, two, one two three four.
gluesniffler Nov 17, 2024
5eeac51
We're swaying on horseback.
gluesniffler Nov 17, 2024
4dc858b
The hills are green
gluesniffler Nov 17, 2024
dc406a6
And the birdies sing
gluesniffler Nov 17, 2024
15abfd9
Merge branch 'master' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 17, 2024
36828c2
And roses are pink
gluesniffler Nov 17, 2024
92f381b
Experience I've never had.
gluesniffler Nov 17, 2024
b603833
I'm so happy
gluesniffler Nov 17, 2024
7c6e38c
Happy to just be, part of your story.
gluesniffler Nov 18, 2024
9b8df1e
After you I follow.
gluesniffler Nov 23, 2024
b2afbfd
Merge branch 'master' of https://github.com/gluesniffler/Einstein-Eng…
gluesniffler Nov 23, 2024
bc44896
After you I follow.
gluesniffler Nov 23, 2024
7f0b88a
The world you showed me broadened my horizon
gluesniffler Nov 23, 2024
5c5ed5d
Forever my hero.
gluesniffler Nov 23, 2024
6e43a13
Forever my hero.
gluesniffler Nov 24, 2024
b53eb64
I am your biggest fan
gluesniffler Nov 24, 2024
b5e47e0
Merge branch 'master' into SHITMED
gluesniffler Nov 24, 2024
8e1823b
I fall down the horseback
gluesniffler Nov 24, 2024
ca07b12
With my crippled legs
gluesniffler Nov 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Content.Client/Options/UI/Tabs/KeyRebindTab.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,13 @@ void AddCheckBox(string checkBoxName, bool currentState, Action<BaseButton.Butto
AddButton(ContentKeyFunctions.TargetHead);
AddButton(ContentKeyFunctions.TargetTorso);
AddButton(ContentKeyFunctions.TargetLeftArm);
AddButton(ContentKeyFunctions.TargetLeftHand);
AddButton(ContentKeyFunctions.TargetRightArm);
AddButton(ContentKeyFunctions.TargetRightHand);
AddButton(ContentKeyFunctions.TargetLeftLeg);
AddButton(ContentKeyFunctions.TargetLeftFoot);
AddButton(ContentKeyFunctions.TargetRightLeg);
AddButton(ContentKeyFunctions.TargetRightFoot);

AddHeader("ui-options-header-misc");
AddButton(ContentKeyFunctions.TakeScreenshot);
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Smoking/MatchstickSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.Smoking.Systems;

namespace Content.Client.Smoking;

public sealed class MatchstickSystem : SharedMatchstickSystem;
6 changes: 6 additions & 0 deletions Content.Client/Speech/Components/OhioAccentComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
namespace Content.Client.Speech.Components;

// We keep this here because of surgery checks being client-side.
[RegisterComponent]
public sealed partial class OhioAccentComponent : Component
{ }
16 changes: 8 additions & 8 deletions Content.Client/Targeting/TargetingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,20 @@ public override void Initialize()
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.Torso)))
.Bind(ContentKeyFunctions.TargetLeftArm,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftArm)))
/* .Bind(ContentKeyFunctions.TargetLeftHand,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftHand))) SOON :TM: */
.Bind(ContentKeyFunctions.TargetLeftHand,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftHand)))
.Bind(ContentKeyFunctions.TargetRightArm,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightArm)))
/* .Bind(ContentKeyFunctions.TargetRightHand,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightHand)))*/
.Bind(ContentKeyFunctions.TargetRightHand,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightHand)))
.Bind(ContentKeyFunctions.TargetLeftLeg,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftLeg)))
/* .Bind(ContentKeyFunctions.TargetLeftFoot,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftFoot)))*/
.Bind(ContentKeyFunctions.TargetLeftFoot,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.LeftFoot)))
.Bind(ContentKeyFunctions.TargetRightLeg,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightLeg)))
/* .Bind(ContentKeyFunctions.TargetRightFoot,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightFoot)))*/
.Bind(ContentKeyFunctions.TargetRightFoot,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightFoot)))
.Register<SharedTargetingSystem>();
}

Expand Down
5 changes: 5 additions & 0 deletions Content.Server/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,10 @@ namespace Content.Server.Body.Components
[RegisterComponent, Access(typeof(BrainSystem))]
public sealed partial class BrainComponent : Component
{
/// <summary>
/// Is this brain currently controlling the entity?
/// </summary>
[DataField]
public bool Active = true;
}
}
10 changes: 10 additions & 0 deletions Content.Server/Body/Systems/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,16 @@ public override HashSet<EntityUid> GibPart(
return gibs;
}

public override bool BurnPart(EntityUid partId, BodyPartComponent? part = null)
{
if (!Resolve(partId, ref part, logMissing: false)
|| TerminatingOrDeleted(partId)
|| EntityManager.IsQueuedForDeletion(partId))
return false;

return base.BurnPart(partId, part);
}

protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceComponent component)
{
return;
Expand Down
51 changes: 41 additions & 10 deletions Content.Server/Body/Systems/BrainSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
using Content.Server.Ghost.Components;
using Content.Shared.Body.Components;
using Content.Shared.Body.Systems;
using Content.Shared.Body.Systems;
using Content.Shared.Body.Events;
using Content.Shared.Body.Organ;
using Content.Server.DelayedDeath;
using Content.Server.DelayedDeath;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Pointing;
Expand All @@ -25,29 +27,33 @@ public override void Initialize()
SubscribeLocalEvent<BrainComponent, PointAttemptEvent>(OnPointAttempt);
}

private void HandleRemoval(EntityUid uid, BrainComponent _, ref OrganRemovedFromBodyEvent args)
private void HandleRemoval(EntityUid uid, BrainComponent brain, ref OrganRemovedFromBodyEvent args)
{
if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.OldBody))
return;

brain.Active = false;
// Prevents revival, should kill the user within a given timespan too.
EnsureComp<DebrainedComponent>(args.OldBody);
EnsureComp<DelayedDeathComponent>(args.OldBody);
HandleMind(uid, args.OldBody);
if (!CheckOtherBrains(args.OldBody))
{
EnsureComp<DebrainedComponent>(args.OldBody);
HandleMind(uid, args.OldBody);
}
}

private void HandleAddition(EntityUid uid, BrainComponent _, ref OrganAddedToBodyEvent args)
private void HandleAddition(EntityUid uid, BrainComponent brain, ref OrganAddedToBodyEvent args)
{
if (TerminatingOrDeleted(uid) || TerminatingOrDeleted(args.Body))
return;

RemComp<DebrainedComponent>(args.Body);
if (_bodySystem.TryGetBodyOrganComponents<HeartComponent>(args.Body, out var _))
RemComp<DelayedDeathComponent>(args.Body);
HandleMind(args.Body, uid);
if (!CheckOtherBrains(args.Body))
{
RemComp<DebrainedComponent>(args.Body);
HandleMind(args.Body, uid, brain);
}
}

private void HandleMind(EntityUid newEntity, EntityUid oldEntity)
private void HandleMind(EntityUid newEntity, EntityUid oldEntity, BrainComponent? brain = null)
{
if (TerminatingOrDeleted(newEntity) || TerminatingOrDeleted(oldEntity))
return;
Expand All @@ -63,11 +69,36 @@ private void HandleMind(EntityUid newEntity, EntityUid oldEntity)
return;

_mindSystem.TransferTo(mindId, newEntity, mind: mind);
if (brain != null)
brain.Active = true;
}

private void OnPointAttempt(Entity<BrainComponent> ent, ref PointAttemptEvent args)
{
args.Cancel();
}

private bool CheckOtherBrains(EntityUid entity)
{
var hasOtherBrains = false;
if (TryComp<BodyComponent>(entity, out var body))
{
if (TryComp<BrainComponent>(entity, out var bodyBrain))
hasOtherBrains = true;
else
{
foreach (var (organ, _) in _bodySystem.GetBodyOrgans(entity, body))
{
if (TryComp<BrainComponent>(organ, out var brain) && brain.Active)
{
hasOtherBrains = true;
break;
}
}
}
}

return hasOtherBrains;
}
}
}
62 changes: 62 additions & 0 deletions Content.Server/Body/Systems/DebrainedSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Content.Shared.Body.Systems;
using Content.Shared.Body.Organ;
using Content.Server.DelayedDeath;
using Content.Shared.Mind;
using Content.Server.Popups;
using Content.Shared.Speech;
using Content.Shared.Standing;
using Content.Shared.Stunnable;

namespace Content.Server.Body.Systems;

/// <summary>
/// This system handles behavior on entities when they lose their head or their brains are removed.
/// MindComponent fuckery should still be mainly handled on BrainSystem as usual.
/// </summary>
public sealed class DebrainedSystem : EntitySystem
{
[Dependency] private readonly SharedBodySystem _bodySystem = default!;
[Dependency] private readonly PopupSystem _popupSystem = default!;
[Dependency] private readonly StandingStateSystem _standingSystem = default!;
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<DebrainedComponent, ComponentInit>(OnComponentInit);
SubscribeLocalEvent<DebrainedComponent, ComponentRemove>(OnComponentRemove);
SubscribeLocalEvent<DebrainedComponent, SpeakAttemptEvent>(OnSpeakAttempt);
SubscribeLocalEvent<DebrainedComponent, StandAttemptEvent>(OnStandAttempt);
}

private void OnComponentInit(EntityUid uid, DebrainedComponent _, ComponentInit args)
{
if (TerminatingOrDeleted(uid))
return;

EnsureComp<DelayedDeathComponent>(uid);
EnsureComp<StunnedComponent>(uid);
_standingSystem.Down(uid);
}

private void OnComponentRemove(EntityUid uid, DebrainedComponent _, ComponentRemove args)
{
if (TerminatingOrDeleted(uid))
return;

RemComp<DelayedDeathComponent>(uid);
RemComp<StunnedComponent>(uid);
if (_bodySystem.TryGetBodyOrganComponents<HeartComponent>(uid, out var _))
RemComp<DelayedDeathComponent>(uid);
}

private void OnSpeakAttempt(EntityUid uid, DebrainedComponent _, SpeakAttemptEvent args)
{
_popupSystem.PopupEntity(Loc.GetString("speech-muted"), uid, uid);
args.Cancel();
}

private void OnStandAttempt(EntityUid uid, DebrainedComponent _, StandAttemptEvent args)
{
args.Cancel();
}
}
87 changes: 87 additions & 0 deletions Content.Server/Body/Systems/EyesSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
using Content.Server.Body.Components;
using Content.Shared.Body.Components;
using Content.Shared.Body.Events;
using Content.Shared.Body.Organ;
using Content.Shared.Eye.Blinding.Components;
using Content.Shared.Eye.Blinding.Systems;

namespace Content.Server.Body.Systems
{
public sealed class EyesSystem : EntitySystem
{
[Dependency] private readonly IEntityManager _entityManager = default!;
[Dependency] private readonly BlindableSystem _blindableSystem = default!;
[Dependency] private readonly BodySystem _bodySystem = default!;

public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<EyesComponent, OrganEnabledEvent>(OnOrganEnabled);
SubscribeLocalEvent<EyesComponent, OrganDisabledEvent>(OnOrganDisabled);
}

private void HandleSight(EntityUid newEntity, EntityUid oldEntity)
{
if (TerminatingOrDeleted(newEntity) || TerminatingOrDeleted(oldEntity))
return;

BlindableComponent? newSight;
BlindableComponent? oldSight;
//transfer existing component to organ
if (!TryComp(newEntity, out newSight))
newSight = EnsureComp<BlindableComponent>(newEntity);

if (!TryComp(oldEntity, out oldSight))
oldSight = EnsureComp<BlindableComponent>(oldEntity);

//give new sight all values of old sight
_blindableSystem.TransferBlindness(newSight, oldSight, newEntity);

var hasOtherEyes = false;
//check for other eye components on owning body and owning body organs (if old entity has a body)
if (TryComp<BodyComponent>(oldEntity, out var body))
{
if (TryComp<EyesComponent>(oldEntity, out var bodyEyes)) //some bodies see through their skin!!! (slimes)
hasOtherEyes = true;
else
{
foreach (var (organ, _) in _bodySystem.GetBodyOrgans(oldEntity, body))
{
if (TryComp<EyesComponent>(organ, out var eyes))
{
hasOtherEyes = true;
break;
}
}
//TODO (MS14): Should we do this for body parts too? might be a little overpowered but could be funny/interesting
}
}

//if there are no existing eye components for the old entity - set old sight to be blind otherwise leave it as is
if (!hasOtherEyes && !TryComp<EyesComponent>(oldEntity, out var self))
_blindableSystem.AdjustEyeDamage((oldEntity, oldSight), oldSight.MaxDamage);

}

private void OnOrganEnabled(EntityUid uid, EyesComponent component, OrganEnabledEvent args)
{
if (TerminatingOrDeleted(uid)
|| args.Organ.Comp.Body is not { Valid: true } body)
return;

RemComp<TemporaryBlindnessComponent>(body);
HandleSight(uid, body);
}

private void OnOrganDisabled(EntityUid uid, EyesComponent component, OrganDisabledEvent args)
{
if (TerminatingOrDeleted(uid)
|| args.Organ.Comp.Body is not { Valid: true } body)
return;

EnsureComp<TemporaryBlindnessComponent>(body);
HandleSight(body, uid);
}
}
}
54 changes: 54 additions & 0 deletions Content.Server/Cybernetics/CyberneticsSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Content.Server.Emp;
using Content.Server.Body.Systems;
using Content.Shared.Body.Part;
using Content.Shared.Body.Organ;
using Content.Shared.Cybernetics;

namespace Content.Server.Cybernetics;

internal sealed class CyberneticsSystem : EntitySystem
{
public override void Initialize()
{
SubscribeLocalEvent<CyberneticsComponent, EmpPulseEvent>(OnEmpPulse);
SubscribeLocalEvent<CyberneticsComponent, EmpDisabledRemoved>(OnEmpDisabledRemoved);
}
private void OnEmpPulse(Entity<CyberneticsComponent> cyberEnt, ref EmpPulseEvent ev)
{
if (!cyberEnt.Comp.Disabled)
{
ev.Affected = true;
ev.Disabled = true;
cyberEnt.Comp.Disabled = true;

if (HasComp<OrganComponent>(cyberEnt))
{
var disableEvent = new OrganEnableChangedEvent(false);
RaiseLocalEvent(cyberEnt, ref disableEvent);
}
else if (HasComp<BodyPartComponent>(cyberEnt))
{
var disableEvent = new BodyPartEnableChangedEvent(false);
RaiseLocalEvent(cyberEnt, ref disableEvent);
}
}
}

private void OnEmpDisabledRemoved(Entity<CyberneticsComponent> cyberEnt, ref EmpDisabledRemoved ev)
{
if (cyberEnt.Comp.Disabled)
{
cyberEnt.Comp.Disabled = false;
if (HasComp<OrganComponent>(cyberEnt))
{
var enableEvent = new OrganEnableChangedEvent(true);
RaiseLocalEvent(cyberEnt, ref enableEvent);
}
else if (HasComp<BodyPartComponent>(cyberEnt))
{
var enableEvent = new BodyPartEnableChangedEvent(true);
RaiseLocalEvent(cyberEnt, ref enableEvent);
}
}
}
}
Loading
Loading