Adjust various traitor explosives (#42477)

* adj explosions

* yuuup

* next release

* cleanup and EMP changes

* minibomb revert, wait until gib experiment

---------

Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
This commit is contained in:
ArtisticRoomba
2026-01-19 13:54:12 -08:00
committed by GitHub
parent 27c803aeb2
commit 966f244048
11 changed files with 77 additions and 82 deletions

View File

@@ -68,7 +68,8 @@ public abstract class SharedEmpSystem : EntitySystem
/// <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);
@@ -80,7 +81,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);
}
/// <summary>

View File

@@ -9,7 +9,7 @@ public sealed class EmpOnTriggerSystem : XOnTriggerSystem<EmpOnTriggerComponent>
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;
}
}

View File

@@ -14,6 +14,6 @@ public sealed partial class TriggerOnLandSystem : TriggerOnXSystem
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);
}
}

View File

@@ -67,15 +67,16 @@ public sealed partial class TriggerSystem : EntitySystem
/// <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;
}

View File

@@ -9,8 +9,9 @@ namespace Content.Shared.Trigger;
/// 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.

View File

@@ -286,16 +286,11 @@
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
@@ -355,7 +350,7 @@
discountDownTo:
Telecrystal: 3
cost:
Telecrystal: 5
Telecrystal: 4
categories:
- UplinkExplosives
conditions:
@@ -466,19 +461,6 @@
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
@@ -505,19 +487,6 @@
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

View File

@@ -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.

View File

@@ -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

View File

@@ -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.
@@ -81,7 +81,7 @@
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!

View File

@@ -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
@@ -24,7 +24,7 @@
- type: entity
name: flashbang
description: Eeeeeeeeeeeeeeeeeeeeee.
parent: [ FragileGrenadeBase, GrenadeBase, BaseSecurityContraband ]
parent: [ FragileGrenadeBase, TimerGrenadeBase, BaseSecurityContraband ]
id: GrenadeFlashBang
components:
- type: Sprite
@@ -74,12 +74,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
@@ -108,7 +108,7 @@
- type: entity
name: self destruct
description: Go out on your own terms!
parent: GrenadeBase
parent: TimerGrenadeBase
id: SelfDestructSeq
categories: [ HideSpawnMenu ]
components:
@@ -134,7 +134,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.
@@ -267,7 +267,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
@@ -348,30 +348,26 @@
- 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
@@ -402,7 +398,7 @@
- type: entity
name: trick grenade
description: All the grenade without any of the boom.
parent: GrenadeBase
parent: TimerGrenadeBase
id: GrenadeDummy
components:
- type: Sprite

View File

@@ -126,8 +126,8 @@
- type: Explosive
explosionType: HardBomb
totalIntensity: 4000.0
intensitySlope: 3
maxIntensity: 400
intensitySlope: 10
maxIntensity: 75
- type: StaticPrice
price: 10000 # Good luck!