Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface IGame

Hierarchy

Implemented by

Index

Properties

Methods

Properties

absoluteTime

absoluteTime: number

autoSaveTimer

autoSaveTimer: number

cartographyTexture

cartographyTexture: WebGLTexture

contaminatedWater

contaminatedWater: IPointZ[]

corpses

corpses: SaferArray<ICorpse>

crafted

crafted: object

Type declaration

creatureSpawnTimer

creatureSpawnTimer: number

creatures

creatures: SaferArray<ICreature>

debugRenderer

debugRenderer: ITextureDebugRenderer

doodads

doodads: SaferArray<IDoodad>

fadeInAmount

fadeInAmount: number

fillCount

fillCount: number

fillTile

fillTile: boolean[][]

interval

interval: number

isDailyChallenge

isDailyChallenge: boolean

isLoadingSave

isLoadingSave: boolean

items

items: IItemArray

lastCreationIds

lastCreationIds: object

Type declaration

  • [index: number]: number

loadedResources

loadedResources: boolean

mapGenVersion

mapGenVersion: string

mapSize

mapSize: number

mapSizeSq

mapSizeSq: number

messageTimer

messageTimer: number

notifier

notifier: INotifier

particle

particle: IParticle

paused

paused: boolean

playing

playing: boolean

previousSaveVersion

previousSaveVersion: IVersionInfo

realTimeTickSpeed

realTimeTickSpeed: number

saveClear

saveClear: boolean

saveVersion

saveVersion: string | undefined

savedHighscore

savedHighscore: boolean

seeds

seeds: ISeeds

slot

slot: number

spawnCoords

spawnCoords: IPointZ

spriteTexture

spriteTexture: WebGLTexture

spriteTextureSizeInversed

spriteTextureSizeInversed: Vec2

tile

tileContainers

tileContainers: ITileContainer[]

tileData

tileData: object

Type declaration

  • [index: number]: object
    • [index: number]: object

tileEvents

tileEvents: SaferArray<ITileEvent>

tileTexture

tileTexture: WebGLTexture

tileTextureSizeInversed

tileTextureSizeInversed: Vec2

time

updateRender

updateRender: boolean

version

version: string

visible

visible: boolean

Methods

addPlayer

addZoomLevel

  • addZoomLevel(amount: number): void
  • Parameters

    • amount: number

    Returns void

animateSkeletalRemains

  • animateSkeletalRemains(player: IPlayer, x: number, y: number, z: number): void
  • Parameters

    • player: IPlayer
    • x: number
    • y: number
    • z: number

    Returns void

canASeeB

  • canASeeB(aX: number, aY: number, aZ: number, bX: number, bY: number, bZ: number, nondeterministic?: boolean): boolean
  • Parameters

    • aX: number
    • aY: number
    • aZ: number
    • bX: number
    • bY: number
    • bZ: number
    • Optional nondeterministic: boolean

    Returns boolean

cancel

  • cancel(events: string | number | Array<string | number>, cb?: function): void
  • Parameters

    • events: string | number | Array<string | number>
    • Optional cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns void

cancelAll

  • cancelAll(): void
  • Returns void

changeTile

  • changeTile(newTileInfo: TerrainType | ITileData, x: number, y: number, z: number, stackTiles: boolean, dropTiles?: boolean): void
  • Parameters

    • newTileInfo: TerrainType | ITileData
    • x: number
    • y: number
    • z: number
    • stackTiles: boolean
    • Optional dropTiles: boolean

    Returns void

checkForHiddenMob

  • checkForHiddenMob(player: IPlayer, x: number, y: number, z: number): void
  • Parameters

    • player: IPlayer
    • x: number
    • y: number
    • z: number

    Returns void

checkWaterFill

  • checkWaterFill(x: number, y: number, z: number, needed: number): void
  • Parameters

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

    Returns void

consumeWaterTile

  • consumeWaterTile(x: number, y: number, z: number): void
  • Parameters

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

    Returns void

damage

deletePlayer

  • deletePlayer(plys: IPlayer[], identifier: string): void
  • Parameters

    • plys: IPlayer[]
    • identifier: string

    Returns void

directionToMovement

displayMessageIfCanSeeTile

  • displayMessageIfCanSeeTile(x: number, y: number, z: number, message: Message, messageType: MessageType, ...messageArgs: any[]): boolean
  • Parameters

    • x: number
    • y: number
    • z: number
    • message: Message
    • messageType: MessageType
    • Rest ...messageArgs: any[]

    Returns boolean

doLavaEvents

  • doLavaEvents(x: number, y: number, z: number): void
  • Parameters

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

    Returns void

enableFlowFieldDebug

  • enableFlowFieldDebug(): void
  • Returns void

fireBreath

  • fireBreath(x: number, y: number, z: number, facingDirection: FacingDirection, itemName?: string): void
  • Parameters

    • x: number
    • y: number
    • z: number
    • facingDirection: FacingDirection
    • Optional itemName: string

    Returns void

getAmbientLightLevel

  • getAmbientLightLevel(z: number): number
  • Parameters

    • z: number

    Returns number

getBenignity

  • getBenignity(): number
  • Returns number

getBlackness

  • getBlackness(): number
  • Returns number

getCompletedMilestoneCount

  • getCompletedMilestoneCount(): number
  • Returns number

getDamageTypeString

  • getDamageTypeString(damageTypes: DamageType[], prefixes?: string[]): string
  • Parameters

    • damageTypes: DamageType[]
    • Optional prefixes: string[]

    Returns string

getDifficulty

getFireMessage

  • getFireMessage(decay?: number, isOpenFire?: boolean): Message
  • Parameters

    • Optional decay: number
    • Optional isOpenFire: boolean

    Returns Message

getHeight

  • getHeight(z0: number, z1: number, d: number): number
  • Parameters

    • z0: number
    • z1: number
    • d: number

    Returns number

getInspectHealthMessage

  • getInspectHealthMessage(percent: number, skillPercent: number, name: string): IMessagePack
  • Parameters

    • percent: number
    • skillPercent: number
    • name: string

    Returns IMessagePack

getLightSourceAt

  • getLightSourceAt(x: number, y: number, z: number): number
  • Parameters

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

    Returns number

getMalignity

  • getMalignity(): number
  • Returns number

getMaxDurability

  • getMaxDurability(quality: ItemQuality, itemDurability: number): number
  • Parameters

    Returns number

getMovementFinishTime

  • getMovementFinishTime(): number
  • Returns number

getName

getNameFromDescription

getNearestPlayer

  • getNearestPlayer(x: number, y: number, z?: number): IPlayer | undefined
  • Parameters

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

    Returns IPlayer | undefined

getOrCreateTile

  • getOrCreateTile(x: number, y: number, z: number): ITile
  • Parameters

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

    Returns ITile

getOrCreateTileData

  • getOrCreateTileData(x: number, y: number, z: number): ITileData[]
  • Parameters

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

    Returns ITileData[]

getPlayerByIdentifier

  • getPlayerByIdentifier(identifier: string, includeAbsent?: boolean): IPlayer | undefined
  • Parameters

    • identifier: string
    • Optional includeAbsent: boolean

    Returns IPlayer | undefined

getPlayerByName

  • getPlayerByName(name: string): IPlayer | undefined
  • Parameters

    • name: string

    Returns IPlayer | undefined

getPlayerByPid

  • getPlayerByPid(pid: number): IPlayer | undefined
  • Parameters

    • pid: number

    Returns IPlayer | undefined

getPlayers

  • getPlayers(includeGhosts?: boolean, includeConnecting?: boolean): IPlayer[]
  • Parameters

    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns IPlayer[]

getPlayersAtPosition

  • getPlayersAtPosition(x: number, y: number, z: number, includeGhosts?: boolean, includeConnecting?: boolean): IPlayer[]
  • Parameters

    • x: number
    • y: number
    • z: number
    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns IPlayer[]

getPlayersAtTile

  • getPlayersAtTile(tile: ITile, includeGhosts?: boolean, includeConnecting?: boolean): IPlayer[]
  • Parameters

    • tile: ITile
    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns IPlayer[]

getPlayersThatSeeTile

  • getPlayersThatSeeTile(tileX: number, tileY: number, tileZ: number): IPlayer[]
  • Parameters

    • tileX: number
    • tileY: number
    • tileZ: number

    Returns IPlayer[]

getRandomQuality

  • Parameters

    • Optional itemType: ItemType
    • Optional bonusQuality: number

    Returns ItemQuality

getReputation

  • getReputation(): number
  • Returns number

getReputationMessage

  • getReputationMessage(): string
  • Returns string

getSkillPercent

  • Parameters

    Returns number

getStrength

  • getStrength(): number
  • Returns number

getTactics

  • getTactics(): number
  • Returns number

getTile

  • getTile(x: number, y: number, z: number): ITile
  • Parameters

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

    Returns ITile

getTileData

  • getTileData(x: number, y: number, z: number): ITileData[] | undefined
  • Parameters

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

    Returns ITileData[] | undefined

getTileFromPoint

  • Parameters

    Returns ITile

getTileUnsafe

  • getTileUnsafe(x: number, y: number, z: number): ITile
  • Parameters

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

    Returns ITile

getValidPlayerName

  • getValidPlayerName(name: string | undefined): string
  • Parameters

    • name: string | undefined

    Returns string

getWrappedCoord

  • getWrappedCoord(x: number): number
  • Parameters

    • x: number

    Returns number

hurtTerrain

  • hurtTerrain(player: IPlayer | undefined, x: number, y: number, z: number, tile: ITile): boolean
  • Parameters

    • player: IPlayer | undefined
    • x: number
    • y: number
    • z: number
    • tile: ITile

    Returns boolean

initialize

  • initialize(): void
  • Returns void

isOnFire

  • Parameters

    Returns FireType

isPlayerAtPosition

  • isPlayerAtPosition(x: number, y: number, z: number, includeGhosts?: boolean, includeConnecting?: boolean): boolean
  • Parameters

    • x: number
    • y: number
    • z: number
    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns boolean

isPlayerAtTile

  • isPlayerAtTile(tile: ITile, includeGhosts?: boolean, includeConnecting?: boolean): boolean
  • Parameters

    • tile: ITile
    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns boolean

isRealTimeMode

  • isRealTimeMode(): boolean
  • Returns boolean

isTileEmpty

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

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

    Returns boolean

isTileFull

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

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

    Returns boolean

isTileFullEx

  • isTileFullEx(tile: ITile): boolean
  • Parameters

    Returns boolean

makeCaveEntrance

makeMiniMap

  • makeMiniMap(offsetX: number, offsetY: number, offsetZ: number, skillCheck?: boolean): void
  • Parameters

    • offsetX: number
    • offsetY: number
    • offsetZ: number
    • Optional skillCheck: boolean

    Returns void

movementToDirection

  • Parameters

    • x: number
    • y: number

    Returns FacingDirection

on

  • on(events: string | number | Array<string | number>, cb: function): this
  • Parameters

    • events: string | number | Array<string | number>
    • cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns this

onGlobalSlotLoaded

  • onGlobalSlotLoaded(_: number, success: boolean): void
  • Parameters

    • _: number
    • success: boolean

    Returns void

onSaveLoaded

  • onSaveLoaded(slot: number): void
  • Parameters

    • slot: number

    Returns void

once

  • once(event: string | number, cb: function): this
  • Parameters

    • event: string | number
    • cb: function
        • (emitter: this, ...data: any[]): any
        • Parameters

          • emitter: this
          • Rest ...data: any[]

          Returns any

    Returns this

outputFireMessage

  • outputFireMessage(player: IPlayer, decay?: number, isOpenFire?: boolean): void
  • Parameters

    • player: IPlayer
    • Optional decay: number
    • Optional isOpenFire: boolean

    Returns void

packGround

  • packGround(x: number, y: number, z: number): void
  • Parameters

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

    Returns void

passTurn

  • Parameters

    Returns void

play

  • Parameters

    Returns void

processWaterContamination

  • processWaterContamination(): void
  • Returns void

rangeFinder

  • rangeFinder(weaponRange: number, playerSkillLevel: number): number
  • Parameters

    • weaponRange: number
    • playerSkillLevel: number

    Returns number

removePlayer

  • removePlayer(pid: number): void
  • Parameters

    • pid: number

    Returns void

requestPlay

  • requestPlay(options: Partial<IPlayOptions> & object): void
  • Parameters

    Returns void

resetGameState

  • resetGameState(skipSave?: boolean): Promise<void>
  • Parameters

    • Optional skipSave: boolean

    Returns Promise<void>

resetWebGL

  • resetWebGL(): void
  • Returns void

resizeRenderer

  • resizeRenderer(): void
  • Returns void

saveGame

  • Parameters

    • saveType: SaveType
    • Optional skipAudio: boolean

    Returns Promise<ISaveInfo | undefined>

setGlContextSize

  • setGlContextSize(width: number, height: number): void
  • Parameters

    • width: number
    • height: number

    Returns void

setPaused

  • setPaused(paused: boolean, showChatMessage?: boolean): void
  • Parameters

    • paused: boolean
    • Optional showChatMessage: boolean

    Returns void

setTile

  • setTile(x: number, y: number, z: number, tile: ITile): ITile
  • Parameters

    • x: number
    • y: number
    • z: number
    • tile: ITile

    Returns ITile

setupSave

  • setupSave(_: number): void
  • Parameters

    • _: number

    Returns void

shouldRender

  • shouldRender(): number
  • Returns number

synchronizeFlowFields

  • synchronizeFlowFields(plys: IPlayer[]): void
  • Parameters

    Returns void

tickRealtime

  • tickRealtime(): void
  • Returns void

trigger

  • trigger(event: string | number, ...data: any[]): Promise<any[]>
  • Parameters

    • event: string | number
    • Rest ...data: any[]

    Returns Promise<any[]>

updateFlowFieldTile

  • updateFlowFieldTile(tile: ITile, x: number, y: number, z: number): void
  • Parameters

    • tile: ITile
    • x: number
    • y: number
    • z: number

    Returns void

updateOption

  • updateOption(player: IPlayer | undefined, id: string, value: boolean | number): void
  • Parameters

    • player: IPlayer | undefined
    • id: string
    • value: boolean | number

    Returns void

updateReputation

  • updateReputation(reputation: number): void
  • Parameters

    • reputation: number

    Returns void

updateTablesAndWeight

  • updateTablesAndWeight(): void
  • Returns void

updateView

  • updateView(updateFov: boolean): void
  • Parameters

    • updateFov: boolean

    Returns void

waitUntil

  • waitUntil(event: string | number): Promise<Object>
  • Parameters

    • event: string | number

    Returns Promise<Object>

wrapCoordinate

  • wrapCoordinate(cordinate: number, reference: number): number
  • Parameters

    • cordinate: number
    • reference: number

    Returns number

Generated using TypeDoc