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

Хирургия (попытка 2) #65

Merged
merged 42 commits into from
Nov 22, 2024
Merged
Show file tree
Hide file tree
Changes from 35 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
fdbf09f
The ShitMed
gluesniffler Oct 5, 2024
67d262b
Fixes
Roudenn Oct 29, 2024
5a6c44a
Delete redudant systems
Roudenn Oct 29, 2024
10fe206
fix components
Roudenn Oct 29, 2024
7c2ab82
fix error, update system
Rxup Oct 29, 2024
73213f0
Update BodyPartComponent.cs
Roudenn Oct 29, 2024
74734f3
fix max health, fix test legs
Rxup Oct 29, 2024
1a43876
fix test
Rxup Oct 29, 2024
39b21a0
Port fixes from EE (#875)
Roudenn Oct 30, 2024
635ca12
[Fix] Healing Fixes (#874)
Roudenn Oct 30, 2024
8cc9756
[Port] Surgery fixes: Part 2 (#876)
TokenStyle Nov 3, 2024
458da37
remove backmen ccvar
TokenStyle Nov 3, 2024
b0b0e11
Body doll in the Health Analyzer menu (#877)
Roudenn Nov 1, 2024
018ed00
fixes and fix guidebook paths (#887)
Rxup Nov 2, 2024
de95d85
Added some experimental lag fixes to surgery. Might have crashes
gluesniffler Nov 2, 2024
440ceb1
russian locale
TokenStyle Nov 3, 2024
3539651
Merge branch 'master' into shitmedd
TokenStyle Nov 3, 2024
cbca315
Merge branch 'master' into shitmedd
TokenStyle Nov 17, 2024
222aa74
Revert "Added some experimental lag fixes to surgery. Might have cras…
TokenStyle Nov 17, 2024
16e860c
[Port] Surgery fixes: Part 3 (#892)
Roudenn Nov 3, 2024
43744df
[Tweak] Rework BodyPartComponent to use DamageSpecifier (#890)
Roudenn Nov 6, 2024
b58d2a0
[Port] Surgery fixes: Part 4 (#909)
TokenStyle Nov 17, 2024
d87ea8a
[Fix] surgery emergency fix
TokenStyle Nov 17, 2024
99c53ac
[Balance] Surgery healing tweaks (#911)
Roudenn Nov 10, 2024
3e977be
[Port] Surgery Update V: The Phantom Gib (#919)
Roudenn Nov 17, 2024
8201474
let me pass tests
TokenStyle Nov 20, 2024
4c7530b
let me pass test pls
TokenStyle Nov 20, 2024
eba82b2
let me pass test pls
TokenStyle Nov 20, 2024
ed0713c
let me pass tests
TokenStyle Nov 20, 2024
01b6fde
chief medical officer pass tests
TokenStyle Nov 20, 2024
072441f
no felinid ears no fun pass tests
TokenStyle Nov 20, 2024
f7be7fc
[Port] Surgery Fixes: Popup Walker (#923)
Roudenn Nov 19, 2024
2cd2490
[PORT]Health Analyzer update (#925)
trest100 Nov 21, 2024
13934f5
let me pass tests
TokenStyle Nov 21, 2024
ac36313
remove shadowkin let tests pass
TokenStyle Nov 21, 2024
e66b04b
first commit
AwareFoxy Nov 22, 2024
4c1a903
Merge branch 'master' into shitmedd
AwareFoxy Nov 22, 2024
3dc3dfa
Revert "first commit" formatting changes
TokenStyle Nov 22, 2024
3319583
add corvax next comments for changes for easier upstreams
TokenStyle Nov 22, 2024
221ee3e
namespaces changes for everythin
TokenStyle Nov 22, 2024
438b01b
Revert "namespaces changes for everythin"
TokenStyle Nov 22, 2024
02d7f5e
[Fix] Surgery Hotfix: Head and Limbs dissapears
TokenStyle Nov 22, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
72 changes: 72 additions & 0 deletions Content.Client/Backmen/Body/BodySystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
using Content.Shared.Body.Systems;
using Content.Shared.Body.Part;
using Content.Shared.Humanoid;
using Content.Shared.Humanoid.Markings;
using Robust.Client.GameObjects;
using Robust.Shared.Utility;
using Content.Shared.Body.Components;

namespace Content.Client.Body.Systems;

public sealed class BodySystem : SharedBodySystem
{
[Dependency] private readonly MarkingManager _markingManager = default!;

private void ApplyMarkingToPart(MarkingPrototype markingPrototype,
IReadOnlyList<Color>? colors,
bool visible,
SpriteComponent sprite)
{
for (var j = 0; j < markingPrototype.Sprites.Count; j++)
{
var markingSprite = markingPrototype.Sprites[j];

if (markingSprite is not SpriteSpecifier.Rsi rsi)
continue;

var layerId = $"{markingPrototype.ID}-{rsi.RsiState}";

if (!sprite.LayerMapTryGet(layerId, out _))
{
var layer = sprite.AddLayer(markingSprite, j + 1);
sprite.LayerMapSet(layerId, layer);
sprite.LayerSetSprite(layerId, rsi);
}

sprite.LayerSetVisible(layerId, visible);

if (!visible)
continue;

// Okay so if the marking prototype is modified but we load old marking data this may no longer be valid
// and we need to check the index is correct. So if that happens just default to white?
if (colors != null && j < colors.Count)
sprite.LayerSetColor(layerId, colors[j]);
else
sprite.LayerSetColor(layerId, Color.White);
}
}

protected override void ApplyPartMarkings(EntityUid target, BodyPartAppearanceComponent component)
{
if (!TryComp(target, out SpriteComponent? sprite))
return;

if (component.Color != null)
sprite.Color = component.Color.Value;

foreach (var (visualLayer, markingList) in component.Markings)
foreach (var marking in markingList)
{
if (!_markingManager.TryGetMarking(marking, out var markingPrototype))
continue;

ApplyMarkingToPart(markingPrototype, marking.MarkingColors, marking.Visible, sprite);
}
}

protected override void RemoveBodyMarkings(EntityUid target, BodyPartAppearanceComponent partAppearance, HumanoidAppearanceComponent bodyAppearance)
{
return;
}
}
4 changes: 4 additions & 0 deletions Content.Client/Backmen/Body/Components/BrainComponent.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
namespace Content.Client.Backmen.Body.Components;

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

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

[RegisterComponent]
public sealed partial class StomachComponent : Component;
Loading
Loading