Menu

## DamageReflectionEvent extends BattleEvent
in package

DamageReflectionEvent.php : 12

A battle event representing damage being reflected back on the attacker.

### Table of Contents

$damage : int
$message : string
$target : FighterInterface
$applied : mixed
__construct() : mixed
  Construct a DamageReflectionEvent with the target $target, damage amount $damage and the message $message.
apply() : mixed
  Applies the event.
decorate() : string
  Returns a string describing the event.
getDamage() : int
  Returns the damage.

### Properties

#### $damage

DamageReflectionEvent.php : 17
`protected int $damage`

#### $message

DamageReflectionEvent.php : 19
`protected string $message`

#### $target

DamageReflectionEvent.php : 15
`protected FighterInterface $target`

#### $applied

BattleEvent.php : 14
`private mixed $applied = false`

### Methods

#### __construct()

DamageReflectionEvent.php : 30

Construct a DamageReflectionEvent with the target $target, damage amount $damage and the message $message.

`public __construct(FighterInterface $target, int $damage, string $message) : mixed`

$message can contain '{target}' and '{damage}' which will be replaced by the name of the target and the damage, respectively.

##### Parameters

$target : FighterInterface
$damage : int
$message : string

##### Return values

mixed —

#### apply()

DamageReflectionEvent.php : 49

Applies the event.

`public apply() : mixed`

##### Tags

inheritDoc

##### Return values

mixed —

#### decorate()

DamageReflectionEvent.php : 65

Returns a string describing the event.

`public decorate(Game $game) : string`

##### Parameters

$game : Game

##### Tags

inheritDoc

##### Return values

string —

#### getDamage()

DamageReflectionEvent.php : 41

Returns the damage.

`public getDamage() : int`

##### Return values

int —

## Search results