ManaPlus
Public Member Functions | Static Public Member Functions | Data Fields | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
Being Class Reference

#include <being.h>

Inheritance diagram for Being:
ActorSprite ConfigListener CompoundSprite Actor Sprite LocalPlayer

Public Member Functions

 Being (const BeingId id, const ActorTypeT type)
 
 ~Being ()
 
ActorTypeT getType () const
 
void clearPath ()
 
int getActionTime () const
 
void setActionTime (const int actionTime)
 
virtual void nextTile ()
 
void setDestination (const int dstX, const int dstY)
 
void setCachedDestination (const int dstX, const int dstY)
 
int getCachedX () const
 
int getCachedY () const
 
const VectorgetDestination () const
 
int getTileX () const
 
int getTileY () const
 
virtual void setTileCoords (const int x, const int y)
 
void setSpeech (const std::string &text)
 
void takeDamage (Being *const attacker, const int amount, const AttackTypeT type, const int attackId, const int level)
 
void handleAttack (Being *const victim, const int damage, const int attackId)
 
void handleSkillCasting (Being *const victim, const int skillId, const int skillLevel)
 
void handleSkill (Being *const victim, const int damage, const int skillId, const int skillLevel)
 
const ItemInfogetEquippedWeapon () const
 
const std::string & getName () const
 
const std::string & getExtName () const
 
void setName (const std::string &name)
 
bool getShowName () const
 
void setShowName (const bool doShowName)
 
void setPartyName (const std::string &name)
 
const std::string & getPartyName () const
 
const std::string & getGuildName () const
 
const std::string & getClanName () const
 
void setGuildName (const std::string &name)
 
void setGuildPos (const std::string &pos)
 
void setClanName (const std::string &name)
 
void addGuild (Guild *const guild)
 
void removeGuild (const int id)
 
const GuildgetGuild (const std::string &guildName) const
 
const GuildgetGuild (const int id) const
 
GuildgetGuild () const
 
const std::map< int, Guild * > & getGuilds () const
 
void clearGuilds ()
 
int16_t getNumberOfGuilds () const
 
bool isInParty () const
 
void setParty (Party *const party)
 
void setGuild (Guild *const guild)
 
void updateGuild ()
 
PartygetParty () const
 
void setSprite (const unsigned int slot, const int id, std::string color, ItemColor colorId)
 
void setSpriteColor (const unsigned int slot, const int id, const std::string &color)
 
void setSpriteColorId (const unsigned int slot, const int id, ItemColor colorId)
 
void setSpriteCards (const unsigned int slot, const int id, const CardsList &cards)
 
void setSpriteId (const unsigned int slot, const int id)
 
void unSetSprite (const unsigned int slot)
 
void setWeaponId (const int id)
 
void setTempSprite (const unsigned int slot, const int id)
 
void setHairTempSprite (const unsigned int slot, const int id)
 
void updateSprite (const unsigned int slot, const int id, const std::string &color)
 
void setHairColorSpriteID (const unsigned int slot, const int id)
 
void setSpriteColor (const unsigned int slot, const std::string &color)
 
int getNumberOfLayers () const
 
void logic ()
 
void botLogic ()
 
void drawSpeech (const int offsetX, const int offsetY)
 
void drawEmotion (Graphics *const graphics, const int offsetX, const int offsetY) const
 
BeingTypeId getSubType () const
 
void setSubtype (const BeingTypeId subtype, const uint16_t look)
 
const BeingInfogetInfo () const
 
TargetCursorSizeT getTargetCursorSize () const
 
int getTargetOffsetX () const
 
int getTargetOffsetY () const
 
virtual unsigned char getBlockWalkMask () const
 
BlockTypeT getBlockType () const
 
void setWalkSpeed (const int speed)
 
int getWalkSpeed () const
 
void setAttackSpeed (const int speed)
 
int getAttackSpeed () const
 
virtual void setAction (const BeingActionT &action, const int attackId)
 
BeingActionT getCurrentAction () const
 
bool isAlive () const
 
uint8_t getDirection () const
 
virtual void setDirection (const uint8_t direction)
 
void setDirectionDelayed (const uint8_t direction)
 
uint8_t getDirectionDelayed () const
 
SpriteDirection::Type getSpriteDirection () const
 
void setPixelPositionF (const Vector &pos)
 
void setPixelPositionF (const float x, const float y, const float z) A_INLINE
 
int getWidth () const
 
int getHeight () const
 
void fireMissile (Being *const victim, const MissileInfo &missile) const
 
const PathgetPath () const
 
int getDistance () const
 
void setDistance (const int n)
 
void setEmote (const uint8_t emotion, const int emote_time)
 
void setState (const uint8_t state)
 
void drawPlayerSprites (Graphics *const graphics, const int posX, const int posY) const
 
void drawSpritesSDL (Graphics *const graphics, const int posX, const int posY) const
 
void drawHpBar (Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
 
void optionChanged (const std::string &value)
 
void flashName (const int time)
 
int getDamageTaken () const
 
void setDamageTaken (const int damage)
 
void updateName ()
 
void setLevel (const int n)
 
virtual int getLevel () const
 
void setReachable (const ReachableT n)
 
ReachableT getReachable () const
 
void addToCache () const
 
bool updateFromCache ()
 
virtual void setGender (const GenderT gender)
 
GenderT getGender () const
 
std::string getSitAction () const
 
std::string getCastAction () const
 
std::string getCastAction (const SkillInfo *const skill) const
 
std::string getMoveAction () const
 
std::string getDeadAction () const
 
std::string getStandAction () const
 
std::string getSpawnAction () const
 
std::string getWeaponAttackAction (const ItemInfo *const weapon) const
 
std::string getAttackAction () const
 
std::string getAttackAction (const Attack *const attack1) const
 
bool isGM () const
 
void setGM (const bool gm)
 
bool canTalk () const
 
void talkTo () const
 
void draw (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawPlayer (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawOther (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawNpc (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawMonster (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawPortal (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawBasic (Graphics *const graphics, const int x, const int y) const
 
void setMoveTime ()
 
void setAttackTime ()
 
void setTalkTime ()
 
void setTestTime ()
 
void setOtherTime ()
 
time_t getMoveTime () const
 
time_t getAttackTime () const
 
time_t getTalkTime () const
 
time_t getTestTime () const
 
time_t getOtherTime () const
 
void resetCounters ()
 
void updateColors ()
 
void setEnemy (const bool n)
 
const std::string & getIp () const
 
void setIp (const std::string &ip)
 
unsigned int getPvpRank () const
 
void setPvpRank (const unsigned int rank)
 
void setHP (const int hp)
 
void setMaxHP (const int hp)
 
int getHP () const
 
int getMaxHP () const
 
uint8_t calcDirection (const int dstX, const int dstY) const
 
uint8_t calcDirection () const
 
void setAttackDelay (const int n)
 
int getAttackDelay () const
 
int getMinHit () const
 
void setMinHit (const int n)
 
int getMaxHit () const
 
void setMaxHit (const int n)
 
int getCriticalHit () const
 
void setCriticalHit (const int n)
 
void updateHit (const int amount)
 
EquipmentgetEquipment ()
 
void undressItemById (const int id)
 
int getGoodStatus () const
 
void setGoodStatus (const int n)
 
std::string getGenderSign () const
 
std::string getGenderSignWithSpace () const
 
void updateComment ()
 
const std::string getComment () const
 
void setComment (const std::string &n)
 
bool isAdvanced () const
 
void setAdvanced (const bool n)
 
bool isBuyShopEnabled () const
 
bool isSellShopEnabled () const
 
void enableShop (const bool b)
 
void setAttackRange (const int range)
 
void updatePercentHP ()
 
void setRaceName (const std::string &name)
 
std::string getRaceName () const
 
int getSpriteID (const int slot) const
 
const BeingSlotgetSpriteSlot (const int slot) const
 
ItemColor getSpriteColor (const int slot) const
 
void setHairStyle (const unsigned int slot, const int id)
 
void setHairColor (const unsigned int slot, const ItemColor color)
 
void setHairColor (const ItemColor color)
 
void setSpriteSlot (const unsigned int slot, const BeingSlot &beingSlot)
 
ItemColor getHairColor () const
 
void recalcSpritesOrder ()
 
CursorT getHoverCursor () const
 
void addAfkEffect ()
 
void removeAfkEffect ()
 
void updateAwayEffect ()
 
void addSpecialEffect (const int effect)
 
void removeSpecialEffect ()
 
void addEffect (const std::string &name)
 
void setOwner (Being *const owner)
 
BeinggetOwner () const
 
void playSfx (const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const
 
uint16_t getLook () const
 
void setLook (const uint16_t look)
 
void setPath (const Path &path)
 
int getSortPixelY () const
 
void setMap (Map *const map)
 
void recreateItemParticles ()
 
void incUsage ()
 
int decUsage ()
 
virtual int getLastAttackX () const
 
virtual int getLastAttackY () const
 
void drawHomunculus (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawMercenary (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawElemental (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void setTrickDead (const bool b)
 
void setChat (ChatObject *const obj)
 
ChatObjectgetChat () const
 
void setRiding (const bool b)
 
void setHorse (const int horseId)
 
void removeHorse ()
 
void setSellBoard (const std::string &text)
 
std::string getSellBoard () const
 
void setBuyBoard (const std::string &text)
 
std::string getBuyBoard () const
 
void setSpiritBalls (const unsigned int balls)
 
unsigned int getSpiritBalls () const
 
void stopCast (const bool b)
 
void setCreatorId (const BeingId id)
 
BeingId getCreatorId () const
 
void setKarma (const int karma)
 
int getKarma () const
 
void setManner (const int manner)
 
int getManner () const
 
void disableBotAi ()
 
void enableBotAi ()
 
int getAreaSize () const
 
void setAreaSize (const int areaSize)
 
void setTeamId (const uint16_t teamId)
 
void showTeamBadge (const bool show)
 
void showGuildBadge (const bool show)
 
void showClanBadge (const bool show)
 
void showGmBadge (const bool show)
 
void showPartyBadge (const bool show)
 
void showNameBadge (const bool show)
 
void showShopBadge (const bool show)
 
void showInactiveBadge (const bool show)
 
void showAwayBadge (const bool show)
 
void showBadges (const bool show)
 
void setLanguageId (const int lang)
 
int getLanguageId ()
 
uint16_t getTeamId () const
 
virtual void setGroupId (const int id)
 
int getGroupId () const
 
void serverRemove ()
 
void addCast (const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const int waitTimeTicks)
 
void fixDirectionOffsets (int &offsetX, int &offsetY) const
 
bool getAllowNpcEquipment () const
 
- Public Member Functions inherited from ActorSprite
 ActorSprite (const BeingId id)
 
 ~ActorSprite ()
 
BeingId getId () const
 
void setId (const BeingId id)
 
void controlAutoParticle (Particle *const particle)
 
void controlCustomParticle (Particle *const particle)
 
void setTargetType (const TargetCursorTypeT type)
 
void untarget ()
 
void setStatusEffect (const int32_t index, const Enable active, const IsStart start)
 
void setStatusEffectOpitons (const uint32_t option, const uint32_t opt1, const uint32_t opt2, const uint32_t opt3)
 
void setStatusEffectOpitons (const uint32_t option, const uint32_t opt1, const uint32_t opt2)
 
void setStatusEffectOpiton0 (const uint32_t option)
 
void setAlpha (const float alpha)
 
float getAlpha () const
 
void addActorSpriteListener (ActorSpriteListener *const listener)
 
void removeActorSpriteListener (ActorSpriteListener *const listener)
 
int getActorX () const
 
int getActorY () const
 
void setPoison (const bool b)
 
bool getPoison () const
 
void setHaveCart (const bool b)
 
bool getHaveCart () const
 
bool isTrickDead () const
 
const std::set< int32_t > & getStatusEffects () const
 
std::string getStatusEffectsString () const
 
size_t getParticlesCount () const
 
void controlParticleDeleted (const Particle *const particle)
 
- Public Member Functions inherited from CompoundSprite
 CompoundSprite ()
 
 ~CompoundSprite ()
 
bool reset ()
 
bool play (const std::string &action)
 
bool update (const int time)
 
void drawSimple (Graphics *const graphics, const int posX, const int posY) const
 
int getWidth () const
 
int getHeight () const
 
const ImagegetImage () const
 
bool setSpriteDirection (const SpriteDirection::Type direction)
 
int getNumberOfLayers () const
 
unsigned int getCurrentFrame () const
 
unsigned int getFrameCount () const
 
void addSprite (Sprite *const sprite)
 
void setSprite (const size_t layer, Sprite *const sprite)
 
void removeSprite (const int layer)
 
void clear ()
 
void ensureSize (const size_t layerCount)
 
void drawSprites (Graphics *const graphics, const int posX, const int posY) const
 
void setAlpha (float alpha)
 
bool updateNumber (const unsigned num)
 
int getLastTime () const
 
int getStartTime () const
 
- Public Member Functions inherited from Sprite
virtual ~Sprite ()
 
virtual const void * getHash () const
 
virtual const void * getHash2 () const
 
- Public Member Functions inherited from Actor
virtual ~Actor ()
 
const VectorgetPixelPositionF () const
 
int getPixelX () const
 
virtual int getPixelY () const
 
const MapgetMap () const
 
- Public Member Functions inherited from ConfigListener
 ConfigListener ()
 
virtual ~ConfigListener ()
 

Static Public Member Functions

static void reReadConfig ()
 
static BeingCacheEntrygetCacheEntry (const BeingId id)
 
static void clearCache ()
 
static std::string loadComment (const std::string &name, const ActorTypeT &type)
 
static void saveComment (const std::string &name, const std::string &comment, const ActorTypeT &type)
 
static int getHitEffect (const Being *const attacker, const AttackTypeT type, const int attackId, const int level)
 
static uint8_t genderToInt (const GenderT sex) A_CONST
 
static GenderT intToGender (const uint8_t sex) A_CONST
 
static BeingcreateBeing (const BeingId id, const ActorTypeT type, const BeingTypeId subtype, Map *const map)
 
- Static Public Member Functions inherited from ActorSprite
static void load ()
 
static void unload ()
 
- Static Public Member Functions inherited from CompoundSprite
static void setEnableDelay (bool b)
 

Data Fields

NextSoundInfo mNextSound
 
- Data Fields inherited from CompoundSprite
std::vector< Sprite * > mSprites
 
- Data Fields inherited from Actor
int mPixelX
 
int mPixelY
 

Protected Types

typedef std::map< int, ParticleInfo * > SpriteParticleInfo
 
typedef SpriteParticleInfo::iterator SpriteParticleInfoIter
 
- Protected Types inherited from ActorSprite
typedef std::list< ActorSpriteListener * > ActorSpriteListeners
 
typedef ActorSpriteListeners::iterator ActorSpriteListenerIterator
 
- Protected Types inherited from CompoundSprite
typedef std::list< CompoundItem * > ImagesCache
 

Protected Member Functions

void drawPlayerSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawOtherSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawNpcSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawPortalSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawMonsterSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawHomunculusSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawMercenarySpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawElementalSpriteAt (Graphics *const graphics, const int x, const int y) const
 
void drawCompound (Graphics *const graphics, const int posX, const int posY) const
 
virtual void updateCoords ()
 
void showName ()
 
void addItemParticles (const int id, const SpriteDisplay &display)
 
void addItemParticlesCards (const int id, const SpriteDisplay &display, const CardsList &cards)
 
void removeAllItemsParticles ()
 
void removeItemParticles (const int id)
 
void createSpeechBubble ()
 
void setDefaultNameColor (const UserColorIdT defaultColor)
 
void updateBadgesCount ()
 
void postInit (const BeingTypeId subType, Map *const map)
 
void updateBadgesPosition ()
 
template<signed char pos, signed char neg>
int getOffset () const
 
int searchSlotValue (const std::vector< int > &slotRemap, const int val) const
 
void addSpiritBalls (const unsigned int balls, const int effectId)
 
void removeSpiritBalls (const unsigned int balls)
 
void dumpSprites () const
 
void drawBeingCursor (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void drawCasting (Graphics *const graphics, const int offsetX, const int offsetY) const
 
void updateBotFollow (int dstX, int dstY, const int divX, const int divY)
 
void moveBotTo (int dstX, int dstY)
 
void updateBotDirection (const int dstX, const int dstY)
 
void botFixOffset (int &dstX, int &dstY) const
 
- Protected Member Functions inherited from ActorSprite
virtual void updateStatusEffect (const int32_t index, const Enable newStatus, const IsStart start)
 
virtual void handleStatusEffect (const StatusEffect *const effect, const int32_t effectId, const Enable newStatus, const IsStart start)
 
void setupSpriteDisplay (const SpriteDisplay &display, const ForceDisplay forceDisplay, const DisplayTypeT displayType, const std::string &color)
 
- Protected Member Functions inherited from CompoundSprite
void redraw () const
 
void updateImages () const
 
bool updateFromCache () const
 
void initCurrentCacheItem () const
 
- Protected Member Functions inherited from Sprite
 Sprite ()
 
- Protected Member Functions inherited from Actor
 Actor ()
 

Static Protected Member Functions

static int getDefaultEffectId (const AttackTypeT &type)
 
static void searchSlotValueItr (std::vector< int >::iterator &it, int &idx, std::vector< int > &slotRemap, const int val)
 
- Static Protected Member Functions inherited from ActorSprite
static void initTargetCursor ()
 
static void cleanupTargetCursors ()
 

Protected Attributes

BeingInfomInfo
 
AnimatedSpritemEmotionSprite
 
AnimatedSpritemAnimationEffect
 
CastingEffectmCastingEffect
 
AnimatedSpritemBadges [BadgeIndex::BadgeIndexSize]
 
std::string mSpriteAction
 
std::string mName
 
std::string mExtName
 
std::string mRaceName
 
std::string mPartyName
 
std::string mGuildName
 
std::string mClanName
 
std::string mSpeech
 
FlashTextmDispName
 
const ColormNameColor
 
const ItemInfomEquippedWeapon
 
Path mPath
 
TextmText
 
const ColormTextColor
 
Vector mDest
 
std::vector< BeingSlotmSlots
 
SpriteParticleInfo mSpriteParticles
 
std::map< int, Guild * > mGuilds
 
PartymParty
 
int mActionTime
 
int mEmotionTime
 
int mSpeechTime
 
int mAttackSpeed
 
int mLevel
 
int mGroupId
 
int mAttackRange
 
int mLastAttackX
 
int mLastAttackY
 
int mPreStandTime
 
GenderT mGender
 
BeingActionT mAction
 
BeingTypeId mSubType
 
uint8_t mDirection
 
uint8_t mDirectionDelayed
 
SpriteDirection::Type mSpriteDirection
 
bool mShowName
 
bool mIsGM
 
const ActorTypeT mType
 
SpeechBubblemSpeechBubble
 
int mWalkSpeed
 
int mSpeed
 
std::string mIp
 
int * mSpriteRemap
 
int * mSpriteHide
 
int * mSpriteDraw
 
std::string mComment
 
std::string mBuyBoard
 
std::string mSellBoard
 
BeingmOwner
 
ParticlemSpecialParticle
 
ChatObjectmChat
 
HorseInfomHorseInfo
 
std::vector< AnimatedSprite * > mDownHorseSprites
 
std::vector< AnimatedSprite * > mUpHorseSprites
 
std::vector< Particle * > mSpiritParticles
 
int mX
 
int mY
 
int mCachedX
 
int mCachedY
 
int mSortOffsetY
 
int mPixelOffsetY
 
int mFixedOffsetY
 
uint8_t mOldHeight
 
int mDamageTaken
 
int mHP
 
int mMaxHP
 
int mDistance
 
ReachableT mReachable
 
int mGoodStatus
 
time_t mMoveTime
 
time_t mAttackTime
 
time_t mTalkTime
 
time_t mOtherTime
 
time_t mTestTime
 
int mAttackDelay
 
int mMinHit
 
int mMaxHit
 
int mCriticalHit
 
unsigned int mPvpRank
 
unsigned int mNumber
 
unsigned int mSpiritBalls
 
int mUsageCounter
 
int mKarma
 
int mManner
 
int mAreaSize
 
int mCastEndTime
 
int mLanguageId
 
int mBadgesX
 
int mBadgesY
 
BeingId mCreatorId
 
uint16_t mTeamId
 
uint16_t mLook
 
uint16_t mBadgesCount
 
ItemColor mHairColor
 
bool mErased
 
bool mEnemy
 
bool mGotComment
 
bool mAdvanced
 
bool mShop
 
bool mAway
 
bool mInactive
 
bool mNeedPosUpdate
 
bool mBotAi
 
bool mAllowNpcEquipment
 
- Protected Attributes inherited from ActorSprite
std::set< int32_t > mStatusEffects
 
ParticleVector mStatusParticleEffects
 
ParticleList mChildParticleEffects
 
int mHorseId
 
BeingId mId
 
AnimatedSpritemUsedTargetCursor
 
ActorSpriteListeners mActorSpriteListeners
 
int mCursorPaddingX
 
int mCursorPaddingY
 
bool mMustResetParticles
 
bool mPoison
 
bool mHaveCart
 
bool mTrickDead
 
- Protected Attributes inherited from CompoundSprite
ImagesCache imagesCache
 
CompoundItemmCacheItem
 
ImagemImage
 
ImagemAlphaImage
 
int mOffsetX
 
int mOffsetY
 
int mStartTime
 
int mLastTime
 
int mNextRedrawTime
 
bool mNeedsRedraw
 
bool mEnableAlphaFix
 
bool mDisableAdvBeingCaching
 
bool mDisableBeingCaching
 
- Protected Attributes inherited from Sprite
float mAlpha
 
- Protected Attributes inherited from Actor
MapmMap
 
Vector mPos
 
int mYDiff
 

Static Protected Attributes

static time_t mUpdateConfigTime = 0
 
static unsigned int mConfLineLim = 0
 
static int mSpeechType = 0
 
static bool mHighlightMapPortals = false
 
static bool mHighlightMonsterAttackRange = false
 
static bool mLowTraffic = true
 
static bool mDrawHotKeys = true
 
static bool mShowBattleEvents = false
 
static bool mShowMobHP = false
 
static bool mShowOwnHP = false
 
static bool mShowGender = false
 
static bool mShowLevel = false
 
static bool mShowPlayersStatus = false
 
static bool mEnableReorderSprites = true
 
static bool mHideErased = false
 
static Move mMoveNames = Move_false
 
static bool mUseDiagonal = true
 
static BadgeDrawType::Type mShowBadges = BadgeDrawType::Top
 
static int mAwayEffect = -1
 
static VisibleNamePos::Type mVisibleNamePos = VisibleNamePos::Bottom
 
- Static Protected Attributes inherited from ActorSprite
static AnimatedSpritetargetCursor [static_cast< size_t >(TargetCursorType::NUM_TCT)][static_cast< size_t >(TargetCursorSize::NUM_TC)]
 
static bool loaded = false
 
- Static Protected Attributes inherited from CompoundSprite
static bool mEnableDelay = true
 

Friends

class ActorManager
 
class BeingEquipBackend
 
class LocalPlayer
 

Additional Inherited Members

- Public Types inherited from CompoundSprite
typedef std::vector< Sprite * >::iterator SpriteIterator
 
typedef std::vector< Sprite * >::const_iterator SpriteConstIterator
 

Detailed Description

Definition at line 93 of file being.h.

Member Typedef Documentation

◆ SpriteParticleInfo

typedef std::map<int, ParticleInfo*> Being::SpriteParticleInfo
protected

Definition at line 1206 of file being.h.

◆ SpriteParticleInfoIter

typedef SpriteParticleInfo::iterator Being::SpriteParticleInfoIter
protected

Definition at line 1207 of file being.h.

Constructor & Destructor Documentation

◆ Being()

Being::Being ( const BeingId  id,
const ActorTypeT  type 
)

Constructor.

Parameters
ida unique being id
subtypepartly determines the type of the being
mapthe map the being is on

Definition at line 161 of file being.cpp.

References for_each_badges, mBadges, mSpriteDraw, mSpriteHide, and mSpriteRemap.

Referenced by createBeing().

162  :
163  ActorSprite(id),
164  mNextSound(),
166  mEmotionSprite(nullptr),
167  mAnimationEffect(nullptr),
168  mCastingEffect(nullptr),
169  mBadges(),
171  mName(),
172  mExtName(),
173  mRaceName(),
174  mPartyName(),
175  mGuildName(),
176  mClanName(),
177  mSpeech(),
178  mDispName(nullptr),
179  mNameColor(nullptr),
180  mEquippedWeapon(nullptr),
181  mPath(),
182  mText(nullptr),
183  mTextColor(nullptr),
184  mDest(),
185  mSlots(),
187  mGuilds(),
188  mParty(nullptr),
189  mActionTime(0),
190  mEmotionTime(0),
191  mSpeechTime(0),
192  mAttackSpeed(350),
193  mLevel(0),
194  mGroupId(0),
195  mAttackRange(1),
196  mLastAttackX(0),
197  mLastAttackY(0),
198  mPreStandTime(0),
201  mSubType(fromInt(0xFFFF, BeingTypeId)),
205  mShowName(false),
206  mIsGM(false),
207  mType(type),
208  mSpeechBubble(nullptr),
209  mWalkSpeed(playerHandler != nullptr ?
211  mSpeed(playerHandler != nullptr ?
213  mIp(),
214  mSpriteRemap(new int[20]),
215  mSpriteHide(new int[20]),
216  mSpriteDraw(new int[20]),
217  mComment(),
218  mBuyBoard(),
219  mSellBoard(),
220  mOwner(nullptr),
221  mSpecialParticle(nullptr),
222  mChat(nullptr),
223  mHorseInfo(nullptr),
225  mUpHorseSprites(),
227  mX(0),
228  mY(0),
229  mCachedX(0),
230  mCachedY(0),
231  mSortOffsetY(0),
232  mPixelOffsetY(0),
233  mFixedOffsetY(0),
234  mOldHeight(0),
235  mDamageTaken(0),
236  mHP(0),
237  mMaxHP(0),
238  mDistance(0),
240  mGoodStatus(-1),
241  mMoveTime(0),
242  mAttackTime(0),
243  mTalkTime(0),
244  mOtherTime(0),
246  mAttackDelay(0),
247  mMinHit(0),
248  mMaxHit(0),
249  mCriticalHit(0),
250  mPvpRank(0),
251  mNumber(100),
252  mSpiritBalls(0U),
253  mUsageCounter(1),
254  mKarma(0),
255  mManner(0),
256  mAreaSize(11),
257  mCastEndTime(0),
258  mLanguageId(-1),
259  mBadgesX(0),
260  mBadgesY(0),
262  mTeamId(0U),
263  mLook(0U),
264  mBadgesCount(0U),
266  mErased(false),
267  mEnemy(false),
268  mGotComment(false),
269  mAdvanced(false),
270  mShop(false),
271  mAway(false),
272  mInactive(false),
273  mNeedPosUpdate(true),
274  mBotAi(true),
275  mAllowNpcEquipment(false)
276 {
277  for (int f = 0; f < 20; f ++)
278  {
279  mSpriteRemap[f] = f;
280  mSpriteHide[f] = 0;
281  mSpriteDraw[f] = 0;
282  }
283 
285  mBadges[f] = nullptr;
286 }
Net::PlayerHandler * playerHandler
Definition: net.cpp:95
SpriteParticleInfo mSpriteParticles
Definition: being.h:1210
int mSpeechTime
Definition: being.h:1220
unsigned int mPvpRank
Definition: being.h:1364
bool mBotAi
Definition: being.h:1388
int mAttackSpeed
Definition: being.h:1221
bool mEnemy
Definition: being.h:1381
SpriteDirection::Type mSpriteDirection
Definition: being.h:1236
std::string mGuildName
Definition: being.h:1187
int mKarma
Definition: being.h:1368
#define fromInt(val, name)
Definition: intdefines.h:45
uint8_t mDirection
Definition: being.h:1234
int mFixedOffsetY
Definition: being.h:1324
const Color * mNameColor
Definition: being.h:1195
time_t mAttackTime
Definition: being.h:1356
uint16_t mLook
Definition: being.h:1377
unsigned int mSpiritBalls
Definition: being.h:1366
std::vector< AnimatedSprite * > mDownHorseSprites
Definition: being.h:1313
int mEmotionTime
Definition: being.h:1217
static BeingInfo * unknown
Definition: beinginfo.h:55
bool mIsGM
Definition: being.h:1238
ActorSprite(const BeingId id)
Definition: actorsprite.cpp:68
int mCachedX
Definition: being.h:1319
Path mPath
Definition: being.h:1200
CastingEffect * mCastingEffect
Definition: being.h:1179
int mLevel
Definition: being.h:1223
AnimatedSprite * mAnimationEffect
Definition: being.h:1178
int mDistance
Definition: being.h:1330
int mAttackDelay
Definition: being.h:1360
static const std::string STAND("stand")
const ItemColor ItemColor_zero
Definition: itemcolor.h:29
std::string mPartyName
Definition: being.h:1186
const Color * mTextColor
Definition: being.h:1202
std::vector< AnimatedSprite * > mUpHorseSprites
Definition: being.h:1314
int mManner
Definition: being.h:1369
Text * mText
Definition: being.h:1201
std::string mSellBoard
Definition: being.h:1308
Vector mDest
Definition: being.h:1204
std::string mRaceName
Definition: being.h:1185
std::string mClanName
Definition: being.h:1188
uint16_t mTeamId
Definition: being.h:1376
ReachableT mReachable
Definition: being.h:1331
std::vector< Particle * > mSpiritParticles
Definition: being.h:1315
std::vector< BeingSlot > mSlots
Definition: being.h:1209
int mMaxHit
Definition: being.h:1362
bool mErased
Definition: being.h:1380
std::string mName
Definition: being.h:1183
int mGoodStatus
Definition: being.h:1332
time_t mTestTime
Definition: being.h:1359
bool mInactive
Definition: being.h:1386
BeingTypeId mSubType
Definition: being.h:1233
std::string mSpeech
Definition: being.h:1189
Party * mParty
Definition: being.h:1214
bool mNeedPosUpdate
Definition: being.h:1387
SpeechBubble * mSpeechBubble
Definition: being.h:1293
int mUsageCounter
Definition: being.h:1367
std::string mIp
Definition: being.h:1302
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
Definition: being.h:1180
uint8_t mDirectionDelayed
Definition: being.h:1235
int mX
Definition: being.h:1317
NextSoundInfo mNextSound
Definition: being.h:957
int mMaxHP
Definition: being.h:1329
int mLanguageId
Definition: being.h:1372
const ItemInfo * mEquippedWeapon
Definition: being.h:1198
time_t mMoveTime
Definition: being.h:1355
std::string mComment
Definition: being.h:1306
#define for_each_badges()
Definition: being.cpp:155
int * mSpriteHide
Definition: being.h:1304
int mMinHit
Definition: being.h:1361
int mLastAttackY
Definition: being.h:1227
int mDamageTaken
Definition: being.h:1327
int * mSpriteRemap
Definition: being.h:1303
int mCastEndTime
Definition: being.h:1371
bool mGotComment
Definition: being.h:1382
int mLastAttackX
Definition: being.h:1226
bool mShop
Definition: being.h:1384
std::string mExtName
Definition: being.h:1184
time_t mTalkTime
Definition: being.h:1357
volatile time_t cur_time
Definition: timer.cpp:57
bool mShowName
Definition: being.h:1237
unsigned int mNumber
Definition: being.h:1365
BeingId mCreatorId
Definition: being.h:1375
int mWalkSpeed
Definition: being.h:1300
int mActionTime
Definition: being.h:1216
int mSortOffsetY
Definition: being.h:1321
int mGroupId
Definition: being.h:1224
int mPreStandTime
Definition: being.h:1229
int mCachedY
Definition: being.h:1320
AnimatedSprite * mEmotionSprite
Definition: being.h:1177
HorseInfo * mHorseInfo
Definition: being.h:1312
GenderT mGender
Definition: being.h:1231
int mBadgesX
Definition: being.h:1373
int mBadgesY
Definition: being.h:1374
int * mSpriteDraw
Definition: being.h:1305
int mY
Definition: being.h:1318
FlashText * mDispName
Definition: being.h:1194
bool mAway
Definition: being.h:1385
std::string mBuyBoard
Definition: being.h:1307
int mAreaSize
Definition: being.h:1370
int mCriticalHit
Definition: being.h:1363
std::string mSpriteAction
Definition: being.h:1182
const BeingId BeingId_zero
Definition: beingid.h:29
uint8_t mOldHeight
Definition: being.h:1325
ItemColor mHairColor
Definition: being.h:1379
std::map< int, Guild * > mGuilds
Definition: being.h:1213
Being * mOwner
Definition: being.h:1309
int mAttackRange
Definition: being.h:1225
bool mAllowNpcEquipment
Definition: being.h:1389
int mPixelOffsetY
Definition: being.h:1322
Particle * mSpecialParticle
Definition: being.h:1310
int BeingTypeId
Definition: beingtypeid.h:29
int mSpeed
Definition: being.h:1301
uint16_t mBadgesCount
Definition: being.h:1378
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232
bool mAdvanced
Definition: being.h:1383
int mHP
Definition: being.h:1328
ChatObject * mChat
Definition: being.h:1311
time_t mOtherTime
Definition: being.h:1358
virtual int getDefaultWalkSpeed() const =0
const ActorTypeT mType
Definition: being.h:1290

◆ ~Being()

Being::~Being ( )

Definition at line 336 of file being.cpp.

References CHECKLISTENERS, config, delete2, for_each_badges, mAnimationEffect, mBadges, mBadgesCount, mCastingEffect, mChat, mDispName, mEmotionSprite, mSpeechBubble, mSpiritParticles, mSpriteDraw, mSpriteHide, mSpriteRemap, mText, removeAllItemsParticles(), removeHorse(), and Configuration::removeListener().

337 {
338  config.removeListener("visiblenames", this);
340 
341  delete [] mSpriteRemap;
342  mSpriteRemap = nullptr;
343  delete [] mSpriteHide;
344  mSpriteHide = nullptr;
345  delete [] mSpriteDraw;
346  mSpriteDraw = nullptr;
347 
349  delete2(mBadges[f])
350 
353  delete2(mText)
357  mBadgesCount = 0;
358  delete2(mChat)
359  removeHorse();
360 
363 }
void removeAllItemsParticles()
Definition: being.cpp:5034
Configuration config
CastingEffect * mCastingEffect
Definition: being.h:1179
AnimatedSprite * mAnimationEffect
Definition: being.h:1178
#define delete2(var)
Definition: delete2.h:24
Text * mText
Definition: being.h:1201
std::vector< Particle * > mSpiritParticles
Definition: being.h:1315
void removeHorse()
Definition: being.cpp:5401
SpeechBubble * mSpeechBubble
Definition: being.h:1293
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
Definition: being.h:1180
#define for_each_badges()
Definition: being.cpp:155
int * mSpriteHide
Definition: being.h:1304
int * mSpriteRemap
Definition: being.h:1303
AnimatedSprite * mEmotionSprite
Definition: being.h:1177
int * mSpriteDraw
Definition: being.h:1305
FlashText * mDispName
Definition: being.h:1194
#define CHECKLISTENERS
Definition: localconsts.h:276
uint16_t mBadgesCount
Definition: being.h:1378
ChatObject * mChat
Definition: being.h:1311
void removeListener(const std::string &key, ConfigListener *const listener)

Member Function Documentation

◆ addAfkEffect()

void Being::addAfkEffect ( )

Definition at line 4915 of file being.cpp.

References addSpecialEffect(), and mAwayEffect.

Referenced by GameModifiers::changeAwayMode(), getHoverCursor(), and updateAwayEffect().

4916 {
4918 }
static int mAwayEffect
Definition: being.h:1352
void addSpecialEffect(const int effect)
Definition: being.cpp:4925

◆ addCast()

void Being::addCast ( const int  dstX,
const int  dstY,
const int  skillId,
const int  skillLevel,
const int  range,
const int  waitTimeTicks 
)

Definition at line 5366 of file being.cpp.

References SkillData::castingAnimation, data, delete2, SkillDialog::getSkillDataByLevel(), mCastEndTime, mCastingEffect, Actor::mMap, reportAlways, Actor::setMap(), skillDialog, and tick_time.

Referenced by getGroupId(), and EAthena::BeingRecv::processSkillCastingContinue().

5372 {
5373  if (waitTimeTicks <= 0)
5374  {
5375  mCastEndTime = 0;
5376  return;
5377  }
5378  mCastEndTime = tick_time + waitTimeTicks;
5380  skillId,
5381  skillLevel);
5383  if (data != nullptr)
5384  {
5385  const std::string castingAnimation = data->castingAnimation;
5386  mCastingEffect = new CastingEffect(skillId,
5387  skillLevel,
5388  castingAnimation,
5389  dstX,
5390  dstY,
5391  range);
5393  }
5394  else
5395  {
5396  reportAlways("Want to draw casting for unknown skill %d",
5397  skillId)
5398  }
5399 }
volatile int tick_time
Definition: timer.cpp:52
CastingEffect * mCastingEffect
Definition: being.h:1179
#define delete2(var)
Definition: delete2.h:24
std::string castingAnimation
Definition: skilldata.h:41
SkillData * getSkillDataByLevel(const int id, const int level) const
uint32_t data
int mCastEndTime
Definition: being.h:1371
virtual void setMap(Map *const map)
Definition: actor.cpp:47
SkillDialog * skillDialog
Definition: skilldialog.cpp:65
#define reportAlways(...)
Definition: checkutils.h:252
Map * mMap
Definition: actor.h:138

◆ addEffect()

void Being::addEffect ( const std::string &  name)

Definition at line 4956 of file being.cpp.

References Configuration::getStringValue(), AnimatedSprite::load(), mAnimationEffect, and paths.

Referenced by getHoverCursor(), EffectManager::trigger(), and EffectManager::triggerReturn().

4957 {
4958  delete mAnimationEffect;
4960  paths.getStringValue("sprites") + name,
4961  0);
4962 }
std::string getStringValue(const std::string &key) const
AnimatedSprite * mAnimationEffect
Definition: being.h:1178
static AnimatedSprite * load(const std::string &filename, const int variant)
Configuration paths

◆ addGuild()

void Being::addGuild ( Guild *const  guild)

Adds a guild to the being.

Definition at line 1236 of file being.cpp.

References SocialWindow::addTab(), guild, localPlayer, mGuilds, and socialWindow.

Referenced by GuildManager::createTab(), getClanName(), EAthena::GuildRecv::processGuildPositionInfo(), and setGuild().

1237 {
1238  if (guild == nullptr)
1239  return;
1240 
1241  mGuilds[guild->getId()] = guild;
1242 
1243  if (this == localPlayer && (socialWindow != nullptr))
1244  socialWindow->addTab(guild);
1245 }
int16_t getId() const
Definition: guild.h:134
bool addTab(Guild *const guild)
LocalPlayer * localPlayer
SocialWindow * socialWindow
std::map< int, Guild * > mGuilds
Definition: being.h:1213
uint32_t guild

◆ addItemParticles()

void Being::addItemParticles ( const int  id,
const SpriteDisplay display 
)
protected

Definition at line 5041 of file being.cpp.

References ParticleEngine::addEffect(), ActorSprite::controlCustomParticle(), ParticleEngine::enabled, FOR_EACH, mSpriteParticles, particleEngine, and restrict.

Referenced by getAllowNpcEquipment(), setHairTempSprite(), setSpriteColor(), setSpriteColorId(), setSpriteId(), and setTempSprite().

5043 {
5044  const SpriteParticleInfoIter it = mSpriteParticles.find(id);
5045  ParticleInfo *restrict pi = nullptr;
5046  if (it == mSpriteParticles.end())
5047  {
5048  pi = new ParticleInfo;
5049  mSpriteParticles[id] = pi;
5050  }
5051  else
5052  {
5053  pi = (*it).second;
5054  }
5055 
5056  if ((pi == nullptr) || !pi->particles.empty())
5057  return;
5058 
5059  // setup particle effects
5061  (particleEngine != nullptr))
5062  {
5063  FOR_EACH (StringVectCIter, itr, display.particles)
5064  {
5065  Particle *const p = particleEngine->addEffect(*itr, 0, 0, 0);
5067  pi->files.push_back(*itr);
5068  pi->particles.push_back(p);
5069  }
5070  }
5071  else
5072  {
5073  FOR_EACH (StringVectCIter, itr, display.particles)
5074  pi->files.push_back(*itr);
5075  }
5076 }
SpriteParticleInfo mSpriteParticles
Definition: being.h:1210
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static bool enabled
StringVect::const_iterator StringVectCIter
Definition: stringvector.h:30
Particle * addEffect(const std::string &particleEffectFile, const int pixelX, const int pixelY, const int rotation)
ParticleEngine * particleEngine
SpriteParticleInfo::iterator SpriteParticleInfoIter
Definition: being.h:1207
void controlCustomParticle(Particle *const particle)
StringVect particles
Definition: spritedisplay.h:47
#define restrict
Definition: localconsts.h:164

◆ addItemParticlesCards()

void Being::addItemParticlesCards ( const int  id,
const SpriteDisplay display,
const CardsList cards 
)
protected

Definition at line 5078 of file being.cpp.

References ParticleEngine::addEffect(), ActorSprite::controlCustomParticle(), ParticleEngine::enabled, FOR_EACH, ItemDB::get(), ItemInfo::getDisplay(), Actions::info(), Item::isItem(), maxCards, mSpriteParticles, particleEngine, and restrict.

Referenced by getAllowNpcEquipment(), and setSpriteCards().

5081 {
5082  const SpriteParticleInfoIter it = mSpriteParticles.find(id);
5083  ParticleInfo *restrict pi = nullptr;
5084  if (it == mSpriteParticles.end())
5085  {
5086  pi = new ParticleInfo;
5087  mSpriteParticles[id] = pi;
5088  }
5089  else
5090  {
5091  pi = (*it).second;
5092  }
5093 
5094  if ((pi == nullptr) || !pi->particles.empty())
5095  return;
5096 
5097  // setup particle effects
5099  (particleEngine != nullptr))
5100  {
5101  FOR_EACH (StringVectCIter, itr, display.particles)
5102  {
5103  Particle *const p = particleEngine->addEffect(*itr, 0, 0, 0);
5105  pi->files.push_back(*itr);
5106  pi->particles.push_back(p);
5107  }
5108  for (int f = 0; f < maxCards; f ++)
5109  {
5110  const int cardId = cards.cards[f];
5111  if (!Item::isItem(cardId))
5112  continue;
5113  const ItemInfo &info = ItemDB::get(cardId);
5114  const SpriteDisplay &restrict display2 = info.getDisplay();
5115  FOR_EACH (StringVectCIter, itr, display2.particles)
5116  {
5117  Particle *const p = particleEngine->addEffect(*itr, 0, 0, 0);
5119  pi->files.push_back(*itr);
5120  pi->particles.push_back(p);
5121  }
5122  }
5123  }
5124  else
5125  {
5126  FOR_EACH (StringVectCIter, itr, display.particles)
5127  {
5128  pi->files.push_back(*itr);
5129  }
5130  for (int f = 0; f < maxCards; f ++)
5131  {
5132  const int cardId = cards.cards[f];
5133  if (!Item::isItem(cardId))
5134  continue;
5135  const ItemInfo &info = ItemDB::get(cardId);
5136  const SpriteDisplay &restrict display2 = info.getDisplay();
5137  FOR_EACH (StringVectCIter, itr, display2.particles)
5138  {
5139  pi->files.push_back(*itr);
5140  }
5141  }
5142  }
5143 }
int cards[4]
Definition: cardslist.h:67
SpriteParticleInfo mSpriteParticles
Definition: being.h:1210
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
static bool enabled
const ItemInfo & get(const int id)
Definition: itemdb.cpp:792
StringVect::const_iterator StringVectCIter
Definition: stringvector.h:30
Particle * addEffect(const std::string &particleEffectFile, const int pixelX, const int pixelY, const int rotation)
ParticleEngine * particleEngine
SpriteParticleInfo::iterator SpriteParticleInfoIter
Definition: being.h:1207
void controlCustomParticle(Particle *const particle)
bool info(InputEvent &event)
Definition: commands.cpp:56
StringVect particles
Definition: spritedisplay.h:47
const SpriteDisplay & getDisplay() const
Definition: iteminfo.h:93
static bool isItem(const int id)
Definition: item.h:237
#define restrict
Definition: localconsts.h:164
#define maxCards
Definition: cards.h:24

◆ addSpecialEffect()

void Being::addSpecialEffect ( const int  effect)

Definition at line 4925 of file being.cpp.

References ServerCommandType::effect, effectManager, ParticleEngine::enabled, mSpecialParticle, and EffectManager::triggerReturn().

Referenced by addAfkEffect(), QuestsWindow::addEffect(), getHoverCursor(), and ActorManager::updateEffects().

4926 {
4927  if ((effectManager != nullptr) &&
4929  (mSpecialParticle == nullptr) &&
4930  effect != -1)
4931  {
4933  this,
4934  0);
4935  }
4936 }
static bool enabled
Particle * triggerReturn(const int id, Being *const being, const int rotation)
Particle * mSpecialParticle
Definition: being.h:1310
EffectManager * effectManager

◆ addSpiritBalls()

void Being::addSpiritBalls ( const unsigned int  balls,
const int  effectId 
)
protected

Definition at line 5492 of file being.cpp.

References effectManager, mSpiritParticles, and EffectManager::triggerReturn().

Referenced by setSpiritBalls().

5494 {
5495  if (effectManager == nullptr)
5496  return;
5497  for (unsigned int f = 0; f < balls; f ++)
5498  {
5499  Particle *const particle = effectManager->triggerReturn(
5500  effectId,
5501  this,
5502  0);
5503  mSpiritParticles.push_back(particle);
5504  }
5505 }
std::vector< Particle * > mSpiritParticles
Definition: being.h:1315
Particle * triggerReturn(const int id, Being *const being, const int rotation)
EffectManager * effectManager

◆ addToCache()

void Being::addToCache ( ) const

Definition at line 3510 of file being.cpp.

References BeingFlag::AWAY, beingInfoCache, CACHE_SIZE, cur_time, getCacheEntry(), getGuildName(), ActorSprite::getId(), getIp(), getLevel(), Net::getNetworkType(), getPartyName(), getPvpRank(), getTeamId(), BeingFlag::INACTIVE, isAdvanced(), localPlayer, mAway, mInactive, mLowTraffic, mName, mShop, BeingCacheEntry::setAdvanced(), BeingCacheEntry::setFlags(), BeingCacheEntry::setGuildName(), BeingCacheEntry::setIp(), BeingCacheEntry::setLevel(), BeingCacheEntry::setName(), BeingCacheEntry::setPartyName(), BeingCacheEntry::setPvpRank(), BeingCacheEntry::setTeamId(), BeingCacheEntry::setTime(), BeingFlag::SHOP, and ServerType::TMWATHENA.

Referenced by getReachable(), ActorManager::logic(), ActorManager::parseLevels(), EAthena::GuildRecv::processGuildSetPosition(), Ea::BeingRecv::processNameResponse(), EAthena::BeingRecv::processNameResponse2(), EAthena::BeingRecv::processNameResponseTitle(), TmwAthena::BeingRecv::processPlayerGuilPartyInfo(), EAthena::BeingRecv::processPlayerGuilPartyInfo(), EAthena::BeingRecv::processPlayerGuilPartyInfo2(), TmwAthena::BeingRecv::processPvpSet(), setAdvanced(), and setState().

3511 {
3512  if (localPlayer == this)
3513  return;
3514 
3516  if (entry == nullptr)
3517  {
3518  entry = new BeingCacheEntry(getId());
3519  beingInfoCache.push_front(entry);
3520 
3521  if (beingInfoCache.size() >= CACHE_SIZE)
3522  {
3523  delete beingInfoCache.back();
3524  beingInfoCache.pop_back();
3525  }
3526  }
3527  if (!mLowTraffic)
3528  return;
3529 
3530  entry->setName(mName);
3531  entry->setLevel(getLevel());
3532  entry->setPartyName(getPartyName());
3533  entry->setGuildName(getGuildName());
3534  entry->setTime(cur_time);
3535  entry->setPvpRank(getPvpRank());
3536  entry->setIp(getIp());
3537  entry->setAdvanced(isAdvanced());
3538  entry->setTeamId(getTeamId());
3539  if (isAdvanced())
3540  {
3541  int flags = 0;
3543  flags += BeingFlag::SHOP;
3544  if (mAway)
3545  flags += BeingFlag::AWAY;
3546  if (mInactive)
3547  flags += BeingFlag::INACTIVE;
3548  entry->setFlags(flags);
3549  }
3550  else
3551  {
3552  entry->setFlags(0);
3553  }
3554 }
void setTime(const time_t n)
void setLevel(const int n)
const unsigned int CACHE_SIZE
Definition: being.cpp:124
const std::string & getPartyName() const
Definition: being.h:254
void setAdvanced(const bool a)
BeingId getId() const
Definition: actorsprite.h:63
void setPvpRank(const int r)
void setFlags(const int flags)
static bool mLowTraffic
Definition: being.h:1339
void setGuildName(const std::string &name)
std::string mName
Definition: being.h:1183
bool mInactive
Definition: being.h:1386
void setPartyName(const std::string &name)
LocalPlayer * localPlayer
bool mShop
Definition: being.h:1384
std::list< BeingCacheEntry * > beingInfoCache
Definition: being.cpp:147
volatile time_t cur_time
Definition: timer.cpp:57
void setIp(const std::string &ip)
ServerTypeT getNetworkType()
Definition: net.cpp:188
bool isAdvanced() const
Definition: being.h:827
unsigned int getPvpRank() const
Definition: being.h:748
bool mAway
Definition: being.h:1385
static BeingCacheEntry * getCacheEntry(const BeingId id)
Definition: being.cpp:3556
uint16_t getTeamId() const
Definition: being.h:1085
virtual int getLevel() const
Definition: being.h:603
void setTeamId(const uint16_t teamId)
const std::string & getIp() const
Definition: being.h:742
void setName(const std::string &name)
const std::string & getGuildName() const
Definition: being.h:258

◆ botFixOffset()

void Being::botFixOffset ( int &  dstX,
int &  dstY 
) const
protected

Definition at line 2079 of file being.cpp.

References BeingAction::ATTACK, BeingAction::CAST, BeingAction::DEAD, BeingDirection::DOWN, BeingInfo::getAttackOffsetX(), BeingInfo::getAttackOffsetY(), getBlockWalkMask(), getCurrentAction(), BeingInfo::getDeadOffsetX(), BeingInfo::getDeadOffsetY(), BeingInfo::getMoveOffsetX(), BeingInfo::getMoveOffsetY(), BeingInfo::getSitOffsetX(), BeingInfo::getSitOffsetY(), BeingInfo::getTargetOffsetX(), BeingInfo::getTargetOffsetY(), Map::getWalk(), BeingAction::HURT, BeingDirection::LEFT, mDirection, mInfo, Actor::mMap, BeingAction::MOVE, mOwner, mX, mY, BeingAction::PRESTAND, BeingDirection::RIGHT, BeingAction::SIT, BeingAction::SPAWN, BeingAction::STAND, and BeingDirection::UP.

Referenced by botLogic(), and updateBotFollow().

2081 {
2082  if ((mInfo == nullptr) || (mOwner == nullptr))
2083  return;
2084 
2085  int offsetX1;
2086  int offsetY1;
2087  switch (mOwner->getCurrentAction())
2088  {
2089  case BeingAction::SIT:
2090  offsetX1 = mInfo->getSitOffsetX();
2091  offsetY1 = mInfo->getSitOffsetY();
2092  break;
2093 
2094  case BeingAction::MOVE:
2095  offsetX1 = mInfo->getMoveOffsetX();
2096  offsetY1 = mInfo->getMoveOffsetY();
2097  break;
2098 
2099  case BeingAction::DEAD:
2100  offsetX1 = mInfo->getDeadOffsetX();
2101  offsetY1 = mInfo->getDeadOffsetY();
2102  break;
2103 
2104  case BeingAction::ATTACK:
2105  offsetX1 = mInfo->getAttackOffsetX();
2106  offsetY1 = mInfo->getAttackOffsetY();
2107  break;
2108 
2109  case BeingAction::SPAWN:
2110  case BeingAction::HURT:
2111  case BeingAction::STAND:
2112  case BeingAction::PRESTAND:
2113  case BeingAction::CAST:
2114  default:
2115  offsetX1 = mInfo->getTargetOffsetX();
2116  offsetY1 = mInfo->getTargetOffsetY();
2117  break;
2118  }
2119 
2120  int offsetX = offsetX1;
2121  int offsetY = offsetY1;
2122  switch (mOwner->mDirection)
2123  {
2124  case BeingDirection::LEFT:
2125  offsetX = -offsetY1;
2126  offsetY = offsetX1;
2127  break;
2128  case BeingDirection::RIGHT:
2129  offsetX = offsetY1;
2130  offsetY = -offsetX1;
2131  break;
2132  case BeingDirection::UP:
2133  offsetY = -offsetY;
2134  offsetX = -offsetX;
2135  break;
2136  default:
2137  case BeingDirection::DOWN:
2138  break;
2139  }
2140  dstX += offsetX;
2141  dstY += offsetY;
2142  if (mMap != nullptr)
2143  {
2144  if (!mMap->getWalk(dstX, dstY, getBlockWalkMask()))
2145  {
2146  dstX = mOwner->mX;
2147  dstY = mOwner->mY;
2148  }
2149  }
2150 }
uint8_t mDirection
Definition: being.h:1234
int getDeadOffsetX() const
Definition: beinginfo.h:266
virtual unsigned char getBlockWalkMask() const
Definition: being.h:431
int getDeadOffsetY() const
Definition: beinginfo.h:272
int getTargetOffsetX() const
Definition: beinginfo.h:134
int getSitOffsetY() const
Definition: beinginfo.h:248
int mX
Definition: being.h:1317
int getSitOffsetX() const
Definition: beinginfo.h:242
BeingActionT getCurrentAction() const
Definition: being.h:481
bool getWalk(const int x, const int y, const unsigned char blockWalkMask) const
Definition: map.cpp:784
int getMoveOffsetY() const
Definition: beinginfo.h:260
int getMoveOffsetX() const
Definition: beinginfo.h:254
int getAttackOffsetY() const
Definition: beinginfo.h:284
int mY
Definition: being.h:1318
int getAttackOffsetX() const
Definition: beinginfo.h:278
Being * mOwner
Definition: being.h:1309
int getTargetOffsetY() const
Definition: beinginfo.h:140
BeingInfo * mInfo
Definition: being.h:1176
Map * mMap
Definition: actor.h:138

◆ botLogic()

void Being::botLogic ( )

Definition at line 1998 of file being.cpp.

References BeingAction::ATTACK, Net::MercenaryHandler::attack(), Net::HomunculusHandler::attack(), botFixOffset(), BeingAction::CAST, CAST_S32, BeingAction::DEAD, ActorSprite::getId(), LocalPlayer::getTarget(), BeingInfo::getThinkTime(), BeingInfo::getWarpDist(), ActorType::Homunculus, homunculusHandler, BeingAction::HURT, Keep_true, localPlayer, mAction, mBotAi, mercenaryHandler, mInfo, Actor::mMap, mMoveTime, BeingAction::MOVE, moveBotTo(), Net::HomunculusHandler::moveToMaster(), Net::MercenaryHandler::moveToMaster(), mOwner, mType, mX, mY, BeingAction::PRESTAND, BeingAction::SIT, BeingAction::SPAWN, BeingAction::STAND, tick_time, ServerCommandType::time, and updateBotFollow().

Referenced by getNumberOfLayers(), and logic().

1999 {
2000  if ((mOwner == nullptr) || (mMap == nullptr) || (mInfo == nullptr))
2001  return;
2002 
2003  const int time = tick_time;
2004  const int thinkTime = mInfo->getThinkTime();
2005  if (abs(CAST_S32(mMoveTime) - time) < thinkTime)
2006  return;
2007 
2008  mMoveTime = time;
2009 
2010  int dstX = mOwner->mX;
2011  int dstY = mOwner->mY;
2012  const int warpDist = mInfo->getWarpDist();
2013  const int divX = abs(dstX - mX);
2014  const int divY = abs(dstY - mY);
2015 
2016  if (divX >= warpDist || divY >= warpDist)
2017  {
2020  else
2022  mBotAi = true;
2023  return;
2024  }
2025  if (!mBotAi)
2026  return;
2027  if (mAction == BeingAction::MOVE)
2028  {
2030  {
2031  updateBotFollow(dstX, dstY,
2032  divX, divY);
2033  }
2034  return;
2035  }
2036 
2037  switch (mOwner->mAction)
2038  {
2039  case BeingAction::MOVE:
2040  case BeingAction::PRESTAND:
2041  updateBotFollow(dstX, dstY,
2042  divX, divY);
2043  break;
2044  case BeingAction::STAND:
2045  case BeingAction::SPAWN:
2046  botFixOffset(dstX, dstY);
2047  moveBotTo(dstX, dstY);
2048  break;
2049  case BeingAction::ATTACK:
2050  {
2051  const Being *const target = localPlayer->getTarget();
2052  if (target == nullptr)
2053  return;
2054  const BeingId targetId = target->getId();
2056  {
2057  homunculusHandler->attack(targetId,
2058  Keep_true);
2059  }
2060  else
2061  {
2062  mercenaryHandler->attack(targetId,
2063  Keep_true);
2064  }
2065  break;
2066  }
2067  case BeingAction::SIT:
2068  case BeingAction::DEAD:
2069  botFixOffset(dstX, dstY);
2070  moveBotTo(dstX, dstY);
2071  break;
2072  case BeingAction::CAST:
2073  case BeingAction::HURT:
2074  default:
2075  break;
2076  }
2077 }
virtual void attack(const BeingId targetId, const Keep keep) const =0
bool mBotAi
Definition: being.h:1388
volatile int tick_time
Definition: timer.cpp:52
const bool Keep_true
Definition: keep.h:29
BeingId getId() const
Definition: actorsprite.h:63
int BeingId
Definition: beingid.h:29
virtual void moveToMaster() const =0
virtual void moveToMaster() const =0
#define CAST_S32
Definition: cast.h:29
int mX
Definition: being.h:1317
time_t mMoveTime
Definition: being.h:1355
LocalPlayer * localPlayer
Net::MercenaryHandler * mercenaryHandler
Definition: net.cpp:117
int getThinkTime() const
Definition: beinginfo.h:290
virtual void attack(const BeingId targetId, const Keep keep) const =0
Net::HomunculusHandler * homunculusHandler
Definition: net.cpp:111
int mY
Definition: being.h:1318
void moveBotTo(int dstX, int dstY)
Definition: being.cpp:2191
Being * mOwner
Definition: being.h:1309
int getWarpDist() const
Definition: beinginfo.h:236
Definition: being.h:93
void botFixOffset(int &dstX, int &dstY) const
Definition: being.cpp:2079
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232
void updateBotFollow(int dstX, int dstY, const int divX, const int divY)
Definition: being.cpp:2152
Being * getTarget() const
const ActorTypeT mType
Definition: being.h:1290
Map * mMap
Definition: actor.h:138

◆ calcDirection() [1/2]

uint8_t Being::calcDirection ( const int  dstX,
const int  dstY 
) const

Definition at line 1766 of file being.cpp.

References BeingDirection::DOWN, BeingDirection::LEFT, mX, mY, BeingDirection::RIGHT, and BeingDirection::UP.

Referenced by EAthena::BeingRecv::processBeingMove(), and TmwAthena::BeingRecv::processPlayerMove().

1768 {
1769  uint8_t dir = 0;
1770  if (dstX > mX)
1771  dir |= BeingDirection::RIGHT;
1772  else if (dstX < mX)
1773  dir |= BeingDirection::LEFT;
1774  if (dstY > mY)
1775  dir |= BeingDirection::DOWN;
1776  else if (dstY < mY)
1777  dir |= BeingDirection::UP;
1778  return dir;
1779 }
int mX
Definition: being.h:1317
int mY
Definition: being.h:1318

◆ calcDirection() [2/2]

uint8_t Being::calcDirection ( ) const

Definition at line 1752 of file being.cpp.

References BeingDirection::DOWN, BeingDirection::LEFT, mDest, mX, mY, BeingDirection::RIGHT, BeingDirection::UP, Vector::x, and Vector::y.

Referenced by getMaxHP(), handleAttack(), handleSkill(), and nextTile().

1753 {
1754  uint8_t dir = 0;
1755  if (mDest.x > mX)
1756  dir |= BeingDirection::RIGHT;
1757  else if (mDest.x < mX)
1758  dir |= BeingDirection::LEFT;
1759  if (mDest.y > mY)
1760  dir |= BeingDirection::DOWN;
1761  else if (mDest.y < mY)
1762  dir |= BeingDirection::UP;
1763  return dir;
1764 }
Vector mDest
Definition: being.h:1204
int mX
Definition: being.h:1317
float x
Definition: vector.h:208
int mY
Definition: being.h:1318
float y
Definition: vector.h:208

◆ canTalk()

bool Being::canTalk ( ) const
inline

Definition at line 666 of file being.h.

References A_NONNULL, draw(), drawBasic(), drawMonster(), drawNpc(), drawOther(), drawPlayer(), drawPortal(), mType, ActorType::Npc, restrict, restrict2, and talkTo().

Referenced by Actions::doSit(), and Viewport::drawPath().

667  { return mType == ActorType::Npc; }
const ActorTypeT mType
Definition: being.h:1290

◆ clearCache()

void Being::clearCache ( )
static

Definition at line 4716 of file being.cpp.

References beingInfoCache, and delete_all().

Referenced by Game::~Game().

4717 {
4719  beingInfoCache.clear();
4720 }
void delete_all(Container &c)
Definition: dtor.h:55
std::list< BeingCacheEntry * > beingInfoCache
Definition: being.cpp:147

◆ clearGuilds()

void Being::clearGuilds ( )

Removes all guilds the being is in.

Definition at line 1288 of file being.cpp.

References FOR_EACH, guild, localPlayer, mGuilds, ActorSprite::mId, Guild::removeMember(), SocialWindow::removeTab(), and socialWindow.

Referenced by GuildManager::afterRemove(), getGuilds(), GuildManager::process(), EAthena::GuildRecv::processGuildExpulsionContinue(), EAthena::GuildRecv::processGuildLeave(), EAthena::GuildRecv::processGuildLeave2(), TmwAthena::BeingRecv::processPlayerMove(), TmwAthena::BeingRecv::processPlayerUpdate1(), TmwAthena::BeingRecv::processPlayerUpdate2(), setGuild(), and updateGuild().

1289 {
1291  {
1292  Guild *const guild = itr->second;
1293 
1294  if (guild != nullptr)
1295  {
1296  if (this == localPlayer && (socialWindow != nullptr))
1297  socialWindow->removeTab(guild);
1298 
1299  guild->removeMember(mId);
1300  }
1301  }
1302 
1303  mGuilds.clear();
1304 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
bool removeTab(Guild *const guild)
void removeMember(const GuildMember *const member)
Definition: guild.cpp:203
LocalPlayer * localPlayer
SocialWindow * socialWindow
std::map< int, Guild * >::const_iterator GuildsMapCIter
Definition: being.cpp:148
std::map< int, Guild * > mGuilds
Definition: being.h:1213
uint32_t guild
Definition: guild.h:68
BeingId mId
Definition: actorsprite.h:246

◆ clearPath()

void Being::clearPath ( )

Removes all path nodes from this being.

Definition at line 553 of file being.cpp.

References mPath.

Referenced by getType(), TmwAthena::BeingRecv::processBeingVisible(), EAthena::BeingRecv::processBeingVisible(), and LocalPlayer::stopWalking().

554 {
555  mPath.clear();
556 }
Path mPath
Definition: being.h:1200

◆ createBeing()

Being * Being::createBeing ( const BeingId  id,
const ActorTypeT  type,
const BeingTypeId  subtype,
Map *const  map 
)
static

Definition at line 5572 of file being.cpp.

References Being(), and postInit().

Referenced by ActorManager::createBeing(), and NpcDialog::showAvatar().

5576 {
5577  Being *const being = new Being(id,
5578  type);
5579  being->postInit(subType,
5580  map);
5581  return being;
5582 }
Being(const BeingId id, const ActorTypeT type)
Definition: being.cpp:161
void postInit(const BeingTypeId subType, Map *const map)
Definition: being.cpp:288
Definition: being.h:93

◆ createSpeechBubble()

void Being::createSpeechBubble ( )
protected

Definition at line 365 of file being.cpp.

References CREATEWIDGETV0, and mSpeechBubble.

Referenced by getAllowNpcEquipment(), and setSpeech().

366 {
368 }
#define CREATEWIDGETV0(var, type)
Definition: createwidget.h:31
SpeechBubble * mSpeechBubble
Definition: being.h:1293

◆ decUsage()

int Being::decUsage ( )
inline

Definition at line 974 of file being.h.

References mUsageCounter.

975  { return --mUsageCounter; }
int mUsageCounter
Definition: being.h:1367

◆ disableBotAi()

void Being::disableBotAi ( )
inline

Definition at line 1046 of file being.h.

References mBotAi.

1047  { mBotAi = false; }
bool mBotAi
Definition: being.h:1388

◆ draw()

void Being::draw ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const
virtual

Draws the Actor to the given graphics context.

Note: this function could be simplified if the graphics context would support setting a translation offset. It already does this partly with the clipping rectangle support.

Implements Actor.

Definition at line 3836 of file being.cpp.

References ActorType::Avatar, drawElemental(), drawHomunculus(), drawMercenary(), drawMonster(), drawNpc(), drawOther(), drawPlayer(), drawPortal(), ActorType::Elemental, ActorType::FloorItem, ActorType::Homunculus, ActorType::Mercenary, ActorType::Monster, mType, ActorType::Npc, ActorType::Pet, ActorType::Player, ActorType::Portal, ActorType::SkillUnit, and ActorType::Unknown.

Referenced by canTalk(), DebugWindow::draw(), and DebugWindow::safeDraw().

3839 {
3840  switch (mType)
3841  {
3842  case ActorType::Player:
3843  drawPlayer(graphics,
3844  offsetX,
3845  offsetY);
3846  break;
3847  case ActorType::Portal:
3848  drawPortal(graphics,
3849  offsetX,
3850  offsetY);
3851  break;
3852  case ActorType::Homunculus:
3853  drawHomunculus(graphics,
3854  offsetX,
3855  offsetY);
3856  break;
3857  case ActorType::Mercenary:
3858  drawMercenary(graphics,
3859  offsetX,
3860  offsetY);
3861  break;
3862  case ActorType::Elemental:
3863  drawElemental(graphics,
3864  offsetX,
3865  offsetY);
3866  break;
3867  case ActorType::Monster:
3868  drawMonster(graphics,
3869  offsetX,
3870  offsetY);
3871  break;
3872  case ActorType::Npc:
3873  drawNpc(graphics,
3874  offsetX,
3875  offsetY);
3876  break;
3877  case ActorType::Pet:
3878  case ActorType::SkillUnit:
3879  case ActorType::Unknown:
3880  case ActorType::FloorItem:
3881  case ActorType::Avatar:
3882  default:
3883  drawOther(graphics,
3884  offsetX,
3885  offsetY);
3886  break;
3887  }
3888 }
void drawMonster(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3777
void drawNpc(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3765
void drawPlayer(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3691
void drawMercenary(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3801
void drawPortal(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3825
void drawElemental(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3813
void drawHomunculus(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3789
void drawOther(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3753
const ActorTypeT mType
Definition: being.h:1290

◆ drawBasic()

void Being::drawBasic ( Graphics *const  graphics,
const int  x,
const int  y 
) const

Definition at line 3927 of file being.cpp.

References drawCompound(), x, and y.

Referenced by canTalk(), and PlayerBox::draw().

3930 {
3931  drawCompound(graphics, x, y);
3932 }
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3934

◆ drawBeingCursor()

void Being::drawBeingCursor ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const
protected

Definition at line 3731 of file being.cpp.

References AnimatedSprite::draw(), BeingInfo::getTargetOffsetX(), BeingInfo::getTargetOffsetY(), ActorSprite::mCursorPaddingX, ActorSprite::mCursorPaddingY, MILLISECONDS_IN_A_TICK, mInfo, ActorSprite::mUsedTargetCursor, tick_time, and AnimatedSprite::update().

Referenced by drawElemental(), drawHomunculus(), drawMercenary(), drawMonster(), drawNpc(), drawOther(), and drawPlayer().

3734 {
3735  if (mUsedTargetCursor != nullptr)
3736  {
3738  if (mInfo == nullptr)
3739  {
3740  mUsedTargetCursor->draw(graphics,
3741  offsetX - mCursorPaddingX,
3742  offsetY - mCursorPaddingY);
3743  }
3744  else
3745  {
3746  mUsedTargetCursor->draw(graphics,
3747  offsetX + mInfo->getTargetOffsetX() - mCursorPaddingX,
3748  offsetY + mInfo->getTargetOffsetY() - mCursorPaddingY);
3749  }
3750  }
3751 }
volatile int tick_time
Definition: timer.cpp:52
int mCursorPaddingX
Definition: actorsprite.h:255
void draw(Graphics *const graphics, const int posX, const int posY) const
int getTargetOffsetX() const
Definition: beinginfo.h:134
AnimatedSprite * mUsedTargetCursor
Definition: actorsprite.h:249
static const int MILLISECONDS_IN_A_TICK
Definition: timer.h:29
int mCursorPaddingY
Definition: actorsprite.h:256
int getTargetOffsetY() const
Definition: beinginfo.h:140
bool update(const int time)
BeingInfo * mInfo
Definition: being.h:1176

◆ drawCasting()

void Being::drawCasting ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const
protected

◆ drawCompound()

void Being::drawCompound ( Graphics *const  graphics,
const int  posX,
const int  posY 
) const
protected

Definition at line 3934 of file being.cpp.

References Graphics::drawImage(), drawPlayerSprites(), FUNC_BLOCK, Sprite::mAlpha, CompoundSprite::mAlphaImage, CompoundSprite::mImage, CompoundSprite::mNeedsRedraw, CompoundSprite::mOffsetX, CompoundSprite::mOffsetY, CompoundSprite::mSprites, Image::setAlpha(), and CompoundSprite::updateImages().

Referenced by drawBasic(), drawNpcSpriteAt(), drawPlayerSpriteAt(), and getAllowNpcEquipment().

3937 {
3938  FUNC_BLOCK("CompoundSprite::draw", 1)
3939  if (mNeedsRedraw)
3940  updateImages();
3941 
3942  if (mSprites.empty()) // Nothing to draw
3943  return;
3944 
3945  if (mAlpha == 1.0F && (mImage != nullptr))
3946  {
3947  graphics->drawImage(mImage,
3948  posX + mOffsetX,
3949  posY + mOffsetY);
3950  }
3951  else if ((mAlpha != 0.0F) && (mAlphaImage != nullptr))
3952  {
3954  graphics->drawImage(mAlphaImage,
3955  posX + mOffsetX,
3956  posY + mOffsetY);
3957  }
3958  else
3959  {
3960  Being::drawPlayerSprites(graphics, posX, posY);
3961  }
3962 }
if(!vert) return
virtual void setAlpha(const float alpha)
Definition: image.cpp:286
std::vector< Sprite * > mSprites
void drawPlayerSprites(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3890
#define FUNC_BLOCK(name, id)
Definition: perfomance.h:80
std::string empty
Definition: podict.cpp:25
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
void updateImages() const
float mAlpha
Definition: sprite.h:129

◆ drawElemental()

void Being::drawElemental ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3813 of file being.cpp.

References drawBeingCursor(), drawElementalSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by draw(), and getLastAttackY().

3816 {
3817  // getActorX() + offsetX;
3818  const int px = mPixelX - mapTileSize / 2 + offsetX;
3819  // getActorY() + offsetY;
3820  const int py = mPixelY - mapTileSize + offsetY;
3821  drawBeingCursor(graphics, px, py);
3822  drawElementalSpriteAt(graphics, px, py);
3823 }
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
void drawElementalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4166
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawElementalSpriteAt()

void Being::drawElementalSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 4166 of file being.cpp.

References BeingAction::DEAD, drawHpBar(), CompoundSprite::drawSimple(), UserColorId::ELEMENTAL_HP, Attributes::ELEMENTAL_HP, UserColorId::ELEMENTAL_HP2, Attributes::ELEMENTAL_MAX_HP, UserPalette::getColorWithAlpha(), PlayerInfo::getElementalId(), BeingInfo::getHpBarOffsetX(), BeingInfo::getHpBarOffsetY(), BeingInfo::getMaxHP(), PlayerInfo::getStatBase(), mAction, mapTileSize, mAttackRange, mDamageTaken, mHighlightMonsterAttackRange, ActorSprite::mId, mInfo, UserColorId::MONSTER_ATTACK_RANGE, mShowMobHP, userPalette, x, and y.

Referenced by drawElemental(), and getAllowNpcEquipment().

4169 {
4172  {
4173  if (userPalette == nullptr)
4174  {
4175  CompoundSprite::drawSimple(graphics, x, y);
4176  return;
4177  }
4178 
4179  int attackRange;
4180  if (mAttackRange != 0)
4181  attackRange = mapTileSize * mAttackRange;
4182  else
4183  attackRange = mapTileSize;
4184 
4187 
4188  graphics->fillRectangle(Rect(
4189  x - attackRange, y - attackRange,
4190  2 * attackRange + mapTileSize, 2 * attackRange + mapTileSize));
4191  }
4192 
4193  CompoundSprite::drawSimple(graphics, x, y);
4194 
4195  if (mShowMobHP &&
4196  (mInfo != nullptr))
4197  {
4199  {
4200  // show hp bar here
4202  if (maxHP == 0)
4203  maxHP = mInfo->getMaxHP();
4204 
4205  drawHpBar(graphics,
4206  maxHP,
4208  mDamageTaken,
4211  x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(),
4212  y + mapTileSize - 6 + mInfo->getHpBarOffsetY(),
4213  2 * 50,
4214  4);
4215  }
4216  }
4217 }
const Color & getColorWithAlpha(const UserColorIdT type)
Definition: userpalette.h:199
int getHpBarOffsetY() const
Definition: beinginfo.h:164
Definition: rect.h:72
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
UserPalette * userPalette
Definition: userpalette.cpp:33
static bool mHighlightMonsterAttackRange
Definition: being.h:1338
virtual void setColor(const Color &color)
Definition: graphics.h:319
static bool mShowMobHP
Definition: being.h:1342
int mDamageTaken
Definition: being.h:1327
int getStatBase(const AttributesT id)
Definition: playerinfo.cpp:134
BeingId getElementalId()
Definition: playerinfo.cpp:543
virtual void fillRectangle(const Rect &rectangle)=0
int getHpBarOffsetX() const
Definition: beinginfo.h:158
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
Definition: being.cpp:4250
static const int mapTileSize
Definition: map.h:26
int mAttackRange
Definition: being.h:1225
int getMaxHP() const
Definition: beinginfo.h:170
BeingId mId
Definition: actorsprite.h:246
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232

◆ drawEmotion()

void Being::drawEmotion ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Draws the emotion picture above the being.

Definition at line 2374 of file being.cpp.

References AnimatedSprite::draw(), for_each_badges, BadgeDrawType::Hide, mAnimationEffect, mapTileSize, mBadges, mBadgesCount, mBadgesX, mBadgesY, mEmotionSprite, mErased, Actor::mPixelX, Actor::mPixelY, mShowBadges, restrict, x, and y.

Referenced by getNumberOfLayers().

2377 {
2378  if (mErased)
2379  return;
2380 
2381  const int px = mPixelX - offsetX - mapTileSize / 2;
2382  const int py = mPixelY - offsetY - mapTileSize * 2 - mapTileSize;
2383  if (mAnimationEffect != nullptr)
2384  mAnimationEffect->draw(graphics, px, py);
2386  mBadgesCount != 0U)
2387  {
2388  int x = mBadgesX - offsetX;
2389  const int y = mBadgesY - offsetY;
2390  for_each_badges()
2391  {
2392  const AnimatedSprite *restrict const sprite = mBadges[f];
2393  if (sprite != nullptr)
2394  {
2395  sprite->draw(graphics, x, y);
2396  x += 16;
2397  }
2398  }
2399  }
2400  if (mEmotionSprite != nullptr)
2401  mEmotionSprite->draw(graphics, px, py);
2402 }
void draw(Graphics *const graphics, const int posX, const int posY) const
AnimatedSprite * mAnimationEffect
Definition: being.h:1178
bool mErased
Definition: being.h:1380
int mPixelX
Definition: actor.h:132
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
Definition: being.h:1180
#define for_each_badges()
Definition: being.cpp:155
int mPixelY
Definition: actor.h:133
AnimatedSprite * mEmotionSprite
Definition: being.h:1177
int mBadgesX
Definition: being.h:1373
int mBadgesY
Definition: being.h:1374
static BadgeDrawType::Type mShowBadges
Definition: being.h:1351
static const int mapTileSize
Definition: map.h:26
#define restrict
Definition: localconsts.h:164
uint16_t mBadgesCount
Definition: being.h:1378

◆ drawHomunculus()

void Being::drawHomunculus ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3789 of file being.cpp.

References drawBeingCursor(), drawHomunculusSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by draw(), and getLastAttackY().

3792 {
3793  // getActorX() + offsetX;
3794  const int px = mPixelX - mapTileSize / 2 + offsetX;
3795  // getActorY() + offsetY;
3796  const int py = mPixelY - mapTileSize + offsetY;
3797  drawBeingCursor(graphics, px, py);
3798  drawHomunculusSpriteAt(graphics, px, py);
3799 }
void drawHomunculusSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4056
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawHomunculusSpriteAt()

void Being::drawHomunculusSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 4056 of file being.cpp.

References BeingAction::DEAD, drawHpBar(), CompoundSprite::drawSimple(), UserPalette::getColorWithAlpha(), PlayerInfo::getHomunculus(), BeingInfo::getHpBarOffsetX(), BeingInfo::getHpBarOffsetY(), BeingInfo::getMaxHP(), PlayerInfo::getStatBase(), UserColorId::HOMUN_HP, Attributes::HOMUN_HP, UserColorId::HOMUN_HP2, Attributes::HOMUN_MAX_HP, HomunculusInfo::id, Actions::info(), mAction, mapTileSize, mAttackRange, mDamageTaken, mHighlightMonsterAttackRange, ActorSprite::mId, mInfo, UserColorId::MONSTER_ATTACK_RANGE, mShowMobHP, userPalette, x, and y.

Referenced by drawHomunculus(), and getAllowNpcEquipment().

4059 {
4062  {
4063  if (userPalette == nullptr)
4064  {
4065  CompoundSprite::drawSimple(graphics, x, y);
4066  return;
4067  }
4068 
4069  int attackRange;
4070  if (mAttackRange != 0)
4071  attackRange = mapTileSize * mAttackRange;
4072  else
4073  attackRange = mapTileSize;
4074 
4077 
4078  graphics->fillRectangle(Rect(
4079  x - attackRange, y - attackRange,
4080  2 * attackRange + mapTileSize, 2 * attackRange + mapTileSize));
4081  }
4082 
4083  CompoundSprite::drawSimple(graphics, x, y);
4084 
4085  if (mShowMobHP &&
4086  (mInfo != nullptr))
4087  {
4089  if ((info != nullptr) &&
4090  mId == info->id)
4091  {
4092  // show hp bar here
4094  if (maxHP == 0)
4095  maxHP = mInfo->getMaxHP();
4096 
4097  drawHpBar(graphics,
4098  maxHP,
4100  mDamageTaken,
4103  x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(),
4104  y + mapTileSize - 6 + mInfo->getHpBarOffsetY(),
4105  2 * 50,
4106  4);
4107  }
4108  }
4109 }
const Color & getColorWithAlpha(const UserColorIdT type)
Definition: userpalette.h:199
int getHpBarOffsetY() const
Definition: beinginfo.h:164
Definition: rect.h:72
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
UserPalette * userPalette
Definition: userpalette.cpp:33
static bool mHighlightMonsterAttackRange
Definition: being.h:1338
virtual void setColor(const Color &color)
Definition: graphics.h:319
static bool mShowMobHP
Definition: being.h:1342
bool info(InputEvent &event)
Definition: commands.cpp:56
int mDamageTaken
Definition: being.h:1327
int getStatBase(const AttributesT id)
Definition: playerinfo.cpp:134
virtual void fillRectangle(const Rect &rectangle)=0
int getHpBarOffsetX() const
Definition: beinginfo.h:158
HomunculusInfo * getHomunculus()
Definition: playerinfo.cpp:602
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
Definition: being.cpp:4250
static const int mapTileSize
Definition: map.h:26
int mAttackRange
Definition: being.h:1225
int getMaxHP() const
Definition: beinginfo.h:170
BeingId mId
Definition: actorsprite.h:246
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232

◆ drawHpBar()

void Being::drawHpBar ( Graphics *const  graphics,
const int  maxHP,
const int  hp,
const int  damage,
const UserColorIdT  color1,
const UserColorIdT  color2,
const int  x,
const int  y,
const int  width,
const int  height 
) const

Definition at line 4250 of file being.cpp.

References UserPalette::getColorWithAlpha(), Net::ServerFeatures::haveServerHp(), localPlayer, serverFeatures, userPalette, x, and y.

Referenced by drawElementalSpriteAt(), drawHomunculusSpriteAt(), drawMercenarySpriteAt(), drawMonsterSpriteAt(), drawPlayerSpriteAt(), and setDistance().

4260 {
4261  if (maxHP <= 0 || (userPalette == nullptr))
4262  return;
4263 
4264  float p;
4265 
4266  if (hp != 0)
4267  {
4268  p = static_cast<float>(maxHP) / static_cast<float>(hp);
4269  }
4270  else if (maxHP != damage)
4271  {
4272  p = static_cast<float>(maxHP)
4273  / static_cast<float>(maxHP - damage);
4274  }
4275  else
4276  {
4277  p = 1;
4278  }
4279 
4280  if (p <= 0 || p > width)
4281  return;
4282 
4283  const int dx = static_cast<int>(static_cast<float>(width) / p);
4284 
4285 #ifdef TMWA_SUPPORT
4286  if (!serverFeatures->haveServerHp())
4287  { // old servers
4288  if ((damage == 0 && (this != localPlayer || hp == maxHP))
4289  || (hp == 0 && maxHP == damage))
4290  {
4291  graphics->setColor(userPalette->getColorWithAlpha(color1));
4292  graphics->fillRectangle(Rect(
4293  x, y, dx, height));
4294  return;
4295  }
4296  else if (width - dx <= 0)
4297  {
4298  graphics->setColor(userPalette->getColorWithAlpha(color2));
4299  graphics->fillRectangle(Rect(
4300  x, y, width, height));
4301  return;
4302  }
4303  }
4304  else
4305 #endif // TMWA_SUPPORT
4306  {
4307  if (hp == maxHP)
4308  {
4309  graphics->setColor(userPalette->getColorWithAlpha(color1));
4310  graphics->fillRectangle(Rect(
4311  x, y, dx, height));
4312  return;
4313  }
4314  else if (width - dx <= 0)
4315  {
4316  graphics->setColor(userPalette->getColorWithAlpha(color2));
4317  graphics->fillRectangle(Rect(
4318  x, y, width, height));
4319  return;
4320  }
4321  }
4322 
4323  graphics->setColor(userPalette->getColorWithAlpha(color1));
4324  graphics->fillRectangle(Rect(
4325  x, y, dx, height));
4326 
4327  graphics->setColor(userPalette->getColorWithAlpha(color2));
4328  graphics->fillRectangle(Rect(x + dx, y, width - dx, height));
4329 }
const Color & getColorWithAlpha(const UserColorIdT type)
Definition: userpalette.h:199
Definition: rect.h:72
UserPalette * userPalette
Definition: userpalette.cpp:33
Net::ServerFeatures * serverFeatures
Definition: net.cpp:100
virtual void setColor(const Color &color)
Definition: graphics.h:319
virtual bool haveServerHp() const =0
LocalPlayer * localPlayer
virtual void fillRectangle(const Rect &rectangle)=0

◆ drawMercenary()

void Being::drawMercenary ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3801 of file being.cpp.

References drawBeingCursor(), drawMercenarySpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by draw(), and getLastAttackY().

3804 {
3805  // getActorX() + offsetX;
3806  const int px = mPixelX - mapTileSize / 2 + offsetX;
3807  // getActorY() + offsetY;
3808  const int py = mPixelY - mapTileSize + offsetY;
3809  drawBeingCursor(graphics, px, py);
3810  drawMercenarySpriteAt(graphics, px, py);
3811 }
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
void drawMercenarySpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4111
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawMercenarySpriteAt()

void Being::drawMercenarySpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 4111 of file being.cpp.

References BeingAction::DEAD, drawHpBar(), CompoundSprite::drawSimple(), UserPalette::getColorWithAlpha(), BeingInfo::getHpBarOffsetX(), BeingInfo::getHpBarOffsetY(), BeingInfo::getMaxHP(), PlayerInfo::getMercenary(), PlayerInfo::getStatBase(), MercenaryInfo::id, Actions::info(), mAction, mapTileSize, mAttackRange, mDamageTaken, UserColorId::MERC_HP, Attributes::MERC_HP, UserColorId::MERC_HP2, Attributes::MERC_MAX_HP, mHighlightMonsterAttackRange, ActorSprite::mId, mInfo, UserColorId::MONSTER_ATTACK_RANGE, mShowMobHP, userPalette, x, and y.

Referenced by drawMercenary(), and getAllowNpcEquipment().

4114 {
4117  {
4118  if (userPalette == nullptr)
4119  {
4120  CompoundSprite::drawSimple(graphics, x, y);
4121  return;
4122  }
4123 
4124  int attackRange;
4125  if (mAttackRange != 0)
4126  attackRange = mapTileSize * mAttackRange;
4127  else
4128  attackRange = mapTileSize;
4129 
4132 
4133  graphics->fillRectangle(Rect(
4134  x - attackRange, y - attackRange,
4135  2 * attackRange + mapTileSize, 2 * attackRange + mapTileSize));
4136  }
4137 
4138  CompoundSprite::drawSimple(graphics, x, y);
4139 
4140  if (mShowMobHP &&
4141  (mInfo != nullptr))
4142  {
4143  const MercenaryInfo *const info = PlayerInfo::getMercenary();
4144  if ((info != nullptr) &&
4145  mId == info->id)
4146  {
4147  // show hp bar here
4149  if (maxHP == 0)
4150  maxHP = mInfo->getMaxHP();
4151 
4152  drawHpBar(graphics,
4153  maxHP,
4155  mDamageTaken,
4158  x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(),
4159  y + mapTileSize - 6 + mInfo->getHpBarOffsetY(),
4160  2 * 50,
4161  4);
4162  }
4163  }
4164 }
const Color & getColorWithAlpha(const UserColorIdT type)
Definition: userpalette.h:199
int getHpBarOffsetY() const
Definition: beinginfo.h:164
Definition: rect.h:72
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
UserPalette * userPalette
Definition: userpalette.cpp:33
MercenaryInfo * getMercenary()
Definition: playerinfo.cpp:548
static bool mHighlightMonsterAttackRange
Definition: being.h:1338
virtual void setColor(const Color &color)
Definition: graphics.h:319
static bool mShowMobHP
Definition: being.h:1342
bool info(InputEvent &event)
Definition: commands.cpp:56
int mDamageTaken
Definition: being.h:1327
int getStatBase(const AttributesT id)
Definition: playerinfo.cpp:134
virtual void fillRectangle(const Rect &rectangle)=0
int getHpBarOffsetX() const
Definition: beinginfo.h:158
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
Definition: being.cpp:4250
static const int mapTileSize
Definition: map.h:26
int mAttackRange
Definition: being.h:1225
int getMaxHP() const
Definition: beinginfo.h:170
BeingId mId
Definition: actorsprite.h:246
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232

◆ drawMonster()

void Being::drawMonster ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3777 of file being.cpp.

References drawBeingCursor(), drawMonsterSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by canTalk(), and draw().

3780 {
3781  // getActorX() + offsetX;
3782  const int px = mPixelX - mapTileSize / 2 + offsetX;
3783  // getActorY() + offsetY;
3784  const int py = mPixelY - mapTileSize + offsetY;
3785  drawBeingCursor(graphics, px, py);
3786  drawMonsterSpriteAt(graphics, px, py);
3787 }
void drawMonsterSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4002
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawMonsterSpriteAt()

void Being::drawMonsterSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 4002 of file being.cpp.

References BeingAction::DEAD, drawHpBar(), CompoundSprite::drawSimple(), UserPalette::getColorWithAlpha(), BeingInfo::getHpBarOffsetX(), BeingInfo::getHpBarOffsetY(), BeingInfo::getMaxHP(), LocalPlayer::getTarget(), localPlayer, mAction, mapTileSize, mAttackRange, mDamageTaken, mHighlightMonsterAttackRange, mHP, mInfo, mMaxHP, ActorType::Monster, UserColorId::MONSTER_ATTACK_RANGE, UserColorId::MONSTER_HP, UserColorId::MONSTER_HP2, mShowMobHP, mType, userPalette, x, and y.

Referenced by drawMonster(), and getAllowNpcEquipment().

4005 {
4009  {
4010  if (userPalette == nullptr)
4011  {
4012  CompoundSprite::drawSimple(graphics, x, y);
4013  return;
4014  }
4015 
4016  int attackRange;
4017  if (mAttackRange != 0)
4018  attackRange = mapTileSize * mAttackRange;
4019  else
4020  attackRange = mapTileSize;
4021 
4024 
4025  graphics->fillRectangle(Rect(
4026  x - attackRange, y - attackRange,
4027  2 * attackRange + mapTileSize, 2 * attackRange + mapTileSize));
4028  }
4029 
4030  CompoundSprite::drawSimple(graphics, x, y);
4031 
4032  if (mShowMobHP &&
4033  (mInfo != nullptr) &&
4034  (localPlayer != nullptr) &&
4035  localPlayer->getTarget() == this &&
4037  {
4038  // show hp bar here
4039  int maxHP = mMaxHP;
4040  if (maxHP == 0)
4041  maxHP = mInfo->getMaxHP();
4042 
4043  drawHpBar(graphics,
4044  maxHP,
4045  mHP,
4046  mDamageTaken,
4049  x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(),
4050  y + mapTileSize - 6 + mInfo->getHpBarOffsetY(),
4051  2 * 50,
4052  4);
4053  }
4054 }
const Color & getColorWithAlpha(const UserColorIdT type)
Definition: userpalette.h:199
int getHpBarOffsetY() const
Definition: beinginfo.h:164
Definition: rect.h:72
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
UserPalette * userPalette
Definition: userpalette.cpp:33
static bool mHighlightMonsterAttackRange
Definition: being.h:1338
virtual void setColor(const Color &color)
Definition: graphics.h:319
static bool mShowMobHP
Definition: being.h:1342
int mMaxHP
Definition: being.h:1329
LocalPlayer * localPlayer
int mDamageTaken
Definition: being.h:1327
virtual void fillRectangle(const Rect &rectangle)=0
int getHpBarOffsetX() const
Definition: beinginfo.h:158
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
Definition: being.cpp:4250
static const int mapTileSize
Definition: map.h:26
int mAttackRange
Definition: being.h:1225
int getMaxHP() const
Definition: beinginfo.h:170
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232
int mHP
Definition: being.h:1328
Being * getTarget() const
const ActorTypeT mType
Definition: being.h:1290

◆ drawNpc()

void Being::drawNpc ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3765 of file being.cpp.

References drawBeingCursor(), drawNpcSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by canTalk(), and draw().

3768 {
3769  // getActorX() + offsetX;
3770  const int px = mPixelX - mapTileSize / 2 + offsetX;
3771  // getActorY() + offsetY;
3772  const int py = mPixelY - mapTileSize + offsetY;
3773  drawBeingCursor(graphics, px, py);
3774  drawNpcSpriteAt(graphics, px, py);
3775 }
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
void drawNpcSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3995
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawNpcSpriteAt()

void Being::drawNpcSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 3995 of file being.cpp.

References drawCompound(), x, and y.

Referenced by drawNpc(), and getAllowNpcEquipment().

3998 {
3999  drawCompound(graphics, x, y);
4000 }
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3934

◆ drawOther()

void Being::drawOther ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3753 of file being.cpp.

References drawBeingCursor(), drawOtherSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by canTalk(), and draw().

3756 {
3757  // getActorX() + offsetX;
3758  const int px = mPixelX - mapTileSize / 2 + offsetX;
3759  // getActorY() + offsetY;
3760  const int py = mPixelY - mapTileSize + offsetY;
3761  drawBeingCursor(graphics, px, py);
3762  drawOtherSpriteAt(graphics, px, py);
3763 }
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
int mPixelX
Definition: actor.h:132
void drawOtherSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3988
int mPixelY
Definition: actor.h:133
static const int mapTileSize
Definition: map.h:26

◆ drawOtherSpriteAt()

void Being::drawOtherSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 3988 of file being.cpp.

References CompoundSprite::drawSimple(), x, and y.

Referenced by drawOther(), and getAllowNpcEquipment().

3991 {
3992  CompoundSprite::drawSimple(graphics, x, y);
3993 }
void drawSimple(Graphics *const graphics, const int posX, const int posY) const

◆ drawPlayer()

void Being::drawPlayer ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3691 of file being.cpp.

References HorseOffset::downOffsetX, HorseOffset::downOffsetY, drawBeingCursor(), drawPlayerSpriteAt(), for_each_horses, mapTileSize, mDownHorseSprites, mErased, mHorseInfo, Actor::mPixelX, Actor::mPixelY, mSpriteDirection, mUpHorseSprites, HorseInfo::offsets, HorseOffset::riderOffsetX, HorseOffset::riderOffsetY, HorseOffset::upOffsetX, and HorseOffset::upOffsetY.

Referenced by canTalk(), and draw().

3694 {
3695  if (!mErased)
3696  {
3697  // getActorX() + offsetX;
3698  const int px = mPixelX - mapTileSize / 2 + offsetX;
3699  // getActorY() + offsetY;
3700  const int py = mPixelY - mapTileSize + offsetY;
3701  if (mHorseInfo != nullptr)
3702  {
3705  {
3706  (*it)->draw(graphics,
3707  px + offset.downOffsetX,
3708  py + offset.downOffsetY);
3709  }
3710 
3711  drawBeingCursor(graphics, px, py);
3712  drawPlayerSpriteAt(graphics,
3713  px + offset.riderOffsetX,
3714  py + offset.riderOffsetY);
3715 
3717  {
3718  (*it)->draw(graphics,
3719  px + offset.upOffsetX,
3720  py + offset.upOffsetY);
3721  }
3722  }
3723  else
3724  {
3725  drawBeingCursor(graphics, px, py);
3726  drawPlayerSpriteAt(graphics, px, py);
3727  }
3728  }
3729 }
#define for_each_horses(name)
Definition: being.cpp:158
SpriteDirection::Type mSpriteDirection
Definition: being.h:1236
std::vector< AnimatedSprite * > mDownHorseSprites
Definition: being.h:1313
int downOffsetX
Definition: horseoffset.h:41
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3731
std::vector< AnimatedSprite * > mUpHorseSprites
Definition: being.h:1314
bool mErased
Definition: being.h:1380
int mPixelX
Definition: actor.h:132
int downOffsetY
Definition: horseoffset.h:42
int mPixelY
Definition: actor.h:133
int riderOffsetX
Definition: horseoffset.h:43
void drawPlayerSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3964
HorseInfo * mHorseInfo
Definition: being.h:1312
int riderOffsetY
Definition: horseoffset.h:44
static const int mapTileSize
Definition: map.h:26
HorseOffset offsets[10]
Definition: horseinfo.h:53

◆ drawPlayerSpriteAt()

void Being::drawPlayerSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 3964 of file being.cpp.

References BeingAction::DEAD, drawCompound(), drawHpBar(), PlayerInfo::getAttribute(), BeingInfo::getHpBarOffsetX(), BeingInfo::getHpBarOffsetY(), localPlayer, mAction, mapTileSize, mInfo, mShowOwnHP, Attributes::PLAYER_HP, UserColorId::PLAYER_HP, UserColorId::PLAYER_HP2, Attributes::PLAYER_MAX_HP, x, and y.

Referenced by drawPlayer(), and getAllowNpcEquipment().

3967 {
3968  drawCompound(graphics, x, y);
3969 
3970  if (mShowOwnHP &&
3971  (mInfo != nullptr) &&
3972  localPlayer == this &&
3974  {
3975  drawHpBar(graphics,
3978  0,
3981  x - 50 + mapTileSize / 2 + mInfo->getHpBarOffsetX(),
3982  y + mapTileSize - 6 + mInfo->getHpBarOffsetY(),
3983  2 * 50,
3984  4);
3985  }
3986 }
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3934
int getHpBarOffsetY() const
Definition: beinginfo.h:164
LocalPlayer * localPlayer
int getHpBarOffsetX() const
Definition: beinginfo.h:158
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
Definition: being.cpp:4250
static const int mapTileSize
Definition: map.h:26
static bool mShowOwnHP
Definition: being.h:1343
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:101
BeingInfo * mInfo
Definition: being.h:1176
BeingActionT mAction
Definition: being.h:1232

◆ drawPlayerSprites()

void Being::drawPlayerSprites ( Graphics *const  graphics,
const int  posX,
const int  posY 
) const

Definition at line 3890 of file being.cpp.

References CompoundSprite::getNumberOfLayers(), Sprite::mAlpha, mSpriteHide, mSpriteRemap, CompoundSprite::mSprites, and restrict.

Referenced by drawCompound(), and setDistance().

3893 {
3894  const int sz = CompoundSprite::getNumberOfLayers();
3895  for (int f = 0; f < sz; f ++)
3896  {
3897  const int rSprite = mSpriteHide[mSpriteRemap[f]];
3898  if (rSprite == 1)
3899  continue;
3900 
3901  Sprite *restrict const sprite = mSprites[mSpriteRemap[f]];
3902  if (sprite != nullptr)
3903  {
3904  sprite->setAlpha(mAlpha);
3905  sprite->draw(graphics, posX, posY);
3906  }
3907  }
3908 }
Definition: sprite.h:32
int getNumberOfLayers() const
int * mSpriteHide
Definition: being.h:1304
std::vector< Sprite * > mSprites
int * mSpriteRemap
Definition: being.h:1303
#define restrict
Definition: localconsts.h:164
float mAlpha
Definition: sprite.h:129

◆ drawPortal()

void Being::drawPortal ( Graphics *const  graphics,
const int  offsetX,
const int  offsetY 
) const

Definition at line 3825 of file being.cpp.

References drawPortalSpriteAt(), mapTileSize, Actor::mPixelX, and Actor::mPixelY.

Referenced by canTalk(), and draw().

3828 {
3829  // getActorX() + offsetX;
3830  const int px = mPixelX - mapTileSize / 2 + offsetX;
3831  // getActorY() + offsetY;
3832  const int py = mPixelY - mapTileSize + offsetY;
3833  drawPortalSpriteAt(graphics, px, py);
3834 }
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
void drawPortalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4219
static const int mapTileSize
Definition: map.h:26

◆ drawPortalSpriteAt()

void Being::drawPortalSpriteAt ( Graphics *const  graphics,
const int  x,
const int  y 
) const
protected

Definition at line 4219 of file being.cpp.

References UserColorId::BEING, CompoundSprite::drawSimple(), Font::drawString(), UserPalette::getColor(), Gui::getFont(), Map::getHasWarps(), gui, mapTileSize, mDrawHotKeys, mHighlightMapPortals, Actor::mMap, mName, UserColorId::PORTAL_HIGHLIGHT, userPalette, x, and y.

Referenced by drawPortal(), and getAllowNpcEquipment().

4222 {
4223  if (mHighlightMapPortals &&
4224  (mMap != nullptr) &&
4225  !mMap->getHasWarps())
4226  {
4227  if (userPalette == nullptr)
4228  {
4229  CompoundSprite::drawSimple(graphics, x, y);
4230  return;
4231  }
4232 
4233  graphics->setColor(userPalette->
4234  getColorWithAlpha(UserColorId::PORTAL_HIGHLIGHT));
4235 
4236  graphics->fillRectangle(Rect(x, y,
4238 
4239  if (mDrawHotKeys && !mName.empty())
4240  {
4241  const Color &color = userPalette->getColor(UserColorId::BEING,
4242  255U);
4243  gui->getFont()->drawString(graphics, color, color, mName, x, y);
4244  }
4245  }
4246 
4247  CompoundSprite::drawSimple(graphics, x, y);
4248 }
static bool mDrawHotKeys
Definition: being.h:1340
const Color & getColor(UserColorIdT type, const unsigned int alpha)
Definition: userpalette.h:159
Gui * gui
Definition: gui.cpp:110
Definition: rect.h:72
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
static bool mHighlightMapPortals
Definition: being.h:1337
Font * getFont() const
Definition: gui.h:159
UserPalette * userPalette
Definition: userpalette.cpp:33
std::string mName
Definition: being.h:1183
virtual void setColor(const Color &color)
Definition: graphics.h:319
bool getHasWarps() const
Definition: map.h:246
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
Definition: font.cpp:253
virtual void fillRectangle(const Rect &rectangle)=0
static const int mapTileSize
Definition: map.h:26
Definition: color.h:74
Map * mMap
Definition: actor.h:138

◆ drawSpeech()

void Being::drawSpeech ( const int  offsetX,
const int  offsetY 
)

Draws the speech text above the being.

Definition at line 2404 of file being.cpp.

References Text::adviseXY(), ThemeColorId::BUBBLE_TEXT, Graphics::CENTER, delete2, Theme::getColor(), Text::getHeight(), Widget::getHeight(), getHeight(), Widget::getWidth(), mapTileSize, mErased, mMoveNames, Actor::mPixelX, Actor::mPixelY, mSpeech, mSpeechBubble, mSpeechTime, mSpeechType, mText, Widget::mVisible, mY, BeingSpeech::NAME_IN_BUBBLE, BeingSpeech::NO_NAME_IN_BUBBLE, BeingSpeech::NO_SPEECH, Widget::setPosition(), Widget::setVisible(), Speech_true, MailMessageType::Text, BeingSpeech::TEXT_OVERHEAD, theme, userPalette, Visible_false, and Visible_true.

Referenced by getNumberOfLayers().

2406 {
2407  if (mErased)
2408  return;
2409  if (mSpeech.empty())
2410  return;
2411 
2412  const int px = mPixelX - offsetX;
2413  const int py = mPixelY - offsetY;
2414  const int speech = mSpeechType;
2415 
2416  // Draw speech above this being
2417  if (mSpeechTime == 0)
2418  {
2419  if (mSpeechBubble != nullptr &&
2421  {
2423  }
2424  mSpeech.clear();
2425  }
2426  else if (mSpeechTime > 0 && (speech == BeingSpeech::NAME_IN_BUBBLE ||
2427  speech == BeingSpeech::NO_NAME_IN_BUBBLE))
2428  {
2429  delete2(mText)
2430 
2431  if (mSpeechBubble != nullptr)
2432  {
2434  py - getHeight() - (mSpeechBubble->getHeight()));
2436  }
2437  }
2438  else if (mSpeechTime > 0 && speech == BeingSpeech::TEXT_OVERHEAD)
2439  {
2440  if (mSpeechBubble != nullptr)
2442 
2443  if ((mText == nullptr) && (userPalette != nullptr))
2444  {
2445  mText = new Text(mSpeech,
2446  mPixelX,
2447  mPixelY - getHeight(),
2450  Speech_true,
2451  nullptr);
2453  (mY + 1) * mapTileSize - getHeight() - mText->getHeight() - 9,
2454  mMoveNames);
2455  }
2456  }
2457  else if (speech == BeingSpeech::NO_SPEECH)
2458  {
2459  if (mSpeechBubble != nullptr)
2461  delete2(mText)
2462  }
2463 }
int mSpeechTime
Definition: being.h:1220
int getWidth() const
Definition: widget.h:220
const bool Visible_true
Definition: visible.h:29
void setVisible(Visible visible)
Definition: widget.cpp:224
#define delete2(var)
Definition: delete2.h:24
Text * mText
Definition: being.h:1201
UserPalette * userPalette
Definition: userpalette.cpp:33
bool mErased
Definition: being.h:1380
Visible mVisible
Definition: widget.h:962
std::string mSpeech
Definition: being.h:1189
int mPixelX
Definition: actor.h:132
SpeechBubble * mSpeechBubble
Definition: being.h:1293
const Color & getColor(const ThemeColorIdT type, const unsigned int alpha)
Definition: theme.h:135
const bool Visible_false
Definition: visible.h:29
void setPosition(const int x, const int y)
Definition: widget.cpp:160
int mPixelY
Definition: actor.h:133
int getHeight() const
Definition: text.h:65
static int mSpeechType
Definition: being.h:1336
const bool Speech_true
Definition: speech.h:29
Theme * theme
Definition: theme.cpp:61
int mY
Definition: being.h:1318
int getHeight() const
Definition: being.h:535
static Move mMoveNames
Definition: being.h:1349
int getHeight() const
Definition: widget.h:239
static const int mapTileSize
Definition: map.h:26
void adviseXY(const int x, const int y, const Move move)
Definition: text.cpp:143

◆ drawSpritesSDL()

void Being::drawSpritesSDL ( Graphics *const  graphics,
const int  posX,
const int  posY 
) const
virtual

Reimplemented from CompoundSprite.

Definition at line 3910 of file being.cpp.

References mSpriteHide, mSpriteRemap, CompoundSprite::mSprites, and restrict.

Referenced by setDistance().

3913 {
3914  const size_t sz = mSprites.size();
3915  for (size_t f = 0; f < sz; f ++)
3916  {
3917  const int rSprite = mSpriteHide[mSpriteRemap[f]];
3918  if (rSprite == 1)
3919  continue;
3920 
3921  const Sprite *restrict const sprite = mSprites[mSpriteRemap[f]];
3922  if (sprite != nullptr)
3923  sprite->draw(graphics, posX, posY);
3924  }
3925 }
Definition: sprite.h:32
int * mSpriteHide
Definition: being.h:1304
std::vector< Sprite * > mSprites
int * mSpriteRemap
Definition: being.h:1303
#define restrict
Definition: localconsts.h:164

◆ dumpSprites()

void Being::dumpSprites ( ) const
protected

Definition at line 3406 of file being.cpp.

References Logger::log(), logger, mSlots, and toInt.

3407 {
3408  STD_VECTOR<BeingSlot>::const_iterator it1 = mSlots.begin();
3409  const STD_VECTOR<BeingSlot>::const_iterator it1_end = mSlots.end();
3410 
3411  logger->log("sprites");
3412  for (; it1 != it1_end;
3413  ++ it1)
3414  {
3415  logger->log("%d,%s,%d",
3416  (*it1).spriteId,
3417  (*it1).color.c_str(),
3418  toInt((*it1).colorId, int));
3419  }
3420 }
Logger * logger
Definition: logger.cpp:88
std::vector< BeingSlot > mSlots
Definition: being.h:1209
#define toInt(val, name)
Definition: intdefines.h:46
void log(const char *const log_text,...)
Definition: logger.cpp:264

◆ enableBotAi()

void Being::enableBotAi ( )
inline

Definition at line 1049 of file being.h.

References mBotAi.

1050  { mBotAi = true; }
bool mBotAi
Definition: being.h:1388

◆ enableShop()

void Being::enableShop ( const bool  b)

Definition at line 5341 of file being.cpp.

References mShop, showShopBadge(), and updateName().

Referenced by ShopWindow::buyingStoreEnabled(), setAdvanced(), and ShopWindow::vendingEnabled().

5342 {
5343  mShop = b;
5344  updateName();
5346 }
void showShopBadge(const bool show)
Definition: being.cpp:5252
bool mShop
Definition: being.h:1384
void updateName()
Definition: being.cpp:3422

◆ fireMissile()

void Being::fireMissile ( Being *const  victim,
const MissileInfo missile 
) const

Shoots a missile particle from this being, to target being

Definition at line 1377 of file being.cpp.

References BLOCK_END, BLOCK_START, ParticleEngine::createChild(), Actor::mPixelX, Actor::mPixelY, particleEngine, and restrict.

Referenced by getHeight(), handleAttack(), handleSkill(), and handleSkillCasting().

1379 {
1380  BLOCK_START("Being::fireMissile")
1381 
1382  if (victim == nullptr ||
1383  missile.particle.empty() ||
1384  particleEngine == nullptr)
1385  {
1386  BLOCK_END("Being::fireMissile")
1387  return;
1388  }
1389 
1390  Particle *restrict const target = particleEngine->createChild();
1391 
1392  if (target == nullptr)
1393  {
1394  BLOCK_END("Being::fireMissile")
1395  return;
1396  }
1397 
1398  // +++ add z particle position?
1399  Particle *restrict const missileParticle = target->addEffect(
1400  missile.particle,
1401  mPixelX,
1402  mPixelY,
1403  0);
1404 
1405  target->moveBy(Vector(0.0F, 0.0F, missile.z));
1406  target->setLifetime(missile.lifeTime);
1407  victim->controlAutoParticle(target);
1408 
1409  if (missileParticle != nullptr)
1410  {
1411  missileParticle->setDestination(target, missile.speed, 0.0F);
1412  missileParticle->setDieDistance(missile.dieDistance);
1413  missileParticle->setLifetime(missile.lifeTime);
1414  }
1415  BLOCK_END("Being::fireMissile")
1416 }
Definition: vector.h:38
#define BLOCK_START(name)
Definition: perfomance.h:78
ParticleEngine * particleEngine
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:79
void controlAutoParticle(Particle *const particle)
int mPixelX
Definition: actor.h:132
int mPixelY
Definition: actor.h:133
std::string empty
Definition: podict.cpp:25
float dieDistance
Definition: missileinfo.h:43
#define restrict
Definition: localconsts.h:164
void addEffect(const std::string &name)
Definition: being.cpp:4956
float speed
Definition: missileinfo.h:42

◆ fixDirectionOffsets()

void Being::fixDirectionOffsets ( int &  offsetX,
int &  offsetY 
) const

Definition at line 5525 of file being.cpp.

References BeingDirection::DOWN, BeingDirection::LEFT, mDirection, BeingDirection::RIGHT, and BeingDirection::UP.

Referenced by getGroupId(), SkillDialog::useSkillDefault(), SkillDialog::useSkillPosition(), and SkillDialog::useSkillTarget().

5527 {
5528  const uint8_t dir = mDirection;
5529  if ((dir & BeingDirection::DOWN) != 0)
5530  {
5531  // do nothing
5532  }
5533  else if ((dir & BeingDirection::UP) != 0)
5534  {
5535  offsetX = -offsetX;
5536  offsetY = -offsetY;
5537  }
5538  else if ((dir & BeingDirection::LEFT) != 0)
5539  {
5540  const int tmp = offsetY;
5541  offsetY = offsetX;
5542  offsetX = -tmp;
5543  }
5544  else if ((dir & BeingDirection::RIGHT) != 0)
5545  {
5546  const int tmp = offsetY;
5547  offsetY = -offsetX;
5548  offsetX = tmp;
5549  }
5550 }
uint8_t mDirection
Definition: being.h:1234

◆ flashName()

void Being::flashName ( const int  time)

Definition at line 2531 of file being.cpp.

References FlashText::flash(), mDispName, and ServerCommandType::time.

Referenced by setDistance().

2532 {
2533  if (mDispName != nullptr)
2534  mDispName->flash(time);
2535 }
FlashText * mDispName
Definition: being.h:1194
void flash(const int time)
Definition: text.h:119

◆ genderToInt()

static uint8_t Being::genderToInt ( const GenderT  sex)
inlinestatic

Definition at line 926 of file being.h.

References Gender::FEMALE, Gender::HIDDEN, Gender::MALE, and Gender::UNSPECIFIED.

Referenced by EAthena::GameHandler::connect(), TmwAthena::GameHandler::connect(), EAthena::CharServerHandler::connect(), TmwAthena::CharServerHandler::connect(), and EAthena::CharServerHandler::newCharacter().

928  {
929  switch (sex)
930  {
931  case Gender::FEMALE:
932  case Gender::UNSPECIFIED:
933  default:
934  return 0;
935  case Gender::MALE:
936  return 1;
937  case Gender::HIDDEN:
938  return 3;
939  }
940  }

◆ getActionTime()

int Being::getActionTime ( ) const
inline

Returns the time spent in the current action.

Definition at line 127 of file being.h.

References mActionTime.

Referenced by Viewport::getMouseTile().

128  { return mActionTime; }
int mActionTime
Definition: being.h:1216

◆ getAllowNpcEquipment()

bool Being::getAllowNpcEquipment ( ) const
inline

◆ getAreaSize()

int Being::getAreaSize ( ) const
inline

Definition at line 1052 of file being.h.

References mAreaSize.

1053  { return mAreaSize; }
int mAreaSize
Definition: being.h:1370

◆ getAttackAction() [1/2]

std::string Being::getAttackAction ( ) const

Definition at line 1524 of file being.cpp.

Referenced by getAttackAction(), getGender(), getWeaponAttackAction(), and setAction().

◆ getAttackAction() [2/2]

std::string Being::getAttackAction ( const Attack *const  attack1) const

Definition at line 1470 of file being.cpp.

References BlockMask::AIR, getAttackAction(), Map::getBlockMask(), ActorSprite::mHorseId, Actor::mMap, mX, mY, and BlockMask::WATER.

1472 {
1473  if (attack1 == nullptr)
1474  return getAttackAction();
1475 
1476  if (mHorseId != 0)
1477  return attack1->mRideAction;
1478  if (mMap != nullptr)
1479  {
1480  const unsigned char mask = mMap->getBlockMask(mX, mY);
1481  if ((mask & BlockMask::AIR) != 0)
1482  return attack1->mSkyAction;
1483  else if ((mask & BlockMask::WATER) != 0)
1484  return attack1->mWaterAction;
1485  }
1486  return attack1->mAction;
1487 }
std::string mAction
Definition: attack.h:30
unsigned char getBlockMask(const int x, const int y) const
Definition: map.cpp:795
std::string mSkyAction
Definition: attack.h:31
int mX
Definition: being.h:1317
std::string mRideAction
Definition: attack.h:33
int mY
Definition: being.h:1318
std::string mWaterAction
Definition: attack.h:32
std::string getAttackAction() const
Definition: being.cpp:1524
Map * mMap
Definition: actor.h:138

◆ getAttackDelay()

int Being::getAttackDelay ( ) const
inline

Definition at line 772 of file being.h.

References mAttackDelay.

Referenced by TargetDebugTab::logic().

773  { return mAttackDelay; }
int mAttackDelay
Definition: being.h:1360

◆ getAttackSpeed()

int Being::getAttackSpeed ( ) const
inline

Gets the attack speed.

Definition at line 469 of file being.h.

References mAttackSpeed, restrict, restrict2, and LocalPlayer::setAction().

470  { return mAttackSpeed; }
int mAttackSpeed
Definition: being.h:1221

◆ getAttackTime()

time_t Being::getAttackTime ( ) const
inline

Definition at line 723 of file being.h.

References mAttackTime.

724  { return mAttackTime; }
time_t mAttackTime
Definition: being.h:1356

◆ getBlockType()

BlockTypeT Being::getBlockType ( ) const
inlinevirtual

Gets the way the monster blocks pathfinding for other objects

Reimplemented from ActorSprite.

Definition at line 441 of file being.h.

References BeingInfo::getBlockType(), mInfo, and BlockType::NONE.

442  {
443  if (mInfo == nullptr)
444  return BlockType::NONE;
445  return mInfo->getBlockType();
446  }
BlockTypeT getBlockType() const
Definition: beinginfo.h:128
BeingInfo * mInfo
Definition: being.h:1176

◆ getBlockWalkMask()

virtual unsigned char Being::getBlockWalkMask ( ) const
inlinevirtual

Gets the way the object is blocked by other objects.

Reimplemented in LocalPlayer.

Definition at line 431 of file being.h.

References BeingInfo::getBlockWalkMask(), and mInfo.

Referenced by botFixOffset(), moveBotTo(), nextTile(), and setDestination().

432  {
433  if (mInfo == nullptr)
434  return 0;
435  return mInfo->getBlockWalkMask();
436  }
unsigned char getBlockWalkMask() const
Definition: beinginfo.h:122
BeingInfo * mInfo
Definition: being.h:1176

◆ getBuyBoard()

std::string Being::getBuyBoard ( ) const
inline

Definition at line 1018 of file being.h.

References mBuyBoard, restrict2, and setSpiritBalls().

Referenced by BeingPopup::show().

1019  { return mBuyBoard; }
std::string mBuyBoard
Definition: being.h:1307

◆ getCachedX()

int Being::getCachedX ( ) const
inline

Definition at line 152 of file being.h.

References mCachedX.

Referenced by Ea::BeingRecv::processBeingMove3().

153  { return mCachedX; }
int mCachedX
Definition: being.h:1319

◆ getCachedY()

int Being::getCachedY ( ) const
inline

Definition at line 155 of file being.h.

References mCachedY.

Referenced by Ea::BeingRecv::processBeingMove3().

156  { return mCachedY; }
int mCachedY
Definition: being.h:1320

◆ getCacheEntry()

BeingCacheEntry * Being::getCacheEntry ( const BeingId  id)
static

Definition at line 3556 of file being.cpp.

References beingInfoCache, cur_time, and FOR_EACH.

Referenced by addToCache(), getReachable(), and updateFromCache().

3557 {
3558  FOR_EACH (std::list<BeingCacheEntry*>::iterator, i, beingInfoCache)
3559  {
3560  if (*i == nullptr)
3561  continue;
3562 
3563  if (id == (*i)->getId())
3564  {
3565  // Raise priority: move it to front
3566  if ((*i)->getTime() + 120 < cur_time)
3567  {
3568  beingInfoCache.splice(beingInfoCache.begin(),
3569  beingInfoCache, i);
3570  }
3571  return *i;
3572  }
3573  }
3574  return nullptr;
3575 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
std::list< BeingCacheEntry * > beingInfoCache
Definition: being.cpp:147
volatile time_t cur_time
Definition: timer.cpp:57

◆ getCastAction() [1/2]

std::string Being::getCastAction ( ) const

Definition at line 1525 of file being.cpp.

Referenced by getCastAction(), getGender(), and setAction().

◆ getCastAction() [2/2]

std::string Being::getCastAction ( const SkillInfo *const  skill) const

Definition at line 1489 of file being.cpp.

References BlockMask::AIR, Map::getBlockMask(), getCastAction(), ActorSprite::mHorseId, Actor::mMap, mX, mY, Actions::skill(), and BlockMask::WATER.

1491 {
1492  if (skill == nullptr)
1493  return getCastAction();
1494 
1495  if (mHorseId != 0)
1496  return skill->castingRideAction;
1497  if (mMap != nullptr)
1498  {
1499  const unsigned char mask = mMap->getBlockMask(mX, mY);
1500  if ((mask & BlockMask::AIR) != 0)
1501  return skill->castingSkyAction;
1502  else if ((mask & BlockMask::WATER) != 0)
1503  return skill->castingWaterAction;
1504  }
1505  return skill->castingAction;
1506 }
std::string castingWaterAction
Definition: skillinfo.h:58
std::string castingRideAction
Definition: skillinfo.h:56
unsigned char getBlockMask(const int x, const int y) const
Definition: map.cpp:795
std::string getCastAction() const
Definition: being.cpp:1525
std::string castingAction
Definition: skillinfo.h:55
int mX
Definition: being.h:1317
std::string castingSkyAction
Definition: skillinfo.h:57
int mY
Definition: being.h:1318
Map * mMap
Definition: actor.h:138

◆ getChat()

ChatObject* Being::getChat ( ) const
inline

◆ getClanName()

const std::string& Being::getClanName ( ) const
inline

Definition at line 262 of file being.h.

References A_WARN_UNUSED, addGuild(), getGuild(), guild, mClanName, removeGuild(), restrict, restrict2, setClanName(), setGuildName(), and setGuildPos().

Referenced by BeingPopup::show().

264  { return mClanName; }
std::string mClanName
Definition: being.h:1188

◆ getComment()

const std::string Being::getComment ( ) const
inline

Definition at line 811 of file being.h.

References mComment.

Referenced by PopupMenu::handleLink(), and BeingPopup::show().

812  { return mComment; }
std::string mComment
Definition: being.h:1306

◆ getCreatorId()

BeingId Being::getCreatorId ( ) const
inline

Definition at line 1031 of file being.h.

References mCreatorId.

Referenced by PopupMenu::showPopup().

1032  { return mCreatorId; }
BeingId mCreatorId
Definition: being.h:1375

◆ getCriticalHit()

int Being::getCriticalHit ( ) const
inline

Definition at line 787 of file being.h.

References mCriticalHit.

Referenced by TargetDebugTab::logic().

788  { return mCriticalHit; }
int mCriticalHit
Definition: being.h:1363

◆ getCurrentAction()

BeingActionT Being::getCurrentAction ( ) const
inline

◆ getDamageTaken()

int Being::getDamageTaken ( ) const
inline

Definition at line 592 of file being.h.

References mDamageTaken.

Referenced by ActorManager::findMostDamagedPlayer(), BeingPopup::show(), showName(), and SocialPlayersTab::updateAvatar().

593  { return mDamageTaken; }
int mDamageTaken
Definition: being.h:1327

◆ getDeadAction()

std::string Being::getDeadAction ( ) const

Definition at line 1526 of file being.cpp.

Referenced by getGender(), and setAction().

◆ getDefaultEffectId()

int Being::getDefaultEffectId ( const AttackTypeT type)
staticprotected

Definition at line 952 of file being.cpp.

References AttackType::CRITICAL, Configuration::getIntValue(), AttackType::MISS, and paths.

Referenced by getAllowNpcEquipment(), and getHitEffect().

953 {
954  if (type == AttackType::MISS)
955  return paths.getIntValue("missEffectId");
956  else if (type != AttackType::CRITICAL)
957  return paths.getIntValue("hitEffectId");
958  else
959  return paths.getIntValue("criticalHitEffectId");
960 }
int getIntValue(const std::string &key) const
Configuration paths

◆ getDestination()

const Vector& Being::getDestination ( ) const
inline

Returns the destination for this being.

Definition at line 161 of file being.h.

References mDest.

162  { return mDest; }
Vector mDest
Definition: being.h:1204

◆ getDirection()

uint8_t Being::getDirection ( ) const
inline

◆ getDirectionDelayed()

uint8_t Being::getDirectionDelayed ( ) const
inline

◆ getDistance()

int Being::getDistance ( ) const
inline

Definition at line 551 of file being.h.

References mDistance.

Referenced by ActorManager::findNearestLivingBeing().

552  { return mDistance; }
int mDistance
Definition: being.h:1330

◆ getEquipment()

Equipment * Being::getEquipment ( )

Definition at line 4694 of file being.cpp.

References BeingEquipBackend, doctest::detail::binaryAssertComparison::eq, DragDropSource::Equipment, and restrict.

Referenced by EquipmentWindow::setBeing().

4695 {
4696  Equipment *restrict const eq = new Equipment;
4697  Equipment::Backend *restrict const bk = new BeingEquipBackend(this);
4698  eq->setBackend(bk);
4699  return eq;
4700 }
friend class BeingEquipBackend
Definition: being.h:98
#define restrict
Definition: localconsts.h:164

◆ getEquippedWeapon()

const ItemInfo* Being::getEquippedWeapon ( ) const
inline

Definition at line 225 of file being.h.

References mEquippedWeapon.

226  { return mEquippedWeapon; }
const ItemInfo * mEquippedWeapon
Definition: being.h:1198

◆ getExtName()

const std::string& Being::getExtName ( ) const
inline

Definition at line 234 of file being.h.

References mExtName, restrict, restrict2, and setName().

Referenced by PopupMenu::showChatPopup(), and PopupMenu::showPopup().

235  { return mExtName; }
std::string mExtName
Definition: being.h:1184

◆ getGender()

GenderT Being::getGender ( ) const
inline

◆ getGenderSign()

std::string Being::getGenderSign ( ) const

Definition at line 2546 of file being.cpp.

References _, Gender::FEMALE, getGender(), BadgeDrawType::Hide, Gender::MALE, mAway, mInactive, mShop, mShowBadges, mShowGender, mShowPlayersStatus, and ServerCommandType::str.

Referenced by getGenderSignWithSpace(), setGoodStatus(), and showName().

2547 {
2548  std::string str;
2549  if (mShowGender)
2550  {
2551  if (getGender() == Gender::FEMALE)
2552  str = "\u2640";
2553  else if (getGender() == Gender::MALE)
2554  str = "\u2642";
2555  }
2556  if (mShowPlayersStatus &&
2558  {
2559  if (mShop)
2560  str.append("$");
2561  if (mAway)
2562  {
2563  // TRANSLATORS: this away status writed in player nick
2564  str.append(_("A"));
2565  }
2566  else if (mInactive)
2567  {
2568  // TRANSLATORS: this inactive status writed in player nick
2569  str.append(_("I"));
2570  }
2571  }
2572  return str;
2573 }
#define _(s)
Definition: gettext.h:34
GenderT getGender() const
Definition: being.h:625
bool mInactive
Definition: being.h:1386
static bool mShowGender
Definition: being.h:1344
bool mShop
Definition: being.h:1384
static bool mShowPlayersStatus
Definition: being.h:1346
static BadgeDrawType::Type mShowBadges
Definition: being.h:1351
bool mAway
Definition: being.h:1385

◆ getGenderSignWithSpace()

std::string Being::getGenderSignWithSpace ( ) const

Definition at line 2537 of file being.cpp.

References getGenderSign(), restrict, and ServerCommandType::str.

Referenced by setGoodStatus(), BeingPopup::show(), and PopupMenu::showPopup().

2538 {
2539  const std::string &restrict str = getGenderSign();
2540  if (str.empty())
2541  return str;
2542  else
2543  return std::string(" ").append(str);
2544 }
#define restrict
Definition: localconsts.h:164
std::string getGenderSign() const
Definition: being.cpp:2546

◆ getGoodStatus()

int Being::getGoodStatus ( ) const
inline

Definition at line 799 of file being.h.

References mGoodStatus.

Referenced by PlayerRelationsManager::isGoodName().

800  { return mGoodStatus; }
int mGoodStatus
Definition: being.h:1332

◆ getGroupId()

int Being::getGroupId ( ) const
inline

◆ getGuild() [1/3]

const Guild * Being::getGuild ( const std::string &  guildName) const

Returns a pointer to the specified guild that the being is in.

Definition at line 1257 of file being.cpp.

References FOR_EACH, guild, mGuilds, and restrict.

Referenced by ActorManager::addChar(), PopupMenu::addSocialMenu(), SocialGuildTab2::buildCounter(), SocialGuildTab::buildCounter(), Actions::changeRelation(), Minimap::draw2(), NotifyManager::getGuildTab(), PopupMenu::handleLink(), Actions::outString(), outStringNormal(), SocialWindow::postInit(), WhoIsOnline::setNeutralColor(), PopupMenu::showChangePos(), PopupMenu::showChatPopup(), PopupMenu::showPlayerPopup(), PopupMenu::showPopup(), Actions::splitWhisper(), updateColors(), updateGuild(), SocialWindow::updateGuildCounter(), and ChatWindow::updateOnline().

1259 {
1261  {
1262  const Guild *restrict const guild = itr->second;
1263  if ((guild != nullptr) && guild->getName() == guildName)
1264  return guild;
1265  }
1266 
1267  return nullptr;
1268 }
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
std::map< int, Guild * >::const_iterator GuildsMapCIter
Definition: being.cpp:148
#define restrict
Definition: localconsts.h:164
std::map< int, Guild * > mGuilds
Definition: being.h:1213
uint32_t guild
Definition: guild.h:68

◆ getGuild() [2/3]

const Guild * Being::getGuild ( const int  id) const

Returns a pointer to the specified guild that the being is in.

Definition at line 1270 of file being.cpp.

References mGuilds.

1271 {
1272  const std::map<int, Guild*>::const_iterator itr = mGuilds.find(id);
1273  if (itr != mGuilds.end())
1274  return itr->second;
1275 
1276  return nullptr;
1277 }
std::map< int, Guild * > mGuilds
Definition: being.h:1213

◆ getGuild() [3/3]

Guild * Being::getGuild ( ) const

Returns a pointer to the specified guild that the being is in.

Definition at line 1279 of file being.cpp.

References mGuilds.

Referenced by LocalPlayer::checkNewName(), getClanName(), setGuild(), and updateColors().

1280 {
1281  const std::map<int, Guild*>::const_iterator itr = mGuilds.begin();
1282  if (itr != mGuilds.end())
1283  return itr->second;
1284 
1285  return nullptr;
1286 }
std::map< int, Guild * > mGuilds
Definition: being.h:1213

◆ getGuildName()

const std::string& Being::getGuildName ( ) const
inline

Definition at line 258 of file being.h.

References mGuildName.

Referenced by addToCache(), Minimap::draw2(), TargetDebugTab::logic(), BeingPopup::show(), and PopupMenu::showPlayerGMCommands().

260  { return mGuildName; }
std::string mGuildName
Definition: being.h:1187

◆ getGuilds()

const std::map<int, Guild*>& Being::getGuilds ( ) const
inline

Returns all guilds the being is in.

Definition at line 305 of file being.h.

References clearGuilds(), anonymous_namespace{badgesdb.cpp}::mGuilds, and restrict2.

307  { return mGuilds; }
std::map< int, Guild * > mGuilds
Definition: being.h:1213

◆ getHairColor()

ItemColor Being::getHairColor ( ) const
inline

Definition at line 882 of file being.h.

References getHitEffect(), mHairColor, recalcSpritesOrder(), restrict, and restrict2.

Referenced by ActorManager::cloneBeing().

883  { return mHairColor; }
ItemColor mHairColor
Definition: being.h:1379

◆ getHeight()

int Being::getHeight ( ) const
inlinevirtual

Returns the vertical size of the current base sprite of the being.

Reimplemented from ActorSprite.

Definition at line 535 of file being.h.

References DEFAULT_BEING_HEIGHT, fireMissile(), CompoundSprite::getHeight(), restrict, and restrict2.

Referenced by drawSpeech(), setPixelPositionF(), and setSpeech().

536  { return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT); }
int getHeight() const
static const int DEFAULT_BEING_HEIGHT
Definition: being.h:52

◆ getHitEffect()

int Being::getHitEffect ( const Being *const  attacker,
const AttackTypeT  type,
const int  attackId,
const int  level 
)
static

Definition at line 869 of file being.cpp.

References BLOCK_END, BLOCK_START, AttackType::CRITICAL, data, effectManager, getDefaultEffectId(), Configuration::getIntValue(), SkillDialog::getSkillDataByLevel(), SkillData::hitEffectId, Actions::info(), AttackType::MISS, ActorType::Monster, paths, ActorType::Player, restrict, AttackType::SKILL, skillDialog, and AttackType::SKILLMISS.

Referenced by getHairColor(), and takeDamage().

873 {
874  if (effectManager == nullptr)
875  return 0;
876 
877  BLOCK_START("Being::getHitEffect")
878  // Init the particle effect path based on current
879  // weapon or default.
880  int hitEffectId = 0;
881  if (type == AttackType::SKILL || type == AttackType::SKILLMISS)
882  {
883  const SkillData *restrict const data =
884  skillDialog->getSkillDataByLevel(attackId, level);
885  if (data == nullptr)
886  return -1;
887  if (type == AttackType::SKILL)
888  {
889  hitEffectId = data->hitEffectId;
890  if (hitEffectId == -1)
891  hitEffectId = paths.getIntValue("skillHitEffectId");
892  }
893  else
894  {
895  hitEffectId = data->missEffectId;
896  if (hitEffectId == -1)
897  hitEffectId = paths.getIntValue("skillMissEffectId");
898  }
899  }
900  else
901  {
902  if (attacker != nullptr)
903  {
904  const ItemInfo *restrict const attackerWeapon
905  = attacker->getEquippedWeapon();
906  if (attackerWeapon != nullptr &&
907  attacker->getType() == ActorType::Player)
908  {
909  if (type == AttackType::MISS)
910  hitEffectId = attackerWeapon->getMissEffectId();
911  else if (type != AttackType::CRITICAL)
912  hitEffectId = attackerWeapon->getHitEffectId();
913  else
914  hitEffectId = attackerWeapon->getCriticalHitEffectId();
915  }
916  else if (attacker->getType() == ActorType::Monster)
917  {
918  const BeingInfo *restrict const info = attacker->getInfo();
919  if (info != nullptr)
920  {
921  const Attack *restrict const atk =
922  info->getAttack(attackId);
923  if (atk != nullptr)
924  {
925  if (type == AttackType::MISS)
926  hitEffectId = atk->mMissEffectId;
927  else if (type != AttackType::CRITICAL)
928  hitEffectId = atk->mHitEffectId;
929  else
930  hitEffectId = atk->mCriticalHitEffectId;
931  }
932  else
933  {
934  hitEffectId = getDefaultEffectId(type);
935  }
936  }
937  }
938  else
939  {
940  hitEffectId = getDefaultEffectId(type);
941  }
942  }
943  else
944  {
945  hitEffectId = getDefaultEffectId(type);
946  }
947  }
948  BLOCK_END("Being::getHitEffect")
949  return hitEffectId;
950 }
Definition: attack.h:28
int hitEffectId
Definition: skilldata.h:50
#define BLOCK_START(name)
Definition: perfomance.h:78
if(!vert) return
#define BLOCK_END(name)
Definition: perfomance.h:79
int getIntValue(const std::string &key) const
SkillData * getSkillDataByLevel(const int id, const int level) const
bool info(InputEvent &event)
Definition: commands.cpp:56
uint32_t data
ActorTypeT getType() const
Definition: being.h:115
const ItemInfo * getEquippedWeapon() const
Definition: being.h:225
int getMissEffectId() const
Definition: iteminfo.h:182
static int getDefaultEffectId(const AttackTypeT &type)
Definition: being.cpp:952
Configuration paths
SkillDialog * skillDialog
Definition: skilldialog.cpp:65
const BeingInfo * getInfo() const
Definition: being.h:408
#define restrict
Definition: localconsts.h:164
EffectManager * effectManager

◆ getHoverCursor()

CursorT Being::getHoverCursor ( ) const
inline

◆ getHP()

int Being::getHP ( ) const
inline

Definition at line 758 of file being.h.

References mHP.

Referenced by TmwAthena::BeingRecv::processBeingMove(), TmwAthena::BeingRecv::processBeingVisible(), and BeingPopup::show().

759  { return mHP; }
int mHP
Definition: being.h:1328

◆ getInfo()

const BeingInfo* Being::getInfo ( ) const
inline

◆ getIp()

const std::string& Being::getIp ( ) const
inline

Definition at line 742 of file being.h.

References mIp.

Referenced by addToCache(), and SocialPlayersTab::updateAvatar().

743  { return mIp; }
std::string mIp
Definition: being.h:1302

◆ getKarma()

int Being::getKarma ( ) const
inline

Definition at line 1037 of file being.h.

References mKarma.

Referenced by TargetDebugTab::logic().

1038  { return mKarma; }
int mKarma
Definition: being.h:1368

◆ getLanguageId()

int Being::getLanguageId ( )
inline

Definition at line 1082 of file being.h.

References mLanguageId.

Referenced by Actions::splitWhisper().

1083  { return mLanguageId; }
int mLanguageId
Definition: being.h:1372

◆ getLastAttackX()

virtual int Being::getLastAttackX ( ) const
inlinevirtual

Reimplemented in LocalPlayer.

Definition at line 977 of file being.h.

References mLastAttackX.

Referenced by updateBotDirection().

978  { return mLastAttackX; }
int mLastAttackX
Definition: being.h:1226

◆ getLastAttackY()

virtual int Being::getLastAttackY ( ) const
inlinevirtual

Reimplemented in LocalPlayer.

Definition at line 980 of file being.h.

References A_NONNULL, drawElemental(), drawHomunculus(), drawMercenary(), mLastAttackY, restrict, restrict2, setChat(), and setTrickDead().

Referenced by updateBotDirection().

981  { return mLastAttackY; }
int mLastAttackY
Definition: being.h:1227

◆ getLevel()

virtual int Being::getLevel ( ) const
inlinevirtual

◆ getLook()

uint16_t Being::getLook ( ) const
inline

Definition at line 921 of file being.h.

References mLook, restrict2, and setLook().

Referenced by TmwAthena::BeingRecv::processBeingChangeLookContinue(), and EAthena::BeingRecv::processBeingChangeLookContinue().

922  { return mLook; }
uint16_t mLook
Definition: being.h:1377

◆ getManner()

int Being::getManner ( ) const
inline

Definition at line 1043 of file being.h.

References mManner.

Referenced by TargetDebugTab::logic().

1044  { return mManner; }
int mManner
Definition: being.h:1369

◆ getMaxHit()

int Being::getMaxHit ( ) const
inline

Definition at line 781 of file being.h.

References mMaxHit.

Referenced by TargetDebugTab::logic().

782  { return mMaxHit; }
int mMaxHit
Definition: being.h:1362

◆ getMaxHP()

int Being::getMaxHP ( ) const
inline

Definition at line 761 of file being.h.

References A_WARN_UNUSED, calcDirection(), and mMaxHP.

Referenced by BeingPopup::show().

762  { return mMaxHP; }
int mMaxHP
Definition: being.h:1329

◆ getMinHit()

int Being::getMinHit ( ) const
inline

Definition at line 775 of file being.h.

References mMinHit.

Referenced by TargetDebugTab::logic().

776  { return mMinHit; }
int mMinHit
Definition: being.h:1361

◆ getMoveAction()

std::string Being::getMoveAction ( ) const

Definition at line 1436 of file being.cpp.

References BlockMask::AIR, SpriteAction::FLY(), Map::getBlockMask(), ActorSprite::mHorseId, Actor::mMap, SpriteAction::MOVE(), mX, mY, SpriteAction::RIDE(), SpriteAction::SWIM(), and BlockMask::WATER.

Referenced by getGender(), and setAction().

1437 {
1438  if (mHorseId != 0)
1439  return SpriteAction::RIDE;
1440  if (mMap != nullptr)
1441  {
1442  const unsigned char mask = mMap->getBlockMask(mX, mY);
1443  if ((mask & BlockMask::AIR) != 0)
1444  return SpriteAction::FLY;
1445  else if ((mask & BlockMask::WATER) != 0)
1446  return SpriteAction::SWIM;
1447  }
1448  return SpriteAction::MOVE;
1449 }
static const std::string RIDE("ride")
unsigned char getBlockMask(const int x, const int y) const
Definition: map.cpp:795
int mX
Definition: being.h:1317
static const std::string FLY("fly")
int mY
Definition: being.h:1318
static const std::string SWIM("swim")
static const std::string MOVE("walk")
Map * mMap
Definition: actor.h:138<