#include <localplayer.h>

Definition at line 127 of file localplayer.h.
Public Types | |
| enum | Attribute { STR = 0, AGI, VIT, INT, DEX, LUK } |
Public Member Functions | |
| LocalPlayer (int id, int job, Map *map) | |
| Constructor. | |
| ~LocalPlayer () | |
| Destructor. | |
| virtual void | setName (const std::string &name) |
| Set up mName to be the character's name. | |
| virtual void | logic () |
| Performs being logic. | |
| virtual void | setAction (Action action, int attackType=0) |
| Sets the current action. | |
| virtual void | nextStep () |
| Adds a new step when walking before calling super. | |
| Inventory * | getInventory () const |
| Returns the player's inventory. | |
| Inventory * | getStorage () const |
| Returns the player's storage. | |
| void | inviteToParty (const std::string &name) |
| Invite a player to join their party. | |
| void | inviteToParty (Player *player) |
| Invite a player to join their party. | |
| void | moveInvItem (Item *item, int newIndex) |
| Move the Inventory item from the old slot to the new slot. | |
| void | equipItem (Item *item) |
| Equips an item. | |
| void | unequipItem (Item *item) |
| Unequips an item. | |
| void | useItem (Item *item) |
| void | dropItem (Item *item, int quantity) |
| void | pickUp (FloorItem *item) |
| int | getAttackRange () |
| Gets the attack range. | |
| void | trade (Being *being) const |
| Sents a trade request to the given being. | |
| void | tradeReply (bool accept) |
| Accept or decline a trade offer. | |
| bool | tradeRequestOk () const |
| Returns true when the player is ready to accept a trade offer. | |
| void | setTrading (bool trading) |
| Sets the trading state of the player, i.e. | |
| void | attack (Being *target=NULL, bool keep=false) |
| virtual void | setGM () |
| Triggers whether or not to show the name as a GM name. | |
| void | stopAttack () |
| virtual void | handleAttack (Being *victim, int damage, AttackType type) |
| Overridden to do nothing. | |
| virtual void | handleAttack () |
| Being * | getTarget () const |
| Returns the current target of the player. | |
| void | setTarget (Being *target) |
| Sets the target being of the player. | |
| virtual void | setDestination (Uint16 x, Uint16 y) |
| Sets a new destination for this being to walk to. | |
| void | setWalkingDir (int dir) |
| Sets a new direction to keep walking in. | |
| int | getWalkingDir () const |
| Gets the walking direction. | |
| void | setGotoTarget (Being *target) |
| Sets going to being to attack. | |
| bool | withinAttackRange (Being *target) |
| Returns whether the target is in range to attack. | |
| void | stopWalking (bool sendToServer=true) |
| Stops the player dead in his tracks. | |
| void | raiseAttribute (size_t attr) |
| Uses a character point to raise an attribute. | |
| void | lowerAttribute (size_t attr) |
| Uses a correction point to lower an attribute. | |
| void | toggleSit () |
| void | emote (Uint8 emotion) |
| void | revive () |
| void | pickedUp (const std::string &item) |
| Shows item pickup effect if the player is on a map. | |
| bool | getInStorage () |
| Accessors for mInStorage. | |
| void | setInStorage (bool inStorage) |
| int | getHp () const |
| int | getMaxHp () const |
| void | setHp (int value) |
| void | setMaxHp (int value) |
| int | getLevel () const |
| void | setLevel (int value) |
| int | getMoney () const |
| void | setMoney (int value) |
| int | getTotalWeight () const |
| void | setTotalWeight (int value) |
| int | getMaxWeight () const |
| void | setMaxWeight (int value) |
Public Attributes | |
| bool | mUpdateName |
| bool | mMapInitialized |
| Whether or not the name settings have changed. | |
| float | mLastAttackTime |
| Whether or not the map is available yet. | |
| const std::auto_ptr< Equipment > | mEquipment |
Protected Member Functions | |
| virtual void | handleStatusEffect (StatusEffect *effect, int effectId) |
| Handle an update to a status or stun effect. | |
| void | walk (unsigned char dir) |
| void | initTargetCursor () |
| void | loadTargetCursor (std::string filename, int width, int height, bool outRange, Being::TargetCursorSize size) |
| Helper function for loading target cursors. | |
Protected Attributes | |
| bool | mInStorage |
| Whether storage is currently accessible. | |
| int | mLastTarget |
| int | mLevel |
| Time stamp of last targeting action, -1 if none. | |
| int | mMoney |
| int | mTotalWeight |
| int | mMaxWeight |
| int | mHp |
| int | mMaxHp |
| Being * | mTarget |
| FloorItem * | mPickUpTarget |
| bool | mTrading |
| bool | mGoingToTarget |
| bool | mKeepAttacking |
| int | mLastAction |
| Whether or not to continue to attack. | |
| int | mWalkingDir |
| The direction the player is walking in. | |
| int | mDestX |
| X coordinate of destination. | |
| int | mDestY |
| Y coordinate of destination. | |
| std::vector< int > | mStatusEffectIcons |
| Inventory * | mInventory |
| Inventory * | mStorage |
| ImageSet * | mTargetCursorImages [2][NUM_TC] |
| Images of the target cursor. | |
| SimpleAnimation * | mTargetCursor [2][NUM_TC] |
| Animated target cursors. | |
| LocalPlayer::LocalPlayer | ( | int | id, | |
| int | job, | |||
| Map * | map | |||
| ) |
| LocalPlayer::~LocalPlayer | ( | ) |
| void LocalPlayer::setName | ( | const std::string & | name | ) | [virtual] |
Set up mName to be the character's name.
Reimplemented from Player.
Definition at line 249 of file localplayer.cpp.
| void LocalPlayer::logic | ( | ) | [virtual] |
| void LocalPlayer::setAction | ( | Action | action, | |
| int | attackType = 0 | |||
| ) | [virtual] |
| void LocalPlayer::nextStep | ( | ) | [virtual] |
Adds a new step when walking before calling super.
Also, when specified it picks up an item at the end of a path.
Definition at line 263 of file localplayer.cpp.
| Inventory* LocalPlayer::getInventory | ( | ) | const [inline] |
| Inventory* LocalPlayer::getStorage | ( | ) | const [inline] |
| void LocalPlayer::inviteToParty | ( | const std::string & | name | ) |
| void LocalPlayer::inviteToParty | ( | Player * | player | ) |
| void LocalPlayer::moveInvItem | ( | Item * | item, | |
| int | newIndex | |||
| ) |
Move the Inventory item from the old slot to the new slot.
Definition at line 349 of file localplayer.cpp.
| void LocalPlayer::equipItem | ( | Item * | item | ) |
| void LocalPlayer::unequipItem | ( | Item * | item | ) |
| void LocalPlayer::useItem | ( | Item * | item | ) |
Definition at line 379 of file localplayer.cpp.
| void LocalPlayer::dropItem | ( | Item * | item, | |
| int | quantity | |||
| ) |
Definition at line 384 of file localplayer.cpp.
| void LocalPlayer::pickUp | ( | FloorItem * | item | ) |
Definition at line 401 of file localplayer.cpp.
| int LocalPlayer::getAttackRange | ( | ) |
| void LocalPlayer::trade | ( | Being * | being | ) | const |
| void LocalPlayer::tradeReply | ( | bool | accept | ) |
| bool LocalPlayer::tradeRequestOk | ( | ) | const |
Returns true when the player is ready to accept a trade offer.
Returns false otherwise.
Definition at line 688 of file localplayer.cpp.
| void LocalPlayer::setTrading | ( | bool | trading | ) | [inline] |
Sets the trading state of the player, i.e.
whether or not he is currently involved into some trade.
Definition at line 257 of file localplayer.h.
| void LocalPlayer::attack | ( | Being * | target = NULL, |
|
| bool | keep = false | |||
| ) |
Definition at line 752 of file localplayer.cpp.
| void LocalPlayer::setGM | ( | ) | [virtual] |
Triggers whether or not to show the name as a GM name.
Reimplemented from Being.
Definition at line 239 of file localplayer.cpp.
| void LocalPlayer::stopAttack | ( | ) |
Definition at line 810 of file localplayer.cpp.
| virtual void LocalPlayer::handleAttack | ( | Being * | victim, | |
| int | damage, | |||
| AttackType | type | |||
| ) | [inline, virtual] |
Overridden to do nothing.
The attacks of the local player are displayed as soon as the player attacks, not when the server says the player does.
| victim | the victim being | |
| damage | the amount of damage dealt (0 means miss) | |
| type | the attack type |
Reimplemented from Being.
Definition at line 282 of file localplayer.h.
| virtual void LocalPlayer::handleAttack | ( | ) | [inline, virtual] |
Definition at line 283 of file localplayer.h.
| Being * LocalPlayer::getTarget | ( | ) | const |
Returns the current target of the player.
Returns 0 if no being is currently targeted.
Definition at line 530 of file localplayer.cpp.
| void LocalPlayer::setTarget | ( | Being * | target | ) |
| void LocalPlayer::setDestination | ( | Uint16 | x, | |
| Uint16 | y | |||
| ) | [virtual] |
| void LocalPlayer::setWalkingDir | ( | int | dir | ) |
| int LocalPlayer::getWalkingDir | ( | ) | const [inline] |
| void LocalPlayer::setGotoTarget | ( | Being * | target | ) |
| bool LocalPlayer::withinAttackRange | ( | Being * | target | ) |
| void LocalPlayer::stopWalking | ( | bool | sendToServer = true |
) |
Stops the player dead in his tracks.
| void LocalPlayer::raiseAttribute | ( | size_t | attr | ) |
Uses a character point to raise an attribute.
| void LocalPlayer::lowerAttribute | ( | size_t | attr | ) |
Uses a correction point to lower an attribute.
| void LocalPlayer::toggleSit | ( | ) |
Definition at line 649 of file localplayer.cpp.
| void LocalPlayer::emote | ( | Uint8 | emotion | ) |
Definition at line 666 of file localplayer.cpp.
| void LocalPlayer::revive | ( | ) |
Definition at line 821 of file localplayer.cpp.
| void LocalPlayer::pickedUp | ( | const std::string & | item | ) |
| bool LocalPlayer::getInStorage | ( | ) | [inline] |
| void LocalPlayer::setInStorage | ( | bool | inStorage | ) |
| int LocalPlayer::getHp | ( | ) | const [inline] |
Definition at line 393 of file localplayer.h.
| int LocalPlayer::getMaxHp | ( | ) | const [inline] |
Definition at line 396 of file localplayer.h.
| void LocalPlayer::setHp | ( | int | value | ) | [inline] |
Definition at line 399 of file localplayer.h.
| void LocalPlayer::setMaxHp | ( | int | value | ) | [inline] |
Definition at line 402 of file localplayer.h.
| int LocalPlayer::getLevel | ( | ) | const [inline] |
Definition at line 405 of file localplayer.h.
| void LocalPlayer::setLevel | ( | int | value | ) | [inline] |
Definition at line 408 of file localplayer.h.
| int LocalPlayer::getMoney | ( | ) | const [inline] |
Definition at line 419 of file localplayer.h.
| void LocalPlayer::setMoney | ( | int | value | ) | [inline] |
Definition at line 422 of file localplayer.h.
| int LocalPlayer::getTotalWeight | ( | ) | const [inline] |
Definition at line 425 of file localplayer.h.
| void LocalPlayer::setTotalWeight | ( | int | value | ) | [inline] |
Definition at line 428 of file localplayer.h.
| int LocalPlayer::getMaxWeight | ( | ) | const [inline] |
Definition at line 431 of file localplayer.h.
| void LocalPlayer::setMaxWeight | ( | int | value | ) | [inline] |
Definition at line 434 of file localplayer.h.
| void LocalPlayer::handleStatusEffect | ( | StatusEffect * | effect, | |
| int | effectId | |||
| ) | [protected, virtual] |
Handle an update to a status or stun effect.
| The | StatusEffect to effect | |
| effectId | -1 for stun, otherwise the effect index |
Reimplemented from Being.
Definition at line 983 of file localplayer.cpp.
| void LocalPlayer::walk | ( | unsigned char | dir | ) | [protected] |
Definition at line 430 of file localplayer.cpp.
| void LocalPlayer::initTargetCursor | ( | ) | [protected] |
Definition at line 1021 of file localplayer.cpp.
| void LocalPlayer::loadTargetCursor | ( | std::string | filename, | |
| int | width, | |||
| int | height, | |||
| bool | outRange, | |||
| Being::TargetCursorSize | size | |||
| ) | [protected] |
Definition at line 474 of file localplayer.h.
Whether or not the map is available yet.
Used to synchronize the charge dialog
Definition at line 478 of file localplayer.h.
| const std::auto_ptr<Equipment> LocalPlayer::mEquipment |
Definition at line 480 of file localplayer.h.
bool LocalPlayer::mInStorage [protected] |
int LocalPlayer::mLastTarget [protected] |
Definition at line 492 of file localplayer.h.
int LocalPlayer::mLevel [protected] |
int LocalPlayer::mMoney [protected] |
Definition at line 505 of file localplayer.h.
int LocalPlayer::mTotalWeight [protected] |
Definition at line 506 of file localplayer.h.
int LocalPlayer::mMaxWeight [protected] |
Definition at line 507 of file localplayer.h.
int LocalPlayer::mHp [protected] |
Definition at line 508 of file localplayer.h.
int LocalPlayer::mMaxHp [protected] |
Definition at line 509 of file localplayer.h.
Being* LocalPlayer::mTarget [protected] |
Definition at line 511 of file localplayer.h.
FloorItem* LocalPlayer::mPickUpTarget [protected] |
Definition at line 512 of file localplayer.h.
bool LocalPlayer::mTrading [protected] |
Definition at line 514 of file localplayer.h.
bool LocalPlayer::mGoingToTarget [protected] |
Definition at line 515 of file localplayer.h.
bool LocalPlayer::mKeepAttacking [protected] |
Definition at line 516 of file localplayer.h.
int LocalPlayer::mLastAction [protected] |
Whether or not to continue to attack.
Time stamp of the last action, -1 if none.
Definition at line 517 of file localplayer.h.
int LocalPlayer::mWalkingDir [protected] |
int LocalPlayer::mDestX [protected] |
int LocalPlayer::mDestY [protected] |
std::vector<int> LocalPlayer::mStatusEffectIcons [protected] |
Definition at line 522 of file localplayer.h.
Inventory* LocalPlayer::mInventory [protected] |
Definition at line 524 of file localplayer.h.
Inventory* LocalPlayer::mStorage [protected] |
Definition at line 531 of file localplayer.h.
ImageSet* LocalPlayer::mTargetCursorImages[2][NUM_TC] [protected] |
SimpleAnimation* LocalPlayer::mTargetCursor[2][NUM_TC] [protected] |
1.5.5