From 1f09c717f3fb9f7e635b94b0e36805cba93fa037 Mon Sep 17 00:00:00 2001 From: Vanessa <908648+ShepardToTheStars@users.noreply.github.com> Date: Fri, 7 Aug 2026 11:51:24 -0500 Subject: [PATCH] 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> --- .../Humanoid/HumanoidProfileSystem.cs | 12 ++++------ .../Sprite/ScaleVisualsComponent.cs | 24 +++++++++++++++++++ .../Sprite/SharedScaleVisualsSystem.cs | 21 ++++++++++++++++ .../Entities/Mobs/Species/allulalo.yml | 1 + 4 files changed, 50 insertions(+), 8 deletions(-) diff --git a/Content.Shared/Humanoid/HumanoidProfileSystem.cs b/Content.Shared/Humanoid/HumanoidProfileSystem.cs index ca224b6a85a..69062d89f27 100644 --- a/Content.Shared/Humanoid/HumanoidProfileSystem.cs +++ b/Content.Shared/Humanoid/HumanoidProfileSystem.cs @@ -43,14 +43,10 @@ public sealed class HumanoidProfileSystem : EntitySystem } // START DeltaV - Apply profile/species size - Vector2 scale = new(profile.Height, profile.Height); - - // If visuals already exist, then re-apply - if (TryComp(ent, out var scaledVisuals)) - scale *= scaledVisuals.Scale; - - var speciesProto = _prototype.Index(profile.Species); - scale *= speciesProto.BaseScale; + // Assume 1.0 scale unless the original scale exists (blame Allulalo) + var scale = Vector2.One; + if (TryComp(ent, out var scaledVisuals) && scaledVisuals.OriginalScale is { } originalScale) + scale = originalScale; _scale.SetSpriteScale(ent, scale); // END DeltaV diff --git a/Content.Shared/Sprite/ScaleVisualsComponent.cs b/Content.Shared/Sprite/ScaleVisualsComponent.cs index a9c1fcb39c0..9055d3e2add 100644 --- a/Content.Shared/Sprite/ScaleVisualsComponent.cs +++ b/Content.Shared/Sprite/ScaleVisualsComponent.cs @@ -24,4 +24,28 @@ public sealed partial class ScaleVisualsComponent : Component [DataField] [ViewVariables] public Vector2? OriginalScale; + + /// + /// DeltaV - Contains the species scale. Set dynamically by + /// baseScale in the Species prototype. + /// + [DataField, AutoNetworkedField] + [ViewVariables] + public Vector2 SpeciesScale = new(1f, 1f); + + /// + /// DeltaV - Contains the user-defined scale from the character creation + /// screen. + /// + [DataField, AutoNetworkedField] + [ViewVariables] + public Vector2 ProfileScale = new(1f, 1f); + + /// + /// DeltaV - Contains the computer scale from applying Scale, SpeciesScale, and ProfileScale. + /// This will contain the actual scale after all modifiers are applied. + /// + [DataField, AutoNetworkedField] + [ViewVariables] + public Vector2 ComputedScale; } diff --git a/Content.Shared/Sprite/SharedScaleVisualsSystem.cs b/Content.Shared/Sprite/SharedScaleVisualsSystem.cs index 408f5984b13..2f619abf5c3 100644 --- a/Content.Shared/Sprite/SharedScaleVisualsSystem.cs +++ b/Content.Shared/Sprite/SharedScaleVisualsSystem.cs @@ -1,4 +1,6 @@ using System.Numerics; +using Content.Shared.Humanoid; // DeltaV +using Robust.Shared.Prototypes; // DeltaV using Robust.Shared.Serialization; namespace Content.Shared.Sprite; @@ -6,6 +8,7 @@ namespace Content.Shared.Sprite; public abstract class SharedScaleVisualsSystem : EntitySystem { [Dependency] private readonly SharedAppearanceSystem _appearance = default!; + [Dependency] private readonly IPrototypeManager _proto = default!; // DeltaV public override void Initialize() { @@ -39,6 +42,24 @@ public abstract class SharedScaleVisualsSystem : EntitySystem { var comp = EnsureComp(uid); 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(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); var appearanceComponent = EnsureComp(uid); diff --git a/Resources/Prototypes/_Impstation/Entities/Mobs/Species/allulalo.yml b/Resources/Prototypes/_Impstation/Entities/Mobs/Species/allulalo.yml index 08407053e3c..0b2bdcb5579 100644 --- a/Resources/Prototypes/_Impstation/Entities/Mobs/Species/allulalo.yml +++ b/Resources/Prototypes/_Impstation/Entities/Mobs/Species/allulalo.yml @@ -228,6 +228,7 @@ # because Allulalo have to be the special kid on the block. - type: ScaleVisuals scale: 2.0, 2.0 + originalScale: 2.0, 2.0 # END DeltaV - type: entity