Class PlayerCheckProtectEvent<RoomType>

Emitted when a player (i.e. a guardian angel) is attempting to protect another player, and is requesting the host to verify the attempt and actually protect the player. Only admitted if the client is the host.

This event is useful if you want to prevent a protect from actually happening, before it happens. Therefore this event doesn't guarantee that the target is actually dead, see PlayerProtectEvent to listen for that.

Type Parameters

Hierarchy

  • BasicEvent
    • PlayerCheckProtectEvent

Implements

Properties

eventName: "player.checkprotect"
eventName: "player.checkprotect"
isValid: boolean

Whether or not this protect would normally be considered valid and thus the player be protected.

message: undefined | CheckProtectMessage

The message that this event originated from.

player: PlayerData<RoomType>

The player that this event is for.

room: RoomType

The room or client that the event came from.

target: PlayerData<RoomType>

The other player that the player is attempting to protect.

Accessors

  • get alteredIsValid(): boolean
  • Whether or not this protect will be considered valid instead, if altered.

    Returns boolean

  • get alteredPlayer(): PlayerData<RoomType>
  • The player that will protect the target instead, if altered.

    Returns PlayerData<RoomType>

  • get alteredTarget(): PlayerData<RoomType>
  • The player that will protected instead, if altered.

    Returns PlayerData<RoomType>

Constructors

  • Type Parameters

    Parameters

    • room: RoomType
    • player: PlayerData<RoomType>
    • message: undefined | CheckProtectMessage
    • target: PlayerData<RoomType>

      The other player that the player is attempting to protect.

    • isValid: boolean

      Whether or not this protect would normally be considered valid and thus the player be protected.

    Returns PlayerCheckProtectEvent<RoomType>

Methods

  • Change the player that will actually protect the target.

    Parameters

    Returns void

  • Change the player that will actually be protected.

    Parameters

    • target: PlayerData<RoomType>

      The player to protect.

    Returns void

  • Change whether this protect should be consider valid. If valid, ths player will indeed be protected.

    Parameters

    • isValid: boolean

      Whether or not this protect should be considered valid.

    Returns void

Generated using TypeDoc