Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Game

Hierarchy

  • Game

Implements

Index

Constructors

Properties

Methods

Object literals

Constructors

constructor

  • Returns Game

Properties

absoluteTime

absoluteTime: number

autoSaveTimer

autoSaveTimer: number

cartographyTexture

cartographyTexture: WebGLTexture

contaminatedWater

contaminatedWater: IPointZ[]

corpses

corpses: ICorpse[]

crafted

crafted: object

Type declaration

  • [index: number]: boolean

creatureSpawnTimer

creatureSpawnTimer: number

creatures

creatures: ICreature[]

dailyChallenge

dailyChallenge: boolean = false

debugRenderer

debugRenderer: ITextureDebugRenderer

doodads

doodads: IDoodad[]

fadeInAmount

fadeInAmount: number

fillCount

fillCount: number

fillTile

fillTile: boolean[]

flowFieldSyncCount

flowFieldSyncCount: number

glContext

glContext: WebGLRenderingContext | null = null

halfMapSize

halfMapSize: number = this.mapSize / 2

highscores

highscores: IHighscore[] = []

interval

interval: number = 16.6666

isLoadingSave

isLoadingSave: boolean

isRealTime

isRealTime: boolean

items

items: IItemArray

lastCreationIds

lastCreationIds: object

Type declaration

  • [index: number]: number

lastPlayedVersion

lastPlayedVersion: string

loadedResources

loadedResources: boolean

mapContext

mapContext: CanvasRenderingContext2D | null = null

mapSize

mapSize: number = 512

mapSizeSq

mapSizeSq: number = this.mapSize * this.mapSize

messageTimer

messageTimer: number

newCrafted

newCrafted: object

Type declaration

  • [index: number]: boolean

notifier

notifier: INotifier

particle

particle: IParticle

paused

paused: boolean

playedCount

playedCount: number = 0

playing

playing: boolean

realTimeNextTick

realTimeNextTick: number

saveClear

saveClear: boolean

saveVersion

saveVersion: string

savedHighscore

savedHighscore: boolean

slot

slot: number

spawnCoords

spawnCoords: IPointZ

spriteTexture

spriteTexture: WebGLTexture

spriteTextureSizeInversed

spriteTextureSizeInversed: Vec2

tile

tileContainers

tileContainers: ITileContainer[]

tileData

tileData: ITileData[]

tileEvents

tileEvents: ITileEvent[]

tileTexture

tileTexture: WebGLTexture

tileTextureSizeInversed

tileTextureSizeInversed: Vec2

time

unloading

unloading: boolean

updateRender

updateRender: boolean

version

version: string = gameVersion

visible

visible: boolean = true

Methods

addPlayer

addZoomLevel

  • addZoomLevel(amount: number): void
  • Parameters

    • amount: number

    Returns void

animateSkeletalRemains

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

canASeeB

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

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

    Returns boolean

changeTile

  • changeTile(newTile: any, changeX: number, changeY: number, changeZ: number, stackTiles: boolean): void
  • Parameters

    • newTile: any
    • changeX: number
    • changeY: number
    • changeZ: number
    • stackTiles: boolean

    Returns void

checkForHiddenMob

  • checkForHiddenMob(player: IPlayer, x: number, y: number, z: number): 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

directionToMovement

displayMessageIfCanSeeTile

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

enableFlowFieldDebug

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

gameLoop

  • gameLoop(timeStamp: any): void
  • Parameters

    • timeStamp: any

    Returns void

getAmbientLightLevel

  • getAmbientLightLevel(z: number): number

getAttack

  • getAttack(): number
  • Returns number

getBenignity

  • getBenignity(): number

getBlackness

  • getBlackness(): number

getCompletedMilestoneCount

  • getCompletedMilestoneCount(): number

getDifficulty

  • getDifficulty(): string

getFireMessage

  • getFireMessage(decay: number): Message

getHeight

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

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

    Returns number

getLightSourceAt

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

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

    Returns number

getMalignity

  • getMalignity(): number

getMovementFinishTime

  • getMovementFinishTime(): number

getName

getNameFromDescription

getNearestPlayer

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

getOrCreateTile

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

getPlayerAtPosition

  • getPlayerAtPosition(x: number, y: number, z: number, includeGhosts?: boolean): IPlayer | undefined
  • Parameters

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

    Returns IPlayer | undefined

getPlayerAtTile

  • getPlayerAtTile(tile: ITile, includeGhosts?: boolean): IPlayer | undefined

getPlayerAverage

  • getPlayerAverage(calc: function, round?: boolean): number
  • Parameters

    • calc: function
    • Optional round: boolean

    Returns number

getPlayerByIdentifier

  • getPlayerByIdentifier(identifier: string): IPlayer | undefined

getPlayerByName

  • getPlayerByName(name: string, ignoreCase?: boolean): IPlayer | undefined
  • Parameters

    • name: string
    • Default value ignoreCase: boolean = true

    Returns IPlayer | undefined

getPlayerByPid

  • getPlayerByPid(pid: number): IPlayer | undefined

getPlayers

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

    • Optional includeGhosts: boolean

    Returns IPlayer[]

getPlayersThatSeeTile

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

getReputation

  • getReputation(): number

getSerializationProperties

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

getSkillPercent

getStrength

  • getStrength(): number
  • Returns number

getTile

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

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

    Returns ITile

getTileInFrontOfPlayer

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

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

makeCaveEntrance

makeMiniMap

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

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

    Returns void

onGlobalSlotLoaded

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

    • _: number
    • success: boolean

    Returns void

onSaveLoaded

  • onSaveLoaded(slot: number): void
  • Parameters

    • slot: number

    Returns void

outputFireMessage

  • outputFireMessage(player: IPlayer, decay: number): void

packGround

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

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

    Returns void

passTurn

play

  • Parameters

    • saveSlot: number
    • Default value options: IPlayOptions = {}

    Returns void

postLoadResources

  • postLoadResources(): void

processWaterContamination

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

resetGameState

  • resetGameState(skipSave?: boolean): void
  • Parameters

    • Default value skipSave: boolean = false

    Returns void

resizeRenderer

  • resizeRenderer(): void

saveGame

  • saveGame(saveType: SaveType, callback?: function): void
  • Parameters

    • saveType: SaveType
    • Optional callback: function
        • (slot?: number, bytes?: number, saveObject?: SaveObject): void
        • Parameters

          • Optional slot: number
          • Optional bytes: number
          • Optional saveObject: SaveObject

          Returns void

    Returns void

setGlContextSize

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

    • width: number
    • height: number

    Returns void

setPaused

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

    • paused: boolean
    • Optional chatMessage: boolean

    Returns void

setRealTime

  • setRealTime(enabled: boolean): void
  • Parameters

    • enabled: 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

synchronizeFlowFields

  • synchronizeFlowFields(plys: IPlayer[]): void

tickRealtime

  • tickRealtime(): void

updateCraftTableAndWeight

  • updateCraftTableAndWeight(): void
  • AVOID USING THIS. USE updateCraftTableAndWeightNextTick INSTEAD! For most cases you don't need this

    Returns void

updateCraftTableAndWeightNextTick

  • updateCraftTableAndWeightNextTick(): void

updateFieldOfViewNextTick

  • updateFieldOfViewNextTick(): void

updateFlowFieldTile

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

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

    Returns void

updateGame

  • updateGame(): void
  • Returns void

updateOption

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

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

    Returns void

updateReputation

  • updateReputation(reputation: number): void
  • Parameters

    • reputation: number

    Returns void

Object literals

seeds

seeds: object

base

base: number = 0

saved

saved: number = 0

Generated using TypeDoc