DynRPG  v0.14a
RM2k3 Plugin SDK
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator
Public Member Functions | Public Attributes
RPG::Battler Class Reference

Used for entities participating in battle, i.e. actors and monsters. More...

Inherited by RPG::Actor, and RPG::Monster.

List of all members.

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)
Actionaction
 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)

Detailed Description

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.

See also:
RPG::Row
RPG::ActionStatus
RPG::Actor
RPG::Monster

Member Function Documentation

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.

Parameters:
numberThe number to show
colorColor to use (0 to 19)
See also:
damagePopup(std::string)
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.

Parameters:
textText to show
Note:
It is not possible to show string popups with a color other than 0.
See also:
damagePopup(int, int)
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.

Parameters:
skipPluginHandlersIf true, no onDoBattlerAction and onBattlerActionDone handlers will be called for this action.
Returns:
true if the action was successfully executed, otherwise false (in this case try again next frame)
Warning:
This is a highly experimental function! During testing, it has repeatedly caused strange errors and crashes when executed under the wrong conditions or to the wrong time! It's probably not safe to use it for anything else than experiments, to be honest.
See also:
RPG::Action
void RPG::Battler::flash ( int  r,
int  g,
int  b,
int  intensity,
int  duration 
)

Flashes a battler in a certain color.

Parameters:
rRed value (0 to 31)
gGreen value (0 to 31)
bBlue value (0 to 31)
intensityIntensity of the flash (0 to 33.5)
durationDuration in frames

Returns the agility value.

Returns:
Agility value

Returns the attack value.

Returns:
Attack value

Returns the defense value.

Returns:
Defense value

Returns the intelligence value.

Returns:
Intelligence value

Returns the maximal HP.

Returns:
Maximal HP value

Returns the maximal MP.

Returns:
Maximal MP value
std::string RPG::Battler::getName ( )

Returns the name of the actor or monster.

Returns:
The name

Checks whether the battler is a monster or an actor.

Returns:
true if the battler is a monster, false if it is an actor
void RPG::Battler::setRow ( Row  newRow)

Sets the current row.

Parameters:
newRowNew row
Note:
This function has no visible effect on monsters

Member Data Documentation

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").

Note:
This member has no meaning to monsters.

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).

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.

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)

Intensity for flashing the battler (0 to 31 - will decrease until flashing is done)

Note:
Values over 31 will cause the palette to go crazy. Of course you can also use this as an intentional effect.

Red value for flashing the battler (0 to 31)

Frames left until flashing the battler finished (zero: no flashing active)

Internally used.

Current HP.

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

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.

Current X coordinate (centered)

Current Y coordinate (centered)

 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator