StrippableSystem doafter overhaul (#25994)

* Initial commit

* Fixed short circuiting

* Use DebugTools

* Use Entity<TComp> more, and make them nullable

* Bring these two together
This commit is contained in:
Krunklehorn
2024-03-14 22:57:52 -04:00
committed by GitHub
parent 0fdb551c3d
commit 41ca8f3dfc
7 changed files with 517 additions and 357 deletions

View File

@@ -14,12 +14,12 @@ public abstract class SharedStrippableSystem : EntitySystem
SubscribeLocalEvent<StrippableComponent, DragDropDraggedEvent>(OnDragDrop);
}
public (float Time, bool Stealth) GetStripTimeModifiers(EntityUid user, EntityUid target, float initialTime)
public (TimeSpan Time, bool Stealth) GetStripTimeModifiers(EntityUid user, EntityUid target, TimeSpan initialTime)
{
var userEv = new BeforeStripEvent(initialTime);
RaiseLocalEvent(user, userEv);
RaiseLocalEvent(user, ref userEv);
var ev = new BeforeGettingStrippedEvent(userEv.Time, userEv.Stealth);
RaiseLocalEvent(target, ev);
RaiseLocalEvent(target, ref ev);
return (ev.Time, ev.Stealth);
}