diff --git a/Content.Server/Singularity/Components/SinguloFoodComponent.cs b/Content.Server/Singularity/Components/SinguloFoodComponent.cs index e9f9da15c1..edd0aeaf11 100644 --- a/Content.Server/Singularity/Components/SinguloFoodComponent.cs +++ b/Content.Server/Singularity/Components/SinguloFoodComponent.cs @@ -6,8 +6,20 @@ namespace Content.Server.Singularity.Components [RegisterComponent] public sealed partial class SinguloFoodComponent : Component { - [ViewVariables(VVAccess.ReadWrite)] - [DataField("energy")] - public float Energy { get; set; } = 1f; + /// + /// Flat adjustment to the singularity's energy when this entity is eaten by the event horizon. + /// + [DataField] + public float Energy = 1f; + + /// + /// Multiplier applied to singularity's energy. + /// 1.0 = no change, 0.97 = 3% reduction, 1.05 = 5% increase + /// + /// /// + /// This is calculated using the singularity's energy level before has been added. + /// + [DataField] + public float EnergyFactor = 1f; } } diff --git a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs index 6b9182fb4d..f28502fc75 100644 --- a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs @@ -256,7 +256,12 @@ public sealed class SingularitySystem : SharedSingularitySystem public void OnConsumed(EntityUid uid, SinguloFoodComponent comp, ref EventHorizonConsumedEntityEvent args) { if (EntityManager.TryGetComponent(args.EventHorizonUid, out var singulo)) - AdjustEnergy(args.EventHorizonUid, comp.Energy, singularity: singulo); + { + // Calculate the percentage change (positive or negative) + var percentageChange = singulo.Energy * (comp.EnergyFactor - 1f); + // Apply both the flat and percentage changes + AdjustEnergy(args.EventHorizonUid, comp.Energy + percentageChange, singularity: singulo); + } } /// diff --git a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/particles.yml b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/particles.yml index 6e55bfec5e..9d5ffc2486 100644 --- a/Resources/Prototypes/Entities/Structures/Power/Generation/PA/particles.yml +++ b/Resources/Prototypes/Entities/Structures/Power/Generation/PA/particles.yml @@ -80,3 +80,4 @@ lifetime: 0.6 - type: SinguloFood energy: -10 + energyFactor: 0.97