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

@@ -4,6 +4,7 @@ using Content.Shared.Body.Components;
using Content.Shared.Body.Events;
using Content.Shared.Mind;
using Content.Shared.Mind.Components;
using Content.Shared.Pointing;
namespace Content.Server.Body.Systems
{
@@ -17,6 +18,7 @@ namespace Content.Server.Body.Systems
SubscribeLocalEvent<BrainComponent, AddedToPartInBodyEvent>((uid, _, args) => HandleMind(args.Body, uid));
SubscribeLocalEvent<BrainComponent, RemovedFromPartInBodyEvent>((uid, _, args) => HandleMind(uid, args.OldBody));
SubscribeLocalEvent<BrainComponent, PointAttemptEvent>(OnPointAttempt);
}
private void HandleMind(EntityUid newEntity, EntityUid oldEntity)
@@ -36,5 +38,10 @@ namespace Content.Server.Body.Systems
_mindSystem.TransferTo(mindId, newEntity, mind: mind);
}
private void OnPointAttempt(EntityUid uid, BrainComponent component, PointAttemptEvent args)
{
args.Cancel();
}
}
}