extended.php
Table of Contents
- prepare_data_battlebars() : array<string|int, mixed>
- Prepare all data for show battle bars.
- prepare_fight() : array<string|int, mixed>
- This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.
- prepare_companions() : mixed
- This functions prepares companions to be able to take part in a fight. Uses global copies.
- suspend_companions() : mixed
- Suspends companions on a given parameter.
- unsuspend_companions() : mixed
- Enables suspended companions.
- autosettarget() : array<string|int, mixed>
- Automatically chooses the first still living enemy as target for attacks.
- report_companion_move() : array<string|int, mixed>
- Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.
- rollcompaniondamage() : array<string|int, mixed>
- Based upon the companion's stats damage values are calculated.
- battle_spawn() : mixed
- Adds a new creature to the badguy array.
- battle_heal() : mixed
- Allows creatures to heal themselves or another badguy.
- execute_ai_script() : mixed
- Executes the given script or loads the script and then executes it.
Functions
prepare_data_battlebars()
Prepare all data for show battle bars.
prepare_data_battlebars(array<string|int, mixed> $enemies) : array<string|int, mixed>
Parameters
- $enemies : array<string|int, mixed>
prepare_fight()
This function prepares the fight, sets up options and gives hook a hook to change options on a per-player basis.
prepare_fight([array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed> = []
-
the options given by a module or basics
prepare_companions()
This functions prepares companions to be able to take part in a fight. Uses global copies.
prepare_companions() : mixed
suspend_companions()
Suspends companions on a given parameter.
suspend_companions(string $susp[, string $nomsg = null ]) : mixed
Parameters
- $susp : string
-
The type of suspension
- $nomsg : string = null
-
The message to be displayed upon suspending. If false, no message will be displayed.
unsuspend_companions()
Enables suspended companions.
unsuspend_companions(string $susp[, string $nomsg = null ]) : mixed
Parameters
- $susp : string
-
The type of suspension
- $nomsg : string = null
-
The message to be displayed upon unsuspending. If false, no message will be displayed.
autosettarget()
Automatically chooses the first still living enemy as target for attacks.
autosettarget(array<string|int, mixed> $localenemies) : array<string|int, mixed>
Parameters
- $localenemies : array<string|int, mixed>
-
the stack of enemies to find a valid one from
report_companion_move()
Based upon the type of the companion different actions are performed and the companion is marked as "used" after that.
report_companion_move(array<string|int, mixed> $companion[, string $activate = 'fight' ]) : array<string|int, mixed>
Parameters
- $companion : array<string|int, mixed>
-
The companion itself
- $activate : string = 'fight'
-
The stage of activation. Can be one of these: "fight", "defend", "heal" or "magic".
rollcompaniondamage()
Based upon the companion's stats damage values are calculated.
rollcompaniondamage(array<string|int, mixed> $companion) : array<string|int, mixed>
Parameters
- $companion : array<string|int, mixed>
battle_spawn()
Adds a new creature to the badguy array.
battle_spawn(mixed $creature) : mixed
Parameters
- $creature : mixed
-
A standard badguy array. If numeric, the corresponding badguy will be loaded from the database.
battle_heal()
Allows creatures to heal themselves or another badguy.
battle_heal(int $amount[, mixed $target = false ]) : mixed
Parameters
- $amount : int
-
Amount of helath to be restored
- $target : mixed = false
-
if false badguy will heal itself otherwise the enemy with this index
execute_ai_script()
Executes the given script or loads the script and then executes it.
execute_ai_script(string $script) : mixed
Parameters
- $script : string
-
the script to be executed