BuffList
in package
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
protected
array<string|int, mixed>
$activeBuffs
= []
$badguyAttackModifier
protected
float
$badguyAttackModifier
= 1.0
$badguyDamageModifier
protected
float
$badguyDamageModifier
= 1.0
$badguyDefenseModifier
protected
float
$badguyDefenseModifier
= 1.0
$badguyInvulnurable
True if the badguy is invulnurable
protected
bool
$badguyInvulnurable
= false
$buffs
protected
Collection
$buffs
$buffsBySlot
protected
array<string|int, mixed>
$buffsBySlot
$events
protected
ArrayCollection
$events
$goodguyAttackModifier
protected
float
$goodguyAttackModifier
= 1.0
$goodguyDamageModifier
protected
float
$goodguyDamageModifier
= 1.0
$goodguyDefenseModifier
protected
float
$goodguyDefenseModifier
= 1.0
$goodguyInvulnurable
protected
bool
$goodguyInvulnurable
= false
$loaded
protected
bool
$loaded
= false
$modifiersCalculated
True of the modifiers have already been calculated
protected
bool
$modifiersCalculated
= false
$usedBuffs
protected
ArrayCollection
$usedBuffs
Methods
__construct()
Initiates some variables.
public
__construct(Collection $buffs) : mixed
Parameters
- $buffs : Collection
Return values
mixed —activate()
Activates all buffs that activate upon the given activation parameter.
public
activate(int $activation) : Collection
Parameters
- $activation : int
Tags
Return values
Collection —add()
Adds a buff to the buff list, occupying the slot.
public
add(Buff $buff) : mixed
Parameters
- $buff : Buff
Tags
Return values
mixed —badguyIsInvulnurable()
Returns true if the badguy is invulnurable.
public
badguyIsInvulnurable() : bool
Return values
bool —expireOneRound()
Decreases the rounds left on all used buffs.
public
expireOneRound() : Collection
Return values
Collection —A Collection containing expire messages (if there are any)
getBadguyAttackModifier()
Returns the badguy attack modifier calculated over the whole bufflist.
public
getBadguyAttackModifier() : float
Return values
float —getBadguyDamageModifier()
Returns the badguy damage modifier calculated over the whole bufflist.
public
getBadguyDamageModifier() : float
Return values
float —getBadguyDefenseModifier()
Returns the badguy defense modifier calculated over the whole bufflist.
public
getBadguyDefenseModifier() : float
Return values
float —getGoodguyAttackModifier()
Returns the badguy attack modifier calculated over the whole bufflist.
public
getGoodguyAttackModifier() : float
Return values
float —getGoodguyDamageModifier()
Returns the badguy damage modifier calculated over the whole bufflist.
public
getGoodguyDamageModifier() : float
Return values
float —getGoodguyDefenseModifier()
Returns the badguy defense modifier calculated over the whole bufflist.
public
getGoodguyDefenseModifier() : float
Return values
float —goodguyIsInvulnurable()
Returns true if the goodguy is invulnurable.
public
goodguyIsInvulnurable() : bool
Return values
bool —hasBuffsInUse()
Returns whether any buffs are in use.
public
hasBuffsInUse() : bool
Return values
bool —loadBuffs()
Loads all buffs (since it's a lazy correlation).
public
loadBuffs() : mixed
Return values
mixed —processDamageDependentBuffs()
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()
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()
Removes a buff from the buff list.
public
remove(Buff $buff) : mixed
Parameters
- $buff : Buff
Return values
mixed —renew()
Renews a buff.
public
renew(Buff $buff) : mixed
Parameters
- $buff : Buff
Return values
mixed —resetBuffUsage()
Resets the buff usage for a new round.
public
resetBuffUsage() : mixed
Return values
mixed —calculateModifiers()
Calculates all total modifiers.
protected
calculateModifiers() : void
Return values
void —getBuffMessage()
Returns the buff's start or round message.
protected
getBuffMessage(Buff $buff) : string
Parameters
- $buff : Buff
Return values
string —hasBuffBeenUsed()
Returns true if the given buff has already been used this round.
protected
hasBuffBeenUsed(Buff $buff) : bool
Parameters
- $buff : Buff
Return values
bool —iterateBuffList()
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()
Marks the given buff as used.
protected
useBuff(Buff $buff) : mixed
Parameters
- $buff : Buff