Skip to content

Commit

Permalink
Megasquached Surgery Updates
Browse files Browse the repository at this point in the history
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
  • Loading branch information
gluesniffler authored and Roudenn committed Nov 15, 2024
1 parent 4e00804 commit ee599b6
Show file tree
Hide file tree
Showing 202 changed files with 1,563 additions and 634 deletions.
2 changes: 1 addition & 1 deletion Content.Client/Backmen/Body/BodySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceCo
}
}

protected override void RemovePartMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
{
return;
}
Expand Down
2 changes: 0 additions & 2 deletions Content.Client/Backmen/Surgery/SurgeryBui.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ public sealed class SurgeryBui : BoundUserInterface
private bool _isBody = false;
private (EntityUid Ent, EntProtoId Proto)? _surgery;
private readonly List<EntProtoId> _previousSurgeries = new();
private DateTime _lastRefresh = DateTime.UtcNow;
private (string handName, EntityUid item) _throttling = ("", new EntityUid());
public SurgeryBui(EntityUid owner, Enum uiKey) : base(owner, uiKey)
{
_system = _entities.System<SurgerySystem>();
Expand Down
8 changes: 8 additions & 0 deletions Content.Client/Backmen/Targeting/TargetingSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,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.TargetRightArm,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightArm)))
/* .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.TargetRightLeg,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightLeg)))
/* .Bind(ContentKeyFunctions.TargetRightFoot,
InputCmdHandler.FromDelegate((session) => HandleTargetChange(session, TargetBodyPart.RightFoot)))*/
.Register<SharedTargetingSystem>();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,26 +12,46 @@
Name="DollHead"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollTorso"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollGroin"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollLeftArm"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollTorso"
Name="DollLeftHand"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollRightArm"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollRightHand"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollLeftLeg"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollLeftFoot"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollRightLeg"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
<TextureRect
Name="DollRightFoot"
Stretch="KeepAspectCentered"
SetSize="64 64"/>
</PanelContainer>
</Control>
</widgets:PartStatusControl>
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ public PartStatusControl()
{
{ TargetBodyPart.Head, DollHead },
{ TargetBodyPart.Torso, DollTorso },
{ TargetBodyPart.Groin, DollGroin },
{ TargetBodyPart.LeftArm, DollLeftArm },
{ TargetBodyPart.LeftHand, DollLeftHand },
{ TargetBodyPart.RightArm, DollRightArm },
{ TargetBodyPart.RightHand, DollRightHand },
{ TargetBodyPart.LeftLeg, DollLeftLeg },
{ TargetBodyPart.RightLeg, DollRightLeg }
{ TargetBodyPart.LeftFoot, DollLeftFoot },
{ TargetBodyPart.RightLeg, DollRightLeg },
{ TargetBodyPart.RightFoot, DollRightFoot }
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ public void OnSystemUnloaded(TargetingSystem system)

public void OnStateEntered(GameplayState state)
{
if (TargetingControl != null)
{
TargetingControl.SetVisible(_targetingComponent != null);
if (TargetingControl == null)
return;

if (_targetingComponent != null)
TargetingControl.SetColors(_targetingComponent.Target);
}
TargetingControl.SetTargetDollVisible(_targetingComponent != null);

if (_targetingComponent != null)
TargetingControl.SetBodyPartsVisible(_targetingComponent.Target);
}

public void AddTargetingControl(TargetingComponent component)
Expand All @@ -47,37 +47,35 @@ public void AddTargetingControl(TargetingComponent component)

if (TargetingControl != null)
{
TargetingControl.SetVisible(_targetingComponent != null);
TargetingControl.SetTargetDollVisible(_targetingComponent != null);

if (_targetingComponent != null)
TargetingControl.SetColors(_targetingComponent.Target);
TargetingControl.SetBodyPartsVisible(_targetingComponent.Target);
}

}

public void RemoveTargetingControl()
{
if (TargetingControl != null)
TargetingControl.SetVisible(false);
TargetingControl.SetTargetDollVisible(false);

_targetingComponent = null;
}

public void CycleTarget(TargetBodyPart bodyPart)
{
if (_playerManager.LocalEntity is not { } user
|| _entManager.GetComponent<TargetingComponent>(user) is not { } targetingComponent
|| TargetingControl == null)
|| _entManager.GetComponent<TargetingComponent>(user) is not { } targetingComponent
|| TargetingControl == null)
return;

var player = _entManager.GetNetEntity(user);
if (bodyPart != targetingComponent.Target)
{
var msg = new TargetChangeEvent(player, bodyPart);
_net.SendSystemNetworkMessage(msg);
TargetingControl?.SetColors(bodyPart);
TargetingControl?.SetBodyPartsVisible(bodyPart);
}
}


}
Loading

0 comments on commit ee599b6

Please sign in to comment.