Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CreatureManager

Hierarchy

Implements

Index

Properties

Readonly event

Methods

checkSpawnReputation

  • checkSpawnReputation(creatureDescription: ICreatureDescription, reputation?: any, bypass?: boolean): boolean
  • Parameters

    • creatureDescription: ICreatureDescription
    • Default value reputation: any = game.getReputation()
    • Default value bypass: boolean = false

    Returns boolean

exists

  • Parameters

    Returns boolean

getCreaturesWithSpawnGroup

  • getCreaturesWithSpawnGroup(group?: SpawnGroup, checkReputation?: undefined | false | true, reputation?: undefined | number): CreatureType[]
  • Parameters

    • Optional group: SpawnGroup
    • Optional checkReputation: undefined | false | true
    • Optional reputation: undefined | number

    Returns CreatureType[]

getEntities

  • getEntities(): any

getHappinessLevel

  • getHappinessLevel(human: Human, creature: Creature, bonus?: number): number
  • Parameters

    • human: Human
    • creature: Creature
    • Default value bonus: number = 0

    Returns number

getMovePenalty

  • getMovePenalty(moveType: MoveType, tile: ITile, willMove: boolean): number
  • getMovePenalty

    Parameters

    • moveType: MoveType
    • tile: ITile
    • willMove: boolean

      Set to true if the object is about to move to this tile. This method will confirm if theres an existing npc/creature there and return false if so

    Returns number

    Blocked penalty - Do no return 0!

getMovePenaltyFromWasm

  • getMovePenaltyFromWasm(moveType: MoveType, x: number, y: number, z: number): number
  • wasm calls this when calculating penalties for flow fields

    Parameters

    • moveType: MoveType
    • x: number
    • y: number
    • z: number

    Returns number

getMoveTypesInFov

getName

  • getName(creature: Creature | CreatureType, aberrant?: undefined | false | true, count?: undefined | number, article?: undefined | false | true): Translation
  • Parameters

    • creature: Creature | CreatureType
    • Optional aberrant: undefined | false | true
    • Optional count: undefined | number
    • Optional article: undefined | false | true

    Returns Translation

getSpawnableCreatures

  • getSpawnableCreatures(creatureGroup: SpawnGroup, z: number, reputation?: any, time?: any): { aberrantChance: number; pool: CreatureType[] }
  • Parameters

    • creatureGroup: SpawnGroup
    • z: number
    • Default value reputation: any = game.getReputation()
    • Default value time: any = island.time.getTime()

    Returns { aberrantChance: number; pool: CreatureType[] }

maybeSpawnClawWorm

  • Parameters

    Returns void

remove

spawn

  • spawn(creatureType: CreatureType, x: number, y: number, z: number, bypass?: undefined | false | true, forceAberrant?: undefined | false | true, spawnTiles?: TileGroup, bypassCreatureLimit?: undefined | false | true): Creature | undefined
  • Spawns a creature.

    Parameters

    • creatureType: CreatureType

      The type of creature to spawn.

    • x: number

      The tile X position

    • y: number

      The tile Y position

    • z: number

      The tile Z position

    • Optional bypass: undefined | false | true

      Whether to bypass checks for whether the creature can spawn there naturally. Defaults to false, if the creature can't spawn naturally, it won't.

    • Optional forceAberrant: undefined | false | true

      If provided, forces the spawned creature's aberrant state to be the passed boolean. True = aberrant, false = not aberrant. If not provided, the aberrant state is decided based on chance.

    • Optional spawnTiles: TileGroup

      If set, this will overwrite the creature's description for which tiles it can spawn on

    • Optional bypassCreatureLimit: undefined | false | true

      If set, the creature limit will be ignored and spawn the creature over the set limit

    Returns Creature | undefined

spawnFromGroup

  • spawnFromGroup(creatureGroup: SpawnGroup, x: number, y: number, z: number, bypass?: undefined | false | true, bypassCreatureLimit?: undefined | false | true): Creature | undefined
  • Parameters

    • creatureGroup: SpawnGroup
    • x: number
    • y: number
    • z: number
    • Optional bypass: undefined | false | true
    • Optional bypassCreatureLimit: undefined | false | true

    Returns Creature | undefined

spawnGuardians

  • spawnGuardians(position: Vector3, amount: number): number
  • Parameters

    Returns number

updateAll

  • updateAll(realPlayers: Player[]): void
  • Parameters

    Returns void

updateFov

  • updateFov(bounds: Bound3[]): number

Generated using TypeDoc