|
Public Types |
enum | Type { UNKNOWN,
PLAYER,
NPC,
MONSTER
} |
enum | Action {
STAND,
WALK,
ATTACK,
SIT,
DEAD,
HURT
} |
| Action the being is currently performing WARNING: Has to be in sync with the same enum in the Being class of the server! More...
|
enum | Sprite {
BASE_SPRITE = 0,
SHOE_SPRITE,
BOTTOMCLOTHES_SPRITE,
TOPCLOTHES_SPRITE,
HAIR_SPRITE,
HAT_SPRITE,
WEAPON_SPRITE,
VECTOREND_SPRITE
} |
enum | TargetCursorSize { TC_SMALL = 0,
TC_MEDIUM,
TC_LARGE,
NUM_TC
} |
enum | Speech {
NO_SPEECH = 0,
TEXT_OVERHEAD,
NO_NAME_IN_BUBBLE,
NAME_IN_BUBBLE,
NUM_SPEECH
} |
enum | AttackType {
HIT = 0x00,
CRITICAL = 0x0a,
MULTI = 0x08,
REFLECT = 0x04,
FLEE = 0x0b
} |
enum | { DOWN = 1,
LEFT = 2,
UP = 4,
RIGHT = 8
} |
| Directions, to be used as bitmask values. More...
|
Public Member Functions |
| Being (int id, int job, Map *map) |
| Constructor.
|
virtual | ~Being () |
void | clearPath () |
| Removes all path nodes from this being.
|
void | setDestination (int x, int y) |
| Sets a new destination for this being to walk to.
|
const Vector & | getDestination () const |
| Returns the destination for this being.
|
void | adjustCourse (int srcX, int srcY) |
| Adjusts course to expected start point.
|
void | adjustCourse (int srcX, int srcY, int destX, int destY) |
| Adjusts course to expected start and end points.
|
void | setSpeech (const std::string &text, int time=500) |
| Puts a "speech balloon" above this being for the specified amount of time.
|
virtual void | takeDamage (Being *attacker, int damage, AttackType type) |
| Puts a damage bubble above this being.
|
virtual void | handleAttack (Being *victim, int damage, AttackType type) |
| Handles an attack of another being by this being.
|
const std::string & | getName () const |
| Returns the name of the being.
|
virtual void | setName (const std::string &name) |
| Sets the name for the being.
|
int | getHairColor () const |
| Gets the hair color for this being.
|
int | getHairStyle () const |
| Gets the hair style for this being.
|
virtual void | setHairStyle (int style, int color) |
| Sets the hair style and color for this being.
|
virtual void | setSprite (int slot, int id, const std::string &color="") |
| Sets visible equipments for this being.
|
virtual void | setGender (Gender gender) |
| Sets the gender of this being.
|
Gender | getGender () const |
virtual void | setGM () |
| Triggers whether or not to show the name as a GM name.
|
virtual void | logic () |
| Performs being logic.
|
void | drawSpeech (int offsetX, int offsetY) |
| Draws the speech text above the being.
|
void | drawEmotion (Graphics *graphics, int offsetX, int offsetY) |
| Draws the emotion picture above the being.
|
virtual Type | getType () const |
| Returns the type of the being.
|
void | setWalkSpeed (int speed) |
| Sets the walk speed (in pixels per second).
|
int | getWalkSpeed () const |
void | setId (int id) |
| Sets the sprite id.
|
int | getId () const |
void | setMap (Map *map) |
| Sets the map the being is on.
|
virtual void | setAction (Action action, int attackType=0) |
| Sets the current action.
|
bool | isAlive () const |
| Returns whether this being is still alive.
|
Uint8 | getDirection () const |
| Returns the current direction.
|
void | setDirection (Uint8 direction) |
| Sets the current direction.
|
SpriteDirection | getSpriteDirection () const |
| Returns the direction the being is facing.
|
virtual void | draw (Graphics *graphics, int offsetX, int offsetY) const |
| Draws this being to the given graphics context.
|
int | getPixelX () const |
| Returns the X coordinate in pixels.
|
int | getPixelY () const |
| Returns the Y coordinate in pixels.
|
void | setPosition (const Vector &pos) |
| Sets the position of this being.
|
void | setPosition (float x, float y, float z=0.0f) |
| Overloaded method provided for convenience.
|
const Vector & | getPosition () const |
| Returns the position of this being.
|
virtual int | getWidth () const |
| Returns the horizontal size of the current base sprite of the being.
|
virtual int | getHeight () const |
| Returns the vertical size of the current base sprite of the being.
|
virtual Being::TargetCursorSize | getTargetCursorSize () const |
| Returns the required size of a target cursor for this being.
|
void | controlParticle (Particle *particle) |
| Take control of a particle.
|
virtual unsigned char | getWalkMask () const |
| Gets the way the object is blocked by other objects.
|
const Path & | getPath () const |
| Returns the path this being is following.
|
void | setTargetAnimation (SimpleAnimation *animation) |
| Sets the target animation for this being.
|
void | untarget () |
| Untargets the being.
|
void | setEmote (Uint8 emotion, Uint8 emote_time) |
void | setStunMode (int stunMode) |
| Sets the being's stun mode.
|
void | setStatusEffect (int index, bool active) |
void | setStatusEffectBlock (int offset, Uint16 flags) |
| A status effect block is a 16 bit mask of status effects.
|
virtual void | triggerEffect (int effectId) |
| Triggers a visual effect, such as `level up'.
|
virtual AnimatedSprite * | getSprite (int index) const |
Static Public Member Functions |
static int | getNumOfHairstyles () |
| Get the number of hairstyles implemented.
|
static int | getHairColorCount () |
static int | getHairStyleCount () |
static std::string | getHairColor (int index) |
static void | load () |
Public Attributes |
int | mEmotion |
| Currently showing emotion.
|
int | mEmotionTime |
| Time until emotion disappears.
|
int | mSpeechTime |
int | mAttackSpeed |
| Attack speed.
|
Action | mAction |
| Action the being is performing.
|
Uint16 | mJob |
| Job (player job, npc, monster, creature ).
|
Protected Member Functions |
void | setPath (const Path &path) |
| Sets the new path for this being.
|
virtual void | updateCoords () |
| Let the sub-classes react to a replacement.
|
virtual Map::BlockType | getBlockType () const |
| Gets the way the object blocks pathfinding for other objects.
|
void | internalTriggerEffect (int effectId, bool sfx, bool gfx) |
| Trigger visual effect, with components.
|
virtual void | updateStunMode (int oldMode, int newMode) |
| Notify self that the stun mode has been updated.
|
virtual void | updateStatusEffect (int index, bool newStatus) |
| Notify self that a status effect has flipped.
|
virtual void | handleStatusEffect (StatusEffect *effect, int effectId) |
| Handle an update to a status or stun effect.
|
Protected Attributes |
int | mId |
| Unique sprite id.
|
Uint8 | mDirection |
| Facing direction.
|
Map * | mMap |
| Map on which this being resides.
|
std::string | mName |
| Name of character.
|
SpriteIterator | mSpriteIterator |
bool | mIsGM |
bool | mParticleEffects |
| Whether to display particles or not.
|
const ItemInfo * | mEquippedWeapon |
| Engine-related infos about weapon.
|
Path | mPath |
| Number of hair styles in use.
|
std::string | mSpeech |
Text * | mText |
int | mHairStyle |
int | mHairColor |
Gender | mGender |
Uint16 | mStunMode |
| Stun mode; zero if not stunned.
|
std::set< int > | mStatusEffects |
| set of active status effects
|
const gcn::Color * | mNameColor |
std::vector< AnimatedSprite * > | mSprites |
std::vector< int > | mSpriteIDs |
std::vector< std::string > | mSpriteColors |
ParticleList | mStunParticleEffects |
ParticleVector | mStatusParticleEffects |
ParticleList | mChildParticleEffects |
Static Protected Attributes |
static std::vector< std::string > | hairColors |
static int | mNumberOfHairColors = 1 |
static int | mNumberOfHairstyles = 1 |
| Number of hair colors in use.
|
Private Attributes |
bool | mMustResetParticles |
| Reset particle status effects on next redraw?
|
SpeechBubble * | mSpeechBubble |
| Speech Bubble components.
|
int | mWalkSpeed |
| Walking speed (pixels/sec).
|
Vector | mPos |
Vector | mDest |
int | mPx |
int | mPy |
| Position in pixels.
|
SimpleAnimation * | mUsedTargetCursor |
| Target cursor being used.
|