Predict Flashes (#37640)

Co-authored-by: ScarKy0 <scarky0@onet.eu>
This commit is contained in:
slarticodefast
2025-06-23 13:32:56 +02:00
committed by GitHub
parent 7e77ee0cd2
commit b83d00b792
23 changed files with 501 additions and 386 deletions

View File

@@ -0,0 +1,21 @@
using Content.Shared.Inventory;
namespace Content.Shared.Flash;
/// <summary>
/// Called before a flash is used to check if the attempt is cancelled by blindness, items or FlashImmunityComponent.
/// Raised on the target hit by the flash and their inventory items.
/// </summary>
[ByRefEvent]
public record struct FlashAttemptEvent(EntityUid Target, EntityUid? User, EntityUid? Used, bool Cancelled = false) : IInventoryRelayEvent
{
SlotFlags IInventoryRelayEvent.TargetSlots => SlotFlags.HEAD | SlotFlags.EYES | SlotFlags.MASK;
}
/// <summary>
/// Called when a player is successfully flashed.
/// Raised on the target hit by the flash, the user of the flash and the flash used.
/// The Melee parameter is used to check for rev conversion.
/// </summary>
[ByRefEvent]
public record struct AfterFlashedEvent(EntityUid Target, EntityUid? User, EntityUid? Used, bool Melee);