Options
All
  • Public
  • Public/Protected
  • All
Menu

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

  • RoomType: Hostable

Hierarchy

Implements

Index

Properties

Static eventName

eventName: "player.checkprotect" = ...

eventName

eventName: "player.checkprotect" = ...

Readonly isValid

isValid: boolean

Readonly message

message: undefined | CheckProtectMessage

The message that this event originated from.

Readonly player

player: PlayerData<RoomType>

The player that this event is for.

Readonly room

room: RoomType

The room or client that the event came from.

Readonly target

target: PlayerData<RoomType>

Accessors

alteredIsValid

  • get alteredIsValid(): boolean

alteredPlayer

  • get alteredPlayer(): PlayerData<RoomType>

alteredTarget

  • get alteredTarget(): PlayerData<RoomType>

Constructors

constructor

  • new PlayerCheckProtectEvent<RoomType>(room: RoomType, player: PlayerData<RoomType>, message: undefined | CheckProtectMessage, target: PlayerData<RoomType>, isValid: boolean): PlayerCheckProtectEvent<RoomType>

Methods

setPlayer

  • setPlayer(player: PlayerData<RoomType>): void

setTarget

  • setTarget(target: PlayerData<RoomType>): void

setValid

  • setValid(isValid: boolean): 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