diff --git a/Content.Client/Entry/IgnoredComponents.cs b/Content.Client/Entry/IgnoredComponents.cs index a7864593f1..c8c591b40c 100644 --- a/Content.Client/Entry/IgnoredComponents.cs +++ b/Content.Client/Entry/IgnoredComponents.cs @@ -77,7 +77,6 @@ namespace Content.Client.Entry "CanSpill", "SpeedLoader", "Hitscan", - "ExplosiveProjectile", "StunOnCollide", "RandomPottedPlant", "CommunicationsConsole", @@ -96,8 +95,11 @@ namespace Content.Client.Entry "SecureEntityStorage", "PresetIdCard", "SolarControlConsole", - "FlashExplosive", - "FlashAreaOnCollide", + "FlashOnTrigger", + "SoundOnTrigger", + "TriggerOnCollide", + "DeleteOnTrigger", + "ExplodeOnTrigger", "Utensil", "UnarmedCombat", "TimedSpawner", diff --git a/Content.Server/Construction/Components/ConstructionComponent.cs b/Content.Server/Construction/Components/ConstructionComponent.cs index 0fa422c270..08da52c2a4 100644 --- a/Content.Server/Construction/Components/ConstructionComponent.cs +++ b/Content.Server/Construction/Components/ConstructionComponent.cs @@ -445,7 +445,7 @@ namespace Content.Server.Construction.Components otherPhysics.BodyType = physics.BodyType; } - Owner.Delete(); + Owner.QueueDelete(); foreach (var action in node.Actions) { diff --git a/Content.Server/Explosion/Components/ClusterFlashComponent.cs b/Content.Server/Explosion/Components/ClusterFlashComponent.cs index ae5d34f0a1..47f7c6b98e 100644 --- a/Content.Server/Explosion/Components/ClusterFlashComponent.cs +++ b/Content.Server/Explosion/Components/ClusterFlashComponent.cs @@ -1,6 +1,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; +using Content.Server.Flash.Components; using Content.Server.Throwing; using Content.Shared.Explosion; using Content.Shared.Interaction; @@ -58,7 +59,8 @@ namespace Content.Server.Explosion.Components async Task IInteractUsing.InteractUsing(InteractUsingEventArgs args) { - if (_grenadesContainer.ContainedEntities.Count >= _maxGrenades || !args.Using.HasComponent()) + if (_grenadesContainer.ContainedEntities.Count >= _maxGrenades || + !args.Using.HasComponent()) return false; _grenadesContainer.Insert(args.Using); @@ -70,7 +72,7 @@ namespace Content.Server.Explosion.Components { base.Initialize(); - _grenadesContainer = ContainerHelpers.EnsureContainer(Owner, "cluster-flash"); + _grenadesContainer = Owner.EnsureContainer("cluster-flash"); } @@ -117,10 +119,7 @@ namespace Content.Server.Explosion.Components if (grenade.Deleted) return; - if (grenade.TryGetComponent(out OnUseTimerTriggerComponent? useTimer)) - { - useTimer.Trigger(eventArgs.User); - } + EntitySystem.Get().Trigger(grenade, eventArgs.User); }); } diff --git a/Content.Server/Explosion/Components/DeleteOnTriggerComponent.cs b/Content.Server/Explosion/Components/DeleteOnTriggerComponent.cs new file mode 100644 index 0000000000..22ea289926 --- /dev/null +++ b/Content.Server/Explosion/Components/DeleteOnTriggerComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameObjects; + +namespace Content.Server.Explosion.Components +{ + /// + /// Will delete the attached entity upon a . + /// + [RegisterComponent] + public class DeleteOnTriggerComponent : Component + { + public override string Name => "DeleteOnTrigger"; + } +} diff --git a/Content.Server/Explosion/Components/ExplodeOnTriggerComponent.cs b/Content.Server/Explosion/Components/ExplodeOnTriggerComponent.cs new file mode 100644 index 0000000000..9390886a79 --- /dev/null +++ b/Content.Server/Explosion/Components/ExplodeOnTriggerComponent.cs @@ -0,0 +1,13 @@ +using Robust.Shared.GameObjects; + +namespace Content.Server.Explosion.Components +{ + /// + /// Explode using the entity's if Triggered. + /// + [RegisterComponent] + public class ExplodeOnTriggerComponent : Component + { + public override string Name => "ExplodeOnTrigger"; + } +} diff --git a/Content.Server/Explosion/Components/ExplosiveComponent.cs b/Content.Server/Explosion/Components/ExplosiveComponent.cs index 721dcc0fc6..0fc47e991c 100644 --- a/Content.Server/Explosion/Components/ExplosiveComponent.cs +++ b/Content.Server/Explosion/Components/ExplosiveComponent.cs @@ -1,11 +1,13 @@ -using Content.Shared.Acts; using Robust.Shared.GameObjects; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Explosion.Components { + /// + /// Specifies an explosion range should this entity be exploded. + /// [RegisterComponent] - public class ExplosiveComponent : Component, ITimerTrigger, IDestroyAct + public class ExplosiveComponent : Component { public override string Name => "Explosive"; @@ -18,31 +20,6 @@ namespace Content.Server.Explosion.Components [DataField("flashRange")] public int FlashRange; - public bool Exploding { get; private set; } = false; - - public bool Explosion() - { - if (Exploding) - { - return false; - } - else - { - Exploding = true; - Owner.SpawnExplosion(DevastationRange, HeavyImpactRange, LightImpactRange, FlashRange); - Owner.QueueDelete(); - return true; - } - } - - bool ITimerTrigger.Trigger(TimerTriggerEventArgs eventArgs) - { - return Explosion(); - } - - void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs) - { - Explosion(); - } + public bool Exploding { get; set; } = false; } } diff --git a/Content.Server/Explosion/Components/ExplosiveProjectileComponent.cs b/Content.Server/Explosion/Components/ExplosiveProjectileComponent.cs deleted file mode 100644 index 2023e7638b..0000000000 --- a/Content.Server/Explosion/Components/ExplosiveProjectileComponent.cs +++ /dev/null @@ -1,27 +0,0 @@ -using Robust.Shared.GameObjects; -using Robust.Shared.Physics.Collision; -using Robust.Shared.Physics.Dynamics; - -namespace Content.Server.Explosion.Components -{ - [RegisterComponent] - public class ExplosiveProjectileComponent : Component, IStartCollide - { - public override string Name => "ExplosiveProjectile"; - - protected override void Initialize() - { - base.Initialize(); - - Owner.EnsureComponent(); - } - - void IStartCollide.CollideWith(Fixture ourFixture, Fixture otherFixture, in Manifold manifold) - { - if (Owner.TryGetComponent(out ExplosiveComponent? explosive)) - { - explosive.Explosion(); - } - } - } -} diff --git a/Content.Server/Explosion/Components/FlashExplosiveComponent.cs b/Content.Server/Explosion/Components/FlashExplosiveComponent.cs deleted file mode 100644 index 7762e3e8ab..0000000000 --- a/Content.Server/Explosion/Components/FlashExplosiveComponent.cs +++ /dev/null @@ -1,61 +0,0 @@ -using Content.Server.Flash.Components; -using Content.Server.Storage.Components; -using Content.Shared.Acts; -using Robust.Shared.Audio; -using Robust.Shared.Containers; -using Robust.Shared.GameObjects; -using Robust.Shared.Player; -using Robust.Shared.Serialization.Manager.Attributes; - -namespace Content.Server.Explosion.Components -{ - /// - /// When triggered will flash in an area around the object and destroy itself - /// - [RegisterComponent] - public class FlashExplosiveComponent : Component, ITimerTrigger, IDestroyAct - { - public override string Name => "FlashExplosive"; - - [DataField("range")] - private float _range = 7.0f; - [DataField("duration")] - private float _duration = 8.0f; - [DataField("sound")] - private string _sound = "/Audio/Effects/flash_bang.ogg"; - [DataField("deleteOnFlash")] - private bool _deleteOnFlash = true; - - public bool Explode() - { - // If we're in a locker or whatever then can't flash anything - Owner.TryGetContainer(out var container); - if (container == null || !container.Owner.HasComponent()) - { - FlashableComponent.FlashAreaHelper(Owner, _range, _duration); - } - - if (_sound != null) - { - SoundSystem.Play(Filter.Pvs(Owner), _sound, Owner.Transform.Coordinates); - } - - if (_deleteOnFlash && !Owner.Deleted) - { - Owner.Delete(); - } - - return true; - } - - bool ITimerTrigger.Trigger(TimerTriggerEventArgs eventArgs) - { - return Explode(); - } - - void IDestroyAct.OnDestroy(DestructionEventArgs eventArgs) - { - Explode(); - } - } -} diff --git a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs index 44d67d61c3..84931ed26d 100644 --- a/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs +++ b/Content.Server/Explosion/Components/OnUseTimerTriggerComponent.cs @@ -15,12 +15,13 @@ namespace Content.Server.Explosion.Components [DataField("delay")] private float _delay = 0f; + // TODO: Need to split this out so it's a generic "OnUseTimerTrigger" component. public void Trigger(IEntity user) { if (Owner.TryGetComponent(out AppearanceComponent? appearance)) appearance.SetData(TriggerVisuals.VisualState, TriggerVisualState.Primed); - EntitySystem.Get().HandleTimerTrigger(TimeSpan.FromSeconds(_delay), user, Owner); + EntitySystem.Get().HandleTimerTrigger(TimeSpan.FromSeconds(_delay), Owner, user); } bool IUse.UseEntity(UseEntityEventArgs eventArgs) diff --git a/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs b/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs new file mode 100644 index 0000000000..d1acbe4087 --- /dev/null +++ b/Content.Server/Explosion/Components/SoundOnTriggerComponent.cs @@ -0,0 +1,20 @@ +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 + { + public override string Name => "SoundOnTrigger"; + + [ViewVariables(VVAccess.ReadWrite)] + [DataField("sound")] + public SoundSpecifier? Sound { get; set; } = null; + } +} diff --git a/Content.Server/Explosion/Components/TriggerOnCollideComponent.cs b/Content.Server/Explosion/Components/TriggerOnCollideComponent.cs new file mode 100644 index 0000000000..0c15a9a207 --- /dev/null +++ b/Content.Server/Explosion/Components/TriggerOnCollideComponent.cs @@ -0,0 +1,10 @@ +using Robust.Shared.GameObjects; + +namespace Content.Server.Explosion.Components +{ + [RegisterComponent] + public class TriggerOnCollideComponent : Component + { + public override string Name => "TriggerOnCollide"; + } +} diff --git a/Content.Server/Explosion/ExplosionHelper.cs b/Content.Server/Explosion/ExplosionHelper.cs index 9a5c0c9463..06de449702 100644 --- a/Content.Server/Explosion/ExplosionHelper.cs +++ b/Content.Server/Explosion/ExplosionHelper.cs @@ -274,10 +274,12 @@ namespace Content.Server.Explosion public static void SpawnExplosion(this IEntity entity, int devastationRange = 0, int heavyImpactRange = 0, int lightImpactRange = 0, int flashRange = 0) { + // TODO: Need to refactor this stufferino + // If you want to directly set off the explosive if (!entity.Deleted && entity.TryGetComponent(out ExplosiveComponent? explosive) && !explosive.Exploding) { - explosive.Explosion(); + EntitySystem.Get().Explode(entity.Uid, explosive); } else { diff --git a/Content.Server/Explosion/TriggerSystem.cs b/Content.Server/Explosion/TriggerSystem.cs index 1dce4012ea..8f1a03fef9 100644 --- a/Content.Server/Explosion/TriggerSystem.cs +++ b/Content.Server/Explosion/TriggerSystem.cs @@ -1,53 +1,118 @@ using System; -using System.Linq; +using Content.Server.Explosion.Components; +using Content.Server.Flash.Components; +using Content.Shared.Acts; +using Content.Shared.Audio; using JetBrains.Annotations; +using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.Physics.Dynamics; +using Robust.Shared.Player; using Robust.Shared.Timing; namespace Content.Server.Explosion { /// - /// This interface gives components behavior when being "triggered" by timer or other conditions + /// Raised whenever something is Triggered on the entity. /// - public interface ITimerTrigger + public class TriggerEvent : HandledEntityEventArgs { - /// - /// Called when one object is triggering some event - /// - bool Trigger(TimerTriggerEventArgs eventArgs); - } + public IEntity Triggered { get; } + public IEntity? User { get; } - public class TimerTriggerEventArgs : EventArgs - { - public TimerTriggerEventArgs(IEntity user, IEntity source) + public TriggerEvent(IEntity triggered, IEntity? user = null) { + Triggered = triggered; User = user; - Source = source; } - - public IEntity User { get; set; } - public IEntity Source { get; set; } } [UsedImplicitly] public sealed class TriggerSystem : EntitySystem { - public void HandleTimerTrigger(TimeSpan delay, IEntity user, IEntity trigger) + public override void Initialize() { + base.Initialize(); + SubscribeLocalEvent(HandleCollide); + + SubscribeLocalEvent(HandleDeleteTrigger); + SubscribeLocalEvent(HandleSoundTrigger); + SubscribeLocalEvent(HandleExplodeTrigger); + SubscribeLocalEvent(HandleFlashTrigger); + + SubscribeLocalEvent(HandleDestruction); + } + + #region Explosions + private void HandleDestruction(EntityUid uid, ExplosiveComponent component, DestructionEventArgs args) + { + Explode(uid, component); + } + + private void HandleExplodeTrigger(EntityUid uid, ExplodeOnTriggerComponent component, TriggerEvent args) + { + if (!ComponentManager.TryGetComponent(uid, out ExplosiveComponent? explosiveComponent)) return; + + Explode(uid, explosiveComponent); + } + + // You really shouldn't call this directly (TODO Change that when ExplosionHelper gets changed). + public void Explode(EntityUid uid, ExplosiveComponent component) + { + if (component.Exploding) + { + return; + } + + component.Exploding = true; + component.Owner.SpawnExplosion(component.DevastationRange, component.HeavyImpactRange, component.LightImpactRange, component.FlashRange); + EntityManager.QueueDeleteEntity(uid); + } + #endregion + + #region Flash + private void HandleFlashTrigger(EntityUid uid, FlashOnTriggerComponent component, TriggerEvent args) + { + if (component.Flashed) return; + + FlashableComponent.FlashAreaHelper(component.Owner, component.Range, component.Duration); + component.Flashed = true; + } + #endregion + + private void HandleSoundTrigger(EntityUid uid, SoundOnTriggerComponent component, TriggerEvent args) + { + if (component.Sound == null) return; + SoundSystem.Play(Filter.Pvs(component.Owner), component.Sound.GetSound(), AudioHelpers.WithVariation(0.01f)); + } + + private void HandleDeleteTrigger(EntityUid uid, DeleteOnTriggerComponent component, TriggerEvent args) + { + EntityManager.QueueDeleteEntity(uid); + } + + private void HandleCollide(EntityUid uid, TriggerOnCollideComponent component, StartCollideEvent args) + { + Trigger(component.Owner); + } + + public void Trigger(IEntity trigger, IEntity? user = null) + { + var triggerEvent = new TriggerEvent(trigger, user); + EntityManager.EventBus.RaiseLocalEvent(trigger.Uid, triggerEvent); + } + + public void HandleTimerTrigger(TimeSpan delay, IEntity triggered, IEntity? user = null) + { + if (delay.TotalSeconds <= 0) + { + Trigger(triggered, user); + return; + } Timer.Spawn(delay, () => { - var timerTriggerEventArgs = new TimerTriggerEventArgs(user, trigger); - var timerTriggers = trigger.GetAllComponents().ToList(); - - foreach (var timerTrigger in timerTriggers) - { - if (timerTrigger.Trigger(timerTriggerEventArgs)) - { - // If an IOnTimerTrigger returns a status completion we finish our trigger - return; - } - } + Trigger(triggered, user); }); } } diff --git a/Content.Server/Flash/Components/FlashAreaOnCollide.cs b/Content.Server/Flash/Components/FlashOnTriggerComponent.cs similarity index 65% rename from Content.Server/Flash/Components/FlashAreaOnCollide.cs rename to Content.Server/Flash/Components/FlashOnTriggerComponent.cs index 9f7e7145ec..fca5898c34 100644 --- a/Content.Server/Flash/Components/FlashAreaOnCollide.cs +++ b/Content.Server/Flash/Components/FlashOnTriggerComponent.cs @@ -4,12 +4,12 @@ using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Flash.Components { /// - /// Upon colliding with an object this will flash in an area around it + /// Upon being triggered will flash in an area around it. /// [RegisterComponent] - internal sealed class FlashAreaOnCollide : Component + internal sealed class FlashOnTriggerComponent : Component { - public override string Name => "FlashAreaOnCollide"; + public override string Name => "FlashOnTrigger"; [DataField("range")] internal float Range = 1.0f; [DataField("duration")] internal float Duration = 8.0f; diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index d569c9e294..dbf35b88a8 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -3,14 +3,12 @@ using Content.Server.Stunnable.Components; using Content.Server.Weapon.Melee; using Content.Shared.Examine; using Content.Shared.Interaction; -using Content.Shared.Notification; using Content.Shared.Notification.Managers; using Robust.Server.GameObjects; using Robust.Shared.Audio; using Robust.Shared.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; -using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; namespace Content.Server.Flash @@ -26,15 +24,6 @@ namespace Content.Server.Flash SubscribeLocalEvent(OnUseInHand); SubscribeLocalEvent(OnExamined); - SubscribeLocalEvent(HandleCollide); - } - - private void HandleCollide(EntityUid uid, FlashAreaOnCollide component, StartCollideEvent args) - { - if (component.Flashed) return; - - FlashableComponent.FlashAreaHelper(component.Owner, component.Range, component.Duration); - component.Flashed = true; } public void OnMeleeHit(EntityUid uid, FlashComponent comp, MeleeHitEvent args) diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index 0324635748..cb05bcf8aa 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -1,5 +1,6 @@ using Content.Server.Camera; using Content.Server.Projectiles.Components; +using Content.Shared.Body.Components; using Content.Shared.Damage.Components; using JetBrains.Annotations; using Robust.Shared.Audio; @@ -26,9 +27,13 @@ namespace Content.Server.Projectiles return; } + var otherEntity = args.OtherFixture.Body.Owner; + var coordinates = args.OtherFixture.Body.Owner.Transform.Coordinates; var playerFilter = Filter.Pvs(coordinates); - if (args.OtherFixture.Body.Owner.TryGetComponent(out IDamageableComponent? damage) && component.SoundHitSpecies != null) + + if (!otherEntity.Deleted && + otherEntity.HasComponent() && component.SoundHitSpecies != null) { SoundSystem.Play(playerFilter, component.SoundHitSpecies, coordinates); } @@ -37,7 +42,7 @@ namespace Content.Server.Projectiles SoundSystem.Play(playerFilter, component.SoundHit, coordinates); } - if (damage != null) + if (!otherEntity.Deleted && otherEntity.TryGetComponent(out IDamageableComponent? damage)) { EntityManager.TryGetEntity(component.Shooter, out var shooter); @@ -50,7 +55,7 @@ namespace Content.Server.Projectiles } // Damaging it can delete it - if (!args.OtherFixture.Body.Deleted && args.OtherFixture.Body.Owner.TryGetComponent(out CameraRecoilComponent? recoilComponent)) + if (!otherEntity.Deleted && otherEntity.TryGetComponent(out CameraRecoilComponent? recoilComponent)) { var direction = args.OurFixture.Body.LinearVelocity.Normalized; recoilComponent.Kick(direction); diff --git a/Content.Shared/Acts/ActSystem.cs b/Content.Shared/Acts/ActSystem.cs index ba7b9e6fa2..b54b40ece5 100644 --- a/Content.Shared/Acts/ActSystem.cs +++ b/Content.Shared/Acts/ActSystem.cs @@ -17,7 +17,7 @@ namespace Content.Shared.Acts void OnDestroy(DestructionEventArgs eventArgs); } - public class DestructionEventArgs : EventArgs + public class DestructionEventArgs : EntityEventArgs { public IEntity Owner { get; set; } = default!; } diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml index a731d6394c..2cbb0b05eb 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Explosives/grenades.yml @@ -22,6 +22,7 @@ heavyImpactRange: 2 lightImpactRange: 4 flashRange: 7 + - type: ExplodeOnTrigger - type: Damageable - type: Destructible thresholds: @@ -55,7 +56,12 @@ - Belt - type: OnUseTimerTrigger delay: 3.5 - - type: FlashExplosive + - type: FlashOnTrigger + range: 7 + - type: SoundOnTrigger + sound: + path: "/Audio/Effects/flash_bang.ogg" + - type: DeleteOnTrigger - type: Damageable - type: Destructible thresholds: @@ -90,6 +96,7 @@ heavyImpactRange: 3 lightImpactRange: 5 flashRange: 10 + - type: ExplodeOnTrigger - type: Damageable - type: Destructible thresholds: @@ -123,6 +130,7 @@ devastationRange: 25 heavyImpactRange: 25 flashRange: 50 + - type: ExplodeOnTrigger - type: Damageable - type: Destructible thresholds: diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml index db6c6803e9..2a0588ecc0 100644 --- a/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml +++ b/Resources/Prototypes/Entities/Objects/Weapons/Guns/Projectiles/projectiles.yml @@ -39,8 +39,13 @@ soundHit: /Audio/Weapons/Guns/Hits/snap.ogg damages: Piercing: 10 - - type: FlashAreaOnCollide + - type: FlashOnTrigger range: 1 + - type: SoundOnTrigger + sound: + path: "/Audio/Effects/flash_bang.ogg" + - type: TriggerOnCollide + - type: DeleteOnTrigger - type: entity id: BulletBaseHV @@ -151,7 +156,9 @@ netsync: false sprite: Objects/Weapons/Guns/Projectiles/rocket.rsi state: frag - - type: ExplosiveProjectile + - type: ExplodeOnTrigger + - type: DeleteOnTrigger + - type: TriggerOnCollide - type: Projectile deleteOnCollide: false - type: Explosive @@ -191,7 +198,9 @@ netsync: false sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi state: grenade - - type: ExplosiveProjectile + - type: ExplodeOnTrigger + - type: DeleteOnTrigger + - type: TriggerOnCollide - type: Projectile deleteOnCollide: false - type: Explosive @@ -213,8 +222,13 @@ - type: Projectile deleteOnCollide: false soundHit: /Audio/Effects/flash_bang.ogg - - type: FlashAreaOnCollide + - type: FlashOnTrigger range: 7 + - type: SoundOnTrigger + sound: + path: "/Audio/Effects/flash_bang.ogg" + - type: TriggerOnCollide + - type: DeleteOnTrigger # This is supposed to spawn shrapnel and stuff so uhh... TODO? - type: entity @@ -227,7 +241,9 @@ netsync: false sprite: Objects/Weapons/Guns/Projectiles/grenade.rsi state: grenade - - type: ExplosiveProjectile + - type: ExplodeOnTrigger + - type: DeleteOnTrigger + - type: TriggerOnCollide - type: Projectile deleteOnCollide: false - type: Explosive