Travelling pointing arrows, brains can no longer point (#24864)

* Decoupled from gravity, constant animation time, manual networking, cubic interpolation

* Reduced overshoot

* Implemented PointAttemptEvent, reacts with mobstate & sleeping

* Brains can no longer point, PBs must be inside a chassis

* Removed chassis check, made callback more obvious
This commit is contained in:
Krunklehorn
2024-02-03 03:09:20 -05:00
committed by GitHub
parent 240ebfa3a6
commit d01d75073c
10 changed files with 172 additions and 64 deletions

View File

@@ -14,6 +14,7 @@ using Content.Shared.Mind.Components;
using Content.Shared.Mobs;
using Content.Shared.Mobs.Systems;
using Content.Shared.Movement.Systems;
using Content.Shared.Pointing;
using Content.Shared.PowerCell;
using Content.Shared.PowerCell.Components;
using Content.Shared.Roles;
@@ -67,6 +68,7 @@ public sealed partial class BorgSystem : SharedBorgSystem
SubscribeLocalEvent<BorgChassisComponent, GetCharactedDeadIcEvent>(OnGetDeadIC);
SubscribeLocalEvent<BorgBrainComponent, MindAddedMessage>(OnBrainMindAdded);
SubscribeLocalEvent<BorgBrainComponent, PointAttemptEvent>(OnBrainPointAttempt);
InitializeModules();
InitializeMMI();
@@ -242,6 +244,11 @@ public sealed partial class BorgSystem : SharedBorgSystem
_mind.TransferTo(mindId, containerEnt, mind: mind);
}
private void OnBrainPointAttempt(EntityUid uid, BorgBrainComponent component, PointAttemptEvent args)
{
args.Cancel();
}
private void UpdateBatteryAlert(EntityUid uid, PowerCellSlotComponent? slotComponent = null)
{
if (!_powerCell.TryGetBatteryFromSlot(uid, out var battery, slotComponent))