Fix Antags Being Crazy Smol (#6398)

* Fixed antags being crazy smol

* Update Content.Shared/Sprite/SharedScaleVisualsSystem.cs

Signed-off-by: Sir Warock <67167466+SirWarock@users.noreply.github.com>

---------

Signed-off-by: Sir Warock <67167466+SirWarock@users.noreply.github.com>
Co-authored-by: Sir Warock <67167466+SirWarock@users.noreply.github.com>
This commit is contained in:
Vanessa 2026-08-07 11:51:24 -05:00 committed by GitHub
parent 52ed881e2c
commit 1f09c717f3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 50 additions and 8 deletions

View File

@ -43,14 +43,10 @@ public sealed class HumanoidProfileSystem : EntitySystem
} }
// START DeltaV - Apply profile/species size // START DeltaV - Apply profile/species size
Vector2 scale = new(profile.Height, profile.Height); // Assume 1.0 scale unless the original scale exists (blame Allulalo)
var scale = Vector2.One;
// If visuals already exist, then re-apply if (TryComp<ScaleVisualsComponent>(ent, out var scaledVisuals) && scaledVisuals.OriginalScale is { } originalScale)
if (TryComp<ScaleVisualsComponent>(ent, out var scaledVisuals)) scale = originalScale;
scale *= scaledVisuals.Scale;
var speciesProto = _prototype.Index(profile.Species);
scale *= speciesProto.BaseScale;
_scale.SetSpriteScale(ent, scale); _scale.SetSpriteScale(ent, scale);
// END DeltaV // END DeltaV

View File

@ -24,4 +24,28 @@ public sealed partial class ScaleVisualsComponent : Component
[DataField] [DataField]
[ViewVariables] [ViewVariables]
public Vector2? OriginalScale; public Vector2? OriginalScale;
/// <summary>
/// DeltaV - Contains the species scale. Set dynamically by
/// baseScale in the Species prototype.
/// </summary>
[DataField, AutoNetworkedField]
[ViewVariables]
public Vector2 SpeciesScale = new(1f, 1f);
/// <summary>
/// DeltaV - Contains the user-defined scale from the character creation
/// screen.
/// </summary>
[DataField, AutoNetworkedField]
[ViewVariables]
public Vector2 ProfileScale = new(1f, 1f);
/// <summary>
/// DeltaV - Contains the computer scale from applying Scale, SpeciesScale, and ProfileScale.
/// This will contain the actual scale after all modifiers are applied.
/// </summary>
[DataField, AutoNetworkedField]
[ViewVariables]
public Vector2 ComputedScale;
} }

View File

@ -1,4 +1,6 @@
using System.Numerics; using System.Numerics;
using Content.Shared.Humanoid; // DeltaV
using Robust.Shared.Prototypes; // DeltaV
using Robust.Shared.Serialization; using Robust.Shared.Serialization;
namespace Content.Shared.Sprite; namespace Content.Shared.Sprite;
@ -6,6 +8,7 @@ namespace Content.Shared.Sprite;
public abstract class SharedScaleVisualsSystem : EntitySystem public abstract class SharedScaleVisualsSystem : EntitySystem
{ {
[Dependency] private readonly SharedAppearanceSystem _appearance = default!; [Dependency] private readonly SharedAppearanceSystem _appearance = default!;
[Dependency] private readonly IPrototypeManager _proto = default!; // DeltaV
public override void Initialize() public override void Initialize()
{ {
@ -39,6 +42,24 @@ public abstract class SharedScaleVisualsSystem : EntitySystem
{ {
var comp = EnsureComp<ScaleVisualsComponent>(uid); var comp = EnsureComp<ScaleVisualsComponent>(uid);
comp.Scale = scale; comp.Scale = scale;
// BEGIN DeltaV - Apply species and profile height
// We have to ensure this is idempotent so that if it gets applied more than once
// the sprite size at the end is the same.
if (TryComp<HumanoidProfileComponent>(uid, out var profile))
{
var speciesProto = _proto.Index(profile.Species);
comp.SpeciesScale = speciesProto.BaseScale;
scale *= comp.SpeciesScale; // Apply both species scale and character-defined height
Vector2 profileHeight = new(profile.Height, profile.Height);
comp.ProfileScale = profileHeight;
scale *= comp.ProfileScale;
}
comp.ComputedScale = scale; // Nice to know what the computed size is in case of bugs
// END DeltaV
Dirty(uid, comp); Dirty(uid, comp);
var appearanceComponent = EnsureComp<AppearanceComponent>(uid); var appearanceComponent = EnsureComp<AppearanceComponent>(uid);

View File

@ -228,6 +228,7 @@
# because Allulalo have to be the special kid on the block. # because Allulalo have to be the special kid on the block.
- type: ScaleVisuals - type: ScaleVisuals
scale: 2.0, 2.0 scale: 2.0, 2.0
originalScale: 2.0, 2.0
# END DeltaV # END DeltaV
- type: entity - type: entity