Buff
in package
A model representing a buff used to modify the flow of the battle.
Tags
Table of Contents
- ACTIVATE_ANY = 0b1111
- ACTIVATE_DEFENSE = 0b1000
- ACTIVATE_NONE = 0b0
- ACTIVATE_OFFENSE = 0b100
- ACTIVATE_ROUNDEND = 0b10
- ACTIVATE_ROUNDSTART = 0b1
- ACTIVATE_WHILEROUND = 0b1100
- $activateAt : int
- A value determining when the buffs activates.
- $badguyAttackModifier : float
- Modifies the badguy's attack value.
- $badguyDamageModifier : float
- Modifies the damage applied to the badguy.
- $badguyDamageReflection : float
- Fraction of damage that is reflected to the goodguy if damage is applied to the badguy.
- $badguyDefenseModifier : float
- Modified the badguy's defense value.
- $badguyInvulnurable : bool
- True if the badguy stays invulnurable during the buffs duration.
- $badguyLifetap : float
- Fraction of damage applied to the badguy that gets converted to health ("absorb") for the goodguy.
- $badguyRegeneration : int
- Number of healthpoints the badguy regenerates.
- $buffArrayTemplate : array<string|int, mixed>
- Allowed buff values and their type.
- $character : mixed
- $effectFailsMessage : string
- The message given if the effect fails.
- $effectSucceedsMessage : string
- The message given if the effect has success.
- $endMessage : string
- The message given if the buff ends.
- $expiresAfterBattle : bool
- True if the buff should expire if the battle ended.
- $goodguyAttackModifier : float
- Modifies the goodguy's attack value.
- $goodguyDamageModifier : float
- Modifies the damage applied to the goodguy.
- $goodguyDamageReflection : float
- Fraction of damage that is reflected to the badguy if damage is applied to the goodguy.
- $goodguyDefenseModifier : float
- Modifies the goodguy's defense value.
- $goodguyInvulnurable : bool
- True if the goodguy stays invulnurable during the buffs duration.
- $goodguyLifetap : float
- Fraction of damage applied to the goodguy that gets converted to health for the badguy.
- $goodguyRegeneration : int
- Number of healthpoints the goodguy regenerates.
- $hasBeenStarted : bool
- True if the buff has already been started.
- $id : mixed
- $minionMaxBadguyDamage : int
- Maximum damage done to the badguy by the minions (if $numberOfMinions > 0).
- $minionMaxGoodguyDamage : int
- Maximum damage done to the goodguy by the minions (if $numberOfMinions > 0).
- $minionMinBadguyDamage : int
- Minium damage done to the badguy by the minions (if $numberOfMinions > 0).
- $minionMinGoodguyDamage : int
- Minium damage done to the goodguy by the minions (if $numberOfMinions > 0).
- $name : string
- Name of the buff.
- $newDayMessage : string
- Message that gets displayed every new day.
- $noEffectMessage : string
- The message given if the effect has no effect.
- $numberOfMinions : int
- Number of minions.
- $required : type
- Requried buff values.
- $roundMessage : string
- The message given every round.
- $rounds : int
- The number of rounds this buff lasts.
- $slot : mixed
- $startMessage : string
- The message given upon activation of the buff.
- $survivesNewDay : bool
- True if the buff survives a new day.
- __construct() : mixed
- Creates a new buff entity using an array.
- badguyIsInvulnurable() : bool
- Returns true if the badguy is invulnurable.
- constructFromTemplate() : Buff
- Creates a new buff entity using another buff as the template.
- decreaseRounds() : mixed
- Decreases the number of rounds left.
- expiresAfterBattle() : bool
- Returns true if the buff expires after the battle.
- getActivateAt() : int
- Returns the flags when this buff activates its effects.
- getBadguyAttackModifier() : float
- Returns a factor which modifies the badguy's attack value.
- getBadguyDamageModifier() : float
- Returns a factor which modifies the damage applied TO the badguy.
- getBadguyDamageReflection() : float
- Returns the fraction of the damage applied to the badguy that gets reflected to the goodguy.
- getBadguyDefenseModifier() : float
- Returns a factor which modified the badguy's defense value.
- getBadguyLifetap() : float
- Returns the fraction of life that gets absorbed from the damage applied to the badguy.
- getBadguyRegeneration() : int
- Returns the amount of health the badguy gets healed.
- getCharacter() : Character
- Returns the Character this buff has been applied to.
- getEffectFailsMessage() : string
- Returns the message displayed when the buff's effect fails.
- getEffectSucceedsMessage() : string
- Returns the message displayed when the buff's effect succeeds.
- getEndMessage() : string
- Returns the message displayed upon the end of the buff's lifetime.
- getGoodguyAttackModifier() : float
- Returns a factor which modifies the goodguy's attack value.
- getGoodguyDamageModifier() : float
- Returns a factor which modifies the damage applied TO the goodguy.
- getGoodguyDamageReflection() : float
- Returns the fraction of the damage applied to the goodguy that gets reflected to the badguy.
- getGoodguyDefenseModifier() : float
- Returns a factor which modified the goodguy's defense value.
- getGoodguyLifetap() : float
- Returns the fraction of life that gets absorbed from the damage applied to the goodguy.
- getGoodguyRegeneration() : int
- Returns the number of health the goodguy gets healed.
- getId() : int
- Returns the id of the buff.
- getMinionMaxBadguyDamage() : int
- Returns the maximum damage a minion afflicts to the badguy.
- getMinionMaxGoodguyDamage() : int
- Returns the maximum damage a minion afflicts to the goodguy.
- getMinionMinBadguyDamage() : int
- Returns the minium damage a minion afflicts to the badguy.
- getMinionMinGoodguyDamage() : int
- Returns the minium damage a minion afflicts to the goodguy.
- getName() : string
- Returns the buff's name.
- getNewDayMessage() : string
- Returns the message at the dawn of a new day.
- getNoEffectMessage() : string
- Returns the message displayed when the buff has no effect at all.
- getNumberOfMinions() : int
- Returns the number of minions.
- getRoundMessage() : string
- Returns the message displayed every round.
- getRounds() : int
- Returns the number of rounds left.
- getsActivatedAt() : bool
- Checks if this buff gets activated.
- getSlot() : string
- Returns the slot this buff occupies.
- getStartMessage() : string
- Returns the message displayed upon buff activation.
- goodguyIsInvulnurable() : bool
- Returns true if the goodguy is invulnurable.
- hasBeenStarted() : bool
- Returns true if the buff has already been started.
- setHasBeenStarted() : mixed
- Sets if the buff has been started (or not).
- setRounds() : mixed
- Sets the number of rounds left.
- survivesNewDay() : bool
- Returns true if the buff survives a new day.
Constants
ACTIVATE_ANY
public
mixed
ACTIVATE_ANY
= 0b1111
ACTIVATE_DEFENSE
public
mixed
ACTIVATE_DEFENSE
= 0b1000
ACTIVATE_NONE
public
mixed
ACTIVATE_NONE
= 0b0
ACTIVATE_OFFENSE
public
mixed
ACTIVATE_OFFENSE
= 0b100
ACTIVATE_ROUNDEND
public
mixed
ACTIVATE_ROUNDEND
= 0b10
ACTIVATE_ROUNDSTART
public
mixed
ACTIVATE_ROUNDSTART
= 0b1
ACTIVATE_WHILEROUND
public
mixed
ACTIVATE_WHILEROUND
= 0b1100
Properties
$activateAt
A value determining when the buffs activates.
private
int
$activateAt
Tags
$badguyAttackModifier
Modifies the badguy's attack value.
private
float
$badguyAttackModifier
= 1
Tags
$badguyDamageModifier
Modifies the damage applied to the badguy.
private
float
$badguyDamageModifier
= 1
Tags
$badguyDamageReflection
Fraction of damage that is reflected to the goodguy if damage is applied to the badguy.
private
float
$badguyDamageReflection
= 0
Tags
$badguyDefenseModifier
Modified the badguy's defense value.
private
float
$badguyDefenseModifier
= 1
Tags
$badguyInvulnurable
True if the badguy stays invulnurable during the buffs duration.
private
bool
$badguyInvulnurable
= false
Tags
$badguyLifetap
Fraction of damage applied to the badguy that gets converted to health ("absorb") for the goodguy.
private
float
$badguyLifetap
= 0
Tags
$badguyRegeneration
Number of healthpoints the badguy regenerates.
private
int
$badguyRegeneration
= 0
Tags
$buffArrayTemplate
Allowed buff values and their type.
private
static array<string|int, mixed>
$buffArrayTemplate
= ["slot" => "string", "name" => "string", "startMessage" => "string", "roundMessage" => "string", "endMessage" => "string", "effectSucceedsMessage" => "string", "effectFailsMessage" => "string", "noEffectMessage" => "string", "newDayMessage" => "string", "activateAt" => "int", "survivesNewDay" => "bool", "expiresAfterBattle" => "bool", "rounds" => "int", "badguyRegeneration" => "int", "goodguyRegeneration" => "int", "badguyLifetap" => "float", "goodguyLifetap" => "float", "badguyDamageReflection" => "float", "goodguyDamageReflection" => "float", "numberOfMinions" => "int", "minionMinBadguyDamage" => "int", "minionMaxBadguyDamage" => "int", "minionMinGoodguyDamage" => "int", "minionMaxGoodguyDamage" => "int", "badguyDamageModifier" => "float", "badguyAttackModifier" => "float", "badguyDefenseModifier" => "float", "badguyInvulnurable" => "bool", "goodguyDamageModifier" => "float", "goodguyAttackModifier" => "float", "goodguyDefenseModifier" => "float", "goodguyInvulnurable" => "bool"]
$character
private
mixed
$character
Tags
$effectFailsMessage
The message given if the effect fails.
private
string
$effectFailsMessage
= ""
Tags
$effectSucceedsMessage
The message given if the effect has success.
private
string
$effectSucceedsMessage
= ""
Tags
$endMessage
The message given if the buff ends.
private
string
$endMessage
= ""
Tags
$expiresAfterBattle
True if the buff should expire if the battle ended.
private
bool
$expiresAfterBattle
= false
Tags
$goodguyAttackModifier
Modifies the goodguy's attack value.
private
float
$goodguyAttackModifier
= 1
Tags
$goodguyDamageModifier
Modifies the damage applied to the goodguy.
private
float
$goodguyDamageModifier
= 1
Tags
$goodguyDamageReflection
Fraction of damage that is reflected to the badguy if damage is applied to the goodguy.
private
float
$goodguyDamageReflection
= 0
Tags
$goodguyDefenseModifier
Modifies the goodguy's defense value.
private
float
$goodguyDefenseModifier
= 1
Tags
$goodguyInvulnurable
True if the goodguy stays invulnurable during the buffs duration.
private
bool
$goodguyInvulnurable
= false
Tags
$goodguyLifetap
Fraction of damage applied to the goodguy that gets converted to health for the badguy.
private
float
$goodguyLifetap
= 0
Tags
$goodguyRegeneration
Number of healthpoints the goodguy regenerates.
private
int
$goodguyRegeneration
= 0
Tags
$hasBeenStarted
True if the buff has already been started.
private
bool
$hasBeenStarted
= false
Tags
$id
private
mixed
$id
Tags
$minionMaxBadguyDamage
Maximum damage done to the badguy by the minions (if $numberOfMinions > 0).
private
int
$minionMaxBadguyDamage
= 0
Tags
$minionMaxGoodguyDamage
Maximum damage done to the goodguy by the minions (if $numberOfMinions > 0).
private
int
$minionMaxGoodguyDamage
= 0
Tags
$minionMinBadguyDamage
Minium damage done to the badguy by the minions (if $numberOfMinions > 0).
private
int
$minionMinBadguyDamage
= 0
Tags
$minionMinGoodguyDamage
Minium damage done to the goodguy by the minions (if $numberOfMinions > 0).
private
int
$minionMinGoodguyDamage
= 0
Tags
$name
Name of the buff.
private
string
$name
Tags
$newDayMessage
Message that gets displayed every new day.
private
string
$newDayMessage
= ""
Tags
$noEffectMessage
The message given if the effect has no effect.
private
string
$noEffectMessage
= ""
Tags
$numberOfMinions
Number of minions.
private
int
$numberOfMinions
= 0
Tags
$required
Requried buff values.
private
type
$required
= ["slot", "activateAt"]
$roundMessage
The message given every round.
private
string
$roundMessage
= ""
Tags
$rounds
The number of rounds this buff lasts.
private
int
$rounds
= 1
Gets reduces very round by 1. If the value is < 0, the buff is permament until a new day arises.
Tags
$slot
private
mixed
$slot
Tags
$startMessage
The message given upon activation of the buff.
private
string
$startMessage
= ""
Tags
$survivesNewDay
True if the buff survives a new day.
private
bool
$survivesNewDay
= false
Tags
Methods
__construct()
Creates a new buff entity using an array.
public
__construct(array<string|int, mixed> $buffArray) : mixed
Parameters
- $buffArray : array<string|int, mixed>
Tags
Return values
mixed —badguyIsInvulnurable()
Returns true if the badguy is invulnurable.
public
badguyIsInvulnurable() : bool
Return values
bool —constructFromTemplate()
Creates a new buff entity using another buff as the template.
public
static constructFromTemplate(Buff $buff) : Buff
Parameters
- $buff : Buff
Return values
Buff —decreaseRounds()
Decreases the number of rounds left.
public
decreaseRounds([int $roundsToDecrease = 1 ]) : mixed
Parameters
- $roundsToDecrease : int = 1
Return values
mixed —expiresAfterBattle()
Returns true if the buff expires after the battle.
public
expiresAfterBattle() : bool
Return values
bool —getActivateAt()
Returns the flags when this buff activates its effects.
public
getActivateAt() : int
Return values
int —getBadguyAttackModifier()
Returns a factor which modifies the badguy's attack value.
public
getBadguyAttackModifier() : float
Return values
float —getBadguyDamageModifier()
Returns a factor which modifies the damage applied TO the badguy.
public
getBadguyDamageModifier() : float
Return values
float —getBadguyDamageReflection()
Returns the fraction of the damage applied to the badguy that gets reflected to the goodguy.
public
getBadguyDamageReflection() : float
Return values
float —getBadguyDefenseModifier()
Returns a factor which modified the badguy's defense value.
public
getBadguyDefenseModifier() : float
Return values
float —getBadguyLifetap()
Returns the fraction of life that gets absorbed from the damage applied to the badguy.
public
getBadguyLifetap() : float
Return values
float —getBadguyRegeneration()
Returns the amount of health the badguy gets healed.
public
getBadguyRegeneration() : int
Return values
int —getCharacter()
Returns the Character this buff has been applied to.
public
getCharacter() : Character
Return values
Character —getEffectFailsMessage()
Returns the message displayed when the buff's effect fails.
public
getEffectFailsMessage() : string
Return values
string —getEffectSucceedsMessage()
Returns the message displayed when the buff's effect succeeds.
public
getEffectSucceedsMessage() : string
Return values
string —getEndMessage()
Returns the message displayed upon the end of the buff's lifetime.
public
getEndMessage() : string
Return values
string —getGoodguyAttackModifier()
Returns a factor which modifies the goodguy's attack value.
public
getGoodguyAttackModifier() : float
Return values
float —getGoodguyDamageModifier()
Returns a factor which modifies the damage applied TO the goodguy.
public
getGoodguyDamageModifier() : float
Return values
float —getGoodguyDamageReflection()
Returns the fraction of the damage applied to the goodguy that gets reflected to the badguy.
public
getGoodguyDamageReflection() : float
Return values
float —getGoodguyDefenseModifier()
Returns a factor which modified the goodguy's defense value.
public
getGoodguyDefenseModifier() : float
Return values
float —getGoodguyLifetap()
Returns the fraction of life that gets absorbed from the damage applied to the goodguy.
public
getGoodguyLifetap() : float
Return values
float —getGoodguyRegeneration()
Returns the number of health the goodguy gets healed.
public
getGoodguyRegeneration() : int
Return values
int —getId()
Returns the id of the buff.
public
getId() : int
Return values
int —getMinionMaxBadguyDamage()
Returns the maximum damage a minion afflicts to the badguy.
public
getMinionMaxBadguyDamage() : int
Return values
int —getMinionMaxGoodguyDamage()
Returns the maximum damage a minion afflicts to the goodguy.
public
getMinionMaxGoodguyDamage() : int
Return values
int —getMinionMinBadguyDamage()
Returns the minium damage a minion afflicts to the badguy.
public
getMinionMinBadguyDamage() : int
Return values
int —getMinionMinGoodguyDamage()
Returns the minium damage a minion afflicts to the goodguy.
public
getMinionMinGoodguyDamage() : int
Return values
int —getName()
Returns the buff's name.
public
getName() : string
Return values
string —getNewDayMessage()
Returns the message at the dawn of a new day.
public
getNewDayMessage() : string
Return values
string —getNoEffectMessage()
Returns the message displayed when the buff has no effect at all.
public
getNoEffectMessage() : string
Return values
string —getNumberOfMinions()
Returns the number of minions.
public
getNumberOfMinions() : int
Return values
int —getRoundMessage()
Returns the message displayed every round.
public
getRoundMessage() : string
Return values
string —getRounds()
Returns the number of rounds left.
public
getRounds() : int
Return values
int —getsActivatedAt()
Checks if this buff gets activated.
public
getsActivatedAt(int $flag) : bool
Parameters
- $flag : int
Return values
bool —getSlot()
Returns the slot this buff occupies.
public
getSlot() : string
Return values
string —getStartMessage()
Returns the message displayed upon buff activation.
public
getStartMessage() : string
Return values
string —goodguyIsInvulnurable()
Returns true if the goodguy is invulnurable.
public
goodguyIsInvulnurable() : bool
Return values
bool —hasBeenStarted()
Returns true if the buff has already been started.
public
hasBeenStarted() : bool
Return values
bool —setHasBeenStarted()
Sets if the buff has been started (or not).
public
setHasBeenStarted([bool $setTo = true ]) : mixed
Parameters
- $setTo : bool = true
Return values
mixed —setRounds()
Sets the number of rounds left.
public
setRounds(int $rounds) : mixed
Parameters
- $rounds : int
Return values
mixed —survivesNewDay()
Returns true if the buff survives a new day.
public
survivesNewDay() : bool