Menu

## BuffList
in package

BuffList.php : 23

Description of BuffList.

### Table of Contents

$activeBuffs : array<string|int, mixed>
$badguyAttackModifier : float
$badguyDamageModifier : float
$badguyDefenseModifier : float
$badguyInvulnurable : bool
  True if the badguy is invulnurable
$buffs : Collection
$buffsBySlot : array<string|int, mixed>
$events : ArrayCollection
$goodguyAttackModifier : float
$goodguyDamageModifier : float
$goodguyDefenseModifier : float
$goodguyInvulnurable : bool
$loaded : bool
$modifiersCalculated : bool
  True of the modifiers have already been calculated
$usedBuffs : ArrayCollection
__construct() : mixed
  Initiates some variables.
activate() : Collection
  Activates all buffs that activate upon the given activation parameter.
add() : mixed
  Adds a buff to the buff list, occupying the slot.
badguyIsInvulnurable() : bool
  Returns true if the badguy is invulnurable.
expireOneRound() : Collection
  Decreases the rounds left on all used buffs.
getBadguyAttackModifier() : float
  Returns the badguy attack modifier calculated over the whole bufflist.
getBadguyDamageModifier() : float
  Returns the badguy damage modifier calculated over the whole bufflist.
getBadguyDefenseModifier() : float
  Returns the badguy defense modifier calculated over the whole bufflist.
getGoodguyAttackModifier() : float
  Returns the badguy attack modifier calculated over the whole bufflist.
getGoodguyDamageModifier() : float
  Returns the badguy damage modifier calculated over the whole bufflist.
getGoodguyDefenseModifier() : float
  Returns the badguy defense modifier calculated over the whole bufflist.
goodguyIsInvulnurable() : bool
  Returns true if the goodguy is invulnurable.
hasBuffsInUse() : bool
  Returns whether any buffs are in use.
loadBuffs() : mixed
  Loads all buffs (since it's a lazy correlation).
processDamageDependentBuffs() : Collection
  Processes buffs that are dependant on the damage done in one round.
processDirectBuffs() : Collection
  Processes buffs that do direct damage or regeneration.
remove() : mixed
  Removes a buff from the buff list.
renew() : mixed
  Renews a buff.
resetBuffUsage() : mixed
  Resets the buff usage for a new round.
calculateModifiers() : void
  Calculates all total modifiers.
getBuffMessage() : string
  Returns the buff's start or round message.
hasBuffBeenUsed() : bool
  Returns true if the given buff has already been used this round.
iterateBuffList() : Generator|array<string|int, Buff>
  Iterates over every buff that gets activated at one point during a round.
useBuff() : mixed
  Marks the given buff as used.

### Properties

#### $activeBuffs

BuffList.php : 26
`protected array<string|int, mixed> $activeBuffs = []`

#### $badguyAttackModifier

BuffList.php : 35
`protected float $badguyAttackModifier = 1.0`

#### $badguyDamageModifier

BuffList.php : 34
`protected float $badguyDamageModifier = 1.0`

#### $badguyDefenseModifier

BuffList.php : 36
`protected float $badguyDefenseModifier = 1.0`

#### $badguyInvulnurable

BuffList.php : 32

True if the badguy is invulnurable

`protected bool $badguyInvulnurable = false`

#### $buffs

BuffList.php : 50
`protected Collection $buffs`

#### $buffsBySlot

BuffList.php : 25
`protected array<string|int, mixed> $buffsBySlot`

#### $events

BuffList.php : 42
`protected ArrayCollection $events`

#### $goodguyAttackModifier

BuffList.php : 39
`protected float $goodguyAttackModifier = 1.0`

#### $goodguyDamageModifier

BuffList.php : 38
`protected float $goodguyDamageModifier = 1.0`

#### $goodguyDefenseModifier

BuffList.php : 40
`protected float $goodguyDefenseModifier = 1.0`

#### $goodguyInvulnurable

BuffList.php : 37
`protected bool $goodguyInvulnurable = false`

#### $loaded

BuffList.php : 43
`protected bool $loaded = false`

#### $modifiersCalculated

BuffList.php : 30

True of the modifiers have already been calculated

`protected bool $modifiersCalculated = false`

#### $usedBuffs

BuffList.php : 27
`protected ArrayCollection $usedBuffs`

### Methods

#### __construct()

BuffList.php : 49

Initiates some variables.

`public __construct(Collection $buffs) : mixed`

##### Parameters

$buffs : Collection

##### Return values

mixed —

#### activate()

BuffList.php : 138

Activates all buffs that activate upon the given activation parameter.

`public activate(int $activation) : Collection`

##### Parameters

$activation : int

##### Tags

throws
  ArgumentException
throws
  BuffListAlreadyActivatedException

##### Return values

Collection —

#### add()

BuffList.php : 219

Adds a buff to the buff list, occupying the slot.

`public add(Buff $buff) : mixed`

##### Parameters

$buff : Buff

##### Tags

throws
  BuffSlotOccupiedException

  if the slot is already occupied. Use renew instead.

##### Return values

mixed —

#### badguyIsInvulnurable()

BuffList.php : 329

Returns true if the badguy is invulnurable.

`public badguyIsInvulnurable() : bool`

##### Return values

bool —

#### expireOneRound()

BuffList.php : 178

Decreases the rounds left on all used buffs.

`public expireOneRound() : Collection`

##### Return values

Collection —

A Collection containing expire messages (if there are any)

#### getBadguyAttackModifier()

BuffList.php : 299

Returns the badguy attack modifier calculated over the whole bufflist.

`public getBadguyAttackModifier() : float`

##### Return values

float —

#### getBadguyDamageModifier()

BuffList.php : 319

Returns the badguy damage modifier calculated over the whole bufflist.

`public getBadguyDamageModifier() : float`

##### Return values

float —

#### getBadguyDefenseModifier()

BuffList.php : 309

Returns the badguy defense modifier calculated over the whole bufflist.

`public getBadguyDefenseModifier() : float`

##### Return values

float —

#### getGoodguyAttackModifier()

BuffList.php : 339

Returns the badguy attack modifier calculated over the whole bufflist.

`public getGoodguyAttackModifier() : float`

##### Return values

float —

#### getGoodguyDamageModifier()

BuffList.php : 359

Returns the badguy damage modifier calculated over the whole bufflist.

`public getGoodguyDamageModifier() : float`

##### Return values

float —

#### getGoodguyDefenseModifier()

BuffList.php : 349

Returns the badguy defense modifier calculated over the whole bufflist.

`public getGoodguyDefenseModifier() : float`

##### Return values

float —

#### goodguyIsInvulnurable()

BuffList.php : 369

Returns true if the goodguy is invulnurable.

`public goodguyIsInvulnurable() : bool`

##### Return values

bool —

#### hasBuffsInUse()

BuffList.php : 126

Returns whether any buffs are in use.

`public hasBuffsInUse() : bool`

##### Return values

bool —

#### loadBuffs()

BuffList.php : 59

Loads all buffs (since it's a lazy correlation).

`public loadBuffs() : mixed`

##### Return values

mixed —

#### processDamageDependentBuffs()

BuffList.php : 485

Processes buffs that are dependant on the damage done in one round.

`public processDamageDependentBuffs(int $activation, int $damage, Game $game, FighterInterface $goodguy, FighterInterface $badguy) : Collection`

##### Parameters

$activation : int
$damage : int

  Positive damage is applied to the badguy, negative damage is applied to the goodguy

$game : Game
$goodguy : FighterInterface
$badguy : FighterInterface

##### Return values

Collection —

#### processDirectBuffs()

BuffList.php : 383

Processes buffs that do direct damage or regeneration.

`public processDirectBuffs(int $activation, Game $game, FighterInterface $goodguy, FighterInterface $badguy) : Collection`

##### Parameters

$activation : int
$game : Game
$goodguy : FighterInterface
$badguy : FighterInterface

##### Return values

Collection —

#### remove()

BuffList.php : 207

Removes a buff from the buff list.

`public remove(Buff $buff) : mixed`

##### Parameters

$buff : Buff

##### Return values

mixed —

#### renew()

BuffList.php : 236

Renews a buff.

`public renew(Buff $buff) : mixed`

##### Parameters

$buff : Buff

##### Return values

mixed —

#### resetBuffUsage()

BuffList.php : 115

Resets the buff usage for a new round.

`public resetBuffUsage() : mixed`

##### Return values

mixed —

#### calculateModifiers()

BuffList.php : 252

Calculates all total modifiers.

`protected calculateModifiers() : void`

##### Return values

void —

#### getBuffMessage()

BuffList.php : 98

Returns the buff's start or round message.

`protected getBuffMessage(Buff $buff) : string`

##### Parameters

$buff : Buff

##### Return values

string —

#### hasBuffBeenUsed()

BuffList.php : 73

Returns true if the given buff has already been used this round.

`protected hasBuffBeenUsed(Buff $buff) : bool`

##### Parameters

$buff : Buff

##### Return values

bool —

#### iterateBuffList()

BuffList.php : 284

Iterates over every buff that gets activated at one point during a round.

`protected iterateBuffList() : Generator|array<string|int, Buff>`

##### Return values

Generator|array<string|int, Buff> —

#### useBuff()

BuffList.php : 88

Marks the given buff as used.

`protected useBuff(Buff $buff) : mixed`

##### Parameters

$buff : Buff

##### Return values

mixed —

## Search results