Skip to content
Merged
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6d99b8c
trigger refactor
slarticodefast Jul 14, 2025
7744eef
Merge branch 'master' into predicttriggers2
slarticodefast Jul 15, 2025
13d7665
make it compile
slarticodefast Jul 15, 2025
ad40376
start fixing prototypes
slarticodefast Jul 15, 2025
e5bb2bf
cleanup TriggerOnX
slarticodefast Jul 16, 2025
abf04fe
adjust yaml to new keys
slarticodefast Jul 17, 2025
a05ed2b
stop the linter from complaining
slarticodefast Jul 17, 2025
9aeb9c2
fix linter
slarticodefast Jul 17, 2025
9218e18
fix tests
slarticodefast Jul 17, 2025
80d8e38
one more fix
slarticodefast Jul 17, 2025
dc429d3
abstract component
slarticodefast Jul 17, 2025
689b24a
partial review
slarticodefast Jul 20, 2025
65c86f7
fix c4
slarticodefast Jul 20, 2025
36a97c9
TriggerVisuals yaml fix
slarticodefast Jul 20, 2025
4b173d2
fix integration test
slarticodefast Jul 20, 2025
5ec07d2
Merge branch 'master' into predicttriggers2
slarticodefast Jul 23, 2025
2081b5e
fix networking
slarticodefast Jul 23, 2025
a37232d
small fixes
slarticodefast Jul 23, 2025
faa7ada
fix soaplet
slarticodefast Jul 23, 2025
e29e4cf
fix mouse trap damage
slarticodefast Jul 23, 2025
a76600a
add shopopup parameter
slarticodefast Jul 24, 2025
4d6af5d
more fixes
slarticodefast Jul 27, 2025
4e0a37d
some more fixes
slarticodefast Jul 28, 2025
0301722
partial review
slarticodefast Aug 1, 2025
0f1acff
fix proximity
slarticodefast Aug 1, 2025
37e81ed
implant owner
slarticodefast Aug 2, 2025
6100327
fix rattles
slarticodefast Aug 2, 2025
004c075
hot potato popups
slarticodefast Aug 2, 2025
97f6d79
Merge branch 'master' into predicttriggers2
slarticodefast Aug 3, 2025
c743d57
bring back InitialBeepDelay
slarticodefast Aug 3, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Content.Client/Explosion/SmokeOnTriggerSystem.cs

This file was deleted.

7 changes: 0 additions & 7 deletions Content.Client/Explosion/TriggerOnProximityComponent.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Content.Client/Explosion/TriggerSystem.cs

This file was deleted.

1 change: 1 addition & 0 deletions Content.Client/HotPotato/HotPotatoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ public sealed class HotPotatoSystem : SharedHotPotatoSystem
[Dependency] private readonly IRobustRandom _random = default!;
[Dependency] private readonly SharedTransformSystem _transform = default!;

// TODO: particle system
public override void Update(float frameTime)
{
base.Update(frameTime);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using Content.Client.Trigger.Systems;
using Robust.Client.Animations;
using Robust.Shared.Audio;

namespace Content.Client.Trigger;
namespace Content.Client.Trigger.Components;

[RegisterComponent]
[Access(typeof(TimerTriggerVisualizerSystem))]
Expand All @@ -16,28 +17,27 @@ public sealed partial class TimerTriggerVisualsComponent : Component
/// <summary>
/// The RSI state used while the device has not been primed.
/// </summary>
[DataField("unprimedSprite")]
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public string UnprimedSprite = "icon";

/// <summary>
/// The RSI state used when the device is primed.
/// Not VVWrite-able because it's only used at component init to construct the priming animation.
/// </summary>
[DataField("primingSprite")]
[DataField]
public string PrimingSprite = "primed";

/// <summary>
/// The sound played when the device is primed.
/// Not VVWrite-able because it's only used at component init to construct the priming animation.
/// </summary>
[DataField("primingSound")]
[DataField, ViewVariables]
public SoundSpecifier? PrimingSound;

/// <summary>
/// The actual priming animation.
/// Constructed at component init from the sprite and sound.
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[ViewVariables]
public Animation PrimingAnimation = default!;
}
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using Content.Shared.Trigger;
using Content.Shared.Trigger.Components.Triggers;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Animations;

namespace Content.Client.Explosion;
namespace Content.Client.Trigger.Systems;

public sealed partial class TriggerSystem
public sealed class ProximityTriggerAnimationSystem : EntitySystem
{
[Dependency] private readonly AnimationPlayerSystem _player = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
Expand All @@ -18,7 +19,7 @@ public sealed partial class TriggerSystem

private const string AnimKey = "proximity";

private static readonly Animation _flasherAnimation = new Animation
private static readonly Animation FlasherAnimation = new Animation
{
Length = TimeSpan.FromSeconds(0.6f),
AnimationTracks = {
Expand All @@ -42,8 +43,10 @@ public sealed partial class TriggerSystem
}
};

private void InitializeProximity()
public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<TriggerOnProximityComponent, ComponentInit>(OnProximityInit);
SubscribeLocalEvent<TriggerOnProximityComponent, AppearanceChangeEvent>(OnProxAppChange);
SubscribeLocalEvent<TriggerOnProximityComponent, AnimationCompletedEvent>(OnProxAnimation);
Expand Down Expand Up @@ -94,7 +97,7 @@ private void OnChangeData(EntityUid uid, TriggerOnProximityComponent component,
break;
case ProximityTriggerVisuals.Active:
if (_player.HasRunningAnimation(uid, player, AnimKey)) return;
_player.Play((uid, player), _flasherAnimation, AnimKey);
_player.Play((uid, player), FlasherAnimation, AnimKey);
break;
case ProximityTriggerVisuals.Off:
default:
Expand Down
5 changes: 5 additions & 0 deletions Content.Client/Trigger/Systems/ReleaseGasOnTriggerSystem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
using Content.Shared.Trigger.Systems;

namespace Content.Client.Trigger.Systems;

public sealed class ReleaseGasOnTriggerSystem : SharedReleaseGasOnTriggerSystem;
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
using Content.Client.Trigger.Components;
using Content.Shared.Trigger;
using Robust.Client.Animations;
using Robust.Client.GameObjects;
using Robust.Shared.Audio;
using Robust.Shared.Audio.Systems;
using Robust.Shared.GameObjects;

namespace Content.Client.Trigger;
namespace Content.Client.Trigger.Systems;

public sealed class TimerTriggerVisualizerSystem : VisualizerSystem<TimerTriggerVisualsComponent>
{
Expand All @@ -17,25 +16,26 @@ public override void Initialize()
SubscribeLocalEvent<TimerTriggerVisualsComponent, ComponentInit>(OnComponentInit);
}

private void OnComponentInit(EntityUid uid, TimerTriggerVisualsComponent comp, ComponentInit args)
private void OnComponentInit(Entity<TimerTriggerVisualsComponent> ent, ref ComponentInit args)
{
comp.PrimingAnimation = new Animation
ent.Comp.PrimingAnimation = new Animation
{
Length = TimeSpan.MaxValue,
AnimationTracks = {
new AnimationTrackSpriteFlick() {
new AnimationTrackSpriteFlick()
{
LayerKey = TriggerVisualLayers.Base,
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(comp.PrimingSprite, 0f) }
KeyFrames = { new AnimationTrackSpriteFlick.KeyFrame(ent.Comp.PrimingSprite, 0f) }
}
},
};

if (comp.PrimingSound != null)
if (ent.Comp.PrimingSound != null)
{
comp.PrimingAnimation.AnimationTracks.Add(
ent.Comp.PrimingAnimation.AnimationTracks.Add(
new AnimationTrackPlaySound()
{
KeyFrames = { new AnimationTrackPlaySound.KeyFrame(_audioSystem.ResolveSound(comp.PrimingSound), 0) }
KeyFrames = { new AnimationTrackPlaySound.KeyFrame(_audioSystem.ResolveSound(ent.Comp.PrimingSound), 0) }
}
);
}
Expand Down
16 changes: 8 additions & 8 deletions Content.IntegrationTests/Tests/Payload/ModularGrenadeTests.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using Content.IntegrationTests.Tests.Interaction;
using Content.Server.Explosion.Components;
using Content.Shared.Explosion.Components;
using Content.Shared.Trigger.Components;
using Content.Shared.Trigger.Systems;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;

Expand All @@ -25,19 +25,19 @@ public async Task AssembleAndDetonateGrenade()
await InteractUsing(Cable);

// Insert & remove trigger
AssertComp<OnUseTimerTriggerComponent>(false);
AssertComp<TimerTriggerComponent>(false);
await InteractUsing(Trigger);
AssertComp<OnUseTimerTriggerComponent>();
AssertComp<TimerTriggerComponent>();
await FindEntity(Trigger, LookupFlags.Uncontained, shouldSucceed: false);
await InteractUsing(Pry);
AssertComp<OnUseTimerTriggerComponent>(false);
AssertComp<TimerTriggerComponent>(false);

// Trigger was dropped to floor, not deleted.
await FindEntity(Trigger, LookupFlags.Uncontained);

// Re-insert
await InteractUsing(Trigger);
AssertComp<OnUseTimerTriggerComponent>();
AssertComp<TimerTriggerComponent>();

// Insert & remove payload.
await InteractUsing(Payload);
Expand All @@ -61,8 +61,8 @@ public async Task AssembleAndDetonateGrenade()
await Drop();

// Wait until grenade explodes
var timer = Comp<ActiveTimerTriggerComponent>();
while (timer.TimeRemaining >= 0)
var triggerSys = SEntMan.System<TriggerSystem>();
while (triggerSys.GetRemainingTime(ent)?.TotalSeconds >= 0.0)
{
await RunTicks(10);
}
Expand Down
33 changes: 0 additions & 33 deletions Content.Server/AlertLevel/AlertLevelChangeOnTriggerComponent.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Content.Server/Animals/Systems/ParrotMemorySystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
using Content.Server.Mind;
using Content.Server.Popups;
using Content.Server.Radio;
using Content.Server.Speech;
using Content.Server.Speech.Components;
using Content.Server.Vocalization.Systems;
using Content.Shared.Database;
using Content.Shared.Mobs.Systems;
using Content.Shared.Popups;
using Content.Shared.Speech;
using Content.Shared.Speech.Components;
using Content.Shared.Verbs;
using Content.Shared.Whitelist;
using Robust.Shared.Network;
Expand Down
17 changes: 0 additions & 17 deletions Content.Server/Chat/SpeakOnTriggerComponent.cs

This file was deleted.

3 changes: 3 additions & 0 deletions Content.Server/Chat/SuicideSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public bool Suicide(EntityUid victim)
if (!suicideGhostEvent.Handled || _tagSystem.HasTag(victim, CannotSuicideTag))
return false;

// TODO: fix this
// This is a handled event, but the result is never used
// It looks like TriggerOnMobstateChange is supposed to prevent you from suiciding
var suicideEvent = new SuicideEvent(victim);
RaiseLocalEvent(victim, suicideEvent);

Expand Down
5 changes: 0 additions & 5 deletions Content.Server/Chat/Systems/ChatSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ public sealed partial class ChatSystem : SharedChatSystem
[Dependency] private readonly EntityWhitelistSystem _whitelistSystem = default!;
[Dependency] private readonly ExamineSystemShared _examineSystem = default!;

public const int VoiceRange = 10; // how far voice goes in world units
public const int WhisperClearRange = 2; // how far whisper goes while still being understandable, in world units
public const int WhisperMuffledRange = 5; // how far whisper goes at all, in world units
public const string DefaultAnnouncementSound = "/Audio/Announcements/announce.ogg";

private bool _loocEnabled = true;
private bool _deadLoocEnabled;
private bool _critLoocEnabled;
Expand Down
50 changes: 0 additions & 50 deletions Content.Server/Damage/Systems/DamageUserOnTriggerSystem.cs

This file was deleted.

Loading
Loading