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: Implementing Existing Newmed Code Into SS14 #1159

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 18 commits
Commits
Show all changes
44 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
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
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class BrainComponent : Component
{
}
}
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/LungComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class LungComponent : Component
{
}
}
9 changes: 9 additions & 0 deletions Content.Client/Body/Components/StomachComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using Robust.Shared.GameStates;

namespace Content.Client.Body.Components
{
[RegisterComponent]
public sealed partial class StomachComponent : Component
{
}
}
33 changes: 31 additions & 2 deletions Content.Client/Hands/Systems/HandsSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Content.Client.Examine;
using Content.Client.Strip;
using Content.Client.Verbs.UI;
using Content.Shared.Body.Part;
using Content.Shared.Hands;
using Content.Shared.Hands.Components;
using Content.Shared.Hands.EntitySystems;
Expand Down Expand Up @@ -38,7 +39,6 @@ public sealed class HandsSystem : SharedHandsSystem
public event Action<string, EntityUid>? OnPlayerItemRemoved;
public event Action<string>? OnPlayerHandBlocked;
public event Action<string>? OnPlayerHandUnblocked;

public override void Initialize()
{
base.Initialize();
Expand All @@ -49,6 +49,7 @@ public override void Initialize()
SubscribeLocalEvent<HandsComponent, ComponentShutdown>(OnHandsShutdown);
SubscribeLocalEvent<HandsComponent, ComponentHandleState>(HandleComponentState);
SubscribeLocalEvent<HandsComponent, VisualsChangedEvent>(OnVisualsChanged);
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);

OnHandSetActive += OnHandActivated;
}
Expand Down Expand Up @@ -236,7 +237,34 @@ public void UIHandAltActivateItem(string handName)
RaisePredictiveEvent(new RequestHandAltInteractEvent(handName));
}

#region pulling

#endregion

#region visuals
private void HandleBodyPartRemoved(EntityUid uid, HandsComponent component, ref BodyPartRemovedEvent args)
{
if (args.Part.Comp.PartType != BodyPartType.Hand || !TryComp(uid, out SpriteComponent? sprite))
return;

var location = args.Part.Comp.Symmetry switch
{
BodyPartSymmetry.None => HandLocation.Middle,
BodyPartSymmetry.Left => HandLocation.Left,
BodyPartSymmetry.Right => HandLocation.Right,
_ => throw new ArgumentOutOfRangeException(nameof(args.Part.Comp.Symmetry))
};

if (component.RevealedLayers.TryGetValue(location, out var revealedLayers))
{
foreach (var key in revealedLayers)
{
sprite.RemoveLayer(key);
}

revealedLayers.Clear();
}
}

protected override void HandleEntityInserted(EntityUid uid, HandsComponent hands, EntInsertedIntoContainerMessage args)
{
Expand All @@ -262,6 +290,7 @@ protected override void HandleEntityRemoved(EntityUid uid, HandsComponent hands,

if (!hands.Hands.TryGetValue(args.Container.ID, out var hand))
return;

UpdateHandVisuals(uid, args.Entity, hand);
_stripSys.UpdateUi(uid);

Expand Down Expand Up @@ -432,4 +461,4 @@ private void OnHandActivated(Entity<HandsComponent>? ent)
OnPlayerSetActiveHand?.Invoke(hand.Comp.ActiveHand.Name);
}
}
}
}
6 changes: 6 additions & 0 deletions Content.Client/Input/ContentContexts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ public static void SetupContexts(IInputContextContainer contexts)
human.AddFunction(ContentKeyFunctions.Arcade2);
human.AddFunction(ContentKeyFunctions.Arcade3);
human.AddFunction(ContentKeyFunctions.LookUp);
human.AddFunction(ContentKeyFunctions.TargetHead);
gluesniffler marked this conversation as resolved.
Show resolved Hide resolved
human.AddFunction(ContentKeyFunctions.TargetTorso);
human.AddFunction(ContentKeyFunctions.TargetLeftArm);
human.AddFunction(ContentKeyFunctions.TargetRightArm);
human.AddFunction(ContentKeyFunctions.TargetLeftLeg);
human.AddFunction(ContentKeyFunctions.TargetRightLeg);

// actions should be common (for ghosts, mobs, etc)
common.AddFunction(ContentKeyFunctions.OpenActionsMenu);
Expand Down
11 changes: 10 additions & 1 deletion Content.Client/Inventory/ClientInventorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using Content.Shared.Inventory;
using Content.Shared.Inventory.Events;
using Content.Shared.Storage;
using Content.Shared.Targeting.Events;
using JetBrains.Annotations;
using Robust.Client.Player;
using Robust.Client.UserInterface;
Expand Down Expand Up @@ -39,7 +40,7 @@ public override void Initialize()

SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerAttachedEvent>(OnPlayerAttached);
SubscribeLocalEvent<InventorySlotsComponent, LocalPlayerDetachedEvent>(OnPlayerDetached);

SubscribeLocalEvent<InventorySlotsComponent, RefreshInventorySlotsEvent>(OnRefreshInventorySlots);
SubscribeLocalEvent<InventoryComponent, ComponentShutdown>(OnShutdown);

SubscribeLocalEvent<InventorySlotsComponent, DidEquipEvent>((_, comp, args) =>
Expand Down Expand Up @@ -181,6 +182,13 @@ public void UpdateSlot(EntityUid owner, InventorySlotsComponent component, strin
EntitySlotUpdate?.Invoke(newData);
}

public void OnRefreshInventorySlots(EntityUid owner, InventorySlotsComponent component, RefreshInventorySlotsEvent args)
{
if (component.SlotData.TryGetValue(args.SlotName, out var slotData)
&& _playerManager.LocalEntity == owner)
OnSlotRemoved?.Invoke(slotData);
}

public bool TryAddSlotDef(EntityUid owner, InventorySlotsComponent component, SlotDefinition newSlotDef)
{
SlotData newSlotData = newSlotDef; //convert to slotData
Expand Down Expand Up @@ -237,6 +245,7 @@ public void UIInventoryAltActivateItem(string slot, EntityUid uid)

public sealed class SlotData
{
[ViewVariables]
public readonly SlotDefinition SlotDef;
public EntityUid? HeldEntity => Container?.ContainedEntity;
public bool Blocked;
Expand Down
2 changes: 1 addition & 1 deletion Content.Client/Inventory/InventorySlotsComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace Content.Client.Inventory;
public sealed partial class InventorySlotsComponent : Component
{
[ViewVariables]
public readonly Dictionary<string, ClientInventorySystem.SlotData> SlotData = new ();
public readonly Dictionary<string, ClientInventorySystem.SlotData> SlotData = new();

/// <summary>
/// Data about the current layers that have been added to the players sprite due to the items in each equipment slot.
Expand Down
Loading
Loading