/// <param name="energyConsumption">The amount of energy consumed by the EMP pulse.</param>
/// <param name="duration">The duration of the EMP effects.</param>
/// <param name="user">The player that caused the effect. Used for predicted audio.</param>
- public void EmpPulse(EntityCoordinates coordinates, float range, float energyConsumption, TimeSpan duration, EntityUid? user = null)
+ /// <param name="predicted">Whether this pulse is being replicated on the client.</param>
+ public void EmpPulse(EntityCoordinates coordinates, float range, float energyConsumption, TimeSpan duration, EntityUid? user = null, bool predicted = true)
{
_entSet.Clear();
_lookup.GetEntitiesInRange(coordinates, range, _entSet);
if (_net.IsServer)
Spawn(EmpPulseEffectPrototype, coordinates);
- _audio.PlayPredicted(EmpSound, coordinates, user);
+ if (predicted)
+ _audio.PlayPredicted(EmpSound, coordinates, user);
+ else
+ _audio.PlayPvs(EmpSound, coordinates);
}
/// <summary>
protected override void OnTrigger(Entity<EmpOnTriggerComponent> 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;
}
}
private void OnLand(Entity<TriggerOnLandComponent> ent, ref LandEvent args)
{
- Trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut);
+ Trigger.Trigger(ent.Owner, args.User, ent.Comp.KeyOut, predicted: false);
}
}
/// <param name="trigger">The entity that has the components that should be triggered.</param>
/// <param name="user">The user of the trigger. Some effects may target the user instead of the trigger entity.</param>
/// <param name="key">A key string to allow multiple, independent triggers on the same entity. If null then all triggers will activate.</param>
+ /// <param name="predicted">Whether or not this trigger is being predicted</param>
/// <returns>Whether or not the trigger has sucessfully activated an effect.</returns>
- 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;
}
/// Setting this to null will activate all triggers.
/// </param>
/// <param name="Handled">Marks the event as handled if at least one trigger effect was activated.</param>
+/// <param name="Predicted">Marks that this trigger is being replicated on the client.</param>
[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);
/// <summary>
/// Raised before a trigger is activated.
Telecrystal: 4
categories:
- UplinkExplosives
-
-- type: listing
- id: UplinkExplosiveGrenadeFlash
- name: uplink-flash-grenade-name
- description: uplink-flash-grenade-desc
- productEntity: GrenadeFlashBang
- cost:
- Telecrystal: 1
- categories:
- - UplinkExplosives
+ conditions:
+ - !type:StoreWhitelistCondition
+ whitelist:
+ tags:
+ - NukeOpsUplink
- type: listing
id: UplinkSmokeGrenade
discountDownTo:
Telecrystal: 3
cost:
- Telecrystal: 5
+ Telecrystal: 4
categories:
- UplinkExplosives
conditions:
tags:
- NukeOpsUplink
-- 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
-
- type: listing
id: UplinkGrenadeShrapnel
name: uplink-shrapnel-grenade-name
categories:
- UplinkExplosives
-- 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
- type: entity
- parent: [ GrenadeBase, BaseMinorContraband ]
+ parent: [ TimerGrenadeBase, BaseMinorContraband ]
id: PipeBomb
name: pipe bomb
description: An improvised explosive made from pipes and wire.
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
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
- 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.
price: 350
- 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!
- 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
- type: entity
name: flashbang
description: Eeeeeeeeeeeeeeeeeeeeee.
- parent: [ FragileGrenadeBase, GrenadeBase, BaseSecurityContraband ]
+ parent: [ FragileGrenadeBase, TimerGrenadeBase, BaseSecurityContraband ]
id: GrenadeFlashBang
components:
- type: Sprite
- 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
- type: entity
name: self destruct
description: Go out on your own terms!
- parent: GrenadeBase
+ parent: TimerGrenadeBase
id: SelfDestructSeq
categories: [ HideSpawnMenu ]
components:
- 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.
- 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
- 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
sprite: Objects/Weapons/Grenades/empgrenade.rsi
- type: EmpOnTrigger
keysIn:
- - timer
+ - trigger
range: 5.5
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: 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
- type: entity
name: trick grenade
description: All the grenade without any of the boom.
- parent: GrenadeBase
+ parent: TimerGrenadeBase
id: GrenadeDummy
components:
- type: Sprite
- type: Explosive
explosionType: HardBomb
totalIntensity: 4000.0
- intensitySlope: 3
- maxIntensity: 400
+ intensitySlope: 10
+ maxIntensity: 75
- type: StaticPrice
price: 10000 # Good luck!