Skip to content

Commit

Permalink
psi-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Rxup committed Mar 2, 2025
1 parent 850b626 commit ca04b11
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
18 changes: 6 additions & 12 deletions Content.Server/Backmen/StationEvents/Events/GlimmerBreakerRule.cs
Original file line number Diff line number Diff line change
@@ -1,26 +1,21 @@
using System.Linq;
using Content.Server.Backmen.StationEvents.Components;
using Content.Server.Emp;
using Content.Server.Power.Components;
using Content.Server.Shuttles.Components;
using Content.Server.Station.Components;
using Content.Server.Station.Systems;
using Content.Server.StationEvents.Events;
using Content.Shared.Backmen.Psionics.Glimmer;
using Content.Shared.Construction.EntitySystems;
using Content.Shared.GameTicking.Components;
using Content.Shared.Station.Components;
using Robust.Server.GameObjects;
using Robust.Shared.Random;

namespace Content.Server.Backmen.StationEvents.Events;

public sealed class GlimmerBreakerRule : StationEventSystem<GlimmerBreakerRuleComponent>
{
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly MapSystem _mapSystem = default!;
[Dependency] private readonly AnchorableSystem _anchorable = default!;
[Dependency] private readonly GlimmerSystem _glimmerSystem = default!;
[Dependency] private readonly StationSystem _stationSystem = default!;
[Dependency] private readonly EmpSystem _emp = default!;

protected override void Started(EntityUid uid,
GlimmerBreakerRuleComponent component,
Expand All @@ -35,6 +30,8 @@ protected override void Started(EntityUid uid,
.ToHashSet();

var query = EntityQueryEnumerator<ApcComponent, TransformComponent>();
var shuttleQuery = GetEntityQuery<ShuttleComponent>();

List<Entity<ApcComponent>> inShuttle = [];
List<Entity<ApcComponent>> notInShuttle = [];

Expand All @@ -46,13 +43,12 @@ protected override void Started(EntityUid uid,
continue;
}

var isShuttle = HasComp<ShuttleComponent>(gridUid.Value);
if (!apc.MainBreakerEnabled)
{
continue;
}

if (isShuttle)
if (shuttleQuery.HasComp(gridUid.Value))
{
inShuttle.Add((owner, apc));
}
Expand All @@ -69,8 +65,6 @@ protected override void Started(EntityUid uid,
}

var item = _robustRandom.Pick(inShuttle.Count > 0 ? inShuttle : notInShuttle);
item.Comp.MainBreakerEnabled = false;
item.Comp.NeedStateUpdate = true;
return;
_emp.DoEmpEffects(item, 1000, 10);
}
}
2 changes: 1 addition & 1 deletion Resources/Locale/ru-RU/backmen/abilities/psionic.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ glimmer-change-notification = Уровень сияния изменился с
glimmer-report = Текущий уровень сияния: { $level }Ψ.
glimmer-event-report-generic = Ноосферический разряд не обнаружен. Уровень сияния снизился на { $decrease } до { $level }Ψ.
glimmer-event-report-signatures = Проявились новые псионические сигнатуры. Уровень сияния снизился на { $decrease } до { $level }Ψ.
glimmer-event-breaker = Псионическое напряжение вызывает сбои в электронных системах станции и связанных с ней шаттлами.
glimmer-event-breaker = В одном из ЛКП произошло срабатывание предохранителя из-за псионического разряда, вызвавшего перегрузку сети. Электропитание в зоне поражения отключено. Требуется вмешательство инженера для переключения предохранителя — система не восстановится самостоятельно. Пожалуйста, избегайте использования оборудования в этой зоне до восстановления питания.
glimmer-event-awakened-prefix = пробудившийся { $entity }
noospheric-zap-seize = Тебя схватили!
noospheric-zap-seize-potential-regained = Ты захвачен! Какой-то ментальный блок, похоже, тоже снялся.
Expand Down
8 changes: 4 additions & 4 deletions Resources/Prototypes/_Backmen/GameRules/events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@
id: PsiBackmenEventsTable
table: !type:AllSelector
children:
- id: GlimmerWispSpawn
- id: NoosphericZap
- id: NoosphericFry
- id: PsionicCatGotYourTongue
- id: MassMindSwap
- id: GlimmerWispSpawn
- id: GlimmerRandomSentience
- id: GlimmerRevenantSpawn
- id: GlimmerBreaker
- id: NoosphericStorm
- !type:NestedSelector
tableId: FreeProberEventsTable
Expand Down Expand Up @@ -244,17 +244,17 @@
- type: FreeProberRule

- type: entity
id: GlimmerBreak
id: GlimmerBreaker
parent: BaseGlimmerEvent
categories: [ HideSpawnMenu ]
components:
- type: StationEvent
weight: 12
earliestStart: 1
reoccurrenceDelay: 1
minimumPlayers: 10
minimumPlayers: 5
- type: GlimmerEvent
minimumGlimmer: 50
minimumGlimmer: 30
maximumGlimmer: 500
report: glimmer-event-breaker
- type: GlimmerBreakerRule
Expand Down

0 comments on commit ca04b11

Please sign in to comment.