diff --git a/Content.Shared/Emp/SharedEmpSystem.cs b/Content.Shared/Emp/SharedEmpSystem.cs
index 7e6ea58dbc..145b6cf997 100644
--- a/Content.Shared/Emp/SharedEmpSystem.cs
+++ b/Content.Shared/Emp/SharedEmpSystem.cs
@@ -62,7 +62,8 @@ public abstract class SharedEmpSystem : EntitySystem
/// The amount of energy consumed by the EMP pulse.
/// The duration of the EMP effects.
/// The player that caused the effect. Used for predicted audio.
- public void EmpPulse(EntityCoordinates coordinates, float range, float energyConsumption, TimeSpan duration, EntityUid? user = null)
+ /// Whether this pulse is being replicated on the client.
+ public void EmpPulse(EntityCoordinates coordinates, float range, float energyConsumption, TimeSpan duration, EntityUid? user = null, bool predicted = true)
{
_entSet.Clear();
_lookup.GetEntitiesInRange(coordinates, range, _entSet);
@@ -74,7 +75,10 @@ public abstract class SharedEmpSystem : EntitySystem
if (_net.IsServer)
Spawn(EmpPulseEffectPrototype, coordinates);
- _audio.PlayPredicted(EmpSound, coordinates, user);
+ if (predicted)
+ _audio.PlayPredicted(EmpSound, coordinates, user);
+ else
+ _audio.PlayPvs(EmpSound, coordinates);
}
///
diff --git a/Content.Shared/Trigger/Systems/EmpOnTriggerSystem.cs b/Content.Shared/Trigger/Systems/EmpOnTriggerSystem.cs
index 6cefafcadc..a77cddd738 100644
--- a/Content.Shared/Trigger/Systems/EmpOnTriggerSystem.cs
+++ b/Content.Shared/Trigger/Systems/EmpOnTriggerSystem.cs
@@ -9,7 +9,7 @@ public sealed class EmpOnTriggerSystem : XOnTriggerSystem
protected override void OnTrigger(Entity ent, EntityUid target, ref TriggerEvent args)
{
- _emp.EmpPulse(Transform(target).Coordinates, ent.Comp.Range, ent.Comp.EnergyConsumption, ent.Comp.DisableDuration, args.User);
+ _emp.EmpPulse(Transform(target).Coordinates, ent.Comp.Range, ent.Comp.EnergyConsumption, ent.Comp.DisableDuration, args.User, predicted: args.Predicted);
args.Handled = true;
}
}
diff --git a/Content.Shared/Trigger/Systems/TriggerOnLandSystem.cs b/Content.Shared/Trigger/Systems/TriggerOnLandSystem.cs
index 64e2e5a5c1..3852e09efc 100644
--- a/Content.Shared/Trigger/Systems/TriggerOnLandSystem.cs
+++ b/Content.Shared/Trigger/Systems/TriggerOnLandSystem.cs
@@ -14,6 +14,6 @@ public sealed partial class TriggerOnLandSystem : TriggerOnXSystem
private void OnLand(Entity ent, ref LandEvent args)
{
- Trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut);
+ Trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut, predicted: false);
}
}
diff --git a/Content.Shared/Trigger/Systems/TriggerSystem.cs b/Content.Shared/Trigger/Systems/TriggerSystem.cs
index a5fb509eed..1e7261043f 100644
--- a/Content.Shared/Trigger/Systems/TriggerSystem.cs
+++ b/Content.Shared/Trigger/Systems/TriggerSystem.cs
@@ -67,15 +67,16 @@ public sealed partial class TriggerSystem : EntitySystem
/// The entity that has the components that should be triggered.
/// The user of the trigger. Some effects may target the user instead of the trigger entity.
/// A key string to allow multiple, independent triggers on the same entity. If null then all triggers will activate.
+ /// Whether or not this trigger is being predicted
/// Whether or not the trigger has sucessfully activated an effect.
- public bool Trigger(EntityUid trigger, EntityUid? user = null, string? key = null)
+ public bool Trigger(EntityUid trigger, EntityUid? user = null, string? key = null, bool predicted = true)
{
var attemptTriggerEvent = new AttemptTriggerEvent(user, key);
RaiseLocalEvent(trigger, ref attemptTriggerEvent);
if (attemptTriggerEvent.Cancelled)
return false;
- var triggerEvent = new TriggerEvent(user, key);
+ var triggerEvent = new TriggerEvent(user, key, predicted);
RaiseLocalEvent(trigger, ref triggerEvent, true);
return triggerEvent.Handled;
}
diff --git a/Content.Shared/Trigger/TriggerEvent.cs b/Content.Shared/Trigger/TriggerEvent.cs
index e65e3b48a8..9217a4907b 100644
--- a/Content.Shared/Trigger/TriggerEvent.cs
+++ b/Content.Shared/Trigger/TriggerEvent.cs
@@ -9,8 +9,9 @@ namespace Content.Shared.Trigger;
/// Setting this to null will activate all triggers.
///
/// Marks the event as handled if at least one trigger effect was activated.
+/// Marks that this trigger is being replicated on the client.
[ByRefEvent]
-public record struct TriggerEvent(EntityUid? User = null, string? Key = null, bool Handled = false);
+public record struct TriggerEvent(EntityUid? User = null, string? Key = null, bool Predicted = true, bool Handled = false);
///
/// Raised before a trigger is activated.
diff --git a/Resources/Prototypes/Catalog/uplink_catalog.yml b/Resources/Prototypes/Catalog/uplink_catalog.yml
index e38abddfae..d4bf63a9cb 100644
--- a/Resources/Prototypes/Catalog/uplink_catalog.yml
+++ b/Resources/Prototypes/Catalog/uplink_catalog.yml
@@ -346,23 +346,11 @@
Telecrystal: 4
categories:
- UplinkExplosives
- #Sunrise-start
conditions:
- !type:StoreWhitelistCondition
- blacklist:
+ whitelist:
tags:
- - AssaultOpsUplink
- #Sunrise-end
-
-- type: listing
- id: UplinkExplosiveGrenadeFlash
- name: uplink-flash-grenade-name
- description: uplink-flash-grenade-desc
- productEntity: GrenadeFlashBang
- cost:
- Telecrystal: 1
- categories:
- - UplinkExplosives
+ - NukeOpsUplink
- type: listing
id: UplinkSmokeGrenade
@@ -422,7 +410,7 @@
discountDownTo:
Telecrystal: 3
cost:
- Telecrystal: 5
+ Telecrystal: 4
categories:
- UplinkExplosives
#Sunrise-start
@@ -540,26 +528,6 @@
- LoneOpsUplink
- AssaultOpsUplink
-- type: listing
- id: UplinkClusterGrenade
- name: uplink-cluster-grenade-name
- description: uplink-cluster-grenade-desc
- productEntity: ClusterGrenade
- discountCategory: usualDiscounts
- discountDownTo:
- Telecrystal: 5
- cost:
- Telecrystal: 8
- categories:
- - UplinkExplosives
- #Sunrise-start
- conditions:
- - !type:StoreWhitelistCondition
- blacklist:
- tags:
- - AssaultOpsUplink
- #Sunrise-end
-
- type: listing
id: UplinkGrenadeShrapnel
name: uplink-shrapnel-grenade-name
@@ -600,19 +568,6 @@
- AssaultOpsUplink
#Sunrise-end
-- type: listing
- id: UplinkEmpKit
- name: uplink-emp-kit-name
- description: uplink-emp-kit-desc
- productEntity: ElectricalDisruptionKit
- discountCategory: veryRareDiscounts
- discountDownTo:
- Telecrystal: 4
- cost:
- Telecrystal: 6
- categories:
- - UplinkExplosives
-
# Ammo
- type: listing
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/pipebomb.yml b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/pipebomb.yml
index c2f1082e9e..e5ec17759e 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Bombs/pipebomb.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Bombs/pipebomb.yml
@@ -1,5 +1,5 @@
- type: entity
- parent: [ GrenadeBase, BaseMinorContraband ]
+ parent: [ TimerGrenadeBase, BaseMinorContraband ]
id: PipeBomb
name: pipe bomb
description: An improvised explosive made from pipes and wire.
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/base_grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/base_grenades.yml
index 8f2f7547c0..b681bdbd0b 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/base_grenades.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/base_grenades.yml
@@ -14,26 +14,10 @@
quickEquip: false
slots:
- Belt
- - type: TriggerOnUse
- - type: TimerTrigger
- delay: 3
- type: Damageable
damageContainer: Inorganic
- - type: Destructible
- thresholds:
- - trigger: # Start fuse
- !type:DamageTrigger
- damage: 10
- behaviors:
- - !type:TimerStartBehavior
- type: Appearance
- type: AnimationPlayer
- - type: GenericVisualizer
- visuals:
- enum.Trigger.TriggerVisuals.VisualState:
- enum.ConstructionVisuals.Layer:
- Primed: { state: primed }
- Unprimed: { state: icon }
- type: Tag
tags:
- HandGrenade
@@ -48,6 +32,46 @@
restitution: 0.3
friction: 0.2
+- type: entity # Starts fuse after taking 10 damage.
+ parent: GrenadeBase
+ abstract: true
+ id: TimerGrenadeBase
+ components:
+ - type: TriggerOnUse
+ - type: TimerTrigger
+ delay: 3
+ - type: Destructible
+ thresholds:
+ - trigger: # Start fuse
+ !type:DamageTrigger
+ damage: 10
+ behaviors:
+ - !type:TimerStartBehavior
+ - type: GenericVisualizer
+ visuals:
+ enum.Trigger.TriggerVisuals.VisualState:
+ enum.ConstructionVisuals.Layer:
+ Primed: { state: primed }
+ Unprimed: { state: icon }
+
+- type: entity # Starts fuse after taking 10 damage.
+ parent: GrenadeBase
+ abstract: true
+ id: ImpactGrenadeBase
+ components:
+ - type: TriggerOnLand
+ - type: LandAtCursor
+ - type: Destructible
+ thresholds:
+ - trigger: # immediately explode
+ !type:DamageTrigger
+ damage: 45
+ behaviors:
+ - !type:TriggerBehavior
+ keyOut: timer
+ - !type:DoActsBehavior
+ acts: [ "Destruction" ]
+
- type: entity # Starts fuse after taking 10 damage, instantly detonates/activates after taking 45 damage.
abstract: true
id: VolatileGrenadeBase
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/canister_grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/canister_grenades.yml
index dc23f966e2..29959b5046 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/canister_grenades.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/canister_grenades.yml
@@ -1,5 +1,5 @@
- type: entity
- parent: [VolatileGrenadeBase, GrenadeBase, BaseSecurityContraband ]
+ parent: [VolatileGrenadeBase, TimerGrenadeBase, BaseSecurityContraband ]
id: SmokeGrenade
name: smoke grenade
description: A tactical grenade that releases a large, long-lasting cloud of smoke when used.
@@ -90,7 +90,7 @@
#Sunrise-End
- type: entity
- parent: [ BaseEngineeringContraband, VolatileGrenadeBase, GrenadeBase ] # Prevent inheriting DeleteOnTrigger from SmokeGrenade
+ parent: [ BaseEngineeringContraband, VolatileGrenadeBase, TimerGrenadeBase ] # Prevent inheriting DeleteOnTrigger from SmokeGrenade
id: AirGrenade
name: air grenade
description: A special solid state chemical grenade used for quickly releasing standard air into a spaced area. Fills up to 30 tiles!
diff --git a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml
index 54b77d5c07..4bdb34b0c5 100644
--- a/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml
+++ b/Resources/Prototypes/Entities/Objects/Weapons/Throwable/grenades.yml
@@ -1,7 +1,7 @@
- type: entity
name: explosive grenade
description: Grenade that creates a small but devastating explosion.
- parent: [VolatileGrenadeBase, GrenadeBase, BaseSyndicateContraband]
+ parent: [VolatileGrenadeBase, TimerGrenadeBase, BaseSyndicateContraband]
id: ExGrenade
components:
- type: ExplodeOnTrigger
@@ -31,7 +31,7 @@
- type: entity
name: flashbang
description: Eeeeeeeeeeeeeeeeeeeeee.
- parent: [ FragileGrenadeBase, GrenadeBase, BaseSecurityContraband ]
+ parent: [ FragileGrenadeBase, TimerGrenadeBase, BaseSecurityContraband ]
id: GrenadeFlashBang
components:
- type: Sprite
@@ -88,12 +88,12 @@
- type: TimedDespawn
lifetime: 0.5
-#The explosive values for these are pretty god damn mediocre, but SS14's explosion system is hard to understand - this is a good enough approximation of how it was in SS13.
-#Ideally, there should be a weak radius around the bomb outside of its gibbing / spacing range capable of dealing fair damage to players / structures.
+# Tuned to be a general bomb that deals equipment damage without explicitly gibbing, however it will still gladly instakill anyone that mishandles it.
+# One of the few syndie bombs that should punch holes in space.
- type: entity
name: syndicate minibomb
description: A syndicate-manufactured explosive used to stow destruction and cause chaos.
- parent: [VolatileGrenadeBase, GrenadeBase, BaseSyndicateContraband]
+ parent: [VolatileGrenadeBase, TimerGrenadeBase, BaseSyndicateContraband]
id: SyndieMiniBomb
components:
- type: Sprite
@@ -122,7 +122,7 @@
- type: entity
name: self destruct
description: Go out on your own terms!
- parent: GrenadeBase
+ parent: TimerGrenadeBase
id: SelfDestructSeq
categories: [ HideSpawnMenu ]
components:
@@ -148,7 +148,7 @@
- type: entity
- parent: [ FragileGrenadeBase, GrenadeBase, BaseSyndicateContraband ]
+ parent: [ FragileGrenadeBase, TimerGrenadeBase, BaseSyndicateContraband ]
id: SingularityGrenade
name: singularity grenade
description: Grenade that simulates the power of a singularity, pulling things in a heap.
@@ -281,7 +281,7 @@
- type: entity
name: the nuclear option
description: Please don't throw it, think of the children.
- parent: GrenadeBase
+ parent: TimerGrenadeBase
id: NuclearGrenade
components:
- type: Sprite
@@ -362,7 +362,7 @@
- type: entity
name: EMP grenade
description: A grenade designed to wreak havoc on electronic systems.
- parent: [FragileGrenadeBase, GrenadeBase, BaseSyndicateContraband]
+ parent: [ImpactGrenadeBase, BaseSyndicateContraband]
id: EmpGrenade
components:
- type: Sprite
@@ -370,15 +370,11 @@
- type: EmpOnTrigger
keysIn:
- timer
- range: 11 #5.5 Sunrise-Edit
+ range: 8 #5.5 Sunrise-Edit
energyConsumption: 50000
- type: DeleteOnTrigger
keysIn:
- - timer
- - type: Appearance
- - type: TimerTriggerVisuals
- primingSound:
- path: /Audio/Effects/countdown.ogg
+ - trigger
- type: StaticPrice
price: 666 # 2000 for 3, I love fractions
- type: Tag #Sunrise-Start
@@ -394,7 +390,7 @@
- type: entity
name: holy hand grenade
description: O Lord, bless this thy hand grenade, that with it thou mayst blow thine enemies to tiny bits, in thy mercy.
- parent: [GrenadeBase, BaseSyndicateContraband]
+ parent: [TimerGrenadeBase, BaseSyndicateContraband]
id: HolyHandGrenade
components:
- type: Sprite
@@ -425,7 +421,7 @@
- type: entity
name: trick grenade
description: All the grenade without any of the boom.
- parent: GrenadeBase
+ parent: TimerGrenadeBase
id: GrenadeDummy
components:
- type: Sprite
diff --git a/Resources/Prototypes/Entities/Structures/Machines/bombs.yml b/Resources/Prototypes/Entities/Structures/Machines/bombs.yml
index 21228f2cbb..fca87a7bb3 100644
--- a/Resources/Prototypes/Entities/Structures/Machines/bombs.yml
+++ b/Resources/Prototypes/Entities/Structures/Machines/bombs.yml
@@ -129,8 +129,8 @@
- type: Explosive
explosionType: HardBomb
totalIntensity: 4000.0
- intensitySlope: 3
- maxIntensity: 400
+ intensitySlope: 10
+ maxIntensity: 75
- type: StaticPrice
price: 10000 # Good luck!