Use new ComponentPauseGenerator (#25183)
Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
This commit is contained in:
committed by
GitHub
parent
2a2324ecaf
commit
e00f74505c
@@ -33,9 +33,7 @@ public sealed partial class AnomalySystem
|
||||
SubscribeLocalEvent<AnomalyGeneratorComponent, MaterialAmountChangedEvent>(OnGeneratorMaterialAmountChanged);
|
||||
SubscribeLocalEvent<AnomalyGeneratorComponent, AnomalyGeneratorGenerateButtonPressedEvent>(OnGenerateButtonPressed);
|
||||
SubscribeLocalEvent<AnomalyGeneratorComponent, PowerChangedEvent>(OnGeneratorPowerChanged);
|
||||
SubscribeLocalEvent<AnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
|
||||
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, ComponentStartup>(OnGeneratingStartup);
|
||||
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratingUnpaused);
|
||||
}
|
||||
|
||||
private void OnGeneratorPowerChanged(EntityUid uid, AnomalyGeneratorComponent component, ref PowerChangedEvent args)
|
||||
@@ -58,11 +56,6 @@ public sealed partial class AnomalySystem
|
||||
TryGeneratorCreateAnomaly(uid, component);
|
||||
}
|
||||
|
||||
private void OnGeneratorUnpaused(EntityUid uid, AnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.CooldownEndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
public void UpdateGeneratorUi(EntityUid uid, AnomalyGeneratorComponent component)
|
||||
{
|
||||
var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial);
|
||||
@@ -169,11 +162,6 @@ public sealed partial class AnomalySystem
|
||||
Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, true);
|
||||
}
|
||||
|
||||
private void OnGeneratingUnpaused(EntityUid uid, GeneratingAnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent component)
|
||||
{
|
||||
var xform = Transform(uid);
|
||||
|
||||
@@ -22,7 +22,6 @@ public sealed partial class AnomalySystem
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
|
||||
SubscribeLocalEvent<AnomalyVesselComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<AnomalyShutdownEvent>(OnShutdown);
|
||||
SubscribeLocalEvent<AnomalyStabilityChangedEvent>(OnStabilityChanged);
|
||||
}
|
||||
@@ -92,11 +91,6 @@ public sealed partial class AnomalySystem
|
||||
args.Points += (int) (GetAnomalyPointValue(anomaly) * component.PointMultiplier);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, AnomalyVesselComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextBeep += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnVesselAnomalyShutdown(ref AnomalyShutdownEvent args)
|
||||
{
|
||||
var query = EntityQueryEnumerator<AnomalyVesselComponent>();
|
||||
|
||||
@@ -12,13 +12,14 @@ namespace Content.Server.Anomaly.Components;
|
||||
/// This is used for a machine that is able to generate
|
||||
/// anomalies randomly on the station.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem))]
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class AnomalyGeneratorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The time at which the cooldown for generating another anomaly will be over
|
||||
/// </summary>
|
||||
[DataField("cooldownEndTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan CooldownEndTime = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Anomaly.Components;
|
||||
/// they generate points for the selected server based on
|
||||
/// the anomaly's stability and severity.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem))]
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class AnomalyVesselComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -42,6 +42,7 @@ public sealed partial class AnomalyVesselComponent : Component
|
||||
/// When the next beep sound will play
|
||||
/// </summary>
|
||||
[DataField("nextBeep", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextBeep = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,13 +4,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Anomaly.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem))]
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class GeneratingAnomalyGeneratorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// When the generating period will end.
|
||||
/// </summary>
|
||||
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime = TimeSpan.Zero;
|
||||
|
||||
public EntityUid? AudioStream;
|
||||
|
||||
@@ -29,11 +29,9 @@ public sealed class RottingSystem : SharedRottingSystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PerishableComponent, MapInitEvent>(OnPerishableMapInit);
|
||||
SubscribeLocalEvent<PerishableComponent, EntityUnpausedEvent>(OnPerishableUnpaused);
|
||||
SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
|
||||
SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnPerishableExamined);
|
||||
|
||||
SubscribeLocalEvent<RottingComponent, EntityUnpausedEvent>(OnRottingUnpaused);
|
||||
SubscribeLocalEvent<RottingComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<RottingComponent, MobStateChangedEvent>(OnRottingMobStateChanged);
|
||||
SubscribeLocalEvent<RottingComponent, BeingGibbedEvent>(OnGibbed);
|
||||
@@ -47,11 +45,6 @@ public sealed class RottingSystem : SharedRottingSystem
|
||||
component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
|
||||
}
|
||||
|
||||
private void OnPerishableUnpaused(EntityUid uid, PerishableComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.RotNextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args)
|
||||
{
|
||||
if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead)
|
||||
@@ -64,11 +57,6 @@ public sealed class RottingSystem : SharedRottingSystem
|
||||
component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
|
||||
}
|
||||
|
||||
private void OnRottingUnpaused(EntityUid uid, RottingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextRotUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args)
|
||||
{
|
||||
if (TryComp<PerishableComponent>(uid, out var perishable))
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Charges.Components;
|
||||
/// Something with limited charges that can be recharged automatically.
|
||||
/// Requires LimitedChargesComponent to function.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(ChargesSystem))]
|
||||
public sealed partial class AutoRechargeComponent : Component
|
||||
{
|
||||
@@ -21,5 +21,6 @@ public sealed partial class AutoRechargeComponent : Component
|
||||
/// The time when the next charge will be added
|
||||
/// </summary>
|
||||
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextChargeTime;
|
||||
}
|
||||
|
||||
@@ -10,13 +10,6 @@ public sealed class ChargesSystem : SharedChargesSystem
|
||||
{
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<AutoRechargeComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
@@ -32,11 +25,6 @@ public sealed class ChargesSystem : SharedChargesSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, AutoRechargeComponent comp, ref EntityUnpausedEvent args)
|
||||
{
|
||||
comp.NextChargeTime += args.PausedTime;
|
||||
}
|
||||
|
||||
protected override void OnExamine(EntityUid uid, LimitedChargesComponent comp, ExaminedEvent args)
|
||||
{
|
||||
base.OnExamine(uid, comp, args);
|
||||
|
||||
@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
|
||||
/// <summary>
|
||||
/// Causes an entity to automatically emote when taking damage.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(EmoteOnDamageSystem))]
|
||||
[RegisterComponent, Access(typeof(EmoteOnDamageSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class EmoteOnDamageComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -41,6 +41,7 @@ public sealed partial class EmoteOnDamageComponent : Component
|
||||
/// The simulation time of the last emote preformed due to taking damage.
|
||||
/// </summary>
|
||||
[DataField("lastEmoteTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan LastEmoteTime = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -18,15 +18,9 @@ public sealed class EmoteOnDamageSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<EmoteOnDamageComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<EmoteOnDamageComponent, DamageChangedEvent>(OnDamage);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, ref EntityUnpausedEvent args)
|
||||
{
|
||||
emoteOnDamage.LastEmoteTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnDamage(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, DamageChangedEvent args)
|
||||
{
|
||||
if (!args.DamageIncreased)
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Content.Server.Chemistry.Components;
|
||||
/// <summary>
|
||||
/// Passively decreases a solution's quantity of reagent(s).
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SolutionPurgeSystem))]
|
||||
public sealed partial class SolutionPurgeComponent : Component
|
||||
{
|
||||
@@ -42,5 +42,6 @@ public sealed partial class SolutionPurgeComponent : Component
|
||||
/// The time when the next purge will occur.
|
||||
/// </summary>
|
||||
[DataField("nextPurgeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextPurgeTime = TimeSpan.FromSeconds(0);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Chemistry.Components;
|
||||
/// <summary>
|
||||
/// Passively increases a solution's quantity of a reagent.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SolutionRegenerationSystem))]
|
||||
public sealed partial class SolutionRegenerationComponent : Component
|
||||
{
|
||||
@@ -39,5 +39,6 @@ public sealed partial class SolutionRegenerationComponent : Component
|
||||
/// The time when the next regeneration will occur.
|
||||
/// </summary>
|
||||
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
|
||||
}
|
||||
|
||||
@@ -10,13 +10,6 @@ public sealed class SolutionPurgeSystem : EntitySystem
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SolutionPurgeComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
@@ -33,9 +26,4 @@ public sealed class SolutionPurgeSystem : EntitySystem
|
||||
_solutionContainer.SplitSolutionWithout(solution.Value, purge.Quantity, purge.Preserve.ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(Entity<SolutionPurgeComponent> entity, ref EntityUnpausedEvent args)
|
||||
{
|
||||
entity.Comp.NextPurgeTime += args.PausedTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,13 +12,6 @@ public sealed class SolutionRegenerationSystem : EntitySystem
|
||||
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
|
||||
[Dependency] private readonly IGameTiming _timing = default!;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<SolutionRegenerationComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
@@ -52,9 +45,4 @@ public sealed class SolutionRegenerationSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(Entity<SolutionRegenerationComponent> entity, ref EntityUnpausedEvent args)
|
||||
{
|
||||
entity.Comp.NextRegenTime += args.PausedTime;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,7 +68,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
|
||||
// Shouldn't need re-anchoring.
|
||||
SubscribeLocalEvent<DisposalUnitComponent, AnchorStateChangedEvent>(OnAnchorChanged);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
// TODO: Predict me when hands predicted
|
||||
SubscribeLocalEvent<DisposalUnitComponent, ContainerRelayMovementEntityEvent>(OnMovement);
|
||||
SubscribeLocalEvent<DisposalUnitComponent, PowerChangedEvent>(OnPowerChange);
|
||||
@@ -103,14 +102,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
|
||||
GetNetEntityList(component.RecentlyEjected));
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, SharedDisposalUnitComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.NextFlush != null)
|
||||
component.NextFlush = component.NextFlush.Value + args.PausedTime;
|
||||
|
||||
component.NextPressurized += args.PausedTime;
|
||||
}
|
||||
|
||||
private void AddDisposalAltVerbs(EntityUid uid, SharedDisposalUnitComponent component, GetVerbsEvent<AlternativeVerb> args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract)
|
||||
|
||||
@@ -17,7 +17,6 @@ public sealed class EmpSystem : SharedEmpSystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<EmpDisabledComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<EmpDisabledComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<EmpOnTriggerComponent, TriggerEvent>(HandleEmpTrigger);
|
||||
|
||||
@@ -96,12 +95,6 @@ public sealed class EmpSystem : SharedEmpSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, EmpDisabledComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.DisabledUntil += args.PausedTime;
|
||||
component.TargetTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, EmpDisabledComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("emp-disabled-comp-on-examine"));
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Explosion.Components.OnTrigger;
|
||||
/// <summary>
|
||||
/// After being triggered applies the specified components and runs triggers again.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class TwoStageTriggerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,6 +23,7 @@ public sealed partial class TwoStageTriggerComponent : Component
|
||||
public ComponentRegistry SecondStageComponents = new();
|
||||
|
||||
[DataField("nextTriggerTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? NextTriggerTime;
|
||||
|
||||
[DataField("triggered")]
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace Content.Server.Explosion.Components
|
||||
/// <summary>
|
||||
/// Raises a <see cref="TriggerEvent"/> whenever an entity collides with a fixture attached to the owner of this component.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class TriggerOnProximityComponent : SharedTriggerOnProximityComponent
|
||||
{
|
||||
public const string FixtureID = "trigger-on-proximity-fixture";
|
||||
@@ -58,6 +58,7 @@ namespace Content.Server.Explosion.Components
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("nextTrigger", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextTrigger = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
@@ -65,6 +66,7 @@ namespace Content.Server.Explosion.Components
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField("nextVisualUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextVisualUpdate = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -17,7 +17,6 @@ public sealed partial class TriggerSystem
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
|
||||
// Shouldn't need re-anchoring.
|
||||
SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
|
||||
@@ -65,12 +64,6 @@ public sealed partial class TriggerSystem
|
||||
collisionLayer: component.Layer);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, TriggerOnProximityComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextTrigger += args.PausedTime;
|
||||
component.NextVisualUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnProximityStartCollide(EntityUid uid, TriggerOnProximityComponent component, ref StartCollideEvent args)
|
||||
{
|
||||
if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID)
|
||||
|
||||
@@ -14,16 +14,9 @@ public sealed class TwoStageTriggerSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<TwoStageTriggerComponent, EntityUnpausedEvent>(OnTriggerUnpaused);
|
||||
SubscribeLocalEvent<TwoStageTriggerComponent, TriggerEvent>(OnTrigger);
|
||||
}
|
||||
|
||||
private void OnTriggerUnpaused(EntityUid uid, TwoStageTriggerComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.NextTriggerTime != null)
|
||||
component.NextTriggerTime = component.NextTriggerTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnTrigger(EntityUid uid, TwoStageTriggerComponent component, TriggerEvent args)
|
||||
{
|
||||
if (component.Triggered)
|
||||
|
||||
@@ -63,7 +63,6 @@ public sealed class SmokeSystem : EntitySystem
|
||||
SubscribeLocalEvent<SmokeComponent, ReactionAttemptEvent>(OnReactionAttempt);
|
||||
SubscribeLocalEvent<SmokeComponent, SolutionRelayEvent<ReactionAttemptEvent>>(OnReactionAttempt);
|
||||
SubscribeLocalEvent<SmokeComponent, SpreadNeighborsEvent>(OnSmokeSpread);
|
||||
SubscribeLocalEvent<SmokeAffectedComponent, EntityUnpausedEvent>(OnAffectedUnpaused);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
@@ -124,11 +123,6 @@ public sealed class SmokeSystem : EntitySystem
|
||||
RemComp(args.OtherEntity, smokeAffectedComponent);
|
||||
}
|
||||
|
||||
private void OnAffectedUnpaused(Entity<SmokeAffectedComponent> entity, ref EntityUnpausedEvent args)
|
||||
{
|
||||
entity.Comp.NextSecond += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnSmokeSpread(Entity<SmokeComponent> entity, ref SpreadNeighborsEvent args)
|
||||
{
|
||||
if (entity.Comp.SpreadAmount == 0 || !_solutionContainerSystem.ResolveSolution(entity.Owner, SmokeComponent.SolutionName, ref entity.Comp.Solution, out var solution))
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Server.Gateway.Components;
|
||||
/// <summary>
|
||||
/// Controlling gateway that links to other gateway destinations on the server.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(GatewaySystem))]
|
||||
[RegisterComponent, Access(typeof(GatewaySystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class GatewayComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -61,5 +61,6 @@ public sealed partial class GatewayComponent : Component
|
||||
/// The time at which the portal can next be opened.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextReady;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Gateway.Components;
|
||||
/// <summary>
|
||||
/// Generates gateway destinations at a regular interval.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class GatewayGeneratorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +20,7 @@ public sealed partial class GatewayGeneratorComponent : Component
|
||||
/// Next time another seed unlocks.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUnlock;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -67,7 +67,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<GatewayGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
|
||||
SubscribeLocalEvent<GatewayGeneratorComponent, MapInitEvent>(OnGeneratorMapInit);
|
||||
SubscribeLocalEvent<GatewayGeneratorComponent, ComponentShutdown>(OnGeneratorShutdown);
|
||||
SubscribeLocalEvent<GatewayGeneratorDestinationComponent, AttemptGatewayOpenEvent>(OnGeneratorAttemptOpen);
|
||||
@@ -85,11 +84,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnGeneratorUnpaused(Entity<GatewayGeneratorComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.NextUnlock += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnGeneratorMapInit(EntityUid uid, GatewayGeneratorComponent generator, MapInitEvent args)
|
||||
{
|
||||
if (!_cfgManager.GetCVar(CCVars.GatewayGeneratorEnabled))
|
||||
|
||||
@@ -32,7 +32,6 @@ public sealed class GatewaySystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<GatewayComponent, EntityUnpausedEvent>(OnGatewayUnpaused);
|
||||
SubscribeLocalEvent<GatewayComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<GatewayComponent, ActivatableUIOpenAttemptEvent>(OnGatewayOpenAttempt);
|
||||
SubscribeLocalEvent<GatewayComponent, BoundUIOpenedEvent>(UpdateUserInterface);
|
||||
@@ -48,11 +47,6 @@ public sealed class GatewaySystem : EntitySystem
|
||||
UpdateAllGateways();
|
||||
}
|
||||
|
||||
private void OnGatewayUnpaused(EntityUid uid, GatewayComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextReady += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnStartup(EntityUid uid, GatewayComponent comp, ComponentStartup args)
|
||||
{
|
||||
// no need to update ui since its just been created, just do portal
|
||||
|
||||
@@ -52,7 +52,6 @@ namespace Content.Server.Hands.Systems
|
||||
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);
|
||||
|
||||
SubscribeLocalEvent<HandsComponent, ComponentGetState>(GetComponentState);
|
||||
SubscribeLocalEvent<HandsComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
|
||||
SubscribeLocalEvent<HandsComponent, BeforeExplodeEvent>(OnExploded);
|
||||
|
||||
@@ -73,10 +72,6 @@ namespace Content.Server.Hands.Systems
|
||||
args.State = new HandsComponentState(hands);
|
||||
}
|
||||
|
||||
private void OnUnpaused(Entity<HandsComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.NextThrowTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
|
||||
{
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Kitchen.Components;
|
||||
/// <summary>
|
||||
/// Attached to a microwave that is currently in the process of cooking
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class ActiveMicrowaveComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
@@ -17,6 +17,7 @@ public sealed partial class ActiveMicrowaveComponent : Component
|
||||
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan MalfunctionTime = TimeSpan.Zero;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -86,7 +86,6 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
|
||||
SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentStartup>(OnCookStart);
|
||||
SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentShutdown>(OnCookStop);
|
||||
SubscribeLocalEvent<ActiveMicrowaveComponent, EntityUnpausedEvent>(OnEntityUnpaused);
|
||||
SubscribeLocalEvent<ActiveMicrowaveComponent, EntInsertedIntoContainerMessage>(OnActiveMicrowaveInsert);
|
||||
SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
|
||||
|
||||
@@ -112,11 +111,6 @@ namespace Content.Server.Kitchen.EntitySystems
|
||||
microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
|
||||
}
|
||||
|
||||
private void OnEntityUnpaused(Entity<ActiveMicrowaveComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.MalfunctionTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnActiveMicrowaveInsert(Entity<ActiveMicrowaveComponent> ent, ref EntInsertedIntoContainerMessage args)
|
||||
{
|
||||
AddComp<ActivelyMicrowavedComponent>(args.Entity);
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Medical.Components;
|
||||
/// <summary>
|
||||
/// After scanning, retrieves the target Uid to use with its related UI.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(HealthAnalyzerSystem), typeof(CryoPodSystem))]
|
||||
public sealed partial class HealthAnalyzerComponent : Component
|
||||
{
|
||||
@@ -14,6 +14,7 @@ public sealed partial class HealthAnalyzerComponent : Component
|
||||
/// When should the next update be sent for the patient
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUpdate = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -50,21 +50,12 @@ public sealed class DefibrillatorSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<DefibrillatorComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<DefibrillatorComponent, UseInHandEvent>(OnUseInHand);
|
||||
SubscribeLocalEvent<DefibrillatorComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty);
|
||||
SubscribeLocalEvent<DefibrillatorComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<DefibrillatorComponent, DefibrillatorZapDoAfterEvent>(OnDoAfter);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, DefibrillatorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.NextZapTime == null)
|
||||
return;
|
||||
|
||||
component.NextZapTime = component.NextZapTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args)
|
||||
{
|
||||
if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))
|
||||
|
||||
@@ -30,7 +30,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, EntityUnpausedEvent>(OnEntityUnpaused);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, AfterInteractEvent>(OnAfterInteract);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, HealthAnalyzerDoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<HealthAnalyzerComponent, EntGotInsertedIntoContainerMessage>(OnInsertedIntoContainer);
|
||||
@@ -65,11 +64,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnEntityUnpaused(Entity<HealthAnalyzerComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.NextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Trigger the doafter for scanning
|
||||
/// </summary>
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Medical.SuitSensors;
|
||||
/// Tracking device, embedded in almost all uniforms and jumpsuits.
|
||||
/// If enabled, will report to crew monitoring console owners position and status.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SuitSensorSystem))]
|
||||
public sealed partial class SuitSensorComponent : Component
|
||||
{
|
||||
@@ -57,6 +57,7 @@ public sealed partial class SuitSensorComponent : Component
|
||||
/// Next time when sensor updated owners status
|
||||
/// </summary>
|
||||
[DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUpdate = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,7 +40,6 @@ public sealed class SuitSensorSystem : EntitySystem
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawn);
|
||||
SubscribeLocalEvent<SuitSensorComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<SuitSensorComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<SuitSensorComponent, GotEquippedEvent>(OnEquipped);
|
||||
SubscribeLocalEvent<SuitSensorComponent, GotUnequippedEvent>(OnUnequipped);
|
||||
SubscribeLocalEvent<SuitSensorComponent, ExaminedEvent>(OnExamine);
|
||||
@@ -51,11 +50,6 @@ public sealed class SuitSensorSystem : EntitySystem
|
||||
SubscribeLocalEvent<SuitSensorComponent, EmpDisabledRemoved>(OnEmpFinished);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, SuitSensorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.NPC.Components;
|
||||
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class NPCJukeComponent : Component
|
||||
{
|
||||
[DataField("jukeType")]
|
||||
@@ -13,6 +13,7 @@ public sealed partial class NPCJukeComponent : Component
|
||||
public float JukeDuration = 0.5f;
|
||||
|
||||
[DataField("nextJuke", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextJuke;
|
||||
|
||||
[DataField("targetTile")]
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.NPC.Components;
|
||||
/// <summary>
|
||||
/// Added to NPCs that are moving.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class NPCSteeringComponent : Component
|
||||
{
|
||||
#region Context Steering
|
||||
@@ -49,6 +49,7 @@ public sealed partial class NPCSteeringComponent : Component
|
||||
/// Next time we can change our steering direction.
|
||||
/// </summary>
|
||||
[DataField("nextSteer", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextSteer = TimeSpan.Zero;
|
||||
|
||||
[DataField("lastSteerIndex")]
|
||||
@@ -66,6 +67,7 @@ public sealed partial class NPCSteeringComponent : Component
|
||||
public EntityCoordinates LastStuckCoordinates;
|
||||
|
||||
[DataField("lastStuckTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan LastStuckTime;
|
||||
|
||||
public const float StuckDistance = 1f;
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Content.Server.NPC.Pathfinding;
|
||||
/// <summary>
|
||||
/// Stores the relevant pathfinding data for grids.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(PathfindingSystem))]
|
||||
[RegisterComponent, Access(typeof(PathfindingSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class GridPathfindingComponent : Component
|
||||
{
|
||||
[ViewVariables]
|
||||
@@ -15,6 +15,7 @@ public sealed partial class GridPathfindingComponent : Component
|
||||
/// Next time the graph is allowed to update.
|
||||
/// </summary>
|
||||
/// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime.
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUpdate;
|
||||
|
||||
[ViewVariables]
|
||||
|
||||
@@ -44,7 +44,6 @@ public sealed partial class PathfindingSystem
|
||||
{
|
||||
SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
|
||||
SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved);
|
||||
SubscribeLocalEvent<GridPathfindingComponent, EntityUnpausedEvent>(OnGridPathPause);
|
||||
SubscribeLocalEvent<GridPathfindingComponent, ComponentShutdown>(OnGridPathShutdown);
|
||||
SubscribeLocalEvent<CollisionChangeEvent>(OnCollisionChange);
|
||||
SubscribeLocalEvent<CollisionLayerChangeEvent>(OnCollisionLayerChange);
|
||||
@@ -61,10 +60,6 @@ public sealed partial class PathfindingSystem
|
||||
DirtyChunk(ev.Entity, Comp<MapGridComponent>(ev.Entity).GridTileToLocal(ev.NewTile.GridIndices));
|
||||
}
|
||||
|
||||
private void OnGridPathPause(EntityUid uid, GridPathfindingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnGridPathShutdown(EntityUid uid, GridPathfindingComponent component, ComponentShutdown args)
|
||||
{
|
||||
|
||||
@@ -33,15 +33,9 @@ public sealed class NPCJukeSystem : EntitySystem
|
||||
_npcRangedQuery = GetEntityQuery<NPCRangedCombatComponent>();
|
||||
_physicsQuery = GetEntityQuery<PhysicsComponent>();
|
||||
|
||||
SubscribeLocalEvent<NPCJukeComponent, EntityUnpausedEvent>(OnJukeUnpaused);
|
||||
SubscribeLocalEvent<NPCJukeComponent, NPCSteeringEvent>(OnJukeSteering);
|
||||
}
|
||||
|
||||
private void OnJukeUnpaused(EntityUid uid, NPCJukeComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextJuke += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnJukeSteering(EntityUid uid, NPCJukeComponent component, ref NPCSteeringEvent args)
|
||||
{
|
||||
if (component.JukeType == JukeType.AdjacentTile)
|
||||
|
||||
@@ -107,7 +107,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
|
||||
Subs.CVar(_configManager, CCVars.NPCPathfinding, SetNPCPathfinding, true);
|
||||
|
||||
SubscribeLocalEvent<NPCSteeringComponent, ComponentShutdown>(OnSteeringShutdown);
|
||||
SubscribeLocalEvent<NPCSteeringComponent, EntityUnpausedEvent>(OnSteeringUnpaused);
|
||||
SubscribeNetworkEvent<RequestNPCSteeringDebugEvent>(OnDebugRequest);
|
||||
}
|
||||
|
||||
@@ -158,12 +157,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
|
||||
component.PathfindToken = null;
|
||||
}
|
||||
|
||||
private void OnSteeringUnpaused(EntityUid uid, NPCSteeringComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.LastStuckTime += args.PausedTime;
|
||||
component.NextSteer += args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the AI to the steering system to move towards a specific target
|
||||
/// </summary>
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Server.Nutrition.Components;
|
||||
/// <summary>
|
||||
/// This is used for a machine that extracts hunger from entities and creates meat. Yum!
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(FatExtractorSystem))]
|
||||
[RegisterComponent, Access(typeof(FatExtractorSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class FatExtractorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -48,6 +48,7 @@ public sealed partial class FatExtractorComponent : Component
|
||||
/// When the next update will occur
|
||||
/// </summary>
|
||||
[DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUpdate;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,23 +40,11 @@ public sealed class AnimalHusbandrySystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<ReproductiveComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<ReproductiveComponent, MindAddedMessage>(OnMindAdded);
|
||||
SubscribeLocalEvent<InfantComponent, EntityUnpausedEvent>(OnInfantUnpaused);
|
||||
SubscribeLocalEvent<InfantComponent, ComponentStartup>(OnInfantStartup);
|
||||
SubscribeLocalEvent<InfantComponent, ComponentShutdown>(OnInfantShutdown);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, ReproductiveComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextBreedAttempt += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnInfantUnpaused(EntityUid uid, InfantComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.InfantEndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
// we express EZ-pass terminate the pregnancy if a player takes the role
|
||||
private void OnMindAdded(EntityUid uid, ReproductiveComponent component, MindAddedMessage args)
|
||||
{
|
||||
|
||||
@@ -27,18 +27,12 @@ public sealed class FatExtractorSystem : EntitySystem
|
||||
/// <inheritdoc/>
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<FatExtractorComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged);
|
||||
SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed);
|
||||
SubscribeLocalEvent<FatExtractorComponent, StorageAfterOpenEvent>(OnOpen);
|
||||
SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, FatExtractorComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnGotEmagged(EntityUid uid, FatExtractorComponent component, ref GotEmaggedEvent args)
|
||||
{
|
||||
args.Handled = true;
|
||||
|
||||
@@ -8,13 +8,14 @@ namespace Content.Server.Physics.Components;
|
||||
/// <summary>
|
||||
/// A component which makes its entity chasing entity with selected component.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(ChasingWalkSystem))]
|
||||
[RegisterComponent, Access(typeof(ChasingWalkSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class ChasingWalkComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The next moment in time when the entity is pushed toward its goal
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextImpulseTime;
|
||||
|
||||
/// <summary>
|
||||
@@ -57,6 +58,7 @@ public sealed partial class ChasingWalkComponent : Component
|
||||
/// The next change of direction time.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextChangeVectorTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -27,7 +27,6 @@ public sealed class ChasingWalkSystem : VirtualController
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<ChasingWalkComponent, MapInitEvent>(OnChasingMapInit);
|
||||
SubscribeLocalEvent<ChasingWalkComponent, EntityUnpausedEvent>(OnChasingUnpaused);
|
||||
}
|
||||
|
||||
private void OnChasingMapInit(EntityUid uid, ChasingWalkComponent component, MapInitEvent args)
|
||||
@@ -36,12 +35,6 @@ public sealed class ChasingWalkSystem : VirtualController
|
||||
component.NextChangeVectorTime = _gameTiming.CurTime;
|
||||
}
|
||||
|
||||
private void OnChasingUnpaused(EntityUid uid, ChasingWalkComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextImpulseTime += args.PausedTime;
|
||||
component.NextChangeVectorTime += args.PausedTime;
|
||||
}
|
||||
|
||||
public override void UpdateBeforeSolve(bool prediction, float frameTime)
|
||||
{
|
||||
base.UpdateBeforeSolve(prediction, frameTime);
|
||||
|
||||
@@ -39,11 +39,6 @@ public sealed partial class PowerCellSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, PowerCellDrawComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdateTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnDrawChargeChanged(EntityUid uid, PowerCellDrawComponent component, ref ChargeChangedEvent args)
|
||||
{
|
||||
// Update the bools for client prediction.
|
||||
|
||||
@@ -35,7 +35,6 @@ public sealed partial class PowerCellSystem : SharedPowerCellSystem
|
||||
SubscribeLocalEvent<PowerCellComponent, ExaminedEvent>(OnCellExamined);
|
||||
SubscribeLocalEvent<PowerCellComponent, EmpAttemptEvent>(OnCellEmpAttempt);
|
||||
|
||||
SubscribeLocalEvent<PowerCellDrawComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<PowerCellDrawComponent, ChargeChangedEvent>(OnDrawChargeChanged);
|
||||
SubscribeLocalEvent<PowerCellDrawComponent, PowerCellChangedEvent>(OnDrawCellChanged);
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.PowerSink
|
||||
/// <summary>
|
||||
/// Absorbs power up to its capacity when anchored then explodes.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class PowerSinkComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,6 +21,7 @@ namespace Content.Server.PowerSink
|
||||
/// If explosion has been triggered, time at which to explode.
|
||||
/// </summary>
|
||||
[DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public System.TimeSpan? ExplosionTime = null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,7 +37,6 @@ namespace Content.Server.PowerSink
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<PowerSinkComponent, ExaminedEvent>(OnExamine);
|
||||
SubscribeLocalEvent<PowerSinkComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
private void OnExamine(EntityUid uid, PowerSinkComponent component, ExaminedEvent args)
|
||||
@@ -54,14 +53,6 @@ namespace Content.Server.PowerSink
|
||||
);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, PowerSinkComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.ExplosionTime == null)
|
||||
return;
|
||||
|
||||
component.ExplosionTime = component.ExplosionTime + args.PausedTime;
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
var toRemove = new RemQueue<(EntityUid Entity, PowerSinkComponent Sink)>();
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Server.Salvage.Expeditions;
|
||||
/// <summary>
|
||||
/// Designates this entity as holding a salvage expedition.
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
|
||||
{
|
||||
public SalvageMissionParams MissionParams = default!;
|
||||
@@ -26,6 +26,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
|
||||
/// When the expeditions ends.
|
||||
/// </summary>
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -31,10 +31,7 @@ public sealed partial class SalvageSystem
|
||||
SubscribeLocalEvent<SalvageExpeditionConsoleComponent, EntParentChangedMessage>(OnSalvageConsoleParent);
|
||||
SubscribeLocalEvent<SalvageExpeditionConsoleComponent, ClaimSalvageMessage>(OnSalvageClaimMessage);
|
||||
|
||||
SubscribeLocalEvent<SalvageExpeditionDataComponent, EntityUnpausedEvent>(OnDataUnpaused);
|
||||
|
||||
SubscribeLocalEvent<SalvageExpeditionComponent, ComponentShutdown>(OnExpeditionShutdown);
|
||||
SubscribeLocalEvent<SalvageExpeditionComponent, EntityUnpausedEvent>(OnExpeditionUnpaused);
|
||||
SubscribeLocalEvent<SalvageExpeditionComponent, ComponentGetState>(OnExpeditionGetState);
|
||||
|
||||
SubscribeLocalEvent<SalvageStructureComponent, ExaminedEvent>(OnStructureExamine);
|
||||
@@ -89,16 +86,6 @@ public sealed partial class SalvageSystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDataUnpaused(EntityUid uid, SalvageExpeditionDataComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextOffer += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnExpeditionUnpaused(EntityUid uid, SalvageExpeditionComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void UpdateExpeditions()
|
||||
{
|
||||
var currentTime = _timing.CurTime;
|
||||
|
||||
@@ -3,13 +3,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Shuttles.Components;
|
||||
|
||||
[RegisterComponent, Access(typeof(ArrivalsSystem))]
|
||||
[RegisterComponent, Access(typeof(ArrivalsSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class ArrivalsShuttleComponent : Component
|
||||
{
|
||||
[DataField("station")]
|
||||
public EntityUid Station;
|
||||
|
||||
[DataField("nextTransfer", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextTransfer;
|
||||
|
||||
[DataField("nextArrivalsTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
|
||||
@@ -6,9 +6,10 @@ namespace Content.Server.Shuttles.Components;
|
||||
/// <summary>
|
||||
/// If added to a grid gets launched when the emergency shuttle launches.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(EmergencyShuttleSystem))]
|
||||
[RegisterComponent, Access(typeof(EmergencyShuttleSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class EscapePodComponent : Component
|
||||
{
|
||||
[DataField("launchTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? LaunchTime;
|
||||
}
|
||||
|
||||
@@ -85,7 +85,6 @@ public sealed class ArrivalsSystem : EntitySystem
|
||||
SubscribeLocalEvent<StationArrivalsComponent, ComponentStartup>(OnArrivalsStartup);
|
||||
|
||||
SubscribeLocalEvent<ArrivalsShuttleComponent, ComponentStartup>(OnShuttleStartup);
|
||||
SubscribeLocalEvent<ArrivalsShuttleComponent, EntityUnpausedEvent>(OnShuttleUnpaused);
|
||||
SubscribeLocalEvent<ArrivalsShuttleComponent, FTLTagEvent>(OnShuttleTag);
|
||||
|
||||
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStarting);
|
||||
@@ -384,11 +383,6 @@ public sealed class ArrivalsSystem : EntitySystem
|
||||
EnsureComp<PreventPilotComponent>(uid);
|
||||
}
|
||||
|
||||
private void OnShuttleUnpaused(EntityUid uid, ArrivalsShuttleComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextTransfer += args.PausedTime;
|
||||
}
|
||||
|
||||
private bool TryGetArrivals(out EntityUid uid)
|
||||
{
|
||||
var arrivalsQuery = EntityQueryEnumerator<ArrivalsSourceComponent>();
|
||||
|
||||
@@ -93,8 +93,6 @@ public sealed partial class EmergencyShuttleSystem
|
||||
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
|
||||
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll);
|
||||
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt);
|
||||
|
||||
SubscribeLocalEvent<EscapePodComponent, EntityUnpausedEvent>(OnEscapeUnpaused);
|
||||
}
|
||||
|
||||
private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args)
|
||||
|
||||
@@ -507,14 +507,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
|
||||
EnsureComp<EmergencyShuttleComponent>(shuttle.Value);
|
||||
}
|
||||
|
||||
private void OnEscapeUnpaused(EntityUid uid, EscapePodComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.LaunchTime == null)
|
||||
return;
|
||||
|
||||
component.LaunchTime = component.LaunchTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns whether a target is escaping on the emergency shuttle, but only if evac has arrived.
|
||||
/// </summary>
|
||||
|
||||
@@ -40,7 +40,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
||||
SubscribeLocalEvent<GhostComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
|
||||
SubscribeLocalEvent<StationDataComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
|
||||
SubscribeLocalEvent<EventHorizonComponent, MapInitEvent>(OnHorizonMapInit);
|
||||
SubscribeLocalEvent<EventHorizonComponent, EntityUnpausedEvent>(OnHorizonUnpaused);
|
||||
SubscribeLocalEvent<EventHorizonComponent, StartCollideEvent>(OnStartCollide);
|
||||
SubscribeLocalEvent<EventHorizonComponent, EntGotInsertedIntoContainerMessage>(OnEventHorizonContained);
|
||||
SubscribeLocalEvent<EventHorizonContainedEvent>(OnEventHorizonContained);
|
||||
@@ -57,11 +56,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
|
||||
component.NextConsumeWaveTime = _timing.CurTime;
|
||||
}
|
||||
|
||||
private void OnHorizonUnpaused(EntityUid uid, EventHorizonComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextConsumeWaveTime += args.PausedTime;
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
{
|
||||
var vvHandle = Vvm.GetTypeHandler<EventHorizonComponent>();
|
||||
|
||||
@@ -2,12 +2,13 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Server.Spreader;
|
||||
|
||||
[RegisterComponent, Access(typeof(KudzuSystem))]
|
||||
[RegisterComponent, Access(typeof(KudzuSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class GrowingKudzuComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The next time kudzu will try to tick its growth level.
|
||||
/// </summary>
|
||||
[DataField("nextTick", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextTick = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
@@ -21,7 +21,6 @@ public sealed class KudzuSystem : EntitySystem
|
||||
{
|
||||
SubscribeLocalEvent<KudzuComponent, ComponentStartup>(SetupKudzu);
|
||||
SubscribeLocalEvent<KudzuComponent, SpreadNeighborsEvent>(OnKudzuSpread);
|
||||
SubscribeLocalEvent<GrowingKudzuComponent, EntityUnpausedEvent>(OnKudzuUnpaused);
|
||||
SubscribeLocalEvent<KudzuComponent, DamageChangedEvent>(OnDamageChanged);
|
||||
}
|
||||
|
||||
@@ -80,11 +79,6 @@ public sealed class KudzuSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnKudzuUnpaused(EntityUid uid, GrowingKudzuComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextTick += args.PausedTime;
|
||||
}
|
||||
|
||||
private void SetupKudzu(EntityUid uid, KudzuComponent component, ComponentStartup args)
|
||||
{
|
||||
if (!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.StationEvents.Components;
|
||||
/// <summary>
|
||||
/// Defines basic data for a station event
|
||||
/// </summary>
|
||||
[RegisterComponent]
|
||||
[RegisterComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class StationEventComponent : Component
|
||||
{
|
||||
public const float WeightVeryLow = 0.0f;
|
||||
@@ -79,11 +79,13 @@ public sealed partial class StationEventComponent : Component
|
||||
/// When the station event starts.
|
||||
/// </summary>
|
||||
[DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan StartTime;
|
||||
|
||||
/// <summary>
|
||||
/// When the station event ends.
|
||||
/// </summary>
|
||||
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? EndTime;
|
||||
}
|
||||
|
||||
@@ -29,15 +29,6 @@ public sealed class EventManagerSystem : EntitySystem
|
||||
_sawmill = Logger.GetSawmill("events");
|
||||
|
||||
Subs.CVar(_configurationManager, CCVars.EventsEnabled, SetEnabled, true);
|
||||
|
||||
SubscribeLocalEvent<StationEventComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, StationEventComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.StartTime += args.PausedTime;
|
||||
if (component.EndTime != null)
|
||||
component.EndTime = component.EndTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Server.Tesla.Components;
|
||||
/// <summary>
|
||||
/// Periodically fires electric arcs at surrounding objects.
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(LightningArcShooterSystem))]
|
||||
[RegisterComponent, Access(typeof(LightningArcShooterSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class LightningArcShooterComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -45,6 +45,7 @@ public sealed partial class LightningArcShooterComponent : Component
|
||||
/// The time, upon reaching which the next batch of lightning bolts will be fired.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextShootTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Server.Tesla.Components;
|
||||
/// <summary>
|
||||
/// The component changes the visual of an object after it is struck by lightning
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(LightningSparkingSystem))]
|
||||
[RegisterComponent, Access(typeof(LightningSparkingSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class LightningSparkingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -20,6 +20,7 @@ public sealed partial class LightningSparkingComponent : Component
|
||||
/// When the spark visual should turn off.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan LightningEndTime;
|
||||
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
|
||||
@@ -18,7 +18,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<LightningArcShooterComponent, MapInitEvent>(OnShooterMapInit);
|
||||
SubscribeLocalEvent<LightningArcShooterComponent, EntityUnpausedEvent>(OnShooterUnpaused);
|
||||
}
|
||||
|
||||
private void OnShooterMapInit(EntityUid uid, LightningArcShooterComponent component, ref MapInitEvent args)
|
||||
@@ -26,11 +25,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
|
||||
component.NextShootTime = _gameTiming.CurTime + TimeSpan.FromSeconds(component.ShootMaxInterval);
|
||||
}
|
||||
|
||||
private void OnShooterUnpaused(EntityUid uid, LightningArcShooterComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextShootTime += args.PausedTime;
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
{
|
||||
base.Update(frameTime);
|
||||
|
||||
@@ -18,12 +18,6 @@ public sealed class LightningSparkingSystem : EntitySystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<LightningSparkingComponent, HitByLightningEvent>(OnHitByLightning);
|
||||
SubscribeLocalEvent<LightningSparkingComponent, EntityUnpausedEvent>(OnLightningUnpaused);
|
||||
}
|
||||
|
||||
private void OnLightningUnpaused(EntityUid uid, LightningSparkingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.LightningEndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnHitByLightning(Entity<LightningSparkingComponent> uid, ref HitByLightningEvent args)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Content.Shared.Anomaly.Components;
|
||||
///
|
||||
/// Anomalies and their related components were designed here: https://hackmd.io/@ss14-design/r1sQbkJOs
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedAnomalySystem))]
|
||||
public sealed partial class AnomalyComponent : Component
|
||||
{
|
||||
@@ -86,7 +86,7 @@ public sealed partial class AnomalyComponent : Component
|
||||
/// <summary>
|
||||
/// The time at which the next artifact pulse will occur.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
public TimeSpan NextPulseTime = TimeSpan.Zero;
|
||||
|
||||
|
||||
@@ -5,13 +5,14 @@ namespace Content.Shared.Anomaly.Components;
|
||||
/// <summary>
|
||||
/// This component tracks anomalies that are currently pulsing
|
||||
/// </summary>
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem))]
|
||||
[RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class AnomalyPulsingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The time at which the pulse will be over.
|
||||
/// </summary>
|
||||
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,6 +8,7 @@ namespace Content.Shared.Anomaly.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[Access(typeof(SharedAnomalySystem))]
|
||||
[AutoGenerateComponentPause]
|
||||
public sealed partial class AnomalySupercriticalComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -15,6 +16,7 @@ public sealed partial class AnomalySupercriticalComponent : Component
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -46,10 +46,6 @@ public abstract class SharedAnomalySystem : EntitySystem
|
||||
SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitStartEvent>(OnAnomalyThrowStart);
|
||||
SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitEndEvent>(OnAnomalyThrowEnd);
|
||||
|
||||
SubscribeLocalEvent<AnomalyComponent, EntityUnpausedEvent>(OnAnomalyUnpause);
|
||||
SubscribeLocalEvent<AnomalyPulsingComponent, EntityUnpausedEvent>(OnPulsingUnpause);
|
||||
SubscribeLocalEvent<AnomalySupercriticalComponent, EntityUnpausedEvent>(OnSupercriticalUnpause);
|
||||
|
||||
_sawmill = Logger.GetSawmill("anomaly");
|
||||
}
|
||||
|
||||
@@ -89,23 +85,6 @@ public abstract class SharedAnomalySystem : EntitySystem
|
||||
Popup.PopupEntity(Loc.GetString("anomaly-component-contact-damage"), target, target);
|
||||
}
|
||||
|
||||
private void OnAnomalyUnpause(EntityUid uid, AnomalyComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextPulseTime += args.PausedTime;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void OnPulsingUnpause(EntityUid uid, AnomalyPulsingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnSupercriticalUnpause(EntityUid uid, AnomalySupercriticalComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
public void DoAnomalyPulse(EntityUid uid, AnomalyComponent? component = null)
|
||||
{
|
||||
if (!Resolve(uid, ref component))
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Atmos.Rotting;
|
||||
/// This makes mobs eventually start rotting when they die.
|
||||
/// It may be expanded to food at some point, but it's just for mobs right now.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedRottingSystem))]
|
||||
public sealed partial class PerishableComponent : Component
|
||||
{
|
||||
@@ -27,6 +27,7 @@ public sealed partial class PerishableComponent : Component
|
||||
/// Gasses are released, this is when the next gas release update will be.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan RotNextUpdate = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Atmos.Rotting;
|
||||
/// Tracking component for stuff that has started to rot.
|
||||
/// Only the current stage is networked to the client.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedRottingSystem))]
|
||||
public sealed partial class RottingComponent : Component
|
||||
{
|
||||
@@ -22,6 +22,7 @@ public sealed partial class RottingComponent : Component
|
||||
/// When the next check will happen for rot progression + effects like damage and ammonia
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextRotUpdate = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Bed.Cryostorage;
|
||||
/// This is used to track an entity that is currently being held in Cryostorage.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[AutoGenerateComponentState]
|
||||
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class CryostorageContainedComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -22,6 +22,7 @@ public sealed partial class CryostorageContainedComponent : Component
|
||||
/// The time at which the cryostorage grace period ends.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? GracePeriodEndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -37,7 +37,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
|
||||
SubscribeLocalEvent<CryostorageComponent, CanDropTargetEvent>(OnCanDropTarget);
|
||||
|
||||
SubscribeLocalEvent<CryostorageContainedComponent, EntGotRemovedFromContainerMessage>(OnRemovedContained);
|
||||
SubscribeLocalEvent<CryostorageContainedComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<CryostorageContainedComponent, ComponentShutdown>(OnShutdownContained);
|
||||
|
||||
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
|
||||
@@ -130,13 +129,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
|
||||
RemCompDeferred(ent, comp);
|
||||
}
|
||||
|
||||
private void OnUnpaused(Entity<CryostorageContainedComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
var comp = ent.Comp;
|
||||
if (comp.GracePeriodEndTime != null)
|
||||
comp.GracePeriodEndTime = comp.GracePeriodEndTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnShutdownContained(Entity<CryostorageContainedComponent> ent, ref ComponentShutdown args)
|
||||
{
|
||||
var comp = ent.Comp;
|
||||
|
||||
@@ -26,14 +26,8 @@ namespace Content.Server.Bed.Sleep
|
||||
SubscribeLocalEvent<SleepingComponent, SpeakAttemptEvent>(OnSpeakAttempt);
|
||||
SubscribeLocalEvent<SleepingComponent, CanSeeAttemptEvent>(OnSeeAttempt);
|
||||
SubscribeLocalEvent<SleepingComponent, PointAttemptEvent>(OnPointAttempt);
|
||||
SubscribeLocalEvent<SleepingComponent, EntityUnpausedEvent>(OnSleepUnpaused);
|
||||
}
|
||||
|
||||
private void OnSleepUnpaused(EntityUid uid, SleepingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.CoolDownEnd += args.PausedTime;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent args)
|
||||
{
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Bed.Sleep;
|
||||
/// <summary>
|
||||
/// Added to entities when they go to sleep.
|
||||
/// </summary>
|
||||
[NetworkedComponent, RegisterComponent]
|
||||
[NetworkedComponent, RegisterComponent, AutoGenerateComponentPause(Dirty = true)]
|
||||
public sealed partial class SleepingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +24,7 @@ public sealed partial class SleepingComponent : Component
|
||||
public TimeSpan Cooldown = TimeSpan.FromSeconds(1f);
|
||||
|
||||
[DataField("cooldownEnd", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan CoolDownEnd;
|
||||
|
||||
[DataField("wakeAction")] public EntityUid? WakeAction;
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Chasm;
|
||||
/// <summary>
|
||||
/// Added to entities which have started falling into a chasm.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class ChasmFallingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -23,6 +23,7 @@ public sealed partial class ChasmFallingComponent : Component
|
||||
public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
|
||||
|
||||
[DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextDeletionTime = TimeSpan.Zero;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -26,7 +26,6 @@ public sealed class ChasmSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<ChasmComponent, StepTriggeredEvent>(OnStepTriggered);
|
||||
SubscribeLocalEvent<ChasmComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
|
||||
SubscribeLocalEvent<ChasmFallingComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<ChasmFallingComponent, UpdateCanMoveEvent>(OnUpdateCanMove);
|
||||
}
|
||||
|
||||
@@ -73,11 +72,6 @@ public sealed class ChasmSystem : EntitySystem
|
||||
args.Continue = true;
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, ChasmFallingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextDeletionTime += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnUpdateCanMove(EntityUid uid, ChasmFallingComponent component, UpdateCanMoveEvent args)
|
||||
{
|
||||
args.Cancel();
|
||||
|
||||
@@ -7,13 +7,14 @@ namespace Content.Shared.Chemistry.Components;
|
||||
/// This is used for entities which are currently being affected by smoke.
|
||||
/// Manages the gradual metabolism every second.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class SmokeAffectedComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
/// The time at which the next smoke metabolism will occur.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextSecond;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.Climbing.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class ClimbingComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -17,6 +17,7 @@ public sealed partial class ClimbingComponent : Component
|
||||
/// Whether the owner is being moved onto the climbed entity.
|
||||
/// </summary>
|
||||
[AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? NextTransition;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -62,7 +62,6 @@ public sealed partial class ClimbSystem : VirtualController
|
||||
SubscribeLocalEvent<ClimbingComponent, ClimbDoAfterEvent>(OnDoAfter);
|
||||
SubscribeLocalEvent<ClimbingComponent, EndCollideEvent>(OnClimbEndCollide);
|
||||
SubscribeLocalEvent<ClimbingComponent, BuckleChangeEvent>(OnBuckleChange);
|
||||
SubscribeLocalEvent<ClimbingComponent, EntityUnpausedEvent>(OnClimbableUnpaused);
|
||||
|
||||
SubscribeLocalEvent<ClimbableComponent, CanDropTargetEvent>(OnCanDragDropOn);
|
||||
SubscribeLocalEvent<ClimbableComponent, GetVerbsEvent<AlternativeVerb>>(AddClimbableVerb);
|
||||
@@ -71,15 +70,6 @@ public sealed partial class ClimbSystem : VirtualController
|
||||
SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed);
|
||||
}
|
||||
|
||||
private void OnClimbableUnpaused(EntityUid uid, ClimbingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (component.NextTransition == null)
|
||||
return;
|
||||
|
||||
component.NextTransition = component.NextTransition.Value + args.PausedTime;
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
public override void UpdateBeforeSolve(bool prediction, float frameTime)
|
||||
{
|
||||
base.UpdateBeforeSolve(prediction, frameTime);
|
||||
|
||||
@@ -28,16 +28,9 @@ public sealed class PacificationSystem : EntitySystem
|
||||
SubscribeLocalEvent<PacifiedComponent, BeforeThrowEvent>(OnBeforeThrow);
|
||||
SubscribeLocalEvent<PacifiedComponent, AttackAttemptEvent>(OnAttackAttempt);
|
||||
SubscribeLocalEvent<PacifiedComponent, ShotAttemptedEvent>(OnShootAttempt);
|
||||
SubscribeLocalEvent<PacifiedComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<PacifismDangerousAttackComponent, AttemptPacifiedAttackEvent>(OnPacifiedDangerousAttack);
|
||||
}
|
||||
|
||||
private void OnUnpaused(Entity<PacifiedComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
if (ent.Comp.NextPopupTime != null)
|
||||
ent.Comp.NextPopupTime = ent.Comp.NextPopupTime.Value + args.PausedTime;
|
||||
}
|
||||
|
||||
private bool PacifiedCanAttack(EntityUid user, EntityUid target, [NotNullWhen(false)] out string? reason)
|
||||
{
|
||||
var ev = new AttemptPacifiedAttackEvent(user);
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Shared.CombatMode.Pacification;
|
||||
///
|
||||
/// If you want full-pacifism (no combat mode at all), you can simply set <see cref="DisallowAllCombat"/> before adding.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(PacificationSystem))]
|
||||
public sealed partial class PacifiedComponent : Component
|
||||
{
|
||||
@@ -33,6 +33,7 @@ public sealed partial class PacifiedComponent : Component
|
||||
public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0);
|
||||
|
||||
[DataField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? NextPopupTime = null;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Shared.Construction.Components;
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[Access(typeof(SharedFlatpackSystem))]
|
||||
[AutoGenerateComponentState]
|
||||
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class FlatpackCreatorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -26,6 +26,7 @@ public sealed partial class FlatpackCreatorComponent : Component
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoNetworkedField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan PackEndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -40,7 +40,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
|
||||
SubscribeLocalEvent<FlatpackComponent, ExaminedEvent>(OnFlatpackExamined);
|
||||
|
||||
SubscribeLocalEvent<FlatpackCreatorComponent, ContainerIsRemovingAttemptEvent>(OnCreatorRemovingAttempt);
|
||||
SubscribeLocalEvent<FlatpackCreatorComponent, EntityUnpausedEvent>(OnCreatorUnpaused);
|
||||
}
|
||||
|
||||
private void OnFlatpackInteractUsing(Entity<FlatpackComponent> ent, ref InteractUsingEvent args)
|
||||
@@ -110,11 +109,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
|
||||
args.Cancel();
|
||||
}
|
||||
|
||||
private void OnCreatorUnpaused(Entity<FlatpackCreatorComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.PackEndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
public void SetupFlatpack(Entity<FlatpackComponent?> ent, EntityUid? board)
|
||||
{
|
||||
if (!Resolve(ent, ref ent.Comp))
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
namespace Content.Shared.Damage.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[AutoGenerateComponentState]
|
||||
[AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
[Access(typeof(DamageOnHoldingSystem))]
|
||||
public sealed partial class DamageOnHoldingComponent : Component
|
||||
{
|
||||
@@ -29,5 +29,6 @@ public sealed partial class DamageOnHoldingComponent : Component
|
||||
|
||||
[DataField("nextDamage", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoNetworkedField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextDamage = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ namespace Content.Shared.Damage.Components;
|
||||
/// <summary>
|
||||
/// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
|
||||
public sealed partial class StaminaComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -49,5 +49,6 @@ public sealed partial class StaminaComponent : Component
|
||||
/// To avoid continuously updating our data we track the last time we updated so we can extrapolate our current stamina.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextUpdate = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
SubscribeLocalEvent<DamageOnHoldingComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<DamageOnHoldingComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
@@ -26,11 +25,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, DamageOnHoldingComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextDamage += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, DamageOnHoldingComponent component, MapInitEvent args)
|
||||
{
|
||||
component.NextDamage = _timing.CurTime;
|
||||
|
||||
@@ -46,7 +46,6 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
|
||||
InitializeModifier();
|
||||
|
||||
SubscribeLocalEvent<StaminaComponent, EntityUnpausedEvent>(OnStamUnpaused);
|
||||
SubscribeLocalEvent<StaminaComponent, ComponentStartup>(OnStartup);
|
||||
SubscribeLocalEvent<StaminaComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<StaminaComponent, AfterAutoHandleStateEvent>(OnStamHandleState);
|
||||
@@ -61,11 +60,6 @@ public sealed partial class StaminaSystem : EntitySystem
|
||||
SubscribeLocalEvent<StaminaDamageOnHitComponent, MeleeHitEvent>(OnMeleeHit);
|
||||
}
|
||||
|
||||
private void OnStamUnpaused(EntityUid uid, StaminaComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextUpdate += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnStamHandleState(EntityUid uid, StaminaComponent component, ref AfterAutoHandleStateEvent args)
|
||||
{
|
||||
if (component.Critical)
|
||||
|
||||
@@ -7,7 +7,7 @@ namespace Content.Shared.Emp;
|
||||
/// While entity has this component it is "disabled" by EMP.
|
||||
/// Add desired behaviour in other systems
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedEmpSystem))]
|
||||
public sealed partial class EmpDisabledComponent : Component
|
||||
{
|
||||
@@ -15,6 +15,7 @@ public sealed partial class EmpDisabledComponent : Component
|
||||
/// Moment of time when component is removed and entity stops being "disabled"
|
||||
/// </summary>
|
||||
[DataField("timeLeft", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan DisabledUntil;
|
||||
|
||||
[DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)]
|
||||
@@ -23,5 +24,6 @@ public sealed partial class EmpDisabledComponent : Component
|
||||
/// <summary>
|
||||
/// When next effect will be spawned
|
||||
/// </summary>
|
||||
[AutoPausedField]
|
||||
public TimeSpan TargetTime = TimeSpan.Zero;
|
||||
}
|
||||
|
||||
@@ -6,12 +6,13 @@ namespace Content.Shared.Gravity;
|
||||
/// <summary>
|
||||
/// Indicates this entity is shaking due to gravity changes.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class GravityShakeComponent : Component
|
||||
{
|
||||
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
|
||||
public int ShakeTimes;
|
||||
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextShake;
|
||||
}
|
||||
|
||||
@@ -5,16 +5,6 @@ public abstract partial class SharedGravitySystem
|
||||
protected const float GravityKick = 100.0f;
|
||||
protected const float ShakeCooldown = 0.2f;
|
||||
|
||||
private void InitializeShake()
|
||||
{
|
||||
SubscribeLocalEvent<GravityShakeComponent, EntityUnpausedEvent>(OnShakeUnpaused);
|
||||
}
|
||||
|
||||
private void OnShakeUnpaused(EntityUid uid, GravityShakeComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextShake += args.PausedTime;
|
||||
}
|
||||
|
||||
private void UpdateShake()
|
||||
{
|
||||
var curTime = Timing.CurTime;
|
||||
|
||||
@@ -61,8 +61,6 @@ namespace Content.Shared.Gravity
|
||||
SubscribeLocalEvent<GravityChangedEvent>(OnGravityChange);
|
||||
SubscribeLocalEvent<GravityComponent, ComponentGetState>(OnGetState);
|
||||
SubscribeLocalEvent<GravityComponent, ComponentHandleState>(OnHandleState);
|
||||
|
||||
InitializeShake();
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
|
||||
@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Hands.Components;
|
||||
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedHandsSystem))]
|
||||
public sealed partial class HandsComponent : Component
|
||||
{
|
||||
@@ -62,6 +62,7 @@ public sealed partial class HandsComponent : Component
|
||||
/// The time at which throws will be allowed again.
|
||||
/// </summary>
|
||||
[DataField, ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextThrowTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -8,7 +8,7 @@ namespace Content.Shared.Materials;
|
||||
/// Tracker component for the process of reclaiming entities
|
||||
/// <seealso cref="MaterialReclaimerComponent"/>
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem))]
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem)), AutoGenerateComponentPause]
|
||||
public sealed partial class ActiveMaterialReclaimerComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -21,6 +21,7 @@ public sealed partial class ActiveMaterialReclaimerComponent : Component
|
||||
/// When the reclaiming process ends.
|
||||
/// </summary>
|
||||
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
|
||||
|
||||
namespace Content.Shared.Materials;
|
||||
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
public sealed partial class InsertingMaterialStorageComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -11,6 +11,7 @@ public sealed partial class InsertingMaterialStorageComponent : Component
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
|
||||
[ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan EndTime;
|
||||
|
||||
[ViewVariables, AutoNetworkedField]
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace Content.Shared.Materials;
|
||||
/// This is a machine that handles converting entities
|
||||
/// into the raw materials and chemicals that make them up.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
|
||||
[Access(typeof(SharedMaterialReclaimerSystem))]
|
||||
public sealed partial class MaterialReclaimerComponent : Component
|
||||
{
|
||||
@@ -90,6 +90,7 @@ public sealed partial class MaterialReclaimerComponent : Component
|
||||
/// When the next sound will be allowed to be played. Used to prevent spam.
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan NextSound;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -34,13 +34,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
public override void Initialize()
|
||||
{
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, GotEmaggedEvent>(OnEmagged);
|
||||
SubscribeLocalEvent<MaterialReclaimerComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<CollideMaterialReclaimerComponent, StartCollideEvent>(OnCollide);
|
||||
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, ComponentStartup>(OnActiveStartup);
|
||||
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, EntityUnpausedEvent>(OnActiveUnpaused);
|
||||
}
|
||||
|
||||
private void OnMapInit(EntityUid uid, MaterialReclaimerComponent component, MapInitEvent args)
|
||||
@@ -53,11 +51,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
_audio.Stop(component.Stream);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.NextSound += args.PausedTime;
|
||||
}
|
||||
|
||||
private void OnExamined(EntityUid uid, MaterialReclaimerComponent component, ExaminedEvent args)
|
||||
{
|
||||
args.PushMarkup(Loc.GetString("recycler-count-items", ("items", component.ItemsProcessed)));
|
||||
@@ -82,11 +75,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
|
||||
component.ReclaimingContainer = Container.EnsureContainer<Container>(uid, ActiveReclaimerContainerId);
|
||||
}
|
||||
|
||||
private void OnActiveUnpaused(EntityUid uid, ActiveMaterialReclaimerComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tries to start processing an item via a <see cref="MaterialReclaimerComponent"/>.
|
||||
/// </summary>
|
||||
|
||||
@@ -30,7 +30,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
|
||||
SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing);
|
||||
SubscribeLocalEvent<InsertingMaterialStorageComponent, EntityUnpausedEvent>(OnUnpaused);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -52,11 +51,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
|
||||
_appearance.SetData(uid, MaterialStorageVisuals.Inserting, false);
|
||||
}
|
||||
|
||||
private void OnUnpaused(EntityUid uid, InsertingMaterialStorageComponent component, ref EntityUnpausedEvent args)
|
||||
{
|
||||
component.EndTime += args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the volume of a specified material contained in this storage.
|
||||
/// </summary>
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace Content.Shared.Medical;
|
||||
/// This is used for defibrillators; a machine that shocks a dead
|
||||
/// person back into the world of the living.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent]
|
||||
[RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
|
||||
public sealed partial class DefibrillatorComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -24,6 +24,7 @@ public sealed partial class DefibrillatorComponent : Component
|
||||
/// The time at which the zap cooldown will be completed
|
||||
/// </summary>
|
||||
[DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
|
||||
[AutoPausedField]
|
||||
public TimeSpan? NextZapTime;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -15,6 +15,7 @@ namespace Content.Shared.Ninja.Components;
|
||||
/// As an implementation detail, dashing with katana is a suit action which isn't ideal.
|
||||
/// </summary>
|
||||
[RegisterComponent, NetworkedComponent, Access(typeof(SharedNinjaSuitSystem)), AutoGenerateComponentState]
|
||||
[AutoGenerateComponentPause]
|
||||
public sealed partial class NinjaSuitComponent : Component
|
||||
{
|
||||
/// <summary>
|
||||
@@ -46,6 +47,7 @@ public sealed partial class NinjaSuitComponent : Component
|
||||
/// Time at which we will be able to use our abilities again
|
||||
/// </summary>
|
||||
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
|
||||
[AutoPausedField]
|
||||
public TimeSpan DisableCooldown;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -27,7 +27,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
|
||||
base.Initialize();
|
||||
|
||||
SubscribeLocalEvent<NinjaSuitComponent, MapInitEvent>(OnMapInit);
|
||||
SubscribeLocalEvent<NinjaSuitComponent, EntityUnpausedEvent>(OnEntityUnpaused);
|
||||
|
||||
SubscribeLocalEvent<NinjaSuitComponent, GotEquippedEvent>(OnEquipped);
|
||||
SubscribeLocalEvent<NinjaSuitComponent, GetItemActionsEvent>(OnGetItemActions);
|
||||
@@ -43,11 +42,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
|
||||
Dirty(uid, component);
|
||||
}
|
||||
|
||||
private void OnEntityUnpaused(Entity<NinjaSuitComponent> ent, ref EntityUnpausedEvent args)
|
||||
{
|
||||
ent.Comp.DisableCooldown += args.PausedTime;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Call the shared and serverside code for when a ninja equips the suit.
|
||||
/// </summary>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user