-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work towards cleaning up, making the Eye better.
- Loading branch information
1 parent
29de297
commit d29cb66
Showing
10 changed files
with
140 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
54 changes: 54 additions & 0 deletions
54
Content.Shared/SimpleStation14/StationAI/Systems/SharedAiEyeSystem.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
using Content.Shared.Actions; | ||
using Content.Shared.Actions.ActionTypes; | ||
using Content.Shared.SimpleStation14.StationAI; | ||
using Robust.Shared.Prototypes; | ||
using Content.Shared.Mobs; | ||
using Content.Shared.Mobs.Systems; | ||
using Robust.Shared.Audio; | ||
using Robust.Shared.Player; | ||
using Content.Shared.Borgs; | ||
using Content.Shared.SimpleStation14.Holograms.Components; | ||
using Content.Shared.SimpleStation14.Holograms; | ||
using Robust.Shared.Timing; | ||
|
||
namespace Content.Shared.SimpleStation14.StationAI.Systems; | ||
|
||
public sealed class SharedAiEyeSystem : EntitySystem | ||
{ | ||
[Dependency] private readonly IPrototypeManager _prototypeManager = default!; | ||
[Dependency] private readonly SharedActionsSystem _actions = default!; | ||
[Dependency] private readonly IEntityManager _entityManager = default!; | ||
[Dependency] private readonly MobStateSystem _mobState = default!; | ||
[Dependency] private readonly SharedHologramSystem _hologramSystem = default!; | ||
[Dependency] private readonly IGameTiming _timing = default!; | ||
|
||
public override void Initialize() | ||
{ | ||
SubscribeLocalEvent<AIEyeComponent, HologramGetProjectorEvent>(OnHologramGetProjector); | ||
SubscribeLocalEvent<AIEyeComponent, HologramCheckProjectorValidEvent>(OnHologramCheckProjectorValid); | ||
} | ||
|
||
private void OnHologramGetProjector(EntityUid eyeUid, AIEyeComponent eyeComp, ref HologramGetProjectorEvent args) | ||
{ | ||
if (!TryComp<HologramProjectedComponent>(eyeUid, out var projectedComp)) | ||
return; | ||
|
||
if (!_hologramSystem.IsHoloProjectorValid(eyeUid, projectedComp.CurProjector, projectedComp: projectedComp)) | ||
return; | ||
|
||
|
||
} | ||
|
||
private void OnHologramCheckProjectorValid(EntityUid eyeUid, AIEyeComponent eyeComp, ref HologramCheckProjectorValidEvent args) | ||
{ | ||
if (!HasComp<AIEyePowerComponent>(args.Projector) || !TryComp<HologramServerLinkedComponent>(eyeUid, out var serverLinkedComp) || !_hologramSystem.IsHoloProjectorValid(eyeUid, args.Projector, raiseEvent: false)) | ||
return; | ||
|
||
if (serverLinkedComp.LinkedServer != args.Projector) | ||
{ | ||
Log.Error($"Projector {args.Projector} is not valid for eye {eyeUid}"); | ||
args.Valid = false; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters