diff --git a/Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml b/Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml index 2f582983f5d..d83e794472c 100644 --- a/Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml +++ b/Content.Client/Info/PlaytimeStats/PlaytimeStatsHeader.xaml @@ -1,6 +1,5 @@ <Control xmlns="https://spacestation14.io" - xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls" - EnableAllKeybinds="True"> + xmlns:customControls="clr-namespace:Content.Client.Administration.UI.CustomControls"> <PanelContainer Name="BackgroundColorPlaytimePanel" Access="Public"/> <BoxContainer Orientation="Vertical" HorizontalExpand="True"> diff --git a/Content.Client/Nyanotrasen/IgnoreHumanoids/IgnoreHumanoidsOverlaySystem.cs b/Content.Client/Nyanotrasen/IgnoreHumanoids/IgnoreHumanoidsOverlaySystem.cs index 094bac1aa12..83177bd0cdc 100644 --- a/Content.Client/Nyanotrasen/IgnoreHumanoids/IgnoreHumanoidsOverlaySystem.cs +++ b/Content.Client/Nyanotrasen/IgnoreHumanoids/IgnoreHumanoidsOverlaySystem.cs @@ -2,6 +2,7 @@ using Content.Shared.GameTicking; using Robust.Client.Player; using Robust.Client.Graphics; +using Robust.Shared.Player; using Robust.Shared.Prototypes; namespace Content.Client.IgnoreHumanoids diff --git a/Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFryerVisualizer.cs b/Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFryerVisualizer.cs index 69f613fc110..a8c310bcf41 100644 --- a/Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFryerVisualizer.cs +++ b/Content.Client/Nyanotrasen/Kitchen/Visualizers/DeepFryerVisualizer.cs @@ -1,6 +1,6 @@ using Robust.Client.GameObjects; -using Content.Client.Chemistry.Visualizers; using Content.Client.Kitchen.Components; +using Content.Shared.Chemistry.Components; using Content.Shared.Kitchen.Components; namespace Content.Client.Kitchen.Visualizers diff --git a/Content.Client/Nyanotrasen/Overlays/Overlays/DogVisionSystem.cs b/Content.Client/Nyanotrasen/Overlays/Overlays/DogVisionSystem.cs index 598852cff43..4ca4b25b48c 100644 --- a/Content.Client/Nyanotrasen/Overlays/Overlays/DogVisionSystem.cs +++ b/Content.Client/Nyanotrasen/Overlays/Overlays/DogVisionSystem.cs @@ -2,6 +2,7 @@ using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.Player; +using Robust.Shared.Player; namespace Content.Client.Nyanotrasen.Overlays; public sealed class DogVisionSystem : EntitySystem diff --git a/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs b/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs index 8f1723d1f22..d594bdd6fd1 100644 --- a/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs +++ b/Content.Client/Salvage/UI/SalvageExpeditionConsoleBoundUserInterface.cs @@ -1,14 +1,6 @@ -using System.Linq; -using Content.Client.Stylesheets; -using Content.Shared.CCVar; -using Content.Shared.Procedural; using Content.Shared.Salvage.Expeditions; -using Content.Shared.Salvage.Expeditions.Modifiers; using JetBrains.Annotations; -using Robust.Client.UserInterface; -using Robust.Client.UserInterface.Controls; -using Robust.Shared.Configuration; -using Robust.Shared.Prototypes; +using Robust.Client.GameObjects; namespace Content.Client.Salvage.UI; @@ -16,22 +8,23 @@ namespace Content.Client.Salvage.UI; public sealed class SalvageExpeditionConsoleBoundUserInterface : BoundUserInterface { [ViewVariables] - private OfferingWindow? _window; - - [Dependency] private readonly IConfigurationManager _cfgManager = default!; - [Dependency] private readonly IEntityManager _entManager = default!; - [Dependency] private readonly IPrototypeManager _protoManager = default!; + private SalvageExpeditionWindow? _window; public SalvageExpeditionConsoleBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey) { - IoCManager.InjectDependencies(this); } protected override void Open() { base.Open(); - _window = new OfferingWindow(); - _window.Title = Loc.GetString("salvage-expedition-window-title"); + _window = new SalvageExpeditionWindow(); + _window.ClaimMission += index => + { + SendMessage(new ClaimSalvageMessage() + { + Index = index, + }); + }; _window.OnClose += Close; _window?.OpenCenteredLeft(); } @@ -47,133 +40,9 @@ protected override void UpdateState(BoundUserInterfaceState state) { base.UpdateState(state); - if (state is not SalvageExpeditionConsoleState current || _window == null) + if (state is not SalvageExpeditionConsoleState current) return; - _window.Progression = null; - _window.Cooldown = TimeSpan.FromSeconds(_cfgManager.GetCVar(CCVars.SalvageExpeditionCooldown)); - _window.NextOffer = current.NextOffer; - _window.Claimed = current.Claimed; - _window.ClearOptions(); - var salvage = _entManager.System<SalvageSystem>(); - - for (var i = 0; i < current.Missions.Count; i++) - { - var missionParams = current.Missions[i]; - - var offering = new OfferingWindowOption(); - offering.Title = Loc.GetString($"salvage-expedition-type"); - - var difficultyId = "Moderate"; - var difficultyProto = _protoManager.Index<SalvageDifficultyPrototype>(difficultyId); - // TODO: Selectable difficulty soon. - var mission = salvage.GetMission(difficultyProto, missionParams.Seed); - - // Difficulty - // Details - offering.AddContent(new Label() - { - Text = Loc.GetString("salvage-expedition-window-difficulty") - }); - - var difficultyColor = difficultyProto.Color; - - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-difficulty-Moderate"), - FontColorOverride = difficultyColor, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-difficulty-players"), - HorizontalAlignment = Control.HAlignment.Left, - }); - - offering.AddContent(new Label - { - Text = difficultyProto.RecommendedPlayers.ToString(), - FontColorOverride = StyleNano.NanoGold, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - // Details - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-window-hostiles") - }); - - var faction = mission.Faction; - - offering.AddContent(new Label - { - Text = faction, - FontColorOverride = StyleNano.NanoGold, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - // Duration - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-window-duration") - }); - - offering.AddContent(new Label - { - Text = mission.Duration.ToString(), - FontColorOverride = StyleNano.NanoGold, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - // Biome - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-window-biome") - }); - - var biome = mission.Biome; - - offering.AddContent(new Label - { - Text = Loc.GetString(_protoManager.Index<SalvageBiomeModPrototype>(biome).ID), - FontColorOverride = StyleNano.NanoGold, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - // Modifiers - offering.AddContent(new Label - { - Text = Loc.GetString("salvage-expedition-window-modifiers") - }); - - var mods = mission.Modifiers; - - offering.AddContent(new Label - { - Text = string.Join("\n", mods.Select(o => "- " + o)).TrimEnd(), - FontColorOverride = StyleNano.NanoGold, - HorizontalAlignment = Control.HAlignment.Left, - Margin = new Thickness(0f, 0f, 0f, 5f), - }); - - offering.ClaimPressed += args => - { - SendMessage(new ClaimSalvageMessage() - { - Index = missionParams.Index, - }); - }; - - offering.Claimed = current.ActiveMission == missionParams.Index; - offering.Disabled = current.Claimed || current.Cooldown; - - _window.AddOption(offering); - } + _window?.UpdateState(current); } } diff --git a/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml b/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml new file mode 100644 index 00000000000..67280c34f97 --- /dev/null +++ b/Content.Client/Salvage/UI/SalvageExpeditionWindow.xaml @@ -0,0 +1,23 @@ +<controls:FancyWindow xmlns="https://spacestation14.io" + xmlns:controls="clr-namespace:Content.Client.UserInterface.Controls" + Title="{Loc 'salvage-expedition-window-title'}" + MinSize="800 360"> + <BoxContainer Orientation="Vertical"> + <BoxContainer Orientation="Horizontal"> + <Label Name="NextOfferLabel" + Text="{Loc 'salvage-expedition-window-next'}" + Margin="5"></Label> + <ProgressBar Name="NextOfferBar" + HorizontalExpand="True" + MinValue="0" + MaxValue="1" + SetHeight="25"/> + <Label Name="NextOfferText" Text="0.00" + Margin="5"/> + </BoxContainer> + <controls:HLine Color="#404040" Thickness="2" Margin="0 5 0 5"/> + <BoxContainer Name="Container" + Orientation="Horizontal" + Margin="5 0 5 0"/> + </BoxContainer> +</controls:FancyWindow> diff --git a/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs b/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs index f510bccefc5..0096fe1c17c 100644 --- a/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs +++ b/Content.Client/VendingMachines/UI/VendingMachineMenu.xaml.cs @@ -130,7 +130,7 @@ public void Populate(List<VendingMachineInventoryEntry> inventory, float priceMo if (prototype != null && prototype.TryGetComponent<SolutionContainerManagerComponent>(out var priceSolutions)) { - foreach (var solution in priceSolutions.Solutions.Values) + foreach (var solution in priceSolutions.Solutions!.Values) { foreach (var (reagent, quantity) in solution.Contents) { diff --git a/Content.Server/Body/Components/RespiratorComponent.cs b/Content.Server/Body/Components/RespiratorComponent.cs index a6e61f5802d..a0f57599cbf 100644 --- a/Content.Server/Body/Components/RespiratorComponent.cs +++ b/Content.Server/Body/Components/RespiratorComponent.cs @@ -73,8 +73,6 @@ public sealed partial class RespiratorComponent : Component [DataField("CPRSound")] public SoundSpecifier CPRSound { get; set; } = new SoundPathSpecifier("/Audio/Effects/CPR.ogg"); - public IPlayingAudioStream? CPRPlayingStream; - public bool IsReceivingCPR = false; } } diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 995cbc53f21..0b02c30a6ea 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -21,6 +21,7 @@ using JetBrains.Annotations; using Robust.Shared.Timing; using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; using Robust.Shared.Random; using Robust.Shared.Physics.Components; using Robust.Shared.Player; @@ -237,7 +238,6 @@ private void OnApplyMetabolicMultiplier(EntityUid uid, RespiratorComponent compo private void OnDoAfter(EntityUid uid, RespiratorComponent component, DoAfterEvent args) { - component.CPRPlayingStream?.Stop(); component.IsReceivingCPR = false; if (args.Handled || args.Cancelled) @@ -292,7 +292,7 @@ public void AttemptCPR(EntityUid uid, RespiratorComponent component, EntityUid u _popupSystem.PopupEntity(Loc.GetString("cpr-start-second-person-patient", ("user", Identity.Entity(user, EntityManager))), uid, uid, Shared.Popups.PopupType.Medium); component.IsReceivingCPR = true; - component.CPRPlayingStream = _audio.PlayPvs(component.CPRSound, uid, audioParams: AudioParams.Default.WithVolume(-3f)); + //_audio.PlayPvs(component.CPRSound, uid, audioParams: AudioParams.Default.WithVolume(-3f)); var args = new DoAfterArgs(EntityManager, user, Math.Min(component.CycleDelay * 2, 6f), new CPRDoAfterEvent(), uid, target: uid) { diff --git a/Content.Server/Botany/Systems/MutationSystem.cs b/Content.Server/Botany/Systems/MutationSystem.cs index 3d2aa804cc7..9f55bbb342a 100644 --- a/Content.Server/Botany/Systems/MutationSystem.cs +++ b/Content.Server/Botany/Systems/MutationSystem.cs @@ -238,7 +238,7 @@ private void MutateGasses(ref Dictionary<Gas, float> gasses, float min, float ma Gas.Nitrogen, Gas.CarbonDioxide, Gas.NitrousOxide, - Gas.Miasma, + Gas.Ammonia, Gas.Plasma, Gas.Tritium, Gas.WaterVapor, diff --git a/Content.Server/Cargo/Systems/PricingSystem.cs b/Content.Server/Cargo/Systems/PricingSystem.cs index 70cf446648e..635ae9a758a 100644 --- a/Content.Server/Cargo/Systems/PricingSystem.cs +++ b/Content.Server/Cargo/Systems/PricingSystem.cs @@ -1,3 +1,4 @@ +using System.Linq; using Content.Server.Administration; using Content.Server.Body.Systems; using Content.Server.Cargo.Components; diff --git a/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs index 9c3003150e2..3e2851a7c6b 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionTransferSystem.cs @@ -10,6 +10,7 @@ using JetBrains.Annotations; using Robust.Server.GameObjects; using Robust.Shared.Player; +using Robust.Shared.Audio.Systems; namespace Content.Server.Chemistry.EntitySystems { diff --git a/Content.Server/DeltaV/Weapons/Ranged/Systems/EnergyGunSystem.cs b/Content.Server/DeltaV/Weapons/Ranged/Systems/EnergyGunSystem.cs index 96afc8cd179..d5d5e091b72 100644 --- a/Content.Server/DeltaV/Weapons/Ranged/Systems/EnergyGunSystem.cs +++ b/Content.Server/DeltaV/Weapons/Ranged/Systems/EnergyGunSystem.cs @@ -135,7 +135,7 @@ private void SetFireMode(EntityUid uid, EnergyGunComponent component, EnergyWeap if (TryComp<AppearanceComponent>(uid, out var _) && TryComp<ItemComponent>(uid, out var item)) { - _item.SetHeldPrefix(uid, component.CurrentFireMode.State, item); + _item.SetHeldPrefix(uid, component.CurrentFireMode.State, component: item); switch (component.CurrentFireMode.State) { case "disabler": diff --git a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs index 5e11b572615..f1df8b605c9 100644 --- a/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs +++ b/Content.Server/GameTicking/Rules/NukeopsRuleSystem.cs @@ -989,19 +989,6 @@ private void SpawnOperatives(int spawnCount, List<ICommonSession> sessions, bool } } - /// <summary> - /// Display a greeting message and play a sound for a nukie - /// </summary> - private void NotifyNukie(ICommonSession session, NukeOperativeComponent nukeop, NukeopsRuleComponent nukeopsRule) - { - if (nukeopsRule.TargetStation is not { } station) - return; - - _chatManager.DispatchServerMessage(session, Loc.GetString("nukeops-welcome", ("station", station), ("name", nukeopsRule.OperationName))); - _audio.PlayGlobal(nukeop.GreetSoundNotification, session); - } - - private void SpawnOperativesForGhostRoles(EntityUid uid, NukeopsRuleComponent? component = null) { if (!Resolve(uid, ref component)) diff --git a/Content.Server/Interaction/InteractionPopupSystem.cs b/Content.Server/Interaction/InteractionPopupSystem.cs index c4a03f174bc..a029ff196d8 100644 --- a/Content.Server/Interaction/InteractionPopupSystem.cs +++ b/Content.Server/Interaction/InteractionPopupSystem.cs @@ -19,6 +19,7 @@ public sealed class InteractionPopupSystem : EntitySystem [Dependency] private readonly IRobustRandom _random = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; [Dependency] private readonly SharedAudioSystem _audio = default!; + [Dependency] private readonly MobStateSystem _mobStateSystem = default!; public override void Initialize() { @@ -82,9 +83,9 @@ public void TryHug(EntityUid uid, InteractionPopupComponent component, EntityUid if (component.MessagePerceivedByOthers != null) { var msgOthers = Loc.GetString(component.MessagePerceivedByOthers, - ("user", Identity.Entity(args.User, EntityManager)), ("target", Identity.Entity(uid, EntityManager))); - _popupSystem.PopupEntity(msg, uid, args.User); - _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(args.User, entityManager: EntityManager), true); + ("user", Identity.Entity(user, EntityManager)), ("target", Identity.Entity(uid, EntityManager))); + _popupSystem.PopupEntity(msg, uid, user); + _popupSystem.PopupEntity(msgOthers, uid, Filter.PvsExcept(user, entityManager: EntityManager), true); } else _popupSystem.PopupEntity(msg, uid, user); //play only for the initiating entity. @@ -92,9 +93,9 @@ public void TryHug(EntityUid uid, InteractionPopupComponent component, EntityUid if (sfx is not null) //not all cases will have sound. { if (component.SoundPerceivedByOthers) - _audio.PlayPvs(sfx, args.Target); //play for everyone in range + _audio.PlayPvs(sfx, uid); //play for everyone in range else - _audio.PlayEntity(sfx, Filter.Entities(args.User, args.Target), args.Target, true); //play only for the initiating entity and its target. + _audio.PlayEntity(sfx, Filter.Entities(user, uid), uid, true); //play only for the initiating entity and its target. } component.LastInteractTime = curTime; diff --git a/Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs b/Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs index 56e14777711..e066da5c2f3 100644 --- a/Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs +++ b/Content.Server/Nyanotrasen/Abilities/Felinid/FelinidSystem.cs @@ -7,12 +7,15 @@ using Content.Shared.Hands; using Content.Shared.IdentityManagement; using Content.Server.Body.Components; +using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Medical; +using Content.Server.Nutrition.Components; using Content.Server.Nutrition.EntitySystems; using Content.Shared.Nutrition.Components; using Content.Server.Popups; +using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.EntitySystems; -using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; using Robust.Shared.Player; using Robust.Shared.Random; using Robust.Shared.Prototypes; @@ -24,6 +27,7 @@ namespace Content.Server.Abilities.Felinid public sealed class FelinidSystem : EntitySystem { + [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedActionsSystem _actionsSystem = default!; [Dependency] private readonly VomitSystem _vomitSystem = default!; [Dependency] private readonly HungerSystem _hunger = default!; @@ -108,7 +112,7 @@ private void OnHairball(EntityUid uid, FelinidComponent component, HairballActio } _popupSystem.PopupEntity(Loc.GetString("hairball-cough", ("name", Identity.Entity(uid, EntityManager))), uid); - SoundSystem.Play("/Audio/Nyanotrasen/Voice/Felinid/hairball.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.15f)); + _audio.PlayPvs("/Audio/Nyanotrasen/Voice/Felinid/hairball.ogg", uid, AudioHelpers.WithVariation(0.15f)); EnsureComp<CoughingUpHairballComponent>(uid); args.Handled = true; @@ -145,7 +149,7 @@ private void OnEatMouse(EntityUid uid, FelinidComponent component, EatMouseActio Del(component.PotentialTarget.Value); component.PotentialTarget = null; - SoundSystem.Play("/Audio/Items/eatfood.ogg", Filter.Pvs(uid), uid, AudioHelpers.WithVariation(0.15f)); + _audio.PlayPvs("/Audio/Items/eatfood.ogg", uid, AudioHelpers.WithVariation(0.15f)); _hunger.ModifyHunger(uid, 70f, hunger); _actionsSystem.RemoveAction(uid, component.EatMouseAction); @@ -156,13 +160,14 @@ private void SpawnHairball(EntityUid uid, FelinidComponent component) var hairball = EntityManager.SpawnEntity(component.HairballPrototype, Transform(uid).Coordinates); var hairballComp = Comp<HairballComponent>(hairball); - if (TryComp<BloodstreamComponent>(uid, out var bloodstream)) + if (TryComp<BloodstreamComponent>(uid, out var bloodstream) && bloodstream.ChemicalSolution is Entity<SolutionComponent> bloodSol) { - var temp = bloodstream.ChemicalSolution.SplitSolution(20); + var tempSol = _solutionSystem.SplitSolution(bloodSol, 20); - if (_solutionSystem.TryGetSolution(hairball, hairballComp.SolutionName, out var hairballSolution)) + if (_solutionSystem.TryGetSolution(hairball, hairballComp.SolutionName, out var hairballSolution) + && hairballSolution is Entity<SolutionComponent> solution) { - _solutionSystem.TryAddSolution(hairball, hairballSolution, temp); + _solutionSystem.TryAddSolution(solution, tempSol); } } } diff --git a/Content.Server/Nyanotrasen/Abilities/Gachi/GachiSystem.cs b/Content.Server/Nyanotrasen/Abilities/Gachi/GachiSystem.cs deleted file mode 100644 index aab59881352..00000000000 --- a/Content.Server/Nyanotrasen/Abilities/Gachi/GachiSystem.cs +++ /dev/null @@ -1,103 +0,0 @@ -using System.Linq; -using Content.Shared.Damage; -using Content.Shared.FixedPoint; -using Content.Shared.Inventory.Events; -using Content.Server.Abilities.Gachi.Components; -using Content.Shared.Weapons.Melee.Events; -using Content.Shared.Clothing.Components; -using Content.Shared.Mobs; -using Robust.Shared.Audio; -using Robust.Shared.Player; -using Robust.Shared.Random; - -namespace Content.Server.Abilities.Gachi -{ - public sealed class GachiSystem : EntitySystem - { - [Dependency] private readonly IRobustRandom _random = default!; - public override void Initialize() - { - base.Initialize(); - SubscribeLocalEvent<GachiComponent, DamageChangedEvent>(OnDamageChanged); - SubscribeLocalEvent<GachiComponent, MeleeHitEvent>(OnMeleeHit); - SubscribeLocalEvent<GachiComponent, MobStateChangedEvent>(OnMobStateChanged); - SubscribeLocalEvent<JabroniOutfitComponent, GotEquippedEvent>(OnEquipped); - SubscribeLocalEvent<JabroniOutfitComponent, GotUnequippedEvent>(OnUnequipped); - } - - public override void Update(float frameTime) - { - base.Update(frameTime); - foreach (var gachi in EntityQuery<GachiComponent>()) - { - gachi.Accumulator += frameTime; - if (gachi.Accumulator < gachi.AddToMultiplierTime.TotalSeconds) - continue; - gachi.Accumulator -= (float) gachi.AddToMultiplierTime.TotalSeconds; - if (gachi.Multiplier < 1f) - gachi.Multiplier += 0.01f; - } - } - - private void OnDamageChanged(EntityUid uid, GachiComponent component, DamageChangedEvent args) - { - if (TryComp<DamageableComponent>(uid, out var damageableComponent) && (damageableComponent.TotalDamage + args.DamageDelta?.Total >= 100)) - return; - if (args.DamageIncreased && args.DamageDelta != null && args.DamageDelta.Total >= 5 && _random.Prob(0.3f * component.Multiplier)) - { - FixedPoint2 newMultiplier = component.Multiplier - 0.25; - component.Multiplier = (float) FixedPoint2.Max(FixedPoint2.Zero, newMultiplier); - - if (_random.Prob(0.01f)) - { - SoundSystem.Play( "/Audio/Effects/Gachi/ripears.ogg", Filter.Pvs(uid), AudioParams.Default.WithVolume(8f)); - return; - } - SoundSystem.Play(component.PainSound.GetSound(), Filter.Pvs(uid), uid); - - } - } - - private void OnMeleeHit(EntityUid uid, GachiComponent component, MeleeHitEvent args) - { - if (!args.IsHit || - !args.HitEntities.Any()) - { - return; - } - - if (_random.Prob(0.2f * component.Multiplier)) - { - FixedPoint2 newMultiplier = component.Multiplier - 0.25; - component.Multiplier = (float) FixedPoint2.Max(FixedPoint2.Zero, newMultiplier); - SoundSystem.Play(component.HitOtherSound.GetSound(), Filter.Pvs(uid), uid); - } - } - - private void OnMobStateChanged(EntityUid uid, GachiComponent component, MobStateChangedEvent args) - { - if (args.NewMobState == Shared.Mobs.MobState.Critical) - { - SoundSystem.Play("/Audio/Effects/Gachi/knockedhimout.ogg", Filter.Pvs(uid), uid); - } - } - - private void OnEquipped(EntityUid uid, JabroniOutfitComponent component, GotEquippedEvent args) - { - if (!TryComp<ClothingComponent>(uid, out var clothing)) - return; - if (!clothing.Slots.HasFlag(args.SlotFlags)) - return; - EnsureComp<GachiComponent>(args.Equipee); - component.IsActive = true; - } - - private void OnUnequipped(EntityUid uid, JabroniOutfitComponent component, GotUnequippedEvent args) - { - if (!component.IsActive) - return; - component.IsActive = false; - RemComp<GachiComponent>(uid); - } - } -} diff --git a/Content.Server/Nyanotrasen/Chemistry/AutoRegenReagent/AutoRegenReagentSystem.cs b/Content.Server/Nyanotrasen/Chemistry/AutoRegenReagent/AutoRegenReagentSystem.cs index 0e986cf43be..6ebc57d8763 100644 --- a/Content.Server/Nyanotrasen/Chemistry/AutoRegenReagent/AutoRegenReagentSystem.cs +++ b/Content.Server/Nyanotrasen/Chemistry/AutoRegenReagent/AutoRegenReagentSystem.cs @@ -1,5 +1,6 @@ +using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Popups; -using Content.Shared.Chemistry.EntitySystems; +using Content.Shared.Chemistry.Components; using Content.Shared.Verbs; using Robust.Shared.Player; @@ -21,7 +22,7 @@ private void OnInit(EntityUid uid, AutoRegenReagentComponent component, Componen { if (component.SolutionName == null) return; - if (_solutionSystem.TryGetSolution(uid, component.SolutionName, out var solution)) + if (_solutionSystem.TryGetSolution(uid, component.SolutionName, out var _, out var solution)) component.Solution = solution; component.CurrentReagent = component.Reagents[component.CurrentIndex]; } @@ -67,16 +68,17 @@ private string SwitchReagent(AutoRegenReagentComponent component, EntityUid user public override void Update(float frameTime) { base.Update(frameTime); - foreach (var autoComp in EntityQuery<AutoRegenReagentComponent>()) + + var query = EntityQueryEnumerator<AutoRegenReagentComponent, SolutionComponent>(); + + while (query.MoveNext(out var solution, out var regenComp, out var solutionComp)) { - if (autoComp.Solution == null) - return; - autoComp.Accumulator += frameTime; - if (autoComp.Accumulator < 1f) + regenComp.Accumulator += frameTime; + if (regenComp.Accumulator < 1f) continue; - autoComp.Accumulator -= 1f; - - _solutionSystem.TryAddReagent(autoComp.Owner, autoComp.Solution, autoComp.CurrentReagent, autoComp.unitsPerSecond, out var accepted); + regenComp.Accumulator -= 1f; + _solutionSystem.TryAddReagent((solution, solutionComp), regenComp.CurrentReagent, + regenComp.unitsPerSecond); } } } diff --git a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs index 0cd1e63efb6..78ab4dc1e13 100644 --- a/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs +++ b/Content.Server/Nyanotrasen/Kitchen/EntitySystems/DeepFryerSystem.cs @@ -10,10 +10,11 @@ using Robust.Shared.Timing; using Content.Server.Administration.Logs; using Content.Server.Atmos.Components; -using Content.Server.Atmos.Miasma; +using Content.Server.Atmos.Rotting; using Content.Server.Audio; using Content.Server.Body.Components; using Content.Server.Cargo.Systems; +using Content.Server.Chemistry.Containers.EntitySystems; using Content.Shared.Chemistry.Components.SolutionManager; using Content.Server.Chemistry.EntitySystems; using Content.Server.Construction; @@ -33,7 +34,7 @@ using Content.Server.Temperature.Components; using Content.Server.Temperature.Systems; using Content.Server.UserInterface; -using Content.Shared.Atmos.Miasma; +using Content.Shared.Atmos.Rotting; using Content.Shared.Buckle.Components; using Content.Shared.Chemistry.Components; using Content.Shared.Chemistry.Reagent; @@ -64,7 +65,7 @@ using Content.Shared.NPC; using Content.Shared.Chemistry.EntitySystems; using Content.Shared.Construction; -//using Robust.Shared.Audio.Systems; +using Robust.Shared.Audio.Systems; namespace Content.Server.Kitchen.EntitySystems { @@ -136,6 +137,7 @@ public override void Update(float frameTime) { base.Update(frameTime); + foreach (var component in EntityManager.EntityQuery<DeepFryerComponent>()) { var uid = component.Owner; @@ -148,8 +150,9 @@ public override void Update(float frameTime) UpdateNextFryTime(uid, component); + // Heat the vat solution and contained entities. - _solutionContainerSystem.SetTemperature(uid, component.Solution, component.PoweredTemperature); + _solutionContainerSystem.SetTemperature(component.Solution, component.PoweredTemperature); foreach (var item in component.Storage.ContainedEntities) CookItem(uid, component, item); diff --git a/Content.Server/Nyanotrasen/Mail/MailSystem.cs b/Content.Server/Nyanotrasen/Mail/MailSystem.cs index 80056a8bb94..929011e58ed 100644 --- a/Content.Server/Nyanotrasen/Mail/MailSystem.cs +++ b/Content.Server/Nyanotrasen/Mail/MailSystem.cs @@ -9,7 +9,7 @@ using Content.Server.Cargo.Components; using Content.Server.Cargo.Systems; using Content.Server.Chat.Systems; -using Content.Shared.Chemistry.EntitySystems; +using Content.Server.Chemistry.Containers.EntitySystems; using Content.Server.Damage.Components; using Content.Server.Destructible; using Content.Server.Destructible.Thresholds; @@ -36,13 +36,14 @@ using Content.Shared.Hands.EntitySystems; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; +using Content.Shared.Item; using Content.Shared.Mail; using Content.Shared.Maps; using Content.Shared.PDA; -using Content.Shared.Random.Helpers; using Content.Shared.Roles; using Content.Shared.Storage; using Content.Shared.Tag; +using Robust.Shared.Audio.Systems; using Timer = Robust.Shared.Timing.Timer; namespace Content.Server.Mail @@ -722,7 +723,6 @@ public void OpenMail(EntityUid uid, MailComponent? component = null, EntityUid? _handsSystem.PickupOrDrop(user, entity); } - _itemSystem.SetSize(uid, 1); _tagSystem.AddTag(uid, "Trash"); _tagSystem.AddTag(uid, "Recyclable"); _tagSystem.AddTag(uid, "ClothMade"); // Frontier - Make it so moth can eat open mail. diff --git a/Content.Server/Salvage/SalvageSystem.Expeditions.cs b/Content.Server/Salvage/SalvageSystem.Expeditions.cs index 184bd5286dc..9fe09587893 100644 --- a/Content.Server/Salvage/SalvageSystem.Expeditions.cs +++ b/Content.Server/Salvage/SalvageSystem.Expeditions.cs @@ -230,7 +230,7 @@ private void MiningTax(List<EntityUid> entities, EntityUid entity, SalvageMining while (children.MoveNext(out var child)) { - MiningTax(entities, child.Value, mining, xformQuery); + MiningTax(entities, child, mining, xformQuery); } } diff --git a/Content.Server/Salvage/SpawnSalvageMissionJob.cs b/Content.Server/Salvage/SpawnSalvageMissionJob.cs index 93c44e2eb37..e4dc0e1c775 100644 --- a/Content.Server/Salvage/SpawnSalvageMissionJob.cs +++ b/Content.Server/Salvage/SpawnSalvageMissionJob.cs @@ -109,8 +109,8 @@ protected override async Task<bool> Process() { biome = _entManager.AddComponent<BiomeComponent>(mapUid); var biomeSystem = _entManager.System<BiomeSystem>(); - biomeSystem.SetTemplate(biome, _prototypeManager.Index<BiomeTemplatePrototype>(missionBiome.BiomePrototype)); - biomeSystem.SetSeed(biome, mission.Seed); + biomeSystem.SetTemplate(mapUid, biome, _prototypeManager.Index<BiomeTemplatePrototype>(missionBiome.BiomePrototype)); + biomeSystem.SetSeed(mapUid, biome, mission.Seed); _entManager.Dirty(biome); // Gravity @@ -179,7 +179,7 @@ protected override async Task<bool> Process() var dungeonOffsetDistance = minDungeonOffset + (maxDungeonOffset - minDungeonOffset) * random.NextFloat(); var dungeonOffset = new Vector2(0f, dungeonOffsetDistance); dungeonOffset = dungeonRotation.RotateVec(dungeonOffset); - var dungeonMod = _prototypeManager.Index<SalvageDungeonMod>(mission.Dungeon); + var dungeonMod = _prototypeManager.Index<SalvageDungeonModPrototype>(mission.Dungeon); var dungeonConfig = _prototypeManager.Index<DungeonConfigPrototype>(dungeonMod.Proto); dungeon = await WaitAsyncTask(_dungeon.GenerateDungeonAsync(dungeonConfig, mapUid, grid, (Vector2i) dungeonOffset, @@ -245,7 +245,7 @@ private async Task SpawnDungeonLoot(Dungeon? dungeon, SalvageBiomeMod biomeMod, if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome) && biomeLoot.Prototype.TryGetValue(biomeMod.ID, out var mod)) { - _biome.AddMarkerLayer(biome, mod); + _biome.AddMarkerLayer(gridUid, biome, biomeMod.ID); } } break; @@ -253,7 +253,7 @@ private async Task SpawnDungeonLoot(Dungeon? dungeon, SalvageBiomeMod biomeMod, { if (_entManager.TryGetComponent<BiomeComponent>(gridUid, out var biome)) { - _biome.AddTemplate(biome, "Loot", _prototypeManager.Index<BiomeTemplatePrototype>(biomeLoot.Prototype), i); + _biome.AddTemplate(gridUid, biome, "Loot", _prototypeManager.Index<BiomeTemplatePrototype>(biomeLoot.Prototype), i); } } break; @@ -274,7 +274,7 @@ private async Task SetupMining( // TODO: Better for (var i = 0; i < _salvage.GetDifficulty(mission.Difficulty); i++) { - _biome.AddMarkerLayer(biome, faction.Configs["Mining"]); + _biome.AddMarkerLayer(gridUid, biome, faction.Configs["Mining"]); } } } diff --git a/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs b/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs index 88047b65b39..ccde09ddd90 100644 --- a/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs +++ b/Content.Server/Shipyard/Systems/ShipyardSystem.Consoles.cs @@ -36,6 +36,7 @@ using Content.Server.Shuttles.Components; using Content.Server.Station.Components; using System.Text.RegularExpressions; +using Robust.Shared.Audio.Systems; namespace Content.Server.Shipyard.Systems; @@ -491,11 +492,11 @@ public bool FoundOrganics(EntityUid uid, EntityQuery<MobStateComponent> mobQuery while (childEnumerator.MoveNext(out var child)) { - if (mobQuery.TryGetComponent(child.Value, out var mobState) - && !_mobState.IsDead(child.Value, mobState) - && _mind.TryGetMind(child.Value, out var mind, out var mindComp) + if (mobQuery.TryGetComponent(child, out var mobState) + && !_mobState.IsDead(child, mobState) + && _mind.TryGetMind(child, out var mind, out var mindComp) && !_mind.IsCharacterDeadIc(mindComp) - || FoundOrganics(child.Value, mobQuery, xformQuery)) + || FoundOrganics(child, mobQuery, xformQuery)) return true; } diff --git a/Content.Server/StationEvents/Events/BluespaceErrorRule.cs b/Content.Server/StationEvents/Events/BluespaceErrorRule.cs index 70f81a6dad4..9a05a74013c 100644 --- a/Content.Server/StationEvents/Events/BluespaceErrorRule.cs +++ b/Content.Server/StationEvents/Events/BluespaceErrorRule.cs @@ -5,6 +5,7 @@ using Robust.Shared.Map; using Content.Server.GameTicking.Rules.Components; using Content.Server.Salvage; +using Content.Server.Salvage.Magnet; using Content.Server.Shuttles.Components; using Content.Server.Shuttles.Systems; using Content.Server.StationEvents.Components; diff --git a/Content.Server/VendingMachines/VendingMachineSystem.cs b/Content.Server/VendingMachines/VendingMachineSystem.cs index e467b264d4b..aae71468ccc 100644 --- a/Content.Server/VendingMachines/VendingMachineSystem.cs +++ b/Content.Server/VendingMachines/VendingMachineSystem.cs @@ -31,6 +31,7 @@ using Robust.Shared.Timing; using Content.Shared.Tools.Components; using Content.Shared.Tools.Systems; +using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; namespace Content.Server.VendingMachines @@ -41,7 +42,7 @@ public sealed class VendingMachineSystem : SharedVendingMachineSystem [Dependency] private readonly IPrototypeManager _prototypeManager = default!; [Dependency] private readonly AccessReaderSystem _accessReader = default!; [Dependency] private readonly AppearanceSystem _appearanceSystem = default!; - [Dependency] private readonly AudioSystem _audioSystem = default!; + [Dependency] private readonly SharedAudioSystem _audioSystem = default!; [Dependency] private readonly BankSystem _bankSystem = default!; [Dependency] private readonly CargoSystem _cargo = default!; [Dependency] private readonly PopupSystem _popupSystem = default!; diff --git a/Content.Server/_NF/ArachnidChaos/ArachnidChaosSystem.cs b/Content.Server/_NF/ArachnidChaos/ArachnidChaosSystem.cs index df4496d99dc..5734034d3ec 100644 --- a/Content.Server/_NF/ArachnidChaos/ArachnidChaosSystem.cs +++ b/Content.Server/_NF/ArachnidChaos/ArachnidChaosSystem.cs @@ -13,13 +13,16 @@ using Robust.Shared.Player; using Content.Shared.Mobs.Systems; using Content.Server.Body.Systems; +using Content.Server.Nutrition.Components; using Content.Shared.Database; +using Robust.Shared.Audio.Systems; using Robust.Shared.Utility; namespace Content.Server.ArachnidChaos { public sealed class ArachnidChaosSystem : EntitySystem { + [Dependency] private readonly SharedAudioSystem _audio = default!; [Dependency] private readonly SharedDoAfterSystem _doAfter = default!; [Dependency] private readonly SharedPopupSystem _popupSystem = default!; [Dependency] private readonly HungerSystem _hunger = default!; @@ -89,7 +92,7 @@ private void OnDoAfter(EntityUid uid, ArachnidChaosComponent comp, DoAfterEvent return; _bloodstreamSystem.TryModifyBloodLevel(args.Args.Target.Value, -5, bloodstream); - SoundSystem.Play("/Audio/Items/drink.ogg", Filter.Pvs(args.Args.User), args.Args.User, AudioHelpers.WithVariation(0.15f)); + _audio.PlayPvs("/Audio/Items/drink.ogg", args.Args.User, AudioHelpers.WithVariation(0.15f)); _hunger.ModifyHunger(args.Args.User, 5, hunger); _adminLogger.Add(LogType.Action, LogImpact.Medium, $"{ToPrettyString(args.Args.User):actor} drank blood from {ToPrettyString(args.Args.Target.Value):actor}"); diff --git a/Content.Server/_NF/Bank/ATMSystem.cs b/Content.Server/_NF/Bank/ATMSystem.cs index 6c3b825bfe0..e1b8f7f0d0c 100644 --- a/Content.Server/_NF/Bank/ATMSystem.cs +++ b/Content.Server/_NF/Bank/ATMSystem.cs @@ -14,6 +14,7 @@ using Content.Server.Administration.Logs; using Content.Server.Cargo.Components; using Content.Shared.Database; +using Robust.Shared.Audio.Systems; namespace Content.Server.Bank; diff --git a/Content.Server/_NF/CryoSleep/CryoSleepSystem.cs b/Content.Server/_NF/CryoSleep/CryoSleepSystem.cs index 2cb86177710..ff46ab1e86d 100644 --- a/Content.Server/_NF/CryoSleep/CryoSleepSystem.cs +++ b/Content.Server/_NF/CryoSleep/CryoSleepSystem.cs @@ -24,6 +24,7 @@ using Content.Shared.Popups; using Content.Shared.Verbs; using Robust.Server.Containers; +using Robust.Shared.Audio.Systems; using Robust.Shared.Containers; using Robust.Shared.Enums; using Robust.Shared.Map; diff --git a/Content.Server/_NF/M_Emp/M_EmpSystem.cs b/Content.Server/_NF/M_Emp/M_EmpSystem.cs index 3858e87ebf0..81934639bc3 100644 --- a/Content.Server/_NF/M_Emp/M_EmpSystem.cs +++ b/Content.Server/_NF/M_Emp/M_EmpSystem.cs @@ -19,6 +19,7 @@ using Content.Server.DeviceNetwork.Systems; using Content.Server.Ame.Components; using Robust.Shared.Audio; +using Robust.Shared.Audio.Systems; // TO ANYONE LOOKING AT THIS CODE, IM SORRY // This code was reused for the salvage magnet and is a mess right now as it is, it has no known issues with, I hope, but its not cleaned as it sould be. diff --git a/Content.Shared/Procedural/Loot/RandomSpawnsLoot.cs b/Content.Shared/Procedural/Loot/RandomSpawnsLoot.cs deleted file mode 100644 index e429eed402a..00000000000 --- a/Content.Shared/Procedural/Loot/RandomSpawnsLoot.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Content.Shared.Random; -using Robust.Shared.Prototypes; -using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype; - -namespace Content.Shared.Procedural.Loot; - -/// <summary> -/// Randomly places loot in free areas inside the dungeon. -/// </summary> -public sealed partial class RandomSpawnsLoot : IDungeonLoot -{ - [ViewVariables(VVAccess.ReadWrite), DataField("entries", required: true)] - public List<RandomSpawnLootEntry> Entries = new(); -} - -[DataDefinition] -public partial record struct RandomSpawnLootEntry() : IBudgetEntry -{ - [ViewVariables(VVAccess.ReadWrite), DataField("proto", required: true, customTypeSerializer:typeof(PrototypeIdSerializer<EntityPrototype>))] - public string Proto { get; set; } = string.Empty; - - /// <summary> - /// Cost for this loot to spawn. - /// </summary> - [ViewVariables(VVAccess.ReadWrite), DataField("cost")] - public float Cost { get; set; } = 1f; - - /// <summary> - /// Unit probability for this entry. Weighted against the entire table. - /// </summary> - [ViewVariables(VVAccess.ReadWrite), DataField("prob")] - public float Prob { get; set; } = 1f; -} diff --git a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonMod.cs b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonMod.cs index ee3233c5512..ec1c9478b7f 100644 --- a/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonMod.cs +++ b/Content.Shared/Salvage/Expeditions/Modifiers/SalvageDungeonMod.cs @@ -17,7 +17,7 @@ public sealed partial class SalvageDungeonModPrototype : IPrototype, IBiomeSpeci public float Cost { get; private set; } = 0f; /// <inheridoc/> - [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeModPrototype>))] + [DataField("biomes", customTypeSerializer: typeof(PrototypeIdListSerializer<SalvageBiomeMod>))] public List<string>? Biomes { get; private set; } = null; /// <summary> diff --git a/Content.Shared/Salvage/SalvageMapPrototype.cs b/Content.Shared/Salvage/SalvageMapPrototype.cs index 518b64dafa9..038636b20f2 100644 --- a/Content.Shared/Salvage/SalvageMapPrototype.cs +++ b/Content.Shared/Salvage/SalvageMapPrototype.cs @@ -1,3 +1,4 @@ +using Content.Shared.Salvage.Expeditions.Modifiers; using Robust.Shared.Prototypes; using Robust.Shared.Utility; diff --git a/Content.Shared/Salvage/SharedSalvageSystem.cs b/Content.Shared/Salvage/SharedSalvageSystem.cs index 63a6b874cb5..af032f8090b 100644 --- a/Content.Shared/Salvage/SharedSalvageSystem.cs +++ b/Content.Shared/Salvage/SharedSalvageSystem.cs @@ -102,7 +102,7 @@ public SalvageMission GetMission(SalvageMissionType config, DifficultyRating dif // - Atmos var biome = GetMod<SalvageBiomeMod>(rand, ref rating); var air = GetBiomeMod<SalvageAirMod>(biome.ID, rand, ref rating); - var dungeon = GetBiomeMod<SalvageDungeonMod>(biome.ID, rand, ref rating); + var dungeon = GetBiomeMod<SalvageDungeonModPrototype>(biome.ID, rand, ref rating); var factionProtos = _proto.EnumeratePrototypes<SalvageFactionPrototype>().ToList(); factionProtos.Sort((x, y) => string.Compare(x.ID, y.ID, StringComparison.Ordinal)); var faction = factionProtos[rand.Next(factionProtos.Count)]; diff --git a/Content.Shared/_NF/Clothing/Systems/EmitsSoundOnMoveSystem.cs b/Content.Shared/_NF/Clothing/Systems/EmitsSoundOnMoveSystem.cs index a84ef9ef99d..555805c83d2 100644 --- a/Content.Shared/_NF/Clothing/Systems/EmitsSoundOnMoveSystem.cs +++ b/Content.Shared/_NF/Clothing/Systems/EmitsSoundOnMoveSystem.cs @@ -6,6 +6,7 @@ using Content.Shared.Inventory.Events; using Content.Shared.Mobs.Components; using Content.Shared.Movement.Components; +using Robust.Shared.Audio.Systems; using Robust.Shared.Physics.Components; using Robust.Shared.Timing;