33#include <guichan/color.hpp>
34#include <guichan/deathlistener.hpp>
42#define STATUS_EFFECTS 32
44#define SPEECH_TIME 500
45#define SPEECH_MAX_TIME 10000
162 void setSpeech(
const std::string &text,
int time = 5000);
198 void setName(
const std::string &name);
258 {
return mParty !=
nullptr; }
269 const std::string &color = std::string(),
270 bool isWeapon =
false);
275 const std::string &color = std::string());
285 void logic()
override;
341 void setAction(
const std::string &action);
An action consists of several animations, one for each direction.
Vector mPos
Position in pixels relative to map.
Holds information about a certain type of monster.
void setPosition(const Vector &pos) final
Sets the pixel position of this actor.
unsigned getSpriteCount() const
void setStatusEffect(int id, bool active)
void event(Event::Channel channel, const Event &event) override
int mSubType
Subtype (graphical view, basically)
const ItemInfo * getEquippedWeapon() const
void setSprite(unsigned slot, int id, const std::string &color=std::string(), bool isWeapon=false)
Sets visible equipments for this being.
void setDestination(int ex, int ey)
Creates a path for the being from current position to ex and ey.
bool mRestoreParticlesOnLogic
void setGuildName(const std::string &name)
Sets the name of the primary guild the being is in.
TargetCursorSize getTargetCursorSize() const override
Returns the required size of a target cursor for this being.
void setShowName(bool doShowName)
void setMoveSpeed(const Vector &speed)
Sets the move speed.
void setDirection(uint8_t direction)
Sets the current direction.
void fireMissile(Being *target, const std::string &particle)
Shoots a missile particle from this being, to target being.
const BeingInfo & getInfo() const
void setMap(Map *map) final
Action mAction
Action the being is performing.
uint8_t getDirection() const
Returns the current direction.
unsigned char getWalkMask() const
Gets the way the object is blocked by other objects.
const std::map< int, Guild * > & getGuilds() const
Returns all guilds the being is in.
int getIp() const
Returns the player's IP or an IP hash.
Type getType() const final
Returns the type of the ActorSprite.
uint8_t mSpriteDirection
Facing direction.
virtual void updateStatusEffect(int index, bool newStatus)
Notify self that a status effect has flipped.
std::vector< SpriteState > mSpriteStates
std::map< int, Guild * > mGuilds
std::string mName
Name of character.
SpriteDirection getSpriteDirection() const
Returns the direction the being is facing.
SpeechBubble * mSpeechBubble
Speech Bubble components.
bool drawnWhenBehind() const override
Determines wether the actor should be drawn translucent when behind another object.
void setPath(const Path &path)
Sets the new path for this being.
int getTileX() const override
Returns the tile x coord.
void setSpriteColor(unsigned slot, const std::string &color=std::string())
void lookAt(const Vector &destVec)
Make the being look at a given pixel position.
int getCollisionRadius() const
Returns the being's pixel radius used to detect collisions.
void drawSpeech(int offsetX, int offsetY)
Draws the speech text above the being.
void updateNamePosition()
Updates name's location.
const ItemInfo * mEquippedWeapon
Engine-related infos about weapon.
bool isGM() const
Whether or not this player is a GM.
void setPosition(float x, float y, float z=0.0f)
Overloaded method provided for convenience.
const std::string & getPartyName() const
void setName(const std::string &name)
Sets the name for the being.
void setIp(int ip)
Sets the IP or an IP hash.
virtual void pathFinished()
Called when the being has reached the end of its path.
int getSpeechTextYPosition() const
Gets the advised Y chat text position.
Vector mDest
destination coordinates.
BeingDirection
Directions, to be used as bitmask values.
void setAttackSpeed(int speed)
Sets the attack speed.
bool isAlive() const
Returns whether this being is still alive.
void setGM(bool gm)
Triggers whether or not to show the name as a GM name.
void setGuildPos(const std::string &pos)
void setPartyName(const std::string &name)
Sets the name of the party the being is in.
virtual void setAction(Action action, int attackId=1)
Sets the current action.
Cursor getHoverCursor() const
void setType(Type type, int subtype)
Can be used to change the type of the being.
const gcn::Color * mNameColor
void lookAt(const Position &destPos)
int getAttackSpeed() const
Gets the attack speed.
const std::string & getName() const
Returns the name of the being.
void setParty(Party *party)
Timer mSpeechTimer
Time until the last speech sentence disappears.
void logic() override
Performs being logic.
FlashText * mDispName
Holds a text object when the being displays its name, 0 otherwise.
void handleAttack(Being *victim, int damage, int attackId=1)
Handles an attack of another being by this being.
void setGender(Gender gender)
Sets the gender of this being.
Map::BlockType getBlockType() const override
Gets the way the monster blocks pathfinding for other objects.
Timer mActionTimer
Time spent in current action.
void addGuild(Guild *guild)
Adds a guild to the being.
void updatePlayerSprites()
Updates the visible sprite IDs of the player, taking into account the item replacements.
short getNumberOfGuilds() const
Get number of guilds the being belongs to.
void removeGuild(int id)
Removers a guild from the being.
Action getCurrentAction() const
Get the being's action currently performed.
Vector mMoveSpeed
Walk speed for x and y movement values.
bool isTargetSelection() const
int getTileY() const override
Returns the tile y coord.
uint16_t getSubType() const
std::map< int, ParticleHandle > mStatusParticleEffects
Guild * getGuild(const std::string &guildName) const
Returns a pointer to the specified guild that the being is in.
uint8_t mDirection
Facing direction.
void death(const gcn::Event &event) override
void takeDamage(Being *attacker, int damage, AttackType type, int attackId=1)
Puts a damage bubble above this being.
Vector mSpeedPixelsPerSecond
Being speed in pixel per second.
void clearPath()
Removes all path nodes from this being.
void setSpriteID(unsigned slot, int id)
const Vector & getDestination() const
Returns the destination for this being.
void setSpeech(const std::string &text, int time=5000)
Puts a "speech balloon" above this being for the specified amount of time.
const Path & getPath() const
Returns the path this being is following.
void addSpriteParticles(SpriteState &spriteState, const SpriteDisplay &display)
void restoreAllSpriteParticles()
int mAttackSpeed
Attack speed.
std::set< int > mStatusEffects
set of active status effects
void clearGuilds()
Removes all guilds the being is in.
int getDamageTaken() const
Defines a class for storing generic item infos.
int getTileHeight() const
Returns the tile height used by this map.
int getTileWidth() const
Returns the tile width of this map.
A particle spawned by a ParticleEmitter.
Simple timer that can be used to check if a certain amount of time has passed.
Cursor
Cursors are in graphic order from left to right.
std::list< Position > Path
std::vector< ParticleHandle > particles
A position along a being's path.