Constructor Summary
Public Constructor | ||
public |
|
Method Summary
Public Methods | ||
public |
addAbility(ability: Ability) Adds an Ability to the Creature's list of Abilities. |
|
public |
Adds an item to the creature's inventory, optionally equipping it if there's room |
|
public |
Puts a Buff onto the creature. |
|
public |
Tells whether the Creature may act on the current timestep. |
|
public |
canAddItem(item: Item, backpackOnly: boolean): boolean Checks to see if the creature's backpack can hold another item |
|
public |
|
|
public |
canOccupyNow(tile: *): * |
|
public |
Determines if the Creature can see the given tile and what's on it. |
|
public |
Tells whether the creature can pickup and use items. |
|
public |
Kills this creature, removing it from the Dungeon |
|
public |
executeMove(dungeon: *, move: *) |
|
public |
getAbilities(): Array<Ability> Gets a list of the Creature's abilities |
|
public |
getAbility(index: number): Ability Gets the creature's Ability at the given index |
|
public |
getAbilityIndex(param: function(): Ability): number Gets the index of a creature's Ability |
|
public |
getArmor(): * |
|
public |
Get's the Creature's maximum allowed hitpoints |
|
public |
Get's the Creature's maximum allowed mana |
|
public |
Gets a list of the Creature's Buffs. |
|
public |
getClosestEnemy(dungeon: *): * |
|
public |
Get's the Creature's current hitpoints |
|
public |
Get's the Creature's current mana |
|
public |
getDamageReduction(type: string): number Get's the amount that damage of the given type is reduced by the creature's defenses. |
|
public |
getFaction(): string |
|
public |
getInventory(): * Gets the creature's inventory |
|
public |
getMeleeWeapon(): * |
|
public |
getNextMove(dungeon: *): Move | Promise |
|
public |
getRangedWeapon(): * |
|
public |
|
|
public |
getStrategy(): * |
|
public |
Gets the number of timesteps until this Creature's next move. |
|
public |
getVisibleCreatures(dungeon: *): * |
|
public |
getVisibleEnemies(dungeon: *): * |
|
public |
getVisibleTiles(dungeon: *): * |
|
public |
|
|
public |
hasSeen(tile: *): * |
|
public |
Restores the Creature's hitpoints by a given amount. The Creature cannot go above it's hitpoint maximum in this way |
|
public |
Tells whether the Creature is dead. |
|
public |
isEnemy(other: *): * |
|
public |
|
|
public |
modifyMana(-: number) Modifies the Creature's current mana by the given amount. Mana cannot go below zero or above the Creature's base mana value |
|
public |
observeMove(dungeon: *, actor: *, move: *) |
|
public |
onDeath() An optional death handler for this Creature. |
|
public |
receiveDamage(dungeon: Dungeon, amount: number, type: string): number Applies a given amount of typed damage to the creature, minus the creature's damage reduction |
|
public |
setArmor(armor: *) |
|
public |
setMeleeWeapon(weapon: *) |
|
public |
setRangedWeapon(weapon: *) |
|
public |
setStrategy(strategy: *) |
|
public |
Takes items from the Creature's current tile and attempts to add each one to it's Inventory in sequence |
|
public |
timestep(dungeon: *) |
|
public |
visionObsuredBy(tile: *): * |
Inherited Summary
From class Entity | ||
public |
|
|
public |
getId(): * |
|
public |
getName(): * |
|
public |
|
|
public |
toString(): * |
Public Constructors
Public Methods
public addAbility(ability: Ability) source
Adds an Ability to the Creature's list of Abilities.
Params:
Name | Type | Attribute | Description |
ability | Ability | The new ability |
public addItem(item: Item, backpackOnly: boolean) source
Adds an item to the creature's inventory, optionally equipping it if there's room
public applyBuff(dungeon: Dungeon, buff: Buff) source
Puts a Buff onto the creature. The Buff will have a chance to apply it's effects each timestep (including the current one) until it ends or is removed
public canActThisTimestep(): boolean source
Tells whether the Creature may act on the current timestep.
public canAddItem(item: Item, backpackOnly: boolean): boolean source
Checks to see if the creature's backpack can hold another item
public canSee(dungeon: *, tile: *): Boolean source
Determines if the Creature can see the given tile and what's on it.
Params:
Name | Type | Attribute | Description |
dungeon | * | ||
tile | * |
public canUseItems(): boolean source
Tells whether the creature can pickup and use items. By default, players can use items and enemies cannot.
public die(-: Dungeon) source
Kills this creature, removing it from the Dungeon
Params:
Name | Type | Attribute | Description |
- | Dungeon | The Dungeon this Creature is in |
public executeMove(dungeon: *, move: *) source
Params:
Name | Type | Attribute | Description |
dungeon | * | ||
move | * |
public getAbility(index: number): Ability source
Gets the creature's Ability at the given index
Params:
Name | Type | Attribute | Description |
index | number |
public getAbilityIndex(param: function(): Ability): number source
Gets the index of a creature's Ability
public getClosestEnemy(dungeon: *): * source
Params:
Name | Type | Attribute | Description |
dungeon | * |
Return:
* |
public getDamageReduction(type: string): number source
Get's the amount that damage of the given type is reduced by the creature's defenses. Damage reduction is subtracted from incoming damage. Damage reduction typically comes from Armor
Params:
Name | Type | Attribute | Description |
type | string | A member of DamageTypes |
public getNextMove(dungeon: *): Move | Promise source
Params:
Name | Type | Attribute | Description |
dungeon | * |
Return:
Move | Promise | A Move or a Promise for a Move |
public getTimeToNextMove(): number source
Gets the number of timesteps until this Creature's next move.
public getVisibleCreatures(dungeon: *): * source
Params:
Name | Type | Attribute | Description |
dungeon | * |
Return:
* |
public getVisibleEnemies(dungeon: *): * source
Params:
Name | Type | Attribute | Description |
dungeon | * |
Return:
* |
public getVisibleTiles(dungeon: *): * source
Params:
Name | Type | Attribute | Description |
dungeon | * |
Return:
* |
public heal(dungeon: Dungeon, amount: number) source
Restores the Creature's hitpoints by a given amount. The Creature cannot go above it's hitpoint maximum in this way
public isDead(): boolean source
Tells whether the Creature is dead. If the Creature is dead it will no longer be in a Dungeon.
public modifyMana(-: number) source
Modifies the Creature's current mana by the given amount. Mana cannot go below zero or above the Creature's base mana value
Params:
Name | Type | Attribute | Description |
- | number | An integer to add to the Creature's current mana. Negative numbers are allowed |
public observeMove(dungeon: *, actor: *, move: *) source
Params:
Name | Type | Attribute | Description |
dungeon | * | ||
actor | * | ||
move | * |
public receiveDamage(dungeon: Dungeon, amount: number, type: string): number source
Applies a given amount of typed damage to the creature, minus the creature's damage reduction
Return:
number | The amount of damage received. If the creature has no reduction for the given type, then this will be the same as the input amount |
public setArmor(armor: *) source
Params:
Name | Type | Attribute | Description |
armor | * |
public setMeleeWeapon(weapon: *) source
Params:
Name | Type | Attribute | Description |
weapon | * |
public setRangedWeapon(weapon: *) source
Params:
Name | Type | Attribute | Description |
weapon | * |
public setStrategy(strategy: *) source
Params:
Name | Type | Attribute | Description |
strategy | * |
public takeItems(dungeon: Dungeon) source
Takes items from the Creature's current tile and attempts to add each one to it's Inventory in sequence
Params:
Name | Type | Attribute | Description |
dungeon | Dungeon | The Dungeon the creature is in |
public timestep(dungeon: *) source
Params:
Name | Type | Attribute | Description |
dungeon | * |