From 1b0e7ae0f5b49df23e718d1bde6cbcebd5cd8067 Mon Sep 17 00:00:00 2001 From: Leon Friedrich <60421075+ElectroJr@users.noreply.github.com> Date: Fri, 25 Mar 2022 17:17:29 +1300 Subject: [PATCH] Add Modular grenades (chemnades). (#7138) --- Content.Client/Entry/IgnoredComponents.cs | 4 +- .../EntitySystems/SolutionContainerSystem.cs | 4 +- .../Construction/Completions/AdminLog.cs | 32 ++++ .../Construction/Completions/PlaySound.cs | 15 +- .../Components/ActiveTimerTriggerComponent.cs | 29 ++++ .../Components/OnUseTimerTriggerComponent.cs | 31 +++- .../Components/SoundOnTriggerComponent.cs | 19 --- .../EntitySystems/TriggerSystem.OnUse.cs | 111 ++++++++++++-- .../Explosion/EntitySystems/TriggerSystem.cs | 90 +++++++---- .../Payload/EntitySystems/PayloadSystem.cs | 141 ++++++++++++++++++ .../Components/BaseEmitSoundComponent.cs | 7 +- .../Components/EmitSoundOnTriggerComponent.cs | 12 ++ Content.Server/Sound/EmitSoundSystem.cs | 25 ++-- Content.Shared.Database/LogType.cs | 2 + .../Components/ChemicalPayloadComponent.cs | 33 ++++ .../Components/PayloadCaseComponent.cs | 12 ++ .../Components/PayloadTriggerComponent.cs | 45 ++++++ .../EntitySystems/ChemicalPayloadSystem.cs | 53 +++++++ Content.Shared/Verbs/Verb.cs | 11 ++ Resources/Locale/en-US/verbs/verb-system.ftl | 1 + .../en-US/weapons/grenades/timer-trigger.ftl | 8 + .../Catalog/Research/technologies.yml | 2 + .../Objects/Devices/Electronics/triggers.yml | 27 ++++ .../Entities/Objects/Devices/payload.yml | 76 ++++++++++ .../Entities/Objects/Fun/bike_horn.yml | 6 + .../Entities/Objects/Specific/chemistry.yml | 43 ++++-- .../Weapons/Guns/Projectiles/projectiles.yml | 2 +- .../Objects/Weapons/Throwable/grenades.yml | 35 ++++- .../Entities/Objects/Weapons/security.yml | 2 +- .../Entities/Structures/Machines/lathe.yml | 3 + .../Graphs/weapons/modular_grenade.yml | 83 +++++++++++ .../Recipes/Construction/modular_grenades.yml | 12 ++ .../Recipes/Construction/weapons.yml | 2 +- .../Prototypes/Recipes/Lathes/devices.yml | 21 +++ Resources/Prototypes/tags.yml | 3 + .../Interface/VerbIcons/clock.svg.192dpi.png | Bin 0 -> 1681 bytes .../VerbIcons/clock.svg.192dpi.png.yml | 2 + .../Objects/Devices/payload.rsi/meta.json | 35 +++++ .../payload.rsi/payload-chemical-armed.png | Bin 0 -> 1935 bytes .../payload.rsi/payload-chemical-left.png | Bin 0 -> 302 bytes .../payload.rsi/payload-chemical-right.png | Bin 0 -> 1467 bytes .../Devices/payload.rsi/payload-empty.png | Bin 0 -> 289 bytes .../payload.rsi/payload-explosive-armed.png | Bin 0 -> 443 bytes .../Objects/Devices/timer.rsi/meta.json | 17 +++ .../Objects/Devices/timer.rsi/timer.png | Bin 0 -> 255 bytes .../Weapons/Grenades/modular.rsi/complete.png | Bin 0 -> 1136 bytes .../Weapons/Grenades/modular.rsi/empty.png | Bin 0 -> 1040 bytes .../Weapons/Grenades/modular.rsi/meta.json | 34 +++++ .../Grenades/modular.rsi/no-payload.png | Bin 0 -> 1134 bytes .../Weapons/Grenades/modular.rsi/primed.png | Bin 0 -> 393 bytes .../Weapons/Grenades/modular.rsi/wired.png | Bin 0 -> 1854 bytes 51 files changed, 994 insertions(+), 96 deletions(-) create mode 100644 Content.Server/Construction/Completions/AdminLog.cs create mode 100644 Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs delete mode 100644 Content.Server/Explosion/Components/SoundOnTriggerComponent.cs create mode 100644 Content.Server/Payload/EntitySystems/PayloadSystem.cs create mode 100644 Content.Server/Sound/Components/EmitSoundOnTriggerComponent.cs create mode 100644 Content.Shared/Payload/Components/ChemicalPayloadComponent.cs create mode 100644 Content.Shared/Payload/Components/PayloadCaseComponent.cs create mode 100644 Content.Shared/Payload/Components/PayloadTriggerComponent.cs create mode 100644 Content.Shared/Payload/EntitySystems/ChemicalPayloadSystem.cs create mode 100644 Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl create mode 100644 Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml create mode 100644 Resources/Prototypes/Entities/Objects/Devices/payload.yml create mode 100644 Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_grenade.yml create mode 100644 Resources/Prototypes/Recipes/Construction/modular_grenades.yml create mode 100644 Resources/Prototypes/Recipes/Lathes/devices.yml create mode 100644 Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png create mode 100644 Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png.yml create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/meta.json create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/payload-chemical-armed.png create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/payload-chemical-left.png create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/payload-chemical-right.png create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/payload-empty.png create mode 100644 Resources/Textures/Objects/Devices/payload.rsi/payload-explosive-armed.png create mode 100644 Resources/Textures/Objects/Devices/timer.rsi/meta.json create mode 100644 Resources/Textures/Objects/Devices/timer.rsi/timer.png create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/complete.png create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/empty.png create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/no-payload.png create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/primed.png create mode 100644 Resources/Textures/Objects/Weapons/Grenades/modular.rsi/wired.png diff --git a/Content.Client/Entry/IgnoredComponents.cs b/Content.Client/Entry/IgnoredComponents.cs index e067f012bd..fae7093a13 100644 --- a/Content.Client/Entry/IgnoredComponents.cs +++ b/Content.Client/Entry/IgnoredComponents.cs @@ -21,8 +21,9 @@ namespace Content.Client.Entry "WarpPoint", "EmitSoundOnUse", "EmitSoundOnLand", - "NameIdentifier", + "EmitSoundOnTrigger", "EmitSoundOnActivate", + "NameIdentifier", "HeatResistance", "EntityStorage", "MeleeWeapon", @@ -101,7 +102,6 @@ namespace Content.Client.Entry "SolarControlConsole", "Thruster", "FlashOnTrigger", - "SoundOnTrigger", "TriggerOnCollide", "DeleteOnTrigger", "EmptyOnMachineDeconstruct", diff --git a/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs index 5d90eb098d..788f7895dc 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionContainerSystem.cs @@ -90,7 +90,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem ("desc", Loc.GetString(proto.PhysicalDescription)))); } - private void UpdateAppearance(EntityUid uid, Solution solution, + public void UpdateAppearance(EntityUid uid, Solution solution, AppearanceComponent? appearanceComponent = null) { if (!EntityManager.EntityExists(uid) @@ -116,7 +116,7 @@ public sealed partial class SolutionContainerSystem : EntitySystem return splitSol; } - private void UpdateChemicals(EntityUid uid, Solution solutionHolder, bool needsReactionsProcessing = false) + public void UpdateChemicals(EntityUid uid, Solution solutionHolder, bool needsReactionsProcessing = false) { // Process reactions if (needsReactionsProcessing && solutionHolder.CanReact) diff --git a/Content.Server/Construction/Completions/AdminLog.cs b/Content.Server/Construction/Completions/AdminLog.cs new file mode 100644 index 0000000000..62ec29986d --- /dev/null +++ b/Content.Server/Construction/Completions/AdminLog.cs @@ -0,0 +1,32 @@ +using Content.Server.Administration.Logs; +using Content.Shared.Construction; +using Content.Shared.Database; +using JetBrains.Annotations; + +namespace Content.Server.Construction.Completions; + +/// +/// Generate an admin log upon reaching this node. Useful for dangerous construction (e.g., modular grenades) +/// +[UsedImplicitly] +public sealed class AdminLog : IGraphAction +{ + [DataField("logType", required: true)] + public LogType LogType = LogType.Construction; + + [DataField("impact")] + public LogImpact Impact = LogImpact.Medium; + + [DataField("message", required: true)] + public string Message = string.Empty; + + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) + { + var logSys = entityManager.EntitySysManager.GetEntitySystem(); + + if (userUid.HasValue) + logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}, User: {entityManager.ToPrettyString(userUid.Value):user}"); + else + logSys.Add(LogType, Impact, $"{Message} - Entity: {entityManager.ToPrettyString(uid):entity}"); + } +} diff --git a/Content.Server/Construction/Completions/PlaySound.cs b/Content.Server/Construction/Completions/PlaySound.cs index 955da59ee9..5cadaf0d88 100644 --- a/Content.Server/Construction/Completions/PlaySound.cs +++ b/Content.Server/Construction/Completions/PlaySound.cs @@ -1,12 +1,9 @@ -using System.Threading.Tasks; -using Content.Shared.Audio; using Content.Shared.Construction; using Content.Shared.Sound; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; +using Robust.Shared.Random; namespace Content.Server.Construction.Completions { @@ -16,9 +13,17 @@ namespace Content.Server.Construction.Completions { [DataField("sound", required: true)] public SoundSpecifier Sound { get; private set; } = default!; + [DataField("AudioParams")] + public AudioParams AudioParams = AudioParams.Default; + + [ViewVariables(VVAccess.ReadWrite)] + [DataField("variation")] + public float Variation = 0.125f; + public void PerformAction(EntityUid uid, EntityUid? userUid, IEntityManager entityManager) { - SoundSystem.Play(Filter.Pvs(uid), Sound.GetSound(), uid, AudioHelpers.WithVariation(0.125f)); + var scale = (float) IoCManager.Resolve().NextGaussian(1, Variation); + SoundSystem.Play(Filter.Pvs(uid, entityManager: entityManager), Sound.GetSound(), uid, AudioParams.WithPitchScale(scale)); } } } diff --git a/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs b/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs new file mode 100644 index 0000000000..118a579b6d --- /dev/null +++ b/Content.Server/Explosion/Components/ActiveTimerTriggerComponent.cs @@ -0,0 +1,29 @@ +using Content.Shared.Sound; +using Robust.Shared.Audio; + +namespace Content.Server.Explosion.Components; + +/// +/// Component for tracking active trigger timers. A timers can activated by some other component, e.g. . +/// +[RegisterComponent] +public sealed class ActiveTimerTriggerComponent : Component +{ + [DataField("timeRemaining")] + public float TimeRemaining; + + [DataField("user")] + public EntityUid? User; + + [DataField("beepInterval")] + public float BeepInterval; + + [DataField("timeUntilBeep")] + public float TimeUntilBeep; + + [DataField("beepSound")] + public SoundSpecifier? BeepSound; + + [DataField("beepParams")] + public AudioParams BeepParams = AudioParams.Default; +} diff --git a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs index fdc928e91d..a76c876421 100644 --- a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs +++ b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs @@ -1,11 +1,36 @@ -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization.Manager.Attributes; +using Content.Shared.Sound; +using Robust.Shared.Audio; namespace Content.Server.Explosion.Components { [RegisterComponent] public sealed class OnUseTimerTriggerComponent : Component { - [DataField("delay")] public float Delay = 0f; + [DataField("delay")] + public float Delay = 1f; + + /// + /// If not null, a user can use verbs to configure the delay to one of these options. + /// + [DataField("delayOptions")] + public List? DelayOptions = null; + + /// + /// If not null, this timer will periodically play this sound wile active. + /// + [DataField("beepSound")] + public SoundSpecifier? BeepSound; + + /// + /// Time before beeping starts. Defaults to a single beep interval. If set to zero, will emit a beep immediately after use. + /// + [DataField("initialBeepDelay")] + public float? InitialBeepDelay; + + [DataField("beepInterval")] + public float BeepInterval = 1; + + [DataField("beepParams")] + public AudioParams BeepParams = AudioParams.Default.WithVolume(-2f); } } diff --git a/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs b/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs deleted file mode 100644 index 6d898239e1..0000000000 --- a/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs +++ /dev/null @@ -1,19 +0,0 @@ -using Content.Server.Explosion.EntitySystems; -using Content.Shared.Sound; -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; - -namespace Content.Server.Explosion.Components -{ - /// - /// Whenever a is run play a sound in PVS range. - /// - [RegisterComponent] - public sealed class SoundOnTriggerComponent : Component - { - [ViewVariables(VVAccess.ReadWrite)] - [DataField("sound")] - public SoundSpecifier? Sound { get; set; } - } -} diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs index 3ea15d04a6..38389f856c 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.OnUse.cs @@ -1,32 +1,119 @@ -using System; using Content.Server.Explosion.Components; +using Content.Shared.Examine; +using Content.Shared.Popups; using Content.Shared.Interaction.Events; -using Content.Shared.Trigger; -using Robust.Shared.GameObjects; +using Content.Shared.Verbs; +using Robust.Shared.Player; namespace Content.Server.Explosion.EntitySystems; public sealed partial class TriggerSystem { + [Dependency] private readonly SharedPopupSystem _popupSystem = default!; + private void InitializeOnUse() { SubscribeLocalEvent(OnTimerUse); + SubscribeLocalEvent(OnExamined); + SubscribeLocalEvent>(OnGetAltVerbs); + } + + private void OnExamined(EntityUid uid, OnUseTimerTriggerComponent component, ExaminedEvent args) + { + if (args.IsInDetailsRange) + args.PushText(Loc.GetString("examine-trigger-timer", ("time", component.Delay))); + } + + /// + /// Add an alt-click interaction that cycles through delays. + /// + private void OnGetAltVerbs(EntityUid uid, OnUseTimerTriggerComponent component, GetVerbsEvent args) + { + if (!args.CanInteract || !args.CanAccess) + return; + + if (component.DelayOptions == null || component.DelayOptions.Count == 1) + return; + + args.Verbs.Add(new AlternativeVerb() + { + Category = TimerOptions, + Text = Loc.GetString("verb-trigger-timer-cycle"), + Act = () => CycleDelay(component, args.User), + Priority = 1 + }); + + foreach (var option in component.DelayOptions) + { + if (MathHelper.CloseTo(option, component.Delay)) + { + args.Verbs.Add(new AlternativeVerb() + { + Category = TimerOptions, + Text = Loc.GetString("verb-trigger-timer-set-current", ("time", option)), + Disabled = true, + Priority = (int) (-100 * option) + }); + continue; + } + + args.Verbs.Add(new AlternativeVerb() + { + Category = TimerOptions, + Text = Loc.GetString("verb-trigger-timer-set", ("time", option)), + Priority = (int) (-100 * option), + + Act = () => + { + component.Delay = option; + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), args.User, Filter.Entities(args.User)); + }, + }); + } + } + + private void CycleDelay(OnUseTimerTriggerComponent component, EntityUid user) + { + if (component.DelayOptions == null || component.DelayOptions.Count == 1) + return; + + // This is somewhat inefficient, but its good enough. This is run rarely, and the lists should be short. + + component.DelayOptions.Sort(); + + if (component.DelayOptions[^1] <= component.Delay) + { + component.Delay = component.DelayOptions[0]; + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", component.Delay)), user, Filter.Entities(user)); + return; + } + + foreach (var option in component.DelayOptions) + { + if (option > component.Delay) + { + component.Delay = option; + _popupSystem.PopupEntity(Loc.GetString("popup-trigger-timer-set", ("time", option)), user, Filter.Entities(user)); + return; + } + } } private void OnTimerUse(EntityUid uid, OnUseTimerTriggerComponent component, UseInHandEvent args) { if (args.Handled) return; - Trigger(uid, args.User, component); + HandleTimerTrigger( + uid, + args.User, + component.Delay, + component.BeepInterval, + component.InitialBeepDelay, + component.BeepSound, + component.BeepParams); + args.Handled = true; } - // TODO: Need to split this out so it's a generic "OnUseTimerTrigger" component. - private void Trigger(EntityUid uid, EntityUid user, OnUseTimerTriggerComponent component) - { - if (TryComp(uid, out var appearance)) - appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Primed); - - HandleTimerTrigger(TimeSpan.FromSeconds(component.Delay), uid, user); - } + public static VerbCategory TimerOptions = new("verb-categories-timer", "/Textures/Interface/VerbIcons/clock.svg.192dpi.png"); } diff --git a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs index b6ead70656..ffa72a0039 100644 --- a/Content.Server/Explosion/EntitySystems/TriggerSystem.cs +++ b/Content.Server/Explosion/EntitySystems/TriggerSystem.cs @@ -1,27 +1,17 @@ -using System; using Content.Server.Administration.Logs; -using Content.Server.Doors; using Content.Server.Doors.Components; using Content.Server.Doors.Systems; using Content.Server.Explosion.Components; using Content.Server.Flash; using Content.Server.Flash.Components; -using Content.Shared.Audio; -using Content.Shared.Doors; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; -using Robust.Shared.IoC; using Robust.Shared.Physics; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; -using Robust.Shared.Timing; -using System.Threading; -using Content.Server.Construction.Components; +using Content.Shared.Sound; using Content.Shared.Trigger; -using Timer = Robust.Shared.Timing.Timer; -using Content.Shared.Physics; -using System.Collections.Generic; +using Content.Shared.Database; namespace Content.Server.Explosion.EntitySystems { @@ -48,6 +38,7 @@ namespace Content.Server.Explosion.EntitySystems [Dependency] private readonly FlashSystem _flashSystem = default!; [Dependency] private readonly DoorSystem _sharedDoorSystem = default!; [Dependency] private readonly SharedBroadphaseSystem _broadphase = default!; + [Dependency] private readonly AdminLogSystem _logSystem = default!; public override void Initialize() { @@ -59,7 +50,6 @@ namespace Content.Server.Explosion.EntitySystems SubscribeLocalEvent(OnTriggerCollide); SubscribeLocalEvent(HandleDeleteTrigger); - SubscribeLocalEvent(HandleSoundTrigger); SubscribeLocalEvent(HandleExplodeTrigger); SubscribeLocalEvent(HandleFlashTrigger); SubscribeLocalEvent(HandleDoorTrigger); @@ -100,12 +90,6 @@ namespace Content.Server.Explosion.EntitySystems } #endregion - private void HandleSoundTrigger(EntityUid uid, SoundOnTriggerComponent component, TriggerEvent args) - { - if (component.Sound == null) return; - SoundSystem.Play(Filter.Pvs(component.Owner), component.Sound.GetSound(), uid); - } - private void HandleDeleteTrigger(EntityUid uid, DeleteOnTriggerComponent component, TriggerEvent args) { EntityManager.QueueDeleteEntity(uid); @@ -128,19 +112,39 @@ namespace Content.Server.Explosion.EntitySystems EntityManager.EventBus.RaiseLocalEvent(trigger, triggerEvent); } - public void HandleTimerTrigger(TimeSpan delay, EntityUid triggered, EntityUid? user = null) + public void HandleTimerTrigger(EntityUid uid, EntityUid? user, float delay , float beepInterval, float? initialBeepDelay, SoundSpecifier? beepSound, AudioParams beepParams) { - if (delay.TotalSeconds <= 0) + if (delay <= 0) { - Trigger(triggered, user); + RemComp(uid); + Trigger(uid, user); return; } - Timer.Spawn(delay, () => + if (HasComp(uid)) + return; + + if (user != null) { - if (Deleted(triggered)) return; - Trigger(triggered, user); - }); + _logSystem.Add(LogType.Trigger, + $"{ToPrettyString(user.Value):user} started a {delay} second timer trigger on entity {ToPrettyString(uid):timer}"); + } + else + { + _logSystem.Add(LogType.Trigger, + $"{delay} second timer trigger started on entity {ToPrettyString(uid):timer}"); + } + + var active = AddComp(uid); + active.TimeRemaining = delay; + active.User = user; + active.BeepParams = beepParams; + active.BeepSound = beepSound; + active.BeepInterval = beepInterval; + active.TimeUntilBeep = initialBeepDelay == null ? active.BeepInterval : initialBeepDelay.Value; + + if (TryComp(uid, out var appearance)) + appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Primed); } public override void Update(float frameTime) @@ -148,6 +152,40 @@ namespace Content.Server.Explosion.EntitySystems base.Update(frameTime); UpdateProximity(frameTime); + UpdateTimer(frameTime); + } + + private void UpdateTimer(float frameTime) + { + HashSet toRemove = new(); + foreach (var timer in EntityQuery()) + { + timer.TimeRemaining -= frameTime; + timer.TimeUntilBeep -= frameTime; + + if (timer.TimeRemaining <= 0) + { + Trigger(timer.Owner, timer.User); + toRemove.Add(timer.Owner); + continue; + } + + if (timer.BeepSound == null || timer.TimeUntilBeep > 0) + continue; + + timer.TimeUntilBeep += timer.BeepInterval; + var filter = Filter.Pvs(timer.Owner, entityManager: EntityManager); + SoundSystem.Play(filter, timer.BeepSound.GetSound(), timer.Owner, timer.BeepParams); + } + + foreach (var uid in toRemove) + { + RemComp(uid); + + // In case this is a re-usable grenade, un-prime it. + if (TryComp(uid, out var appearance)) + appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Unprimed); + } } } } diff --git a/Content.Server/Payload/EntitySystems/PayloadSystem.cs b/Content.Server/Payload/EntitySystems/PayloadSystem.cs new file mode 100644 index 0000000000..ea45580868 --- /dev/null +++ b/Content.Server/Payload/EntitySystems/PayloadSystem.cs @@ -0,0 +1,141 @@ +using Content.Server.Administration.Logs; +using Content.Server.Chemistry.EntitySystems; +using Content.Server.Explosion.EntitySystems; +using Content.Shared.Chemistry.Components; +using Content.Shared.Chemistry.Reaction; +using Content.Shared.Database; +using Content.Shared.Payload.Components; +using Content.Shared.Tag; +using Robust.Shared.Containers; +using Robust.Shared.Serialization.Manager; +using Robust.Shared.Utility; + +namespace Content.Server.Payload.EntitySystems; + +public sealed class PayloadSystem : EntitySystem +{ + [Dependency] private readonly TagSystem _tagSystem = default!; + [Dependency] private readonly SolutionContainerSystem _solutionSystem = default!; + [Dependency] private readonly SharedChemicalReactionSystem _chemistrySystem = default!; + [Dependency] private readonly AdminLogSystem _logSystem = default!; + [Dependency] private readonly IComponentFactory _componentFactory = default!; + [Dependency] private readonly ISerializationManager _serializationManager = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnCaseTriggered); + SubscribeLocalEvent(OnTriggerTriggered); + SubscribeLocalEvent(OnEntityInserted); + SubscribeLocalEvent(OnEntityRemoved); + SubscribeLocalEvent(HandleChemicalPayloadTrigger); + } + + private void OnCaseTriggered(EntityUid uid, PayloadCaseComponent component, TriggerEvent args) + { + if (!TryComp(uid, out ContainerManagerComponent? contMan)) + return; + + // Pass trigger event onto all contained payloads. Payload capacity configurable by construction graphs. + foreach (var container in contMan.Containers.Values) + { + foreach (var entity in container.ContainedEntities) + { + if (_tagSystem.HasTag(entity, "Payload")) + RaiseLocalEvent(entity, args, false); + } + } + } + + private void OnTriggerTriggered(EntityUid uid, PayloadTriggerComponent component, TriggerEvent args) + { + if (!component.Active) + return; + + if (Transform(uid).ParentUid is not { Valid: true } parent) + return; + + // Ensure we don't enter a trigger-loop + DebugTools.Assert(!_tagSystem.HasTag(uid, "Payload")); + + RaiseLocalEvent(parent, args, false); + } + + private void OnEntityInserted(EntityUid uid, PayloadCaseComponent _, EntInsertedIntoContainerMessage args) + { + if (!TryComp(args.Entity, out PayloadTriggerComponent? trigger)) + return; + + trigger.Active = true; + + if (trigger.Components == null) + return; + + // ANY payload trigger that gets inserted can grant components. It is up to the construction graphs to determine trigger capacity. + foreach (var (name, data) in trigger.Components) + { + if (!_componentFactory.TryGetRegistration(name, out var registration)) + continue; + + if (HasComp(uid, registration.Type)) + continue; + + if (_componentFactory.GetComponent(registration.Type) is not Component component) + continue; + + component.Owner = uid; + + if (_serializationManager.Copy(data, component, null) is Component copied) + EntityManager.AddComponent(uid, copied); + + trigger.GrantedComponents.Add(registration.Type); + } + } + + private void OnEntityRemoved(EntityUid uid, PayloadCaseComponent component, EntRemovedFromContainerMessage args) + { + if (!TryComp(args.Entity, out PayloadTriggerComponent? trigger)) + return; + + trigger.Active = false; + + foreach (var type in trigger.GrantedComponents) + { + EntityManager.RemoveComponent(uid, type); + } + + trigger.GrantedComponents.Clear(); + } + + private void HandleChemicalPayloadTrigger(EntityUid uid, ChemicalPayloadComponent component, TriggerEvent args) + { + if (component.BeakerSlotA.Item is not EntityUid beakerA + || component.BeakerSlotB.Item is not EntityUid beakerB + || !TryComp(beakerA, out FitsInDispenserComponent? compA) + || !TryComp(beakerB, out FitsInDispenserComponent? compB) + || !_solutionSystem.TryGetSolution(beakerA, compA.Solution, out var solutionA) + || !_solutionSystem.TryGetSolution(beakerB, compB.Solution, out var solutionB) + || solutionA.TotalVolume == 0 + || solutionB.TotalVolume == 0) + { + return; + } + + var solStringA = SolutionContainerSystem.ToPrettyString(solutionA); + var solStringB = SolutionContainerSystem.ToPrettyString(solutionB); + + _logSystem.Add(LogType.ChemicalReaction, + $"Chemical bomb payload {ToPrettyString(uid):payload} at {Transform(uid).MapPosition:location} is combining two solutions: {solStringA:solutionA} and {solStringB:solutionB}"); + + solutionA.MaxVolume += solutionB.MaxVolume; + _solutionSystem.TryAddSolution(beakerA, solutionA, solutionB); + solutionB.RemoveAllSolution(); + + // The grenade might be a dud. Redistribute solution: + var tmpSol = _solutionSystem.SplitSolution(beakerA, solutionA, solutionA.CurrentVolume * solutionB.MaxVolume / solutionA.MaxVolume); + _solutionSystem.TryAddSolution(beakerB, solutionB, tmpSol); + solutionA.MaxVolume -= solutionB.MaxVolume; + _solutionSystem.UpdateChemicals(beakerA, solutionA, false); + } +} diff --git a/Content.Server/Sound/Components/BaseEmitSoundComponent.cs b/Content.Server/Sound/Components/BaseEmitSoundComponent.cs index ec2e85800c..bbbc6196bd 100644 --- a/Content.Server/Sound/Components/BaseEmitSoundComponent.cs +++ b/Content.Server/Sound/Components/BaseEmitSoundComponent.cs @@ -1,7 +1,5 @@ using Content.Shared.Sound; -using Robust.Shared.GameObjects; -using Robust.Shared.Serialization.Manager.Attributes; -using Robust.Shared.ViewVariables; +using Robust.Shared.Audio; namespace Content.Server.Sound.Components { @@ -15,6 +13,9 @@ namespace Content.Server.Sound.Components [DataField("sound", required: true)] public SoundSpecifier Sound { get; set; } = default!; + [DataField("audioParams")] + public AudioParams AudioParams = AudioParams.Default.WithVolume(-2f); + [ViewVariables(VVAccess.ReadWrite)] [DataField("variation")] public float PitchVariation { get; set; } = 0.0f; diff --git a/Content.Server/Sound/Components/EmitSoundOnTriggerComponent.cs b/Content.Server/Sound/Components/EmitSoundOnTriggerComponent.cs new file mode 100644 index 0000000000..7824e51915 --- /dev/null +++ b/Content.Server/Sound/Components/EmitSoundOnTriggerComponent.cs @@ -0,0 +1,12 @@ +using Content.Server.Explosion.EntitySystems; + +namespace Content.Server.Sound.Components +{ + /// + /// Whenever a is run play a sound in PVS range. + /// + [RegisterComponent] + public sealed class EmitSoundOnTriggerComponent : BaseEmitSoundComponent + { + } +} diff --git a/Content.Server/Sound/EmitSoundSystem.cs b/Content.Server/Sound/EmitSoundSystem.cs index 11d6f37af7..24cf39cfa8 100644 --- a/Content.Server/Sound/EmitSoundSystem.cs +++ b/Content.Server/Sound/EmitSoundSystem.cs @@ -1,14 +1,14 @@ +using Content.Server.Explosion.EntitySystems; using Content.Server.Interaction.Components; using Content.Server.Sound.Components; using Content.Server.Throwing; -using Content.Shared.Audio; using Content.Shared.Interaction; using Content.Shared.Interaction.Events; using Content.Shared.Throwing; using JetBrains.Annotations; using Robust.Shared.Audio; -using Robust.Shared.GameObjects; using Robust.Shared.Player; +using Robust.Shared.Random; namespace Content.Server.Sound { @@ -18,6 +18,8 @@ namespace Content.Server.Sound [UsedImplicitly] public sealed class EmitSoundSystem : EntitySystem { + [Dependency] private readonly IRobustRandom _random = default!; + /// public override void Initialize() { @@ -26,6 +28,12 @@ namespace Content.Server.Sound SubscribeLocalEvent(HandleEmitSoundOnUseInHand); SubscribeLocalEvent(HandleEmitSoundOnThrown); SubscribeLocalEvent(HandleEmitSoundOnActivateInWorld); + SubscribeLocalEvent(HandleEmitSoundOnTrigger); + } + + private void HandleEmitSoundOnTrigger(EntityUid uid, EmitSoundOnTriggerComponent component, TriggerEvent args) + { + TryEmitSound(component); } private void HandleEmitSoundOnLand(EntityUid eUI, BaseEmitSoundComponent component, LandEvent arg) @@ -35,9 +43,7 @@ namespace Content.Server.Sound private void HandleEmitSoundOnUseInHand(EntityUid eUI, BaseEmitSoundComponent component, UseInHandEvent arg) { - if (arg.Handled) return; - - arg.Handled = true; + // Intentionally not handling interaction. This component is an easy way to add sounds in addition to other behavior. TryEmitSound(component); } @@ -48,15 +54,14 @@ namespace Content.Server.Sound private void HandleEmitSoundOnActivateInWorld(EntityUid eUI, BaseEmitSoundComponent component, ActivateInWorldEvent arg) { - if (arg.Handled) return; - - arg.Handled = true; + // Intentionally not handling interaction. This component is an easy way to add sounds in addition to other behavior. TryEmitSound(component); } - private static void TryEmitSound(BaseEmitSoundComponent component) + private void TryEmitSound(BaseEmitSoundComponent component) { - SoundSystem.Play(Filter.Pvs(component.Owner), component.Sound.GetSound(), component.Owner, AudioHelpers.WithVariation(component.PitchVariation).WithVolume(-2f)); + var audioParams = component.AudioParams.WithPitchScale((float) _random.NextGaussian(1, component.PitchVariation)); + SoundSystem.Play(Filter.Pvs(component.Owner, entityManager: EntityManager), component.Sound.GetSound(), component.Owner, audioParams); } } } diff --git a/Content.Shared.Database/LogType.cs b/Content.Shared.Database/LogType.cs index 5419d28e2a..eb8b55600a 100644 --- a/Content.Shared.Database/LogType.cs +++ b/Content.Shared.Database/LogType.cs @@ -65,6 +65,8 @@ public enum LogType Chat = 61, Action = 62, RCD = 63, + Construction = 64, + Trigger = 65, // haha so funny Emag = 69, } diff --git a/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs b/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs new file mode 100644 index 0000000000..99d0356aaa --- /dev/null +++ b/Content.Shared/Payload/Components/ChemicalPayloadComponent.cs @@ -0,0 +1,33 @@ +using Content.Shared.Containers.ItemSlots; +using Robust.Shared.Serialization; + +namespace Content.Shared.Payload.Components; + +/// +/// Chemical payload that mixes the solutions of two drain-able solution containers when triggered. +/// +[RegisterComponent] +public sealed class ChemicalPayloadComponent : Component +{ + [DataField("beakerSlotA", required: true)] + public ItemSlot BeakerSlotA = new(); + + [DataField("beakerSlotB", required: true)] + public ItemSlot BeakerSlotB = new(); +} + +[Serializable, NetSerializable] +public enum ChemicalPayloadVisuals : byte +{ + Slots +} + +[Flags] +[Serializable, NetSerializable] +public enum ChemicalPayloadFilledSlots : byte +{ + None = 0, + Left = 1 << 0, + Right = 1 << 1, + Both = Left | Right, +} diff --git a/Content.Shared/Payload/Components/PayloadCaseComponent.cs b/Content.Shared/Payload/Components/PayloadCaseComponent.cs new file mode 100644 index 0000000000..a942dbb01b --- /dev/null +++ b/Content.Shared/Payload/Components/PayloadCaseComponent.cs @@ -0,0 +1,12 @@ +namespace Content.Shared.Payload.Components; + +/// +/// Component that enables payloads and payload triggers to function. +/// +/// +/// If an entity with a is installed into a an entity with a , the trigger will grant components to the case-entity. If the case entity is +/// triggered, it will forward the trigger onto any contained payload entity. +/// +[RegisterComponent] +public sealed class PayloadCaseComponent : Component { } diff --git a/Content.Shared/Payload/Components/PayloadTriggerComponent.cs b/Content.Shared/Payload/Components/PayloadTriggerComponent.cs new file mode 100644 index 0000000000..c0dfb4db2a --- /dev/null +++ b/Content.Shared/Payload/Components/PayloadTriggerComponent.cs @@ -0,0 +1,45 @@ +using Robust.Shared.GameStates; +using Robust.Shared.Prototypes; + +namespace Content.Shared.Payload.Components; + +/// +/// Component for providing the means of triggering an explosive payload. Used in grenade construction. +/// +/// +/// This component performs two functions. Firstly, it will add or remove other components to some entity when this +/// item is installed inside of it. This is intended for use with constructible grenades. For example, this allows +/// you to add things like , or . +/// This is required because otherwise you would have to forward arbitrary interaction directed at the casing +/// through to the trigger, which would be quite complicated. Also proximity triggers don't really work inside of +/// containers. +/// +/// Secondly, if the entity that this component is attached to is ever triggered directly (e.g., via a device +/// network message), the trigger will be forwarded to the device that this entity is installed in (if any). +/// +[RegisterComponent, NetworkedComponent] +public sealed class PayloadTriggerComponent : Component +{ + /// + /// If true, triggering this entity will also cause the parent of this entity to be triggered. + /// + public bool Active = false; + + /// + /// List of components to add or remove from an entity when this trigger is (un)installed. + /// + [DataField("components", serverOnly:true, readOnly: true)] + public readonly EntityPrototype.ComponentRegistry? Components = null; + + /// + /// Keeps track of what components this trigger has granted to the payload case. + /// + /// + /// This is required in case someone creates a construction graph that accepts more than one trigger, and those + /// trigger grant the same type of component (or the case just innately has that component). This list is used + /// when removing the component, to ensure that removal of this trigger only removes the components that it was + /// responsible for adding. + /// + [DataField("grantedComponents", serverOnly: true)] + public readonly HashSet GrantedComponents = new(); +} diff --git a/Content.Shared/Payload/EntitySystems/ChemicalPayloadSystem.cs b/Content.Shared/Payload/EntitySystems/ChemicalPayloadSystem.cs new file mode 100644 index 0000000000..71670b2d04 --- /dev/null +++ b/Content.Shared/Payload/EntitySystems/ChemicalPayloadSystem.cs @@ -0,0 +1,53 @@ +using Content.Shared.Containers.ItemSlots; +using Content.Shared.Payload.Components; +using Robust.Shared.Containers; + +namespace Content.Shared.Payload.EntitySystems; + +public sealed class ChemicalPayloadSystem : EntitySystem +{ + [Dependency] private readonly ItemSlotsSystem _itemSlotsSystem = default!; + + public override void Initialize() + { + base.Initialize(); + + SubscribeLocalEvent(OnComponentInit); + SubscribeLocalEvent(OnComponentRemove); + SubscribeLocalEvent(OnContainerModified); + SubscribeLocalEvent(OnContainerModified); + } + + private void OnContainerModified(EntityUid uid, ChemicalPayloadComponent component, ContainerModifiedMessage args) + { + UpdateAppearance(uid, component); + } + + private void UpdateAppearance(EntityUid uid, ChemicalPayloadComponent? component = null, AppearanceComponent? appearance = null) + { + if (!Resolve(uid, ref component, ref appearance, false)) + return; + + var filled = ChemicalPayloadFilledSlots.None; + + if (component.BeakerSlotA.HasItem) + filled |= ChemicalPayloadFilledSlots.Left; + + if (component.BeakerSlotB.HasItem) + filled |= ChemicalPayloadFilledSlots.Right; + + appearance.SetData(ChemicalPayloadVisuals.Slots, filled); + } + + private void OnComponentInit(EntityUid uid, ChemicalPayloadComponent payload, ComponentInit args) + { + _itemSlotsSystem.AddItemSlot(uid, "BeakerSlotA", payload.BeakerSlotA); + _itemSlotsSystem.AddItemSlot(uid, "BeakerSlotB", payload.BeakerSlotB); + } + + private void OnComponentRemove(EntityUid uid, ChemicalPayloadComponent payload, ComponentRemove args) + { + _itemSlotsSystem.RemoveItemSlot(uid, payload.BeakerSlotA); + _itemSlotsSystem.RemoveItemSlot(uid, payload.BeakerSlotB); + } +} diff --git a/Content.Shared/Verbs/Verb.cs b/Content.Shared/Verbs/Verb.cs index 4ad9f3e867..0c585cb079 100644 --- a/Content.Shared/Verbs/Verb.cs +++ b/Content.Shared/Verbs/Verb.cs @@ -190,6 +190,17 @@ namespace Content.Shared.Verbs return string.Compare(Text, otherVerb.Text, StringComparison.CurrentCulture); } + if (IconEntity != otherVerb.IconEntity) + { + if (IconEntity == null) + return -1; + + if (otherVerb.IconEntity == null) + return 1; + + return IconEntity.Value.CompareTo(otherVerb.IconEntity.Value); + } + // Finally, compare icon texture paths. Note that this matters for verbs that don't have any text (e.g., the rotate-verbs) return string.Compare(IconTexture, otherVerb.IconTexture, StringComparison.CurrentCulture); } diff --git a/Resources/Locale/en-US/verbs/verb-system.ftl b/Resources/Locale/en-US/verbs/verb-system.ftl index 622813050d..f988b8561b 100644 --- a/Resources/Locale/en-US/verbs/verb-system.ftl +++ b/Resources/Locale/en-US/verbs/verb-system.ftl @@ -20,6 +20,7 @@ verb-categories-rotate = Rotate verb-categories-transfer = Set Transfer Amount verb-categories-split = Split verb-categories-set-sensor = Sensor +verb-categories-timer = Set Delay verb-common-toggle-light = Toggle light verb-common-close = Close diff --git a/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl b/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl new file mode 100644 index 0000000000..70167b39d7 --- /dev/null +++ b/Resources/Locale/en-US/weapons/grenades/timer-trigger.ftl @@ -0,0 +1,8 @@ + +verb-trigger-timer-set = {$time} Seconds +verb-trigger-timer-set-current = {$time} Seconds (current) +verb-trigger-timer-cycle = Cycle Time Delay + +examine-trigger-timer = The timer is set to {$time} seconds. + +popup-trigger-timer-set = Timer set to {$time} seconds. \ No newline at end of file diff --git a/Resources/Prototypes/Catalog/Research/technologies.yml b/Resources/Prototypes/Catalog/Research/technologies.yml index 61813e15ac..15657e8758 100644 --- a/Resources/Prototypes/Catalog/Research/technologies.yml +++ b/Resources/Prototypes/Catalog/Research/technologies.yml @@ -98,6 +98,8 @@ - Syringe - ReagentGrinderMachineCircuitboard - PillCanister + - TimerTrigger + - ChemicalPayload - type: technology name: "medical machinery" diff --git a/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml b/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml new file mode 100644 index 0000000000..8189e1c1c0 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Devices/Electronics/triggers.yml @@ -0,0 +1,27 @@ +# Misc electronic trigger devices. +# TODO: +# - proximity +# - voice +# - machine linking +# - device network +# - biometric/health (maybe just via device nets?) +# - booby-trap / on-storage-open + +- type: entity + parent: BaseItem + id: TimerTrigger + name: timer trigger + description: A configurable timer. + components: + - type: Sprite + sprite: Objects/Devices/timer.rsi + state: timer + - type: Item + size: 5 + - type: PayloadTrigger + components: + - type: OnUseTimerTrigger + delay: 5 + delayOptions: [3, 5, 10, 15, 30] + initialBeepDelay: 0 + beepSound: /Audio/Machines/Nuke/general_beep.ogg diff --git a/Resources/Prototypes/Entities/Objects/Devices/payload.yml b/Resources/Prototypes/Entities/Objects/Devices/payload.yml new file mode 100644 index 0000000000..0ab0a37a64 --- /dev/null +++ b/Resources/Prototypes/Entities/Objects/Devices/payload.yml @@ -0,0 +1,76 @@ +- type: entity + parent: BaseItem + abstract: true + id: BasePayload + components: + - type: Appearance + - type: Sprite + netsync: false + - type: Tag + tags: + - Payload + - type: Damageable + damageContainer: Inorganic + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + +- type: entity + name: explosive payload + parent: BasePayload + id: ExplosivePayload + components: + - type: Sprite + sprite: Objects/Devices/payload.rsi + state: payload-explosive-armed + - type: Explosive + devastationRange: 0 + heavyImpactRange: 2 + lightImpactRange: 4 + flashRange: 7 + - type: ExplodeOnTrigger + - type: Destructible + thresholds: + - trigger: + !type:DamageTypeTrigger + damageType: Heat + damage: 25 + behaviors: + - !type:ExplodeBehavior + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + +- type: entity + name: chemical payload + parent: BasePayload + id: ChemicalPayload + description: A chemical payload. Has space to store two beakers. In combination with a trigger and a case, this can be used to initiate chemical reactions. + components: + - type: Sprite + sprite: Objects/Devices/payload.rsi + state: payload-empty + - type: ChemicalPayload + beakerSlotA: &slotDef + whitelist: + components: + - FitsInDispenser + swap: false + beakerSlotB: *slotDef + - type: Appearance + visuals: + - type: GenericEnumVisualizer + key: enum.ChemicalPayloadVisuals.Slots + states: + enum.ChemicalPayloadFilledSlots.None: payload-empty + enum.ChemicalPayloadFilledSlots.Left: payload-chemical-left + enum.ChemicalPayloadFilledSlots.Right: payload-chemical-right + enum.ChemicalPayloadFilledSlots.Both: payload-chemical-armed diff --git a/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml b/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml index 18ba3aedd8..bbbb3f775e 100644 --- a/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml +++ b/Resources/Prototypes/Entities/Objects/Fun/bike_horn.yml @@ -19,3 +19,9 @@ variation: 0.125 - type: UseDelay delay: 0.5 + - type: EmitSoundOnTrigger + sound: + collection: BikeHorn + - type: Tag + tags: + - Payload # yes, you can make re-usable prank grenades diff --git a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml index 71ef40058e..25bc998c3d 100644 --- a/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml +++ b/Resources/Prototypes/Entities/Objects/Specific/chemistry.yml @@ -1,8 +1,6 @@ - type: entity - name: beaker parent: BaseItem - description: Used to contain a moderate amount of chemicals and solutions. - id: Beaker + id: BaseBeaker components: - type: Tag tags: @@ -39,8 +37,6 @@ interfaces: - key: enum.TransferAmountUiKey.Key type: TransferAmountBoundUserInterface - - type: Spillable - solution: beaker - type: Drink isOpen: true - type: Appearance @@ -60,7 +56,8 @@ - !type:PlaySoundBehavior sound: collection: GlassBreak - - !type:SpillBehavior { } + - !type:SpillBehavior + solution: beaker - !type:SpawnEntitiesBehavior spawn: ShardGlass: @@ -82,12 +79,23 @@ types: Blunt: 5 +- type: entity + name: beaker + parent: BaseBeaker + description: Used to contain a moderate amount of chemicals and solutions. + id: Beaker + components: + - type: Spillable + solution: beaker + - type: entity name: large beaker - parent: Beaker + parent: BaseBeaker description: Used to contain a large amount of chemicals or solutions. id: LargeBeaker components: + - type: Spillable + solution: beaker - type: Sprite sprite: Objects/Specific/Chemistry/beaker_large.rsi layers: @@ -109,7 +117,7 @@ - type: entity name: cryostasis beaker - parent: Beaker + parent: BaseBeaker description: Used to contain chemicals or solutions without reactions. id: CryostasisBeaker components: @@ -122,13 +130,28 @@ beaker: maxVol: 40 canReact: false - + - type: Damageable + damageContainer: Inorganic + damageModifierSet: FlimsyMetallic + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 100 + behaviors: + - !type:SpillBehavior + solution: beaker + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: entity name: bluespace beaker - parent: Beaker + parent: BaseBeaker description: Powered by experimental bluespace technology. id: BluespaceBeaker components: + - type: Spillable + solution: beaker - type: Sprite sprite: Objects/Specific/Chemistry/beaker_bluespace.rsi layers: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index 72258eefcf..23a624c138 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -64,7 +64,7 @@ path: /Audio/Weapons/Guns/Hits/snap.ogg - type: FlashOnTrigger range: 1 - - type: SoundOnTrigger + - type: EmitSoundOnTrigger sound: path: "/Audio/Effects/flash_bang.ogg" diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml index 6446769fd4..e51ace2f79 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml @@ -58,7 +58,7 @@ delay: 3.5 - type: FlashOnTrigger range: 7 - - type: SoundOnTrigger + - type: EmitSoundOnTrigger sound: path: "/Audio/Effects/flash_bang.ogg" - type: DeleteOnTrigger @@ -148,3 +148,36 @@ - type: TimerTriggerVisualizer countdown_sound: path: /Audio/Effects/countdown.ogg + +- type: entity + name: modular grenade + description: A grenade casing. Requires a trigger and a payload. + parent: BaseItem + id: ModularGrenade + components: + - type: Sprite + sprite: Objects/Weapons/Grenades/modular.rsi + state: empty + - type: Item + size: 8 + - type: PayloadCase + - type: Construction + graph: ModularGrenadeGraph + node: emptyCase + - type: Damageable + damageContainer: Inorganic + - type: Destructible + thresholds: + - trigger: + !type:DamageTrigger + damage: 50 + behaviors: + - !type:DoActsBehavior + acts: [ "Destruction" ] + - type: Appearance + visuals: + - type: GenericEnumVisualizer + key: enum.Trigger.TriggerVisuals.VisualState + states: + enum.Trigger.TriggerVisualState.Primed: primed + enum.Trigger.TriggerVisualState.Unprimed: complete diff --git a/Resources/Prototypes/Entities/Objects/Weapons/security.yml b/Resources/Prototypes/Entities/Objects/Weapons/security.yml index 40c45b4e1c..5505142ece 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/security.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/security.yml @@ -56,7 +56,7 @@ id: PortableFlasher description: An ultrabright flashbulb with a proximity trigger, useful for making an area security-only. components: - - type: SoundOnTrigger + - type: EmitSoundOnTrigger sound: path: /Audio/Weapons/flash.ogg - type: FlashOnTrigger diff --git a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml index c73a898994..3791b36ae2 100644 --- a/Resources/Prototypes/Entities/Structures/Machines/lathe.yml +++ b/Resources/Prototypes/Entities/Structures/Machines/lathe.yml @@ -185,6 +185,8 @@ - KitchenKnife - ButchCleaver - FlashlightLantern + - TimerTrigger + - ChemicalPayload - type: ActivatableUI key: enum.LatheUiKey.Key #Yes only having 1 of them here doesn't break anything - type: ActivatableUIRequiresPower @@ -294,6 +296,7 @@ - CableStack - CableMVStack - CableHVStack + - TimerTrigger - type: entity parent: Autolathe diff --git a/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_grenade.yml b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_grenade.yml new file mode 100644 index 0000000000..f2240fe18e --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/Graphs/weapons/modular_grenade.yml @@ -0,0 +1,83 @@ +- type: constructionGraph + id: ModularGrenadeGraph + start: start + graph: + + - node: start + edges: + - to: emptyCase + steps: + - material: Steel + amount: 5 + doAfter: 1 + + - node: emptyCase + entity: ModularGrenade + actions: + - !type:SpriteStateChange + state: empty + edges: + - to: wiredCase + steps: + - material: Cable + doAfter: 0.5 + + - node: wiredCase + entity: ModularGrenade + actions: + - !type:SpriteStateChange + state: wired + - !type:PlaySound + sound: /Audio/Machines/button.ogg + edges: + - to: emptyCase + steps: + - tool: Cutting + doAfter: 0.5 + completed: + - !type:SpawnPrototype + prototype: CableApcStack1 + - to: caseWithTrigger + steps: + - component: PayloadTrigger + store: payloadTrigger + name: Trigger + doAfter: 0.5 + + - node: caseWithTrigger + actions: + - !type:SpriteStateChange + state: no-payload + - !type:PlaySound + sound: /Audio/Machines/button.ogg + edges: + - to: wiredCase + steps: + - tool: Prying + doAfter: 0.5 + completed: + - !type:EmptyContainer + container: payloadTrigger + - to: grenade + steps: + - tag: Payload + store: payload + name: Payload + doAfter: 0.5 + + - node: grenade + actions: + - !type:SpriteStateChange + state: complete + - !type:PlaySound + sound: /Audio/Machines/button.ogg + - !type:AdminLog + message: "A grenade was crafted" + edges: + - to: caseWithTrigger + steps: + - tool: Prying + doAfter: 0.5 + completed: + - !type:EmptyContainer + container: payload \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/modular_grenades.yml b/Resources/Prototypes/Recipes/Construction/modular_grenades.yml new file mode 100644 index 0000000000..280c8a0ad7 --- /dev/null +++ b/Resources/Prototypes/Recipes/Construction/modular_grenades.yml @@ -0,0 +1,12 @@ +- type: construction + name: Modular Grenade + id: ModularGrenadeRecipe + graph: ModularGrenadeGraph + startNode: start + targetNode: grenade + category: Weapons + description: Construct a grenade using a trigger and a payload. + icon: + sprite: Objects/Weapons/Grenades/modular.rsi + state: complete + objectType: Item \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Construction/weapons.yml b/Resources/Prototypes/Recipes/Construction/weapons.yml index b8517ca579..c97b97e7e7 100644 --- a/Resources/Prototypes/Recipes/Construction/weapons.yml +++ b/Resources/Prototypes/Recipes/Construction/weapons.yml @@ -18,4 +18,4 @@ category: Weapons description: A simple weapon for tripping someone at a distance. icon: Objects/Weapons/Throwable/bola.rsi/icon.png - objectType: Item + objectType: Item \ No newline at end of file diff --git a/Resources/Prototypes/Recipes/Lathes/devices.yml b/Resources/Prototypes/Recipes/Lathes/devices.yml new file mode 100644 index 0000000000..c522ef648e --- /dev/null +++ b/Resources/Prototypes/Recipes/Lathes/devices.yml @@ -0,0 +1,21 @@ +- type: latheRecipe + id: TimerTrigger + icon: + sprite: Objects/Devices/timer.rsi + state: timer + result: TimerTrigger + completetime: 500 + materials: + Steel: 300 + Plastic: 200 + +- type: latheRecipe + id: ChemicalPayload + icon: + sprite: Objects/Devices/payload.rsi + state: payload-empty + result: ChemicalPayload + completetime: 500 + materials: + Steel: 200 + Plastic: 300 diff --git a/Resources/Prototypes/tags.yml b/Resources/Prototypes/tags.yml index e38ea86249..6eadfbebba 100644 --- a/Resources/Prototypes/tags.yml +++ b/Resources/Prototypes/tags.yml @@ -216,6 +216,9 @@ - type: Tag id: Ore +- type: Tag + id: Payload # for grenade/bomb crafting + - type: Tag id: PercussionInstrument diff --git a/Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png b/Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png new file mode 100644 index 0000000000000000000000000000000000000000..be3f2d494236b92be16b5fe641fb2b0f477dd516 GIT binary patch literal 1681 zcmV;C25$L@P)-2eau|4BqaRCt{2n_Z|?MHq(P+3w6dr}U&~ zrk0g;PAHldB53$SQF7{{i!6x@%Ptb4i2g8wD7=WekVwi3gvfp|!W2m}E5(vRQOW;5 z%o6Efr5;6(=R94^-g(@vHM3^zwfFX7zp!ui%)Hw(5f_%5IUyQU|>UhMpk z&%kak;E8~a_y*{ih0onZ80@U;LkI90a9O4TtcE_oTO^Aw7G-Vx`21{G}6E>Jd=j>m4zwx?@vPuHp!oB*_)MJ!gzLTaM@~QOF#<)p0 z>ilAiS(#K^3@EdG6h4!*$5H-p5|SJ?<1)=rXF-UnYQY%ODd}BDmDVIYIY}cV4U8#o zm$W2IS|qyCGy+Be^RXdu)GPY2q|TV;EhGunfH{uIWLX;F5jJ**OoG5fU>WD{1GW>9 zAH=<3^Tq_l5fF#({O%=!cMiaAz*>Q|lGe%&;qDH%NNS2`>eA@)O_G!^5XWJokDy#& zm)Gf%UXV1(QFWa$=4izKE{)AT`*}&j9Ob)w1PO7$2mpFXnkDI3+2AD($0WTYX!2yQ~rp!n>zcNFIwmGVHJ6oR5~DB{0WlBODC#u{TjOzFHN^>>u{Ut?f{ z;~ly!rKnOHqk-SBCp%vNw`Rdx;J(YDe}%7oUUnH77gIh`(y!%;G{$UJf}kWNMmoxN z`WoltUPmVd%c(vlJIY+XSpbtAL+B70#R8Q8_7LTmL%%;K09=au#CK{Hd`Si10f+9k zBo8lVj5#g4`G~{p>?CK7#~fuVjWNl#;lLw~o;(ZOn2p}-0F1?bY?de?QY32xPB_RG zSJ0PK09HBl9w9V|3%u|ApVa4+`wYgeF+!@!tw{Y!Kez0k|cWj}mKgLX+rWOMvE z*_)z+B&EGxw@cDAW6Zvk?ZW}|2bKpurAlB4p0k2Vc7g$(#+`(y6xx7UHF3NYz+h}( z(pd$^JAn7N2=*Zt02l!*#(irmElvaP1EIIbs}Eoh@C^2nWjWstbz(17&Y?xNSY{n^xmxK)dQXTY;K!uTJHOpBk+o$YF}hwXYNK>$4?kz{;ihnI_jvSjyme7 bBNG1sXF*3SWnpc500000NkvXXu0mjfF4+ho literal 0 HcmV?d00001 diff --git a/Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png.yml b/Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png.yml new file mode 100644 index 0000000000..5c43e23305 --- /dev/null +++ b/Resources/Textures/Interface/VerbIcons/clock.svg.192dpi.png.yml @@ -0,0 +1,2 @@ +sample: + filter: true diff --git a/Resources/Textures/Objects/Devices/payload.rsi/meta.json b/Resources/Textures/Objects/Devices/payload.rsi/meta.json new file mode 100644 index 0000000000..7f1958955b --- /dev/null +++ b/Resources/Textures/Objects/Devices/payload.rsi/meta.json @@ -0,0 +1,35 @@ +{ + "version": 1, + + "license": "CC0-1.0", + "copyright": "Taken from https://github.com/tgstation/tgstation/blob/master/icons/obj/assemblies/new_assemblies.dmi", + + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "payload-empty", + "directions": 1 + }, + { + "name": "payload-chemical-left", + "directions": 1 + }, + { + "name": "payload-chemical-right", + "directions": 1 + }, + { + "name": "payload-chemical-armed", + "directions": 1, + "delays": [ [ 0.2, 0.2, 0.2 ] ] + }, + { + "name": "payload-explosive-armed", + "directions": 1, + "delays": [ [ 0.2, 0.2, 0.2 ] ] + } + ] +} diff --git a/Resources/Textures/Objects/Devices/payload.rsi/payload-chemical-armed.png b/Resources/Textures/Objects/Devices/payload.rsi/payload-chemical-armed.png new file mode 100644 index 0000000000000000000000000000000000000000..a7a2896a89411d3c28c256e2ef147f9fbaf48bb0 GIT binary patch literal 1935 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 literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Devices/timer.rsi/meta.json b/Resources/Textures/Objects/Devices/timer.rsi/meta.json new file mode 100644 index 0000000000..acad76a3ed --- /dev/null +++ b/Resources/Textures/Objects/Devices/timer.rsi/meta.json @@ -0,0 +1,17 @@ +{ + "version": 1, + + "license": "CC0-1.0", + "copyright": "Taken from https://github.com/tgstation/tgstation/blob/master/icons/obj/assemblies/new_assemblies.dmi", + + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "timer", + "directions": 1 + } + ] +} \ No newline at end of file diff --git a/Resources/Textures/Objects/Devices/timer.rsi/timer.png b/Resources/Textures/Objects/Devices/timer.rsi/timer.png new file mode 100644 index 0000000000000000000000000000000000000000..39b15b076db5637ea76810f07fea4ceb778962c9 GIT binary patch literal 255 zcmV*oeds+if-xD;D(UOEg_2@7=a|D zk8BH26h&E?jWp31(^pjm?>)vg#we~cW-DzD0Nts>lr_fm>B$lBRe5efYb`$!X*(; zfQZ0N`{BDLvBd?l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8npOP@n{~ttchUD#*nRY8Q}atCUevQedU8UtV6W zS8lAAUzDzIXlZGwZ(yWvWTXpJp<7&;SCUwvn^&w1Gr=XbIJqdZpd>RtPXT0NVp4u- ziLDaQr4TRV7Ql_oD~1LWFu?RH5)1SV^$b8>f+_U%#ji9s7p}UvBq$Z(UaSTehg24% z>IbD3=a&{G10ya?8Dv#~m2**QVo82cNPd0}EEEGW@=NlIGx7@*jEwXQ6*R&#^HTE5 zi#5R-e0{Av^NLFn^O93NU2K(rM(AZ`rdT-}m>Iabxf+?9I9nJRx;k0989BK+yE;3W znHgKUnOeZ~y5uL9=BDPA!1Sgd^cv&T3rY*Q1wfl!Qj0RnQd8WD@^clyezwZQ?G^)^ z=0WwQ;C724PQCg-$LND%7AdA-Lcrt$V#3ockONQosd>QUUIa|n*)s#0fO+Dvr;B4q z#jT`2|Nq+`c3@I#V`N**CsBG}1#^T)V9kdIjs~*g;_Ui1V!BaBI@TP!cW>S{MTX6H z&YtD%nJDW#UBltq$IHw84V_w^@ijzl%f7DHwmN+MAz9aT$`YO{xt~0J`oFnJ_U3m5 zh9ZtLg8cG!DN7=iSQt}NQ+e1g=!!QSSm@mTz>%Nn)~#D#blFq3?@g-M;wRGM9_Pry z)W7$L#FGh&8s70~=6b_qcoox8|(njC&WaO0fAPq{tJqX`gRB w`va}dCp)V*y=uCsc5?-@o2-G3EQ3G-gQsyUOK+mm7El@B>FVdQ&MBb@03URAivR!s literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/empty.png b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..7e577c3cc6d2483699067c99ae4509339bae685e GIT binary patch literal 1040 zcmaJ=Pe>F|9G=P|H6bX<%)@g$l;F<4b$8v#P28DXU1`nMCATg$&b)O8oq5yD(;fFv zVI7JJva^S7-6DgakgO;KJ4i%%2np;G{UJL9Q4sWI-Ca9q!_2%teBbx`e!us7SNr?A z>uMTmD2l2}^vEeP0`J?ogZ!OB;RhKG;8+F^pe)WSHl(^VGz3AyP=;X&D%!-k1=vAR z+nV)s24|ATL=_o~;$axqun3!?IyzlTQAZ#KLvUC(BlPO*6B_7RgdPkexuhk*oZeHg z;Xt7;trkYquts+t1s$$P1Pq83;2NW*Bf1f~s4J4Wx6RU^2*D!}dd*ZO*$*USLl9&* zpUQE55DGJVuq_~jT7kd`9Ltk8;NwGLTf68NKMOG0yhp{EHY(Af7 z@_q){!z>>ThgnWw1;IxUK4-$jit96-=CXne9o5z?tRoY6ipmfg!x5S|T}#2RDzc_i zDibLf>naw@Gn|)F8JJA|A8HsCw1ZP{-S39NPI|(EYzjJP%vQ<4Wt+WFmMGa!!N^V{ zG+M4=e-2^ffg!FLPz2jv3IzWv;f)jc&^Idcm+rWEtA}IMm`cGC(nBQQy!@ zKn?_@&GkxLZ9^|buC%EamY89^ll|wU%Uh&Y06%>G?X1kQzS se>#L0XC9n<|NHp(mMqyiU;VJEp4xk)b@9~Y>1Up1BGxD0jh>zS3wKgaF8}}l literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json new file mode 100644 index 0000000000..f23b6ec168 --- /dev/null +++ b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/meta.json @@ -0,0 +1,34 @@ +{ + "version": 1, + "license": "CC-BY-SA-3.0", + "copyright": "Taken from tgstation at commit https://github.com/tgstation/tgstation/commit/29c0ed1b000619cb5398ef921000a8d4502ba0b6 and modified by Swept", + "size": { + "x": 32, + "y": 32 + }, + "states": [ + { + "name": "empty", + "directions": 1 + }, + { + "name": "wired", + "directions": 1 + }, + { + "name": "no-payload", + "directions": 1 + }, + { + "name": "complete", + "directions": 1 + }, + { + "name": "primed", + "directions": 1, + "delays": [ + [ 0.2, 0.2 ] + ] + } + ] +} diff --git a/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/no-payload.png b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/no-payload.png new file mode 100644 index 0000000000000000000000000000000000000000..39d3f2b365377b0a51ac7c06c561c01548738ae9 GIT binary patch literal 1134 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz$r9IylHmNblJdl&R0hYC{G?O` z&)mfH)S%SFl*+=BsWuD@%*vS|5hW46K32*3xq68pHF_1f1wh>l3^w)^1&PVosU-?Y zsp*+{wo31J?^jaDOtDo8H}y5}EpSfF$n>ZxN)4{^3rViZPPR-@vbR&PsjvbXkegbP zs8ErclUHn2VXFi-*9yo63F|8npOP@n{~ttchUD#*nRY8Q}atCUevQedU8UtV6W zS8lAAUzDzIXlZGwZ(yWvWTXpJp<7&;SCUwvn^&w1Gr=XbIJqdZpd>RtPXT0NVp4u- ziLDaQr4TRV7Ql_oD~1LWFu?RH5)1SV^$b8>f+_U%#ji9s7p}UvBq$Z(UaSTehg24% z>IbD3=a&{G10ya?8Dv#~m2**QVo82cNPd0}EEEGW@=NlIGx7@*jEwXQ6*R&#^HTE5 zi#5R-e0{Av^NLFn^O93NU2K(rM(AZ`rdT-}m>Iabxwx8}I9nJRx;k0989BK+yE;3W znHgKUnOeZ~y5uL9=BDPA!1Sgd^t$2H3rY*Q1wfl!Qj0RnQd8WD@^clyezwZQ?G|U8 z=0WwQ;C71(PQCg-$LND%7AdA-Lcrt$V#3ockONQosd>QUUIa|ni=J-T49pV`JzX3_ zDsCnH`TyVkumh7?8zb9dK8ex;E0`lZ0&6}za5Rt=7iZVE5z~!2(y`{)y?gVvDKc!n zbM`E6&qP`0=^75-K3-n#Z|KzWjISYbTlRImw$BF^*$+?mfB$ki_kzHNL(d-zFIvxRWNiHK z&CAQn`!_UoMD1I4g7Lr=zpE}DVIl`~*cs*Q9NA)y8u?ysxEB~|AXnKbz@`^@f7yQK vf~h~B9I=foJ(w{$=L#dx7t{C{I1Ct4ToS|fUfk~vDgiuQ{an^LB{Ts549R^q literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/primed.png b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/primed.png new file mode 100644 index 0000000000000000000000000000000000000000..c5a39eab1da057bb3995d3e5e433bbc4da1e84f1 GIT binary patch literal 393 zcmV;40e1e0P)6sa)Ha70i4%nTUV0P~ACP17^Q5d-~OOc-4OS(Z^%RVPy%nlRAsOc|vQ z^#ITF+OF(O_f;a=gu1SwIT3^qSM{|CQc6hw1x>>D{XqgQv8@jqP!xq(dK3hKQv+=4 z!#!aBwI%sEQ!xd$^H?>qkcSfaQ9jVk*k@uZmmYCOG!N&Fb53CLr&tS1a?t$KgwResk?RI1XRh n^Plw5<1oW848t%F3K1Ou3Nx1s=W-9M00000NkvXXu0mjfJdvxb literal 0 HcmV?d00001 diff --git a/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/wired.png b/Resources/Textures/Objects/Weapons/Grenades/modular.rsi/wired.png new file mode 100644 index 0000000000000000000000000000000000000000..fbdd845527299c621d3380f9f88b0338b7bcf0fa GIT binary patch literal 1854 zcmbVNZD<@t7#{OQ6G<>uP@_MV4Twee_T%n0w@a=yw|AGExG`K$k|0VZyK{GIZg;l3 zo7^QqC_y1c(V|80qe2Ct{z(f`D3w@Rq54Y+l30w|Drf^%swJY(D$d?lqb3?WZf|#I zp68wSdFGw>o*NqMZ*S{r0|2zA2I6UQr~GSI3;A_tW;V#J)gBmi0l0Oyf87FJfAcN? zn%9lYh&Q4>B5T+TKpl^xK*_WT8i3w?B^zoJ$fL$l&ak5N)%VZPl%YrI;jqf7wu17; zz>I_T&kSa?nF&qO>3w^t-jYlLn8<@v$t+l|T#C}=xH5V6hgq5`L%fM7-RCbzji^JE zf*nMO0gll)E=cuA0bUG+g`Ni~ffG2EC*Lr`_sF4$92BVPhbF5zdR9)ylhw7zTa?aw zo-MO%u~-Zgg8}U1SYDDOmJ?V(Uq6_s@NTn6I00Y>U3SJbL~l|P_{|eSX4kJfw@E#U(eIdV-LG|yp0L<>ADrRtT+gI z*vVjAsO|DlEea(F0iL>l*sye5bocmzsst2=9*WXr%Xx+q7(vMJVL2R;h2R4`FLPW4 zs$$*9PX7}s${a5X;lDshz3I?{I{~YzoU&XGS{h2lqclk>U>Ld#r3fDm26cvqD8ytV zp&kZ`n!t=}<5?jX;)QTlD(6M`ajZ@H_SN`0;VYcTC6e)EPe_UId?F?#g;+vKC^1nC zO384f#(mT=$RUG;{})5o#R(TH)&3+Z5lH%hr<_ zFkDhv)78VjA04PZ6%3LaITSL~{DVvcL6S3F9o#D6o$YNUXfcmS$jznsw|c9&#ZOxABf6#4NiKX|5$In(VaHzC-8r9s=I2&%?9{g(T9{KIs zdf~*vZQxpO|7W3NKXm>2(LKj6AGyAOz@G2c_bvq18W!HRKS!g1hdXXO-rcY|`U`z9 z{nQG*@kPTM_kzLY>3QwA@%9v;&J~UE|nOJFUH2^{sg#