mirror of
https://github.com/space-wizards/space-station-14.git
synced 2026-02-14 19:29:53 +01:00
* initial visual nubody * oops overlay * im so pheeming rn * conversion... * tests * comeback of the underwear * oops eyes * blabbl * zeds * yaml linted * search and visible count constraints * reordering * preserve previously selected markings colors * fix test * some ui niceties * ordering * make DB changes backwards-compatible/downgrade-friendly * fix things again * fix migration * vulpkanin markings limit increase * wrapping * code cleanup and more code cleanup and more code cleanup and more code cleanup and * fix slop ports * better sampling API * make filter work + use the method i made for its intended purpose * fix test fails real quick * magic mirror cleanup, remove TODO * don't 0-init the organ profile data * remove deltastates --------- Co-authored-by: Princess Cheeseballs <66055347+Pronana@users.noreply.github.com>
46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using Content.Server.GameTicking.Rules.Components;
|
|
using Content.Server.StationEvents.Components;
|
|
using Content.Server.Traits.Assorted;
|
|
using Content.Shared.GameTicking.Components;
|
|
using Content.Shared.Humanoid;
|
|
using Content.Shared.Mind.Components;
|
|
using Content.Shared.Traits.Assorted;
|
|
|
|
|
|
namespace Content.Server.StationEvents.Events;
|
|
|
|
public sealed class MassHallucinationsRule : StationEventSystem<MassHallucinationsRuleComponent>
|
|
{
|
|
[Dependency] private readonly ParacusiaSystem _paracusia = default!;
|
|
|
|
protected override void Started(EntityUid uid, MassHallucinationsRuleComponent component, GameRuleComponent gameRule, GameRuleStartedEvent args)
|
|
{
|
|
base.Started(uid, component, gameRule, args);
|
|
|
|
var query = EntityQueryEnumerator<MindContainerComponent, HumanoidProfileComponent>();
|
|
while (query.MoveNext(out var ent, out _, out _))
|
|
{
|
|
if (!EnsureComp<ParacusiaComponent>(ent, out var paracusia))
|
|
{
|
|
_paracusia.SetSounds(ent, component.Sounds, paracusia);
|
|
_paracusia.SetTime(ent, component.MinTimeBetweenIncidents, component.MaxTimeBetweenIncidents, paracusia);
|
|
_paracusia.SetDistance(ent, component.MaxSoundDistance);
|
|
|
|
component.AffectedEntities.Add(ent);
|
|
}
|
|
}
|
|
}
|
|
|
|
protected override void Ended(EntityUid uid, MassHallucinationsRuleComponent component, GameRuleComponent gameRule, GameRuleEndedEvent args)
|
|
{
|
|
base.Ended(uid, component, gameRule, args);
|
|
|
|
foreach (var ent in component.AffectedEntities)
|
|
{
|
|
RemComp<ParacusiaComponent>(ent);
|
|
}
|
|
|
|
component.AffectedEntities.Clear();
|
|
}
|
|
}
|