DynRPG v0.32 Unofficial
Plugin SDK
|
Used for entities participating in battle, i.e. actors and monsters. More...
#include <Battler.h>
Public Member Functions | |
std::string | getName () |
Returns the name of the actor or monster. | |
int | getMaxHp () |
Returns the maximal HP. | |
int | getMaxMp () |
Returns the maximal MP. | |
int | getAttack () |
Returns the attack value. | |
int | getDefense () |
Returns the defense value. | |
int | getIntelligence () |
Returns the intelligence value. | |
int | getAgility () |
Returns the agility value. | |
void | setRow (Row newRow) |
Sets the current row. | |
void | damagePopup (int number, int color) |
Shows a damage popup with a number. | |
void | damagePopup (std::string text) |
Shows a damage popup with a small text. | |
bool | isMonster () |
Checks whether the battler is a monster or an actor. | |
void | flash (int r, int g, int b, int intensity, int duration) |
Flashes a battler in a certain color. | |
bool | executeAction (bool skipPluginHandlers=false) |
Executes the action of a battler (highly experimental!) | |
int | getAttributeResist (int id) |
Built-in RM2k3 function that returns the actual damage multiplier for when the battler would be hit with a certain attribute (considers the (Elemental) Resistance of equipment (max. one step towards dmgE) and the "Reduce / Increase Resistance" of skill effects) | |
int | getAttackPower (RPG::Battler *target) |
Built-in RM2k3 function that returns the strength of an attack (not the final attack value) Rough formula (a lot still not taken into account): if (critical hit) atk*3, else if (charge up) atk*2. | |
int | getSkillPower (int skillId, RPG::Battler *target) |
Built-in RM2k3 function that returns the strength of a skill on a certain target, however, it's before the miss probability based on agility and statuses is calculated. | |
Public Attributes | |
int | id |
One-based ID of the battler. | |
bool | notHidden |
false if the battler is currently hidden (but not dead) | |
Action * | action |
Current action of the battler. | |
int | hp |
Current HP. | |
int | mp |
Current MP. | |
int | attackDiff |
Difference from the default attack value. | |
int | defenseDiff |
Difference from the default defense value. | |
int | intelligenceDiff |
Difference from the default intelligence value. | |
int | agilityDiff |
Difference from the default agility value. | |
DArray< short, 1 > | attributes |
Array for a battler's attributes. | |
DArray< short, 1 > | conditions |
Turns elapsed in a certain condition (see details) | |
bool | isCharging |
Is the battler (monster) currently using the "Charge Up" action. | |
int | atbValue |
Current value of the ATB bar (0 to 300000 - see details) | |
bool | mirrored |
true if the battler's image is mirrored | |
int | frameCounter |
Internally used. | |
int | animationId |
ID of the battle graphic pose (see details) | |
int | x |
Current X coordinate (centered) | |
int | y |
Current Y coordinate (centered) | |
int | originX |
Origin X coordinate (used when an actor moves to attack) | |
int | originY |
Origin Y coordinate (used when an actor moves to attack) | |
int | destinationX |
Destination X coordinate (used when an actor moves to attack) | |
int | destinationY |
Destination Y coordinate (used when an actor moves to attack) | |
Row | rowAlt |
Internally used, I do not understand the difference from row yet. | |
Row | row |
Current row (no visible effect on monsters) | |
int | damagePopupTimer |
Frames left until damage popup has finished (zero: no damage popup active) | |
Image * | damageImage |
Pointer to the image of the damage pointer. | |
int | flashR |
Red value for flashing the battler (0 to 31 ) | |
int | flashG |
Green value for flashing the battler (0 to 31 ) | |
int | flashB |
Blue value for flashing the battler (0 to 31 ) | |
double | flashIntensity |
Intensity for flashing the battler (0 to 31 - will decrease until flashing is done) | |
int | flashTimer |
Frames left until flashing the battler finished (zero: no flashing active) | |
int | shakeStrength |
If the battler is being shaken, the strength of the shake. | |
int | shakeSpeed |
If the battler is being shaken, the speed of the shake. | |
int | shakeOffsetX |
If the battler is being shaken, the amount of pixels? to shake the battler left/right. | |
int | shakeOffsetY |
If the battler is being shaken, the amount of pixels? to shake the battler up/down. | |
int | shakeTimer |
Frames left until shaking the battler finished (zero: no shaking active) | |
int | turnsTaken |
Turns taken by this battler. | |
ActionType | actionType |
Whether the action is short, or long (skill is being cast or item is being used) | |
ActionStatus | actionStatus |
Status of the current action. | |
int | jobClassId |
The job class ID. -1 if it's the database default. | |
int | displayedConditions [5] |
Conditions which will be displayed in the info window (see details) | |
Used for entities participating in battle, i.e. actors and monsters.
Even though this is the base class of both RPG::Actor and RPG::Monster, some members only apply to one of them.
void RPG::Battler::damagePopup | ( | int | number, |
int | color ) |
Shows a damage popup with a number.
This function will make a number pop up on a battler.
number | The number to show |
color | Color to use (0 to 19 ) |
void RPG::Battler::damagePopup | ( | std::string | text | ) |
Shows a damage popup with a small text.
This function will make a small text pop up on a battler.
text | Text to show |
0
. bool RPG::Battler::executeAction | ( | bool | skipPluginHandlers = false | ) |
Executes the action of a battler (highly experimental!)
This function can be used to execute an action. You need to set the content of the action
object before.
skipPluginHandlers | If true , no onDoBattlerAction and onBattlerActionDone handlers will be called for this action. |
true
if the action was successfully executed, otherwise false
(in this case try again next frame) void RPG::Battler::flash | ( | int | r, |
int | g, | ||
int | b, | ||
int | intensity, | ||
int | duration ) |
Flashes a battler in a certain color.
r | Red value (0 to 31 ) |
g | Green value (0 to 31 ) |
b | Blue value (0 to 31 ) |
intensity | Intensity of the flash (0 to 33.5 ) |
duration | Duration in frames |
int RPG::Battler::getAgility | ( | ) |
Returns the agility value.
int RPG::Battler::getAttack | ( | ) |
Returns the attack value.
int RPG::Battler::getAttackPower | ( | RPG::Battler * | target | ) |
Built-in RM2k3 function that returns the strength of an attack (not the final attack value) Rough formula (a lot still not taken into account): if (critical hit) atk*3, else if (charge up) atk*2.
target | the target Battler of the attack |
int RPG::Battler::getAttributeResist | ( | int | id | ) |
Built-in RM2k3 function that returns the actual damage multiplier for when the battler would be hit with a certain attribute (considers the (Elemental) Resistance of equipment (max. one step towards dmgE) and the "Reduce / Increase Resistance" of skill effects)
id | the attribute to get the multiplier from |
int RPG::Battler::getDefense | ( | ) |
Returns the defense value.
int RPG::Battler::getIntelligence | ( | ) |
Returns the intelligence value.
int RPG::Battler::getMaxHp | ( | ) |
Returns the maximal HP.
int RPG::Battler::getMaxMp | ( | ) |
Returns the maximal MP.
std::string RPG::Battler::getName | ( | ) |
Returns the name of the actor or monster.
int RPG::Battler::getSkillPower | ( | int | skillId, |
RPG::Battler * | target ) |
Built-in RM2k3 function that returns the strength of a skill on a certain target, however, it's before the miss probability based on agility and statuses is calculated.
skillId | the id of the skill |
target | the target Battler of the attack |
bool RPG::Battler::isMonster | ( | ) |
Checks whether the battler is a monster or an actor.
true
if the battler is a monster, false
if it is an actor void RPG::Battler::setRow | ( | Row | newRow | ) |
Sets the current row.
newRow | New row |
int RPG::Battler::animationId |
ID of the battle graphic pose (see details)
This member specifies which battle graphic pose is displayed. Look into the "Animations 2" tab of the database to find out what the different values mean (e.g. 6
means "Taking
damage").
int RPG::Battler::atbValue |
Current value of the ATB bar (0
to 300000
- see details)
Internally, the ATB bar can have a value between 0
and 300000
where 0
means empty and 300000
means full. If you set a battler's ATB value to a value greater than or equal to 300000
, this will trigger his next action (in case of a monster) or open the action window (in case of an actor).
DArray<short, 1> RPG::Battler::conditions |
Turns elapsed in a certain condition (see details)
This is an array which has as much possible members as there are conditions in the database. The values tell you how many turns the battler has taken while being affected by a certain conditions. If a value is zero, the particular condition does not affect this battler.
For example, if conditions[2]
were 4, this battler would have been infected by poison (by default, condition #2 is poison) for 4 turns. If it were zero, the battler would not be poisoned at the moment.
animationId
is not 9
, otherwise the RPG Maker will try to show the animation for condition #0 which doesn't exist. This would result in an error stating that an "Event script referenced a condition that does not
exist". Use a failsafe like this (0
stands for the idle animation): int RPG::Battler::displayedConditions[5] |
Conditions which will be displayed in the info window (see details)
At target selection, there will be an info window displayed if the target is affected by a condition. The info has five columns for condition names. This array contains the database IDs of the conditions which are displayed in this window. The content of this array will be reset on several occasions. You can change this array in your onDrawBattleStatusWindow
handler.
double RPG::Battler::flashIntensity |
Intensity for flashing the battler (0
to 31
- will decrease until flashing is done)
int RPG::Battler::id |
One-based ID of the battler.
For actors this value is the database ID, for monsters it is the party member ID plus one (e.g. RPG::monsters[3]->id
should always be 4
).
If you want to get the database ID of a monster, you have to use RPG::Monster::databaseId.