30#include <guichan/actionlistener.hpp>
31#include <guichan/deathlistener.hpp>
41class AwayListener :
public gcn::ActionListener,
public gcn::DeathListener
50 void action(
const gcn::ActionEvent &event)
override;
51 void death(
const gcn::Event &event)
override;
80 void logic()
override;
107 void attack(
Being *target =
nullptr,
bool keep =
false);
163 void emote(
int emoteId);
An action consists of several animations, one for each direction.
void action(const gcn::ActionEvent &event) override
void showDialog(const std::string &message)
void death(const gcn::Event &event) override
A tab for the chat window.
An item lying on the floor.
Stores a set of subimages originating from a single image.
Defines a class for storing generic item infos.
The local player character.
int getWalkingDir() const
Gets the walking direction.
void setTarget(Being *target)
Sets the target being of the player.
std::list< std::pair< std::string, int > > mMessages
Queued messages.
void setAttackRange(int range)
Sets the attack range.
virtual void setDestination(const Position &dest)
void afkRespond(ChatTab *tab, const std::string &nick)
void pickedUp(const ItemInfo &itemInfo, int amount, unsigned char fail)
Shows item pickup notifications.
void setGMLevel(int level)
void inviteToGuild(Being *being)
Invite a player to join guild.
void addMessageToQueue(const std::string &message, int color=UserPalette::EXP_INFO)
Being * getTarget() const
Returns the current target of the player.
int getAttackRange() const
Gets the attack range.
void updateStatusEffect(int id, bool newStatus) override
Notify self that a status effect has flipped.
void setAction(Action action, int attackId=1) override
Sets the current action.
virtual void setDestination(int x, int y)
Sets a new destination for this being to walk to.
virtual void setDestination(const Vector &dest)
FloorItem * mPickUpTarget
std::unique_ptr< AwayListener > mAwayListener
Position getNextWalkPosition(unsigned char dir) const
Compute the next pathnode location when walking using keyboard.
bool mKeepAttacking
Whether or not to continue to attack.
void setShowIp(bool show)
void setWalkingDir(int dir)
Sets a new direction to keep walking in, when using the keyboard or the joystick.
bool isPathSetByMouse() const
Tells if the path has been set by mouse.
void event(Event::Channel channel, const Event &event) override
void setGotoTarget(Being *target)
Sets going to being to attack.
bool withinRange(Actor *target, int range) const
Returns whether the target is in range (in pixels).
void setAwayMode(bool away)
void pickUp(FloorItem *item)
Timer mLastTargetTimer
Timer for last targeting action.
void cancelGoToTarget()
Cancel a possible target destination in progress, but not the targeting.
void attack(Being *target=nullptr, bool keep=false)
bool mPathSetByMouse
Tells if the path was set using mouse.
void stopWalking(bool sendToServer=true)
Stops the player dead in his tracks.
int mWalkingDir
The direction the player is walking in.
Timer mLastActionTimer
Timeout for the last action.
bool checkInviteRights(const std::string &guildName)
Check the player has permission to invite users to specific guild.
void logic() override
Performs being logic.
void pathFinished() override
Called when the being has reached the end of its path.
void pathSetByMouse()
Tells that the path has been set by mouse.
void nextTile(unsigned char dir)
set the next path tile when walking and using the keyboard.
void startWalking(unsigned char dir)
Make the character starts to walk.
Simple timer that can be used to check if a certain amount of time has passed.
LocalPlayer * local_player
A position along a being's path.