Legend of the Green Dragon

Battle
in package
Uses BattleTrait, BattleStart, BattleProcess, BattleEnd, Buff, Buffer, Configuration, Context, Enemy, Extended, Formula, Ghost, HealthBar, Menu, Movement, Option, Other, Prepare, Process, Result, Round, Skill, Surprise, Suspend, Target, TempStat, TranslationDomain

Table of Contents

$translationDomain  : mixed
$battleBarEnd  : mixed
$battleBarStart  : mixed
$battleHasWinner  : mixed
$battleIsProcessed  : bool
Indicate if battle is processed.
$battleZone  : mixed
Zone of battle, use in death messages, but can use for other purposes
$createNews  : mixed
Indicating if battle create a news when player lost
$defeat  : mixed
$defended  : mixed
$die  : mixed
Indicating if die when lost in battle
$flawless  : mixed
Indicating if flawless for perfect battle is allowed or not
$gainExp  : mixed
Indicating if gains exp when win in battle
$gainFavor  : mixed
Indicating if gains favor when win in battle
$gainGem  : mixed
Indicating if gain gem when win in battle
$gainGold  : mixed
Indicating if gain gold when win in battle
$lostExp  : mixed
Indicating if lost exp when lost in battle
$lostGold  : mixed
Indicating if lost gold when lost in battle
$options  : array<string|int, mixed>
Options of battle.
$process  : mixed
Indicating if process victory or defeat battle. False when you want simulate a battle.
$round  : mixed
Current round in battle (same as total rounds)
$victory  : mixed
$battleIsEnded  : bool
Indicate if battle is ended.
$battleIsInitalized  : mixed
$battleIsStarted  : bool
Indicate if battle is started.
$battleShowedResults  : mixed
$buffReplacements  : mixed
$buffStarted  : mixed
$companions  : array<string|int, mixed>
Information of companions of user.
$context  : mixed
$debuggedBuffs  : mixed
$dispatcher  : mixed
$doctrine  : mixed
$enemies  : array<string|int, mixed>
List of enemies.
$enemyTargeted  : array<string|int, mixed>
Data of targed enemy.
$expression  : mixed
$ghostActivated  : mixed
$ghostStats  : mixed
$isChangeTarget  : mixed
$log  : mixed
$navigation  : mixed
$playerFunction  : mixed
$request  : mixed
$response  : mixed
$sanitize  : mixed
$settings  : mixed
$surprised  : mixed
$target  : int
Enemy target (value is key in array of enemies).
$temp_user_stats  : mixed
$tools  : mixed
$translator  : mixed
$twig  : mixed
$user  : array<string|int, mixed>
Information of user.
$userBuffs  : array<string|int, mixed>
Buffs of character.
$userSafe  : array<string|int, mixed>
Information of user without some data.
__construct()  : mixed
activateBuffs()  : mixed
addContextToBattleEnd()  : void
Add content to battle end info.
addContextToMessages()  : void
Add messages to context.
addContextToRoundAlly()  : void
Add content to round for ally (player and companion).
addContextToRoundEnemy()  : void
Add content to round for enemy.
addEnemy()  : self
Add one new enemy to list.
allowCreateNews()  : bool
Get if is allow create news on battle lost.
allowFlawless()  : bool
Get if is allow flawlees for perfect battle.
allowProccessBatteResults()  : bool
Get if need process battle on victory/defeat.
applyBodyguard()  : void
applyBuff()  : mixed
applyCompanion()  : mixed
applySkill()  : mixed
applyTempStat()  : mixed
battleEnd()  : self
Finalize battle.
battleHasWinner()  : bool
battleHeal()  : void
Allows creatures to heal themselves or another badguy.
battleProcess()  : self
Process battle.
battleResults()  : void|string
Get results of battle.
battleRoundContinue()  : bool
Check if battle round can continue.
battleSpawn()  : void
Adds a new creature to the badguy array.
battleStart()  : self
Initialize battle.
calculateBuffFields()  : mixed
canDie()  : bool
Get if player can die when lost in battle.
canGainExp()  : bool
Get if player can gain exp when win in battle
canGainFavor()  : bool
Get if player can gain favor when win in battle.
canGainGem()  : bool
Get if player can gain gem when win in battle.
canGainGold()  : bool
Get if player can gain gold when win in battle.
canLostExp()  : bool
Get if player can lost exp when lost in battle.
canLostGold()  : bool
Get if player can lost gold when lost in battle.
checkTempStat()  : mixed
disableCreateNews()  : self
Disable create news on battle lost.
disableDie()  : self
Disable player die when lost in battle.
disableFlawless()  : self
Deny flawlees for perfect battle.
disableGainExp()  : self
Disable player gain exp when win in battle.
disableGainFavor()  : self
Disable player gain favor when win in battle.
disableGainGem()  : self
Disable gain gem when win in battle.
disableGainGold()  : self
Disable gain gold when win in battle.
disableGhost()  : self
Restore player, battle end.
disableLostExp()  : self
Disable player lost exp when lost in battle.
disableLostGold()  : self
Disable lost gold when lost in battle.
disableProccessBatteResults()  : self
Disable process victory or defeat battle.
enableCreateNews()  : self
Enable create news on battle lost.
enableDie()  : self
Enable player die when lost in battle.
enableFlawless()  : self
Allow flawlees for perfect battle.
enableGainExp()  : self
Enable player gain exp when win in battle.
enableGainFavor()  : self
Enable player gain favor when win in battle.
enableGainGem()  : self
Enable gain gem when win in battle.
enableGainGold()  : self
Enable gain gold when win in battle.
enableGhost()  : self
Enable player as Ghost because is dead :(.
enableLostExp()  : self
Enable player lost exp when lost in battle.
enableLostGold()  : self
Enable lost gold when lost in battle.
enableProccessBatteResults()  : self
Enable process victory or defeat battle.
expireBuffs()  : mixed
expireBuffsAfterBattle()  : mixed
fightNav()  : mixed
getAutoAttackCount()  : int
getBattleBarsEnd()  : array<string|int, mixed>
Get info of all battle bars at end battle.
getBattleBarsStart()  : array<string|int, mixed>
Get info of all battle bars at start battle.
getBattleZone()  : string
Get the value of battleZone.
getContext()  : array<string|int, mixed>
Get context vars (results and info).
getEnemies()  : array<string|int, mixed>
Get list of enemies.
getEnemiesCount()  : int
Count enemies targets.
getOption()  : mixed
Get an option by name.
getOptions()  : array<string|int, mixed>
Get all of options.
getOptionType()  : string|null
Get type (same as battle zone).
getRound()  : int
Get the value of round.
getTarget()  : int
Get enemy target.
getTranslationDomain()  : string
Get translator domain for battle.
hasBuff()  : bool
increaseRound()  : self
Increase round by 1.
initialize()  : self
isBuffActive()  : mixed
isDefeat()  : bool
isVictory()  : bool
optionsBattleActive()  : self
Mark battle that as active.
optionsBattleDeactive()  : self
Mark battle that as deactive.
processDmgShield()  : mixed
processLifeTaps()  : mixed
restoreBuffFields()  : mixed
restoreTempStats()  : mixed
setBattleZone()  : self
Set value where the battle takes place.
setExpression()  : void
setLog()  : void
setNavigation()  : void
setOption()  : self
Set an option by name (replace if exists).
setOptions()  : self
Set the value of options (replace all options).
setOptionType()  : self
Set type (same as battle zone).
setResponse()  : void
setRound()  : self
Set the value of round.
setSanitize()  : void
setTarget()  : self
Set enemy target.
setTools()  : void
setTranslationDomain()  : self
Set translator domain for battle.
setTranslator()  : void
setTwig()  : void
stripAllBuffs()  : mixed
stripBuff()  : mixed
suspendBuffByName()  : mixed
suspendBuffs()  : void
Suspend buffs if condition is true.
suspendCompanions()  : void
Suspends companions on a given parameter.
suspendTempStats()  : mixed
unsuspendBuffByName()  : mixed
unsuspendBuffs()  : mixed
unSuspendCompanions()  : mixed
Enables suspended companions.
autoTarget()  : void
Automatically chooses the first still living enemy as target for attacks.
battleDefeat()  : mixed
battleEnemyFleesIfAlone()  : void
Check if enemies flees if are alone. (Leader die).
battleVictory()  : mixed
changeTarget()  : void
Change target enemy.
companionDefender()  : void
Movement of Defender Companion.
companionFighter()  : void
Movement of Fighter Companion.
companionHealer()  : void
Movement of Healer companion.
companionMagic()  : void
Movement of Magic Companion.
countEnemiesAlive()  : int
Count how much enemies are alive.
enemyAiScript()  : mixed
Executes the given script or loads the script and then executes it.
enemyMove()  : void
getPrefBarDisplay()  : array<string|int, mixed>
getSubstituteParams()  : array<string|int, mixed>
isCompanionAlive()  : bool
isEnemyAlive()  : bool
isPlayerAlive()  : bool
isSurprised()  : void
Check if player is surprised.
playerMove()  : void
prepareBattleBars()  : array<string|int, mixed>
Prepare info for battle bars information.
prepareCompanions()  : void
This functions prepares companions to be able to take part in a fight. Uses global copies.
prepareFight()  : void
This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.
proccessEnemiesResult()  : array<string|int, mixed>
processBatteResults()  : void
reportCompanionMove()  : array<string|int, mixed>
Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.
reportEnemyMove()  : bool
Battle: attack of badguy.
reportPlayerMove()  : bool
Battle: attack of player.
reportPowerMove()  : mixed
rollCompanionDamage()  : array<string|int, mixed>
Based upon the companion's stats damage values are calculated.
rollDamage()  : mixed
setBattleBarEnd()  : self
setBattleBarStart()  : self
setEnemies()  : self
Set enemies (replace previous).
updateData()  : self
Updated data of user and companions.
validateTarget()  : int
Check if target is a valid enemy.
victoryGainExperience()  : void
victoryGainFavor()  : void
victoryProccessGemFind()  : void
victoryProccessGoldFind()  : void
surprisedAdjust()  : void

Properties

$battleBarEnd

protected mixed $battleBarEnd = []

$battleBarStart

protected mixed $battleBarStart = []

$battleHasWinner

protected mixed $battleHasWinner = false

$battleIsProcessed

Indicate if battle is processed.

protected bool $battleIsProcessed = false

$battleZone

Zone of battle, use in death messages, but can use for other purposes

protected mixed $battleZone = 'forest'

$createNews

Indicating if battle create a news when player lost

protected mixed $createNews = true

$defeat

protected mixed $defeat = false

$defended

protected mixed $defended = false

$die

Indicating if die when lost in battle

protected mixed $die = true

$flawless

Indicating if flawless for perfect battle is allowed or not

protected mixed $flawless = true

$gainExp

Indicating if gains exp when win in battle

protected mixed $gainExp = false

$gainFavor

Indicating if gains favor when win in battle

protected mixed $gainFavor = false

$gainGem

Indicating if gain gem when win in battle

protected mixed $gainGem

$gainGold

Indicating if gain gold when win in battle

protected mixed $gainGold

$lostExp

Indicating if lost exp when lost in battle

protected mixed $lostExp = true

$lostGold

Indicating if lost gold when lost in battle

protected mixed $lostGold = true

$options

Options of battle.

protected array<string|int, mixed> $options = []

$process

Indicating if process victory or defeat battle. False when you want simulate a battle.

protected mixed $process = true

$round

Current round in battle (same as total rounds)

protected mixed $round = 1

$victory

protected mixed $victory = false

$battleIsEnded

Indicate if battle is ended.

private bool $battleIsEnded = false

$battleIsInitalized

private mixed $battleIsInitalized = false

$battleIsStarted

Indicate if battle is started.

private bool $battleIsStarted = false

$battleShowedResults

private mixed $battleShowedResults = false

$buffReplacements

private mixed $buffReplacements = []

$buffStarted

private mixed $buffStarted = []

$companions

Information of companions of user.

private array<string|int, mixed> $companions

$context

private mixed $context = ['messages' => [], 'encounter' => [], 'battle_start' => [], 'battle_rounds' => [], 'battle_end' => []]

$debuggedBuffs

private mixed $debuggedBuffs = []

$dispatcher

private mixed $dispatcher

$doctrine

private mixed $doctrine

$enemies

List of enemies.

private array<string|int, mixed> $enemies = []

$enemyTargeted

Data of targed enemy.

private array<string|int, mixed> $enemyTargeted

$expression

private mixed $expression

$ghostActivated

private mixed $ghostActivated = false

$ghostStats

private mixed $ghostStats = []

$isChangeTarget

private mixed $isChangeTarget = false

$playerFunction

private mixed $playerFunction

$settings

private mixed $settings

$surprised

private mixed $surprised = false

$target

Enemy target (value is key in array of enemies).

private int $target = 0

$temp_user_stats

private mixed $temp_user_stats = []

$user

Information of user.

private array<string|int, mixed> $user

$userBuffs

Buffs of character.

private array<string|int, mixed> $userBuffs = []

$userSafe

Information of user without some data.

private array<string|int, mixed> $userSafe

Methods

__construct()

public __construct(EventDispatcherInterface $dispatcher, EntityManagerInterface $doctrine, PlayerFunction $playerFunction, Settings $settings, Request $request, Battle $expression) : mixed
Parameters
$dispatcher : EventDispatcherInterface
$doctrine : EntityManagerInterface
$playerFunction : PlayerFunction
$settings : Settings
$request : Request
$expression : Battle
Return values
mixed

activateBuffs()

public activateBuffs(mixed $tag, mixed &$badguy) : mixed
Parameters
$tag : mixed
$badguy : mixed
Return values
mixed

addContextToBattleEnd()

Add content to battle end info.

public addContextToBattleEnd(array<string|int, mixed>|string|null $content) : void
Parameters
$content : array<string|int, mixed>|string|null
Return values
void

addContextToMessages()

Add messages to context.

public addContextToMessages(array<string|int, mixed>|string|null $content) : void
Parameters
$content : array<string|int, mixed>|string|null
Return values
void

addContextToRoundAlly()

Add content to round for ally (player and companion).

public addContextToRoundAlly(array<string|int, mixed>|string|null $content) : void
Parameters
$content : array<string|int, mixed>|string|null
Return values
void

addContextToRoundEnemy()

Add content to round for enemy.

public addContextToRoundEnemy(array<string|int, mixed>|string|null $content) : void
Parameters
$content : array<string|int, mixed>|string|null
Return values
void

addEnemy()

Add one new enemy to list.

public addEnemy(array<string|int, mixed> $enemy) : self
Parameters
$enemy : array<string|int, mixed>
Return values
self

allowCreateNews()

Get if is allow create news on battle lost.

public allowCreateNews() : bool
Return values
bool

allowFlawless()

Get if is allow flawlees for perfect battle.

public allowFlawless() : bool
Return values
bool

allowProccessBatteResults()

Get if need process battle on victory/defeat.

public allowProccessBatteResults() : bool
Return values
bool

applyBodyguard()

public applyBodyguard(mixed $level) : void
Parameters
$level : mixed
Return values
void

applyBuff()

public applyBuff(mixed $name, mixed $buff) : mixed
Parameters
$name : mixed
$buff : mixed
Return values
mixed

applyCompanion()

public applyCompanion(mixed $name, mixed $companion[, mixed $ignoreLimit = false ]) : mixed
Parameters
$name : mixed
$companion : mixed
$ignoreLimit : mixed = false
Return values
mixed

applySkill()

public applySkill(mixed $skill) : mixed
Parameters
$skill : mixed
Return values
mixed

applyTempStat()

public applyTempStat(mixed $name, mixed $value[, mixed $type = 'add' ]) : mixed
Parameters
$name : mixed
$value : mixed
$type : mixed = 'add'
Return values
mixed

battleEnd()

Finalize battle.

public battleEnd() : self
Return values
self

battleHasWinner()

public battleHasWinner() : bool
Return values
bool

battleHeal()

Allows creatures to heal themselves or another badguy.

public battleHeal(int $amount, int $target, int $healer) : void
Parameters
$amount : int

Amount of health to be restored

$target : int

Enemy to heal (index ID of array of enemies)

$healer : int
Return values
void

battleProcess()

Process battle.

public battleProcess() : self
Return values
self

battleResults()

Get results of battle.

public battleResults([bool $return = false ]) : void|string
Parameters
$return : bool = false

Return content results of add to response (Default add results to response)

Return values
void|string

battleRoundContinue()

Check if battle round can continue.

public battleRoundContinue() : bool
Return values
bool

battleSpawn()

Adds a new creature to the badguy array.

public battleSpawn(array<string|int, mixed> $badguy[, int|array<string|int, mixed> $creature = null ]) : void
Parameters
$badguy : array<string|int, mixed>

creature that spawn the new creature

$creature : int|array<string|int, mixed> = null

A standard badguy array. If numeric, the corresponding badguy will be loaded from the database.

Return values
void

battleStart()

Initialize battle.

public battleStart() : self
Return values
self

calculateBuffFields()

public calculateBuffFields() : mixed
Return values
mixed

canDie()

Get if player can die when lost in battle.

public canDie() : bool
Return values
bool

canGainExp()

Get if player can gain exp when win in battle

public canGainExp() : bool
Return values
bool

canGainFavor()

Get if player can gain favor when win in battle.

public canGainFavor() : bool
Return values
bool

canGainGem()

Get if player can gain gem when win in battle.

public canGainGem() : bool
Return values
bool

canGainGold()

Get if player can gain gold when win in battle.

public canGainGold() : bool
Return values
bool

canLostExp()

Get if player can lost exp when lost in battle.

public canLostExp() : bool
Return values
bool

canLostGold()

Get if player can lost gold when lost in battle.

public canLostGold() : bool
Return values
bool

checkTempStat()

public checkTempStat(mixed $name[, mixed $color = false ]) : mixed
Parameters
$name : mixed
$color : mixed = false
Return values
mixed

disableCreateNews()

Disable create news on battle lost.

public disableCreateNews() : self
Return values
self

disableDie()

Disable player die when lost in battle.

public disableDie() : self
Return values
self

disableFlawless()

Deny flawlees for perfect battle.

public disableFlawless() : self
Return values
self

disableGainExp()

Disable player gain exp when win in battle.

public disableGainExp() : self
Return values
self

disableGainFavor()

Disable player gain favor when win in battle.

public disableGainFavor() : self

.

Return values
self

disableGainGem()

Disable gain gem when win in battle.

public disableGainGem() : self
Return values
self

disableGainGold()

Disable gain gold when win in battle.

public disableGainGold() : self
Return values
self

disableGhost()

Restore player, battle end.

public disableGhost() : self
Return values
self

disableLostExp()

Disable player lost exp when lost in battle.

public disableLostExp() : self
Return values
self

disableLostGold()

Disable lost gold when lost in battle.

public disableLostGold() : self
Return values
self

disableProccessBatteResults()

Disable process victory or defeat battle.

public disableProccessBatteResults() : self

When you want simulate a battle.

Return values
self

enableCreateNews()

Enable create news on battle lost.

public enableCreateNews() : self
Return values
self

enableDie()

Enable player die when lost in battle.

public enableDie() : self
Return values
self

enableFlawless()

Allow flawlees for perfect battle.

public enableFlawless() : self
Return values
self

enableGainExp()

Enable player gain exp when win in battle.

public enableGainExp() : self
Return values
self

enableGainFavor()

Enable player gain favor when win in battle.

public enableGainFavor() : self

.

Return values
self

enableGainGem()

Enable gain gem when win in battle.

public enableGainGem() : self
Return values
self

enableGainGold()

Enable gain gold when win in battle.

public enableGainGold() : self
Return values
self

enableGhost()

Enable player as Ghost because is dead :(.

public enableGhost() : self

This make changes necesary for Battle run correct when character is dead.

Return values
self

enableLostExp()

Enable player lost exp when lost in battle.

public enableLostExp() : self
Return values
self

enableLostGold()

Enable lost gold when lost in battle.

public enableLostGold() : self
Return values
self

enableProccessBatteResults()

Enable process victory or defeat battle.

public enableProccessBatteResults() : self

Disabled when you want simulate a battle.

Return values
self

expireBuffs()

public expireBuffs() : mixed
Return values
mixed

expireBuffsAfterBattle()

public expireBuffsAfterBattle() : mixed
Return values
mixed

fightNav()

public fightNav([bool $allowspecial = true ][, bool $allowflee = true ][, string|null $script = null ]) : mixed
Parameters
$allowspecial : bool = true
$allowflee : bool = true
$script : string|null = null
Return values
mixed

getAutoAttackCount()

public getAutoAttackCount() : int
Return values
int

getBattleBarsEnd()

Get info of all battle bars at end battle.

public getBattleBarsEnd() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBattleBarsStart()

Get info of all battle bars at start battle.

public getBattleBarsStart() : array<string|int, mixed>
Return values
array<string|int, mixed>

getBattleZone()

Get the value of battleZone.

public getBattleZone() : string
Return values
string

getContext()

Get context vars (results and info).

public getContext() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEnemies()

Get list of enemies.

public getEnemies() : array<string|int, mixed>
Return values
array<string|int, mixed>

getEnemiesCount()

Count enemies targets.

public getEnemiesCount() : int
Return values
int

getOption()

Get an option by name.

public getOption(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Return values
mixed

getOptions()

Get all of options.

public getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed>

getOptionType()

Get type (same as battle zone).

public getOptionType() : string|null
Return values
string|null

getRound()

Get the value of round.

public getRound() : int
Return values
int

getTarget()

Get enemy target.

public getTarget() : int
Return values
int

getTranslationDomain()

Get translator domain for battle.

public getTranslationDomain() : string
Return values
string

hasBuff()

public hasBuff(mixed $name) : bool
Parameters
$name : mixed
Return values
bool

increaseRound()

Increase round by 1.

public increaseRound() : self
Return values
self

initialize()

public initialize([bool $force = false ]) : self
Parameters
$force : bool = false
Return values
self

isBuffActive()

public isBuffActive(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

isDefeat()

public isDefeat() : bool
Return values
bool

isVictory()

public isVictory() : bool
Return values
bool

optionsBattleActive()

Mark battle that as active.

public optionsBattleActive() : self
Return values
self

optionsBattleDeactive()

Mark battle that as deactive.

public optionsBattleDeactive() : self
Return values
self

processDmgShield()

public processDmgShield(mixed $dshield, mixed $damage, mixed &$badguy) : mixed
Parameters
$dshield : mixed
$damage : mixed
$badguy : mixed
Return values
mixed

processLifeTaps()

public processLifeTaps(mixed $ltaps, mixed $damage, mixed $badguy) : mixed
Parameters
$ltaps : mixed
$damage : mixed
$badguy : mixed
Return values
mixed

restoreBuffFields()

public restoreBuffFields() : mixed
Return values
mixed

restoreTempStats()

public restoreTempStats() : mixed
Return values
mixed

setBattleZone()

Set value where the battle takes place.

public setBattleZone(string $battleZone) : self

Game recognizes the forest and the graveyard, but can add more as you need

Parameters
$battleZone : string
Return values
self

setExpression()

public setExpression(Battle $expression) : void
Parameters
$expression : Battle
Return values
void

setLog()

public setLog(Log $log) : void
Parameters
$log : Log
Tags
required
Return values
void

setOption()

Set an option by name (replace if exists).

public setOption(string $key, mixed $value) : self
Parameters
$key : string
$value : mixed
Return values
self

setOptions()

Set the value of options (replace all options).

public setOptions(array<string|int, mixed> $options) : self
Parameters
$options : array<string|int, mixed>
Return values
self

setOptionType()

Set type (same as battle zone).

public setOptionType(string $type) : self
Parameters
$type : string
Return values
self

setRound()

Set the value of round.

public setRound(int $round) : self
Parameters
$round : int
Return values
self

setTarget()

Set enemy target.

public setTarget(int $target) : self
Parameters
$target : int
Return values
self

setTools()

public setTools(Tool $tools) : void
Parameters
$tools : Tool
Tags
required
Return values
void

setTranslationDomain()

Set translator domain for battle.

public setTranslationDomain(string $translationDomain) : self
Parameters
$translationDomain : string
Return values
self

setTranslator()

public setTranslator(TranslatorInterface $translator) : void
Parameters
$translator : TranslatorInterface
Tags
required
Return values
void

setTwig()

public setTwig(Environment $twig) : void
Parameters
$twig : Environment
Tags
required
Return values
void

stripAllBuffs()

public stripAllBuffs() : mixed
Return values
mixed

stripBuff()

public stripBuff(mixed $name) : mixed
Parameters
$name : mixed
Return values
mixed

suspendBuffByName()

public suspendBuffByName(mixed $name[, mixed $msg = '' ]) : mixed
Parameters
$name : mixed
$msg : mixed = ''
Return values
mixed

suspendBuffs()

Suspend buffs if condition is true.

public suspendBuffs([string $susp = '' ][, string $msg = '' ]) : void
Parameters
$susp : string = ''

The type of suspension

$msg : string = ''

the message to be displayed upon suspending

Return values
void

suspendCompanions()

Suspends companions on a given parameter.

public suspendCompanions([string $susp = '' ][, string $msg = '' ]) : void
Parameters
$susp : string = ''

The type of suspension

$msg : string = ''

the message to be displayed upon suspending

Return values
void

suspendTempStats()

public suspendTempStats() : mixed
Return values
mixed

unsuspendBuffByName()

public unsuspendBuffByName(mixed $name[, mixed $msg = false ]) : mixed
Parameters
$name : mixed
$msg : mixed = false
Return values
mixed

unsuspendBuffs()

public unsuspendBuffs([mixed $susp = false ][, mixed $msg = null ]) : mixed
Parameters
$susp : mixed = false
$msg : mixed = null
Return values
mixed

unSuspendCompanions()

Enables suspended companions.

public unSuspendCompanions(string $susp[, string|null $nomsg = null ]) : mixed
Parameters
$susp : string

The type of suspension

$nomsg : string|null = null

The message to be displayed upon unsuspending. If null, no message will be displayed.

Return values
mixed

autoTarget()

Automatically chooses the first still living enemy as target for attacks.

protected autoTarget() : void
Return values
void

battleDefeat()

protected battleDefeat() : mixed
Return values
mixed

battleEnemyFleesIfAlone()

Check if enemies flees if are alone. (Leader die).

protected battleEnemyFleesIfAlone() : void
Return values
void

battleVictory()

protected battleVictory() : mixed
Return values
mixed

changeTarget()

Change target enemy.

protected changeTarget(int $newTarget) : void
Parameters
$newTarget : int
Return values
void

companionDefender()

Movement of Defender Companion.

protected companionDefender(array<string|int, mixed> &$badguy) : void
Parameters
$badguy : array<string|int, mixed>
Return values
void

companionFighter()

Movement of Fighter Companion.

protected companionFighter(array<string|int, mixed> &$badguy) : void
Parameters
$badguy : array<string|int, mixed>
Return values
void

companionHealer()

Movement of Healer companion.

protected companionHealer(array<string|int, mixed> &$badguy) : void
Parameters
$badguy : array<string|int, mixed>
Return values
void

companionMagic()

Movement of Magic Companion.

protected companionMagic(array<string|int, mixed> &$badguy) : void
Parameters
$badguy : array<string|int, mixed>
Return values
void

countEnemiesAlive()

Count how much enemies are alive.

protected countEnemiesAlive() : int
Return values
int

enemyAiScript()

Executes the given script or loads the script and then executes it.

protected enemyAiScript(array<string|int, mixed> &$badguy) : mixed
Parameters
$badguy : array<string|int, mixed>
Return values
mixed

enemyMove()

protected enemyMove(mixed &$badguy) : void
Parameters
$badguy : mixed
Return values
void

getPrefBarDisplay()

protected getPrefBarDisplay() : array<string|int, mixed>
Return values
array<string|int, mixed>

getSubstituteParams()

protected getSubstituteParams(array<string|int, mixed> $badguy[, array<string|int, mixed> $search = [] ][, array<string|int, mixed> $replace = [] ]) : array<string|int, mixed>
Parameters
$badguy : array<string|int, mixed>
$search : array<string|int, mixed> = []
$replace : array<string|int, mixed> = []
Return values
array<string|int, mixed>

isCompanionAlive()

protected isCompanionAlive(mixed &$companion) : bool
Parameters
$companion : mixed
Return values
bool

isEnemyAlive()

protected isEnemyAlive(mixed &$badguy) : bool
Parameters
$badguy : mixed
Return values
bool

isPlayerAlive()

protected isPlayerAlive() : bool
Return values
bool

isSurprised()

Check if player is surprised.

protected isSurprised() : void
Return values
void

playerMove()

protected playerMove(mixed &$badguy) : void
Parameters
$badguy : mixed
Return values
void

prepareBattleBars()

Prepare info for battle bars information.

protected prepareBattleBars() : array<string|int, mixed>
Return values
array<string|int, mixed>

prepareCompanions()

This functions prepares companions to be able to take part in a fight. Uses global copies.

protected prepareCompanions() : void
Return values
void

prepareFight()

This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.

protected prepareFight() : void
Return values
void

proccessEnemiesResult()

protected proccessEnemiesResult() : array<string|int, mixed>
Return values
array<string|int, mixed>

processBatteResults()

protected processBatteResults() : void
Return values
void

reportCompanionMove()

Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.

protected reportCompanionMove(array<string|int, mixed> &$companion, mixed &$badguy[, string $activate = 'fight' ]) : array<string|int, mixed>
Parameters
$companion : array<string|int, mixed>

The companion itself

$badguy : mixed
$activate : string = 'fight'

The stage of activation. Can be one of these: "fight", "defend", "heal" or "magic".

Return values
array<string|int, mixed>

The changed companion

reportEnemyMove()

Battle: attack of badguy.

protected reportEnemyMove(mixed &$badguy) : bool
Parameters
$badguy : mixed
Return values
bool

reportPlayerMove()

Battle: attack of player.

protected reportPlayerMove(array<string|int, mixed> &$badguy) : bool
Parameters
$badguy : array<string|int, mixed>
Return values
bool

reportPowerMove()

protected reportPowerMove(mixed $crit, mixed $dmg) : mixed
Parameters
$crit : mixed
$dmg : mixed
Return values
mixed

rollCompanionDamage()

Based upon the companion's stats damage values are calculated.

protected rollCompanionDamage(array<string|int, mixed> $companion, array<string|int, mixed> $badguy) : array<string|int, mixed>
Parameters
$companion : array<string|int, mixed>
$badguy : array<string|int, mixed>
Return values
array<string|int, mixed>

rollDamage()

protected rollDamage(mixed $badguy) : mixed
Parameters
$badguy : mixed
Return values
mixed

setBattleBarEnd()

protected setBattleBarEnd(array<string|int, mixed> $bars) : self
Parameters
$bars : array<string|int, mixed>
Return values
self

setBattleBarStart()

protected setBattleBarStart(array<string|int, mixed> $bars) : self
Parameters
$bars : array<string|int, mixed>
Return values
self

setEnemies()

Set enemies (replace previous).

protected setEnemies(array<string|int, mixed> $enemies) : self
Parameters
$enemies : array<string|int, mixed>
Return values
self

updateData()

Updated data of user and companions.

protected updateData() : self
Return values
self

validateTarget()

Check if target is a valid enemy.

protected validateTarget(int $target) : int
Parameters
$target : int
Return values
int

victoryGainExperience()

protected victoryGainExperience(mixed $exp, mixed $expbonus) : void
Parameters
$exp : mixed
$expbonus : mixed
Return values
void

victoryGainFavor()

protected victoryGainFavor(mixed $exp, mixed $expbonus) : void
Parameters
$exp : mixed
$expbonus : mixed
Return values
void

victoryProccessGemFind()

protected victoryProccessGemFind() : void
Return values
void

victoryProccessGoldFind()

protected victoryProccessGoldFind(mixed $gold) : void
Parameters
$gold : mixed
Return values
void

surprisedAdjust()

private surprisedAdjust() : void
Return values
void

Search results