Tile class

Hierarchy

  • default

Implements

Constructors

  • Constructed during map gen

    Parameters

    • island: default
    • x: number
    • y: number
    • z: number
    • id: number
    • rendererData: number
    • quality: Quality

    Returns default

Properties

containedItems?: default[]

ITileContainer

corpses?: default[]

Note: corpses must be ordered by id asc

creature?: default

Entities on the tile

doodad?: default
events?: default[]

Note: tile events must be ordered by id asc

id: number
island: default
islandId: `${number},${number}`

IVector4

npc?: default
x: number
y: number

Accessors

  • get doodadAnimationDisabled(): boolean
  • Returns boolean

  • set doodadAnimationDisabled(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get doodadOverHidden(): boolean
  • This should only be called if you know what you're doing Ensure a tile data with tilled is created Otherwise the game state could get out of sync

    Returns boolean

  • set doodadOverHidden(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

  • get hasTileContainer(): boolean
  • Check if this tile contains some items

    Returns boolean

  • get isEmpty(): boolean
  • Checks for: Passable No doodads No tile items No creatures No corpses No tile events No girls

    Returns boolean

  • get isFlammable(): boolean
  • Check if the tile can be lit on fire (has terrain/doodad/items that are flammable)

    Returns boolean

  • get isFull(): boolean
  • Checks if the tile is full of items

    Returns boolean

  • get isMapEdge(): boolean
  • Returns boolean

  • get isOnFire(): FireType
  • Gets the fire type of a fire on the tile if there is one

    Returns FireType

  • get isOpenTile(): boolean
  • Check is a tile is open

    Returns boolean

  • get isTileBlocked(): boolean
  • Check if the tile is blocked (impassable terrain / creatures / npcs / players / doodads that cause blocked movement).

    Returns boolean

  • get isTilled(): boolean
  • Returns boolean

  • get isVoid(): boolean
  • Check if this tile is Void type

    Returns boolean

  • get point(): IVector3
  • Returns IVector3

  • get quality(): Quality
  • Returns Quality

  • set quality(value: undefined | Quality): void
  • Parameters

    Returns void

  • get type(): TerrainType
  • Returns TerrainType

  • set type(value: number): void
  • Parameters

    • value: number

    Returns void

  • get variation(): number
  • Returns number

Methods

  • Parameters

    Returns void

  • Checks if this tile can be used for sailing. Ensures it's connected to the edge of the map.

    Returns ICanSailAwayResult

  • Parameters

    • type: CanASeeBType
    • islandId: `${number},${number}`
    • x: number
    • y: number
    • z: number
    • fieldOfView: undefined | default = renderer.fieldOfView
    • Optional customRadius: number

    Returns boolean

  • Parameters

    Returns boolean

  • Changes the tile

    Parameters

    Returns void

  • Parameters

    Returns void

  • Parameters

    Returns boolean

  • Clears all the water puddles on the tile.

    Parameters

    • executor: default<number>

      The player to send the message to.

    Returns boolean

  • Returns void

  • Decrease the depth of a water tile if under 6 connected tiles

    Returns void

  • Converts shallow single bodies of fresh/swamp water into seawater

    Returns void

  • Contaminate water sources when new ones are created based on the surrounding water.

    Returns void

  • Finds either lava or water ajacent to either lava or water, and cools the lava down based its findings.

    Returns void

  • Cools the tile (such as lava) and reveals to any in-LOS players about it.

    Returns void

  • Parameters

    • particle: undefined | IRGB
    • count: number = 1
    • intensity: number = 5

    Returns void

  • Create puddles around a point and limit them (so they can't expand infinitely)

    Returns void

  • Parameters

    • isMatchingTile: ((tile: default) => boolean)
    • options: {
          canVisitTile?: ((tile: default) => boolean);
          maxTilesChecked?: number;
      } = {}
      • Optional canVisitTile?: ((tile: default) => boolean)
      • Optional maxTilesChecked?: number

    Returns undefined | default

  • Parameters

    • isMatchingTile: ((tile: default) => boolean)
    • options: {
          canVisitTile?: ((tile: default) => boolean);
          maxTiles?: number;
          maxTilesChecked?: number;
      } = {}
      • Optional canVisitTile?: ((tile: default) => boolean)
      • Optional maxTiles?: number
      • Optional maxTilesChecked?: number

    Returns default[]

  • Parameters

    • target: default
    • isTileBlocked: ((tile: default) => boolean)
    • Optional getTilePenalty: ((tile: default) => number)
    • maxNodesChecked: number = 300

    Returns undefined | default[]

  • Use game.changeTile or game.removeTopTile when modifying tiles. This should only be called if you know what you're doing. Otherwise the game state could get out of sync.

    Parameters

    Returns void

  • Parameters

    • includeCoordinates: boolean = false

    Returns default

  • Gets the nearest player based.

    Parameters

    • Optional canSee: boolean

      If set to true, check if the player can see the x/y/z coords. Defaults to false.

    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean

    Returns {
        distance?: number;
        player?: default<number>;
    }

    • Optional distance?: number
    • Optional player?: default<number>
  • Returns ITileData[]

  • Parameters

    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean
    • Optional includeZMovement: boolean

    Returns default<number>[]

  • Returns default<number>[]

  • Returns undefined | ITileData[]

  • Array version of tilesAround

    Parameters

    • includeCurrentTile: boolean = false
    • includeCorners: boolean = false

    Returns default[]

  • Parameters

    • Optional noTileDataOffset: boolean

    Returns number

  • Parameters

    Returns boolean

  • Parameters

    Returns boolean

  • Checks if another cave entrance is nearby.

    Returns

    True if it created cave entrances

    Returns boolean

  • Checks if a tile is dangerous for a human

    Parameters

    Returns false | {
        message: default;
        object: default;
    }

  • Parameters

    • Optional includeGhosts: boolean
    • Optional includeConnecting: boolean
    • Optional includeZMovement: boolean

    Returns boolean

  • Check if a tile is a suitable spawn point

    Returns boolean

  • Check if a tile is a suitable spawn point

    Parameters

    • ensureConnectedToOcean: boolean

    Returns boolean

  • Check if a tile is a suitable spawn point

    Parameters

    • Optional disallowWater: boolean

    Returns boolean

  • Check if a tile is a suitable spawn point for a creature

    Returns boolean

  • Returns whether the tile is blocked (completely impassible) for the human

    Parameters

    • human: default<number>
    • clientSide: boolean

    Returns boolean

  • Used to genererate and find appropriate cave entrances

    Returns

    True if it created cave entrances

    Parameters

    • source: undefined | default<number>
    • chance: number = 50

    Returns boolean

  • Used to check if lava exists below, then create a passage above

    Returns

    True if it created a lava passage

    Parameters

    • source: undefined | default<number>

    Returns boolean

  • Parameters

    • range: number
    • includeCurrentTile: boolean = false

    Returns undefined | default

  • Pack or set the ground as untilled

    Returns void

  • Plants a random seed at the given coordinates based on what can grow on that tile naturally. This will replace any doodad that is there.

    Returns

    True if a seed was planted.

    Returns boolean

  • Parameters

    • type: SfxType
    • Optional delay: number
    • Optional speed: number

    Returns void

  • Parameters

    Returns void

  • Removes the top tiledata (index 0) from the tile If there is no remaining tile data, a new tile data will be added with the newTileTypeWhenEmpty type

    Parameters

    Returns void

  • Used to spawn a random doodad on the current biome type and at a set location (and terrain type) based on spawnOnWorldGen properties in doodad descriptions.

    Parameters

    • terrainType: TerrainType = ...

      Optional terrain type for overriding the biome item types

    Returns void

  • Used to spawn a random item on the current biome type based on spawnOnWorldGen properties in item descriptions.

    Parameters

    • terrainType: TerrainType = ...

      Optional terrain type for overriding the biome item types

    Returns void

  • Possibly collapses or opens up a cave (on both sides) and breaks any doodads.

    Parameters

    • Optional checkType: TerrainType

      TerrainType to check if the tile point equals this before switching.

    Returns void

  • IterableIterator version of TileHelpers.getTilesAround

    Parameters

    • includeCurrentTile: boolean = false
    • includeCorners: boolean = false

    Returns Generator<default, void, unknown>

  • Parameters

    • range: number
    • includeCurrentTile: boolean = false

    Returns Stream<default>

  • Returns string

  • Creates a fake tile

    Parameters

    • island: default
    • x: number = 0
    • y: number = 0
    • z: number = 0

    Returns default

  • Parameters

    • value: any

    Returns value is default

Generated using TypeDoc