Home Reference Source Repository
import DashAttack from 'roguelike/app/abilities/DashAttack.js'
public class | source

DashAttack

Extends:

Ability → DashAttack

An Ability that enables a creature to move forward and melee attack with the same action

Method Summary

Public Methods
public
public
public
public
public

getReasonIllegal(dungeon: *, creature: *, optionalTargetTile: *, isFree: *): undefined

public
public
public
public

use(dungeon: *, creature: *, optionalTargetTile: *, isFree: *)

Causes the creature to move the the closest tile the is adjacent to the target tile and attack the occupant with its melee weapon

Inherited Summary

From class Ability
public

For targetted abilities, tells whether or not the target can be the tile the creature is standing on.

public abstract

A short description of the ability

public abstract

Gets the amount of mana deducted from the user upon use.

public

Gets a formatted name for the ability

public

For targetted abilities, tells how far away the ability can target.

public

getReasonIllegal(dungeon: Dungeon, creature: Creature, optionalTargetTile: Tile, isFree: boolean): String

Gives a reason the ability cannot be performed by the given creature, if any exists.

public

Tells whether the ability can cause the creature to move.

public abstract

For a targetted ability, tells whether the ability requires the target tile to contain a creature.

public abstract

Tells whether the ability targets a tile.

public

For targetted abilities, tells whether or not the target must be visible to the creature.

public

Generic toString method

public

use(dungeon: Dungeon, creature: Creature, optionalTargetTile: Tile, isFree: boolean)

Causes the given creature to perform the ability, modifying the game state

Public Methods

public canTargetSelf(): boolean source

Override:

Ability#canTargetSelf

Return:

boolean

public getDescription(): string source

Override:

Ability#getDescription

Return:

string

public getManaCost(): number source

Override:

Ability#getManaCost

Return:

number

public getRange(): number source

Override:

Ability#getRange

Return:

number

public getReasonIllegal(dungeon: *, creature: *, optionalTargetTile: *, isFree: *): undefined source

Override:

Ability#getReasonIllegal

Params:

NameTypeAttributeDescription
dungeon *
creature *
optionalTargetTile *
isFree *

Return:

undefined

public isMovementAbility(): boolean source

Override:

Ability#isMovementAbility

Return:

boolean

public isTargetCreature(): boolean source

Override:

Ability#isTargetCreature

Return:

boolean

public isTargetted(): boolean source

Override:

Ability#isTargetted

Return:

boolean

public use(dungeon: *, creature: *, optionalTargetTile: *, isFree: *) source

Causes the creature to move the the closest tile the is adjacent to the target tile and attack the occupant with its melee weapon

Override:

Ability#use

Params:

NameTypeAttributeDescription
dungeon *
creature *
optionalTargetTile *
isFree *