![]() |
DynRPG
v0.20
RM2k3 Plugin SDK
|
Used for entities participating in battle, i.e. actors and monsters. More...
Inherited by RPG::Actor, and RPG::Monster.
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!) | |
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. | |
DArray< short, 1 > | conditions |
Turns elapsed in a certain condition (see details) | |
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 | originalX |
Original X coordinate (used when an actor moves to attack) | |
int | originalY |
Original 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) | |
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 | turnsTaken |
Turns taken by this battler. | |
bool | longAction |
true if the last action takes longer (info window needed) - I am not completely sure about that | |
ActionStatus | actionStatus |
Status of the current action. | |
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::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.
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 |
Current action of the battler.
Status of the current action.
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").
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): if(battler->animationId == 9) battler->animationId = 0;
Frames left until damage popup has finished (zero: no damage popup active)
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.
Blue value for flashing the battler (0
to 31
)
Green value for flashing the battler (0
to 31
)
double RPG::Battler::flashIntensity |
Intensity for flashing the battler (0
to 31
- will decrease until flashing is done)
Red value for flashing the battler (0
to 31
)
Frames left until flashing the battler finished (zero: no flashing active)
Internally used.
int RPG::Battler::hp |
Current HP.
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.
true
if the last action takes longer (info window needed) - I am not completely sure about that
true
if the battler's image is mirrored
int RPG::Battler::mp |
Current MP.
false
if the battler is currently hidden (but not dead)
Original X coordinate (used when an actor moves to attack)
Original Y coordinate (used when an actor moves to attack)
Current row (no visible effect on monsters)
Internally used, I do not understand the difference from row
yet.
Turns taken by this battler.
int RPG::Battler::x |
Current X coordinate (centered)
int RPG::Battler::y |
Current Y coordinate (centered)