Class: NPC

NPC


new NPC(username, avatarURL [, id])

A player object representing a non-player. It makes sense I promise. This represents a Player in the game, that is not attached to a real account. Serializable.
Parameters:
Name Type Argument Description
username string The username to show for this npc.
avatarURL string The url (or fake url) of the image to use as the player's avatar.
id string <optional>
Id to assign, if a valid id is not provided, a random id will be generated.
Source:

Extends

Members


avatarURL :string

The URL to the discord avatar of the User.
Type:
  • string
Inherited From:
Overrides:
Default Value:
  • ''
Source:

bleeding :number

How many days has the player been wounded.
Type:
  • number
Inherited From:
Overrides:
Source:

dayOfDeath :number

The day at which the player last died in the game. Only a valid number if the player is currently dead. Otherwise a garbage value will be available.
Type:
  • number
Inherited From:
Overrides:
Source:

id :string

The id of the User this Player represents.
Type:
  • string
Inherited From:
Overrides:
Source:

<constant> isNPC :boolean

Always true.
Type:
  • boolean
Default Value:
  • true
Source:

kills :number

The number of players this player has caused to die.
Type:
  • number
Inherited From:
Overrides:
Source:

living :boolean

Is the player still alive.
Type:
  • boolean
Inherited From:
Overrides:
Default Value:
  • true
Source:

name :string

The name of this Player.
Type:
  • string
Inherited From:
Overrides:
Source:

nickname :string

The nickname for this user usually assigned by the guild. If the user does not have a nickname, this will have the same value as `name`.
Type:
  • string
Inherited From:
Overrides:
Source:

rank :number

The current rank of the player in the game.
Type:
  • number
Inherited From:
Overrides:
Default Value:
  • 1
Source:

settings :object

Custom settings for this user associated with the games.
Type:
  • object
Inherited From:
Overrides:
Default Value:
  • {}
Source:

state :string

The current player state (normal, wounded, dead, zombie).
Type:
  • string
Inherited From:
Overrides:
Default Value:
  • normal
Source:

username :string

Equivalent to `this.name` for compatibility.
Type:
  • string
Source:

weapons :object.<number>

The weapons the player currently has and how many of each.
Type:
  • object.<number>
Inherited From:
Overrides:
Default Value:
  • {}
Source: