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

[Fix] Surgery Hotfix: Head and Limbs dissapears #932

Merged
merged 9 commits into from
Nov 23, 2024
12 changes: 6 additions & 6 deletions Content.Shared/Body/Part/BodyPartComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
/// to make possible severing it.
/// </summary>
[DataField, AutoNetworkedField]
public float SeverIntegrity = 90;
public float SeverIntegrity = 80;

/// <summary>
/// On what TargetIntegrity we should re-enable the part.
Expand All @@ -124,11 +124,11 @@ public sealed partial class BodyPartComponent : Component, ISurgeryToolComponent
[DataField, AutoNetworkedField]
public Dictionary<TargetIntegrity, float> IntegrityThresholds = new()
{
{ TargetIntegrity.CriticallyWounded, 90 },
{ TargetIntegrity.HeavilyWounded, 75 },
{ TargetIntegrity.ModeratelyWounded, 60 },
{ TargetIntegrity.SomewhatWounded, 40},
{ TargetIntegrity.LightlyWounded, 20 },
{ TargetIntegrity.CriticallyWounded, 70 },
{ TargetIntegrity.HeavilyWounded, 60 },
{ TargetIntegrity.ModeratelyWounded, 45 },
{ TargetIntegrity.SomewhatWounded, 30},
{ TargetIntegrity.LightlyWounded, 15 },
{ TargetIntegrity.Healthy, 10 },
};

Expand Down
22 changes: 11 additions & 11 deletions Content.Shared/Body/Systems/SharedBodySystem.Body.cs
Original file line number Diff line number Diff line change
Expand Up @@ -396,19 +396,19 @@ public virtual HashSet<EntityUid> GibPart(

RemovePartChildren((partId, part), bodyEnt);

_gibbingSystem.TryGibEntityWithRef(partId,
partId,
GibType.Gib,
GibContentsOption.Drop,
ref gibs,
playAudio: true,
launchGibs: true,
launchDirection: splatDirection,
launchImpulse: GibletLaunchImpulse * splatModifier,
launchImpulseVariance: GibletLaunchImpulseVariance,
launchCone: splatCone);
// We have to iterate though every organ to drop it when part is being destroyed
foreach (var organ in GetPartOrgans(partId, part))
{
_gibbingSystem.TryGibEntityWithRef(bodyEnt, organ.Id, GibType.Drop, GibContentsOption.Skip,
ref gibs, playAudio: false, launchImpulse: GibletLaunchImpulse * splatModifier,
launchImpulseVariance: GibletLaunchImpulseVariance, launchCone: splatCone);
}
}

_gibbingSystem.TryGibEntityWithRef(partId, partId, GibType.Gib, GibContentsOption.Drop, ref gibs,
playAudio: true, launchGibs: true, launchDirection: splatDirection, launchImpulse: GibletLaunchImpulse * splatModifier,
launchImpulseVariance: GibletLaunchImpulseVariance, launchCone: splatCone);

if (HasComp<InventoryComponent>(partId))
{
foreach (var item in _inventory.GetHandOrInventoryEntities((partId)))
Expand Down
Loading