Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Player

Hierarchy

  • Player

Implements

Index

Constructors

constructor

  • Returns Player

Properties

attack

attack: number = 0

benignity

benignity: number = 0

customization

customization: IPlayerCustomization

deathBy

deathBy: string = messages[Message.Mysteriously] as string

defense

defense: PlayerDefense = new PlayerDefense(0,new Resistances(DamageType.Blunt, 0,DamageType.Piercing, 0,DamageType.Fire, 0,DamageType.Slashing, 0),new Vulnerabilities(DamageType.Blunt, 0,DamageType.Piercing, 0,DamageType.Fire, 0,DamageType.Slashing, 0))

defenses

defenses: number[] = []

dehydration

dehydration: number = 0

dexterity

dexterity: number = 0

equipped

equipped: object

Type declaration

  • [index: number]: number

facingDirection

facingDirection: FacingDirection = FacingDirection.None

flowFieldManager

flowFieldManager: IFlowFieldManager

fromX

fromX: number = 0

fromY

fromY: number = 0

handToUse

handToUse: EquipType = EquipType.LeftHand

hintSeen

hintSeen: boolean[] = []

id

id: number

identifier

identifier: string

isMoving

isMoving: boolean

lightBonus

lightBonus: number = 0

malignity

malignity: number = 0

moveType

moveType: MoveType = MoveType.Land

movement

movement: IInputMovement

movementAnimation

movementAnimation: number = 0

movementCompleteZ

movementCompleteZ: number | undefined = undefined

movementCompleted

movementCompleted: boolean = false

movementFinishTime

movementFinishTime: number = 0

movementProgress

movementProgress: number = 0

name

name: string

nextMoveDirection

nextMoveDirection: FacingDirection | undefined

nextProcessInput

nextProcessInput: number = 0

nextX

nextX: number = -1

nextY

nextY: number = -1

options

options: IOptions

raft

raft: number | undefined = undefined

resting

resting: boolean = false

score

score: number = 0

skills

skills: ISkillSet = skillSet()

spawnPoint

spawnPoint: IPointZ = {} as IPointZ

starvation

starvation: number = 0

state

state: PlayerState = PlayerState.None

stepCounter

stepCounter: number = 0

strength

strength: number = 0

swimming

swimming: boolean = false

tamedCreatures

tamedCreatures: number[] = []

turns

turns: number = 0

Player strength !== max health

walkSoundCounter

walkSoundCounter: number = 4

wasAbsentPlayer

wasAbsentPlayer: boolean = false

weight

weight: number = 0

weightBonus

weightBonus: number = 25

x

x: number = 0

y

y: number = 0

z

z: WorldZ = WorldZ.Overworld

Methods

addDelay

  • addDelay(delay: Delay, replace?: boolean): void
  • Parameters

    • delay: Delay
    • Optional replace: boolean

    Returns void

addMilestone

  • addMilestone(milestone: MilestoneType, data?: number | null): void
  • Parameters

    • milestone: MilestoneType
    • Default value data: number | null = null

    Returns void

attributes

  • attributes(): void

burn

  • burn(skipMessage?: boolean): number | null
  • Burn the player

    Parameters

    • Default value skipMessage: boolean = false

    Returns number | null

calculateEquipmentStats

  • calculateEquipmentStats(): void

calculateStats

  • calculateStats(): void

canCarve

  • canCarve(): IItem | undefined

canJump

  • canJump(): boolean
  • Returns boolean

checkForTargetInRange

  • checkForTargetInRange(range: number, includePlayers?: boolean): IMobCheck

checkReputationMilestones

  • checkReputationMilestones(): void

checkUnder

  • checkUnder(inFacingDirection?: boolean, autoActions?: boolean, enterCave?: boolean, forcePickUp?: boolean, skipDoodadEvents?: boolean): void
  • Parameters

    • Optional inFacingDirection: boolean
    • Optional autoActions: boolean
    • Default value enterCave: boolean = true
    • Default value forcePickUp: boolean = false
    • Default value skipDoodadEvents: boolean = false

    Returns void

checkWeight

  • checkWeight(): void

createFlowFieldManager

  • createFlowFieldManager(): void

createItemInInventory

damage

  • damage(amount: number, damageMessage: string, soundDelay?: number): void
  • Parameters

    • amount: number
    • damageMessage: string
    • Default value soundDelay: number = 0

    Returns void

damageEquipment

  • damageEquipment(): void

equip

  • Parameters

    • item: IItem
    • slot: EquipType
    • Default value internal: boolean = false

    Returns void

getBindDownTime

  • getBindDownTime(key: KeyBind): number | undefined

getEquipSlotForItem

getEquippedItem

getEquippedItems

  • getEquippedItems(): IItem[]

getHandToUse

getMaxHealth

  • getMaxHealth(): number

getMouseDirection

getReputation

  • getReputation(): number

getSerializationProperties

  • getSerializationProperties(_: string): Array<string>

getTouchDirection

hasDelay

  • hasDelay(): boolean
  • Returns boolean

hurtHands

inspect

  • inspect(x: number, y: number, z?: number): void
  • Parameters

    • x: number
    • y: number
    • Default value z: number = this.z

    Returns void

inspectTile

isBindDown

  • isBindDown(key: KeyBind): boolean

isGhost

  • isGhost(): boolean
  • Returns boolean

isLocalPlayer

  • isLocalPlayer(): boolean

kill

  • kill(): void
  • Returns void

processInput

  • processInput(): void

queueSoundEffect

  • queueSoundEffect(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void
  • Parameters

    • type: SfxType
    • Default value delay: number = 0
    • Default value speed: number = 1
    • Default value noPosition: boolean = false

    Returns void

queueSoundEffectInFront

  • queueSoundEffectInFront(type: SfxType, delay?: number, speed?: number, noPosition?: boolean): void
  • Parameters

    • type: SfxType
    • Default value delay: number = 0
    • Default value speed: number = 1
    • Default value noPosition: boolean = false

    Returns void

resetKeyBindState

  • resetKeyBindState(): void

rest

  • Parameters

    Returns void

setId

  • setId(id: number): void
  • Parameters

    • id: number

    Returns void

setMouseDirection

setRaft

  • setRaft(itemId: number | undefined): void
  • Parameters

    • itemId: number | undefined

    Returns void

setTouchDirection

setZ

  • setZ(z: number): void
  • Parameters

    • z: number

    Returns void

setup

  • setup(completedMilestones: number): void
  • Parameters

    • completedMilestones: number

    Returns void

skillGain

  • skillGain(skillType: SkillType, mod?: number, bypass?: boolean): void
  • Parameters

    • skillType: SkillType
    • Optional mod: number
    • Optional bypass: boolean

    Returns void

staminaCheck

  • staminaCheck(): boolean

staminaReduction

  • staminaReduction(skillType: SkillType): void

tick

  • Parameters

    Returns void

unequip

  • unequip(item: IItem, internal?: boolean, skipMessage?: boolean): void
  • Parameters

    • item: IItem
    • Default value internal: boolean = false
    • Default value skipMessage: boolean = false

    Returns void

unequipAll

  • unequipAll(): void

updateCraftTableAndWeight

  • updateCraftTableAndWeight(): void

updateKeyBindState

  • updateKeyBindState(key: KeyBind, state: number | undefined): void

updateReputation

  • updateReputation(reputation: number): void
  • Parameters

    • reputation: number

    Returns void

Object literals

attackFromEquip

attackFromEquip: object

leftHand

leftHand: number = 0

rightHand

rightHand: number = 0

direction

direction: object

x

x: number = 0

y

y: number = 0

inventory

inventory: object

containedItems

containedItems: Array<IItem> = (new Array()) as IItemArray

containedWithin

containedWithin: null = null

weightCapacity

weightCapacity: number = Infinity

stats

stats: object

health

health: object

regen

regen: number = 80

regenBase

regenBase: number = 80

timer

timer: number = 0

value

value: number = 0

hunger

hunger: object

regen

regen: number = 110

regenBase

regenBase: number = 110

timer

timer: number = 0

value

value: number = 0

stamina

stamina: object

regen

regen: number = 10

regenBase

regenBase: number = 10

timer

timer: number = 0

value

value: number = 0

thirst

thirst: object

regen

regen: number = 80

regenBase

regenBase: number = 80

timer

timer: number = 0

value

value: number = 0

status

status: object

bleeding

bleeding: boolean = false

burned

burned: boolean = false

poisoned

poisoned: boolean = false

Generated using TypeDoc