Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Human

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Object literals

Constructors

constructor

Properties

anim

anim: number

attackAnimationEndTime

attackAnimationEndTime: number | undefined

attackAnimationType

attackAnimationType: DamageType | undefined

crafted

crafted: Record<number, ICrafted>

customization

customization: ICustomizations

deathBy

deathBy: ISerializedTranslation = Translation.message(Message.Mysteriously).serialize()

defense

defense: PlayerDefense = new PlayerDefense(0, 0)

defenses

defenses: number[] = []

entityType

entityType: EntityType

Readonly equipEffects

equipEffects: Map<EquipEffect, [LightSource, number] | [Telescopy, number, number]> = new Map<EquipEffect, EquipEffects>()

equipped

equipped: Record<number, number>

event

facingDirection

facingDirection: Cardinal | None

fromX

fromX: number

Not guaranteed to be synced between the server and client for Player entities

fromY

fromY: number

Not guaranteed to be synced between the server and client for Player entities

handToUse

handToUse: EquipType | undefined = EquipType.LeftHand

id

id: number

identifier

identifier: string

moveType

moveType: MoveType | undefined

options

options: IOptions = Objects.deepClone(SaveDataGlobal.defaultOptions)

properties

properties: IProperties | undefined

Optional referenceId

referenceId: undefined | number

Optional renamed

renamed: string | ISerializedTranslation

restData

restData: IRestData | undefined

score

score: number = 0

skill

skill: SkillManager = new SkillManager(this, {id: () => this.id,getSkillGainMultiplier: (...args) => this.getSkillGainMultiplier(...args),canSkillGain: (...args) => this.canSkillGain(...args),onSkillGain: (...args) => this.onSkillGain(...args),})

Readonly stat

stat: Stats<this> = new Stats(this)

state

state: PlayerState = PlayerState.None

stats

stats: IStats

status

status: IStatus

stopNextMovement

stopNextMovement: boolean

swimming

swimming: boolean = false

vehicleItemId

vehicleItemId: number | undefined

x

x: number

y

y: number

z

z: number

Accessors

asCreature

  • get asCreature(): undefined
  • Returns undefined

asEntity

asHuman

asNPC

  • get asNPC(): NPC | undefined
  • Returns NPC | undefined

asPlayer

  • get asPlayer(): Player | undefined
  • Returns Player | undefined

Methods

addDelay

  • addDelay(delay: number, replace?: undefined | false | true, addStaminaDelay?: undefined | false | true): void
  • Parameters

    • delay: number
    • Optional replace: undefined | false | true
    • Optional addStaminaDelay: undefined | false | true

    Returns void

addProperty

  • addProperty(property: Property, value: any): void

animateAttack

  • animateAttack(damageType: DamageType[] | undefined): void

animateBumpTowards

  • animateBumpTowards(x: number, y: number): void
  • Faces the target and animates a bump into effect

    Parameters

    • x: number
    • y: number

    Returns void

burn

  • burn(fireType: FireType, skipMessage?: boolean, skipParry?: undefined | false | true, equipType?: EquipType, fromCombat?: undefined | false | true): number | undefined
  • Burn the player

    Parameters

    • fireType: FireType
    • Default value skipMessage: boolean = false
    • Optional skipParry: undefined | false | true
    • Optional equipType: EquipType
    • Optional fromCombat: undefined | false | true

    Returns number | undefined

calculateEquipmentStats

  • calculateEquipmentStats(): void
  • Returns void

Protected calculateStats

  • calculateStats(): void
  • Returns void

canJump

  • canJump(): boolean
  • Returns boolean

canSeeObject

canSeePosition

  • canSeePosition(type: CanASeeBType, tileX: number, tileY: number, tileZ: number): boolean

Protected canSkillGain

  • Parameters

    Returns boolean

cancelResting

  • Parameters

    Returns boolean

causeStatus

  • Parameters

    Returns void

checkForGatherFire

  • Returns Translation | undefined

checkForTargetInRange

  • checkForTargetInRange(range: number, includePlayers?: undefined | false | true): IMobCheck
  • Parameters

    • range: number
    • Optional includePlayers: undefined | false | true

    Returns IMobCheck

checkUnder

createItemInInventory

damage

  • damage(damageInfoOrAmount: IDamageInfo | number): number | undefined
  • damage(damageInfoOrAmount: IDamageInfo | number, damageMessage?: Message | Translation, soundDelay?: undefined | number, causesBlood?: undefined | false | true): number | undefined
  • Parameters

    Returns number | undefined

  • Parameters

    • damageInfoOrAmount: IDamageInfo | number
    • Optional damageMessage: Message | Translation
    • Optional soundDelay: undefined | number
    • Optional causesBlood: undefined | false | true

    Returns number | undefined

damageByInteractingWith

damageRandomEquipment

  • damageRandomEquipment(): void
  • Returns void

discoverRecipe

  • discoverRecipe(recipeType: ItemType, crafted?: ICrafted, discoveredClientSide?: undefined | false | true): void
  • Parameters

    • recipeType: ItemType
    • Default value crafted: ICrafted = { newUnlock: true, unlockTime: Date.now() }
    • Optional discoveredClientSide: undefined | false | true

    Returns void

equip

  • Parameters

    Returns boolean

extinguishTorches

  • extinguishTorches(): void
  • Extinguishes all torches the player is holding.

    Returns void

getActiveStatuses

getAndSwitchHandToUse

  • getAndSwitchHandToUse(): EquipType | undefined
  • Returns EquipType | undefined

Protected Abstract getApplicableStatusEffects

getAsHuman

  • Returns Human

Protected getBaseStatBonuses

getBurnDamage

  • getBurnDamage(fireType: FireType, skipParry?: undefined | false | true, equipType?: EquipType): number
  • Parameters

    • fireType: FireType
    • Optional skipParry: undefined | false | true
    • Optional equipType: EquipType

    Returns number

getConsumeBonus

  • getConsumeBonus(item: Item | undefined, skillUse?: SkillType): number
  • Parameters

    Returns number

getCraftingDifficulty

getDamage

  • Parameters

    Returns number

getDamageModifier

  • getDamageModifier(): number
  • Returns number

getEquipEffect

getEquipSlotForItem

  • Parameters

    Returns EquipType | undefined

getEquippedItem

  • Parameters

    Returns Item | undefined

getEquippedItems

  • getEquippedItems(): Item[]
  • Returns Item[]

getFacingPoint

getFacingTile

getInspectionId

  • getInspectionId(): string

getInsulation

getMaxHealth

  • getMaxHealth(): number
  • Returns number

getMoveType

getMovementFinishTime

  • getMovementFinishTime(_timeStamp: number): number | undefined

getMovementPoint

  • getMovementPoint(timeStamp: number): IVector2

getMovementProgress

  • getMovementProgress(timeStamp: number): number

Abstract getName

getPoint

getProducedTemperature

  • getProducedTemperature(): number | undefined

getProperty

  • getProperty<T>(property: Property): T | undefined

getQualityBonus

  • getQualityBonus(item: Item | undefined): number
  • Parameters

    • item: Item | undefined

    Returns number

getReputation

  • getReputation(): number
  • Returns number

getSkillBonus

  • getSkillBonus(skillUse?: SkillType): number
  • Parameters

    Returns number

Protected getSkillGainMultiplier

  • getSkillGainMultiplier(skill: SkillType): number
  • Parameters

    Returns number

getStaminaDelay

  • getStaminaDelay(staminaToStartAddingDelayAt?: number): number
  • Gets a stamina penalty delay to be used for slowed actions and movement.

    Parameters

    • Default value staminaToStartAddingDelayAt: number = STAMINA_LOW_PENALTY_START

      Stat value where delays start getting added from.

    Returns number

getStatus

  • Returns the handler for this status effect, whether or not this entity currently has the effect.

    Type parameters

    Parameters

    Returns undefined | S

getStatuses

getTile

getTileUpdateType

hasDelay

  • hasDelay(): boolean
  • Returns boolean

hasHandToUse

  • hasHandToUse(): boolean
  • Returns boolean

hasProperty

  • hasProperty(property: Property): boolean

hasStatus

  • Returns whether the entity has the given StatusType

    Parameters

    Returns boolean

isGhost

  • isGhost(): boolean
  • Returns boolean

isInFov

  • isInFov(): boolean

isLocalPlayer

  • isLocalPlayer(): boolean
  • Returns boolean

isNearby

  • isNearby(entity: Entity): boolean

isOnFire

isResting

  • isResting(): boolean
  • Returns boolean

isRestingCancelled

  • isRestingCancelled(): boolean
  • Returns boolean

isSwimming

  • isSwimming(): boolean
  • Gets if the human is swimming (and not on a boat)

    Returns boolean

moveTo

  • moveTo(x: number, y: number, z: number): boolean
  • Parameters

    • x: number
    • y: number
    • z: number

    Returns boolean

notifyItem

notifyStat

Protected onSkillGain

  • onSkillGain(skill: SkillType, mod: number): void
  • Parameters

    Returns void

onUnserialized

  • onUnserialized(): 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

rangeAction

  • Parameters

    Returns { actionRange: number; bonusRange: number; mobCheck: IMobCheck }

    • actionRange: number
    • bonusRange: number
    • mobCheck: IMobCheck

removeProperty

  • removeProperty(property: Property): boolean

Protected resetDefense

  • resetDefense(skipStatChangedEvent?: undefined | false | true): void
  • Parameters

    • Optional skipStatChangedEvent: undefined | false | true

    Returns void

Protected resetStatTimers

  • resetStatTimers(): void
  • Returns void

setInFov

  • setInFov(inFov: boolean): void
  • Parameters

    • inFov: boolean

    Returns void

setMoveType

setOptions

  • Parameters

    Returns void

setPaddling

  • setPaddling(paddling: boolean, itemId: number, extinguishTorches?: undefined | false | true): void
  • Parameters

    • paddling: boolean
    • itemId: number
    • Optional extinguishTorches: undefined | false | true

    Returns void

setPosition

  • Parameters

    Returns void

setStatus

  • Sets whether the entity has the given StatusType. Emits EntityEvent.StatusChange.

    Parameters

    Returns void

setZ

  • setZ(z: number, updateFlowField?: boolean): void
  • Parameters

    • z: number
    • Default value updateFlowField: boolean = true

    Returns void

staminaReduction

  • staminaReduction(skill?: SkillType, level?: undefined | number): void
  • Parameters

    • Optional skill: SkillType
    • Optional level: undefined | number

    Returns void

startResting

  • Parameters

    Returns void

Protected statGain

  • statGain(stat: Stat, bypass: boolean): void
  • Improve one of the core player stats

    Parameters

    • stat: Stat
    • bypass: boolean

    Returns void

Protected swimAndSootheCheck

  • Parameters

    Returns void

toString

  • toString(): string

unequip

  • unequip(item: Item): void
  • Parameters

    Returns void

unequipAll

  • unequipAll(): void
  • Returns void

update

  • update(): void
  • Returns void

updatePaddling

  • updatePaddling(): void
  • Returns void

updateReputation

  • updateReputation(reputation: number): void
  • Parameters

    • reputation: number

    Returns void

updateStatsAndAttributes

  • updateStatsAndAttributes(): void
  • Returns void

updateSwimming

  • updateSwimming(): void
  • Returns void

Static getNameTranslation

  • Returns Translation

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: Item[] = ([]) as Item[]

Generated using TypeDoc