ManaPlus
being.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2018 The ManaPlus Developers
6  *
7  * This file is part of The ManaPlus Client.
8  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <http://www.gnu.org/licenses/>.
21  */
22 
23 #ifndef BEING_BEING_H
24 #define BEING_BEING_H
25 
26 #include "position.h"
27 
28 #include "enums/being/badgeindex.h"
29 #include "enums/being/reachable.h"
30 
31 #include "enums/gui/usercolorid.h"
32 
33 #include "enums/simpletypes/move.h"
34 
36 
37 #include "resources/beinginfo.h"
38 #include "resources/beingslot.h"
39 
40 #include "being/actorsprite.h"
41 
42 #include "enums/being/attacktype.h"
45 #include "enums/being/gender.h"
46 
48 
49 #include "localconsts.h"
50 
51 static const int DEFAULT_BEING_WIDTH = 32;
52 static const int DEFAULT_BEING_HEIGHT = 32;
53 
54 class AnimatedSprite;
55 class BeingCacheEntry;
56 class CastingEffect;
57 class Color;
58 class Equipment;
59 class FlashText;
60 class Guild;
61 class ItemInfo;
62 class Particle;
63 class Party;
64 class SpeechBubble;
65 class Text;
66 
67 struct ChatObject;
68 struct HorseInfo;
69 struct MissileInfo;
70 struct SkillInfo;
71 struct ParticleInfo;
72 
73 extern volatile time_t cur_time;
74 
76 {
78  sound(nullptr),
79  x(0),
80  y(0),
81  time(0)
82  {
83  }
84 
86 
87  const SoundInfo *sound;
88  int x;
89  int y;
90  int time;
91 };
92 
93 class Being notfinal : public ActorSprite,
94  public ConfigListener
95 {
96  public:
97  friend class ActorManager;
98  friend class BeingEquipBackend;
99  friend class LocalPlayer;
100 
108  Being(const BeingId id,
109  const ActorTypeT type);
110 
112 
113  ~Being() override;
114 
117  { return mType; }
118 
122  void clearPath() restrict2;
123 
127  int getActionTime() const restrict2 noexcept2 A_WARN_UNUSED
128  { return mActionTime; }
129 
134  void setActionTime(const int actionTime) restrict2 noexcept2
135  { mActionTime = actionTime; }
136 
140  virtual void nextTile() restrict2;
141 
145  void setDestination(const int dstX,
146  const int dstY) restrict2;
147 
148  void setCachedDestination(const int dstX,
149  const int dstY) restrict2 noexcept2
150  { mCachedX = dstX; mCachedY = dstY; }
151 
153  { return mCachedX; }
154 
156  { return mCachedY; }
157 
161  const Vector &getDestination() const restrict2 noexcept2 A_WARN_UNUSED
162  { return mDest; }
163 
167  int getTileX() const restrict2 noexcept2 override A_WARN_UNUSED
168  { return mX; }
169 
173  int getTileY() const restrict2 noexcept2 override A_WARN_UNUSED
174  { return mY; }
175 
179  void setTileCoords(const int x, const int y) restrict2;
180 
188  void setSpeech(const std::string &restrict text) restrict2;
189 
199  void takeDamage(Being *restrict const attacker,
200  const int amount,
201  const AttackTypeT type,
202  const int attackId,
203  const int level) restrict2;
204 
212  void handleAttack(Being *restrict const victim,
213  const int damage,
214  const int attackId) restrict2;
215 
216  void handleSkillCasting(Being *restrict const victim,
217  const int skillId,
218  const int skillLevel) restrict2;
219 
220  void handleSkill(Being *restrict const victim,
221  const int damage,
222  const int skillId,
223  const int skillLevel) restrict2;
224 
225  const ItemInfo *getEquippedWeapon() const restrict2 A_WARN_UNUSED
226  { return mEquippedWeapon; }
227 
231  const std::string &getName() const restrict2 noexcept2 A_WARN_UNUSED
232  { return mName; }
233 
234  const std::string &getExtName() const restrict2 noexcept2 A_WARN_UNUSED
235  { return mExtName; }
236 
242  void setName(const std::string &restrict name) restrict2;
243 
245  { return mShowName; }
246 
247  void setShowName(const bool doShowName) restrict2;
248 
252  void setPartyName(const std::string &restrict name) restrict2;
253 
254  const std::string &getPartyName() const restrict2 noexcept2
256  { return mPartyName; }
257 
258  const std::string &getGuildName() const restrict2 noexcept2
260  { return mGuildName; }
261 
262  const std::string &getClanName() const restrict2 noexcept2
264  { return mClanName; }
265 
270  void setGuildName(const std::string &restrict name) restrict2;
271 
272  void setGuildPos(const std::string &restrict pos) restrict2;
273 
274  void setClanName(const std::string &restrict name) restrict2;
275 
279  void addGuild(Guild *restrict const guild) restrict2;
280 
284  void removeGuild(const int id) restrict2;
285 
289  const Guild *getGuild(const std::string &restrict guildName)
290  const restrict2 A_WARN_UNUSED;
291 
295  const Guild *getGuild(const int id) const restrict2 A_WARN_UNUSED;
296 
300  Guild *getGuild() const restrict2 A_WARN_UNUSED;
301 
305  const std::map<int, Guild*> &getGuilds() const restrict2 noexcept2
306  A_WARN_UNUSED
307  { return mGuilds; }
308 
312  void clearGuilds() restrict2;
313 
317  int16_t getNumberOfGuilds() const restrict2 A_WARN_UNUSED
318  { return CAST_S16(mGuilds.size()); }
319 
320  bool isInParty() const restrict2 noexcept2 A_WARN_UNUSED
321  { return mParty != nullptr; }
322 
323  void setParty(Party *restrict const party) restrict2;
324 
325  void setGuild(Guild *restrict const guild) restrict2;
326 
327  void updateGuild() restrict2;
328 
329  Party *getParty() const restrict2 noexcept2 A_WARN_UNUSED
330  { return mParty; }
331 
332  void setSprite(const unsigned int slot,
333  const int id,
334  std::string color,
335  ItemColor colorId) restrict2;
336 
337  void setSpriteColor(const unsigned int slot,
338  const int id,
339  const std::string &color) restrict2;
340 
341  void setSpriteColorId(const unsigned int slot,
342  const int id,
343  ItemColor colorId) restrict2;
344 
345  void setSpriteCards(const unsigned int slot,
346  const int id,
347  const CardsList &restrict cards) restrict2;
348 
349  void setSpriteId(const unsigned int slot,
350  const int id) restrict2;
351 
352  void unSetSprite(const unsigned int slot) restrict2;
353 
354  void setWeaponId(const int id) restrict2;
355 
356  void setTempSprite(const unsigned int slot,
357  const int id) restrict2;
358 
359  void setHairTempSprite(const unsigned int slot,
360  const int id) restrict2;
361 
362  void updateSprite(const unsigned int slot,
363  const int id,
364  const std::string &restrict color)
365  restrict2;
366 
367  void setHairColorSpriteID(const unsigned int slot,
368  const int id) restrict2;
369 
370  void setSpriteColor(const unsigned int slot,
371  const std::string &restrict color) restrict2;
372 
376  int getNumberOfLayers() const restrict2 override A_WARN_UNUSED
378 
382  void logic() restrict2 override;
383 
384  void botLogic() restrict2;
385 
389  void drawSpeech(const int offsetX,
390  const int offsetY) restrict2;
391 
395  void drawEmotion(Graphics *restrict const graphics,
396  const int offsetX,
397  const int offsetY) const restrict2 A_NONNULL(2);
398 
399  BeingTypeId getSubType() const restrict2 noexcept2 A_WARN_UNUSED
400  { return mSubType; }
401 
405  void setSubtype(const BeingTypeId subtype,
406  const uint16_t look) restrict2;
407 
408  const BeingInfo *getInfo() const restrict2 noexcept2 A_WARN_UNUSED
409  { return mInfo; }
410 
411  TargetCursorSizeT getTargetCursorSize() const restrict2 override final
413 
414  int getTargetOffsetX() const restrict2 override A_WARN_UNUSED
415  {
416  if (mInfo == nullptr)
417  return 0;
418  return mInfo->getTargetOffsetX();
419  }
420 
421  int getTargetOffsetY() const restrict2 override A_WARN_UNUSED
422  {
423  if (mInfo == nullptr)
424  return 0;
425  return mInfo->getTargetOffsetY();
426  }
427 
431  virtual unsigned char getBlockWalkMask() const restrict2 A_WARN_UNUSED
432  {
433  if (mInfo == nullptr)
434  return 0;
435  return mInfo->getBlockWalkMask();
436  }
437 
441  BlockTypeT getBlockType() const restrict2 override A_WARN_UNUSED
442  {
443  if (mInfo == nullptr)
444  return BlockType::NONE;
445  return mInfo->getBlockType();
446  }
447 
451  void setWalkSpeed(const int speed) restrict2
452  { mWalkSpeed = speed; mSpeed = speed; }
453 
457  int getWalkSpeed() const restrict2 noexcept2 A_WARN_UNUSED
458  { return mWalkSpeed; }
459 
463  void setAttackSpeed(const int speed) restrict2 noexcept2
464  { mAttackSpeed = speed; }
465 
469  int getAttackSpeed() const restrict2 noexcept2 A_WARN_UNUSED
470  { return mAttackSpeed; }
471 
475  virtual void setAction(const BeingActionT &restrict action,
476  const int attackId) restrict2;
477 
481  BeingActionT getCurrentAction() const restrict2 noexcept2 A_WARN_UNUSED
482  { return mAction; }
483 
487  bool isAlive() const restrict2 noexcept2 A_WARN_UNUSED
488  { return mAction != BeingAction::DEAD; }
489 
493  uint8_t getDirection() const restrict2 noexcept2 A_WARN_UNUSED
494  { return mDirection; }
495 
499  virtual void setDirection(const uint8_t direction) restrict2;
500 
501  void setDirectionDelayed(const uint8_t direction) restrict2 noexcept2
502  { mDirectionDelayed = direction; }
503 
504  uint8_t getDirectionDelayed() const restrict2 noexcept2 A_WARN_UNUSED
505  { return mDirectionDelayed; }
506 
511  A_WARN_UNUSED
512  { return mSpriteDirection; }
513 
514  void setPixelPositionF(const Vector &restrict pos) restrict2 override;
515 
521  inline void setPixelPositionF(const float x,
522  const float y,
523  const float z) restrict2 A_INLINE
524  { setPixelPositionF(Vector(x, y, z)); }
525 
529  int getWidth() const restrict2 override final A_WARN_UNUSED
530  { return std::max(CompoundSprite::getWidth(), DEFAULT_BEING_WIDTH); }
531 
535  int getHeight() const restrict2 override final A_WARN_UNUSED
536  { return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT); }
537 
541  void fireMissile(Being *restrict const victim,
542  const MissileInfo &restrict missile) const restrict2;
543 
548  const Path &getPath() const restrict2 noexcept2 A_WARN_UNUSED
549  { return mPath; }
550 
551  int getDistance() const restrict2 noexcept2 A_WARN_UNUSED
552  { return mDistance; }
553 
554  void setDistance(const int n) restrict2 noexcept2
555  { mDistance = n; }
556 
561  void setEmote(const uint8_t emotion,
562  const int emote_time) restrict2;
563 
564  void setState(const uint8_t state) restrict2;
565 
566  void drawPlayerSprites(Graphics *restrict const graphics,
567  const int posX,
568  const int posY) const
569  restrict2 A_NONNULL(2);
570 
571  void drawSpritesSDL(Graphics *restrict const graphics,
572  const int posX,
573  const int posY) const
574  restrict2 override final A_NONNULL(2);
575 
576  void drawHpBar(Graphics *restrict const graphics,
577  const int maxHP,
578  const int hp,
579  const int damage,
580  const UserColorIdT color1,
581  const UserColorIdT color2,
582  const int x,
583  const int y,
584  const int width,
585  const int height) const restrict2 A_NONNULL(2);
586 
587  void optionChanged(const std::string &restrict value)
588  restrict2 override;
589 
590  void flashName(const int time) restrict2;
591 
592  int getDamageTaken() const restrict2 noexcept2 A_WARN_UNUSED
593  { return mDamageTaken; }
594 
595  void setDamageTaken(const int damage) restrict2 noexcept2
596  { mDamageTaken = damage; }
597 
598  void updateName() restrict2;
599 
600  void setLevel(const int n) restrict2 noexcept2
601  { mLevel = n; }
602 
603  virtual int getLevel() const restrict2 A_WARN_UNUSED
604  { return mLevel; }
605 
606  void setReachable(const ReachableT n) restrict2 noexcept2
607  { mReachable = n; }
608 
609  ReachableT getReachable() const restrict2 noexcept2 A_WARN_UNUSED
610  { return mReachable; }
611 
612  static void reReadConfig();
613 
615 
616  void addToCache() const restrict2;
617 
618  bool updateFromCache() restrict2;
619 
623  virtual void setGender(const GenderT gender) restrict2;
624 
625  GenderT getGender() const restrict2 noexcept2 A_WARN_UNUSED
626  { return mGender; }
627 
631  std::string getSitAction() const restrict2 A_WARN_UNUSED;
632 
633  std::string getCastAction() const restrict2 A_WARN_UNUSED;
634 
635  std::string getCastAction(const SkillInfo *restrict const skill) const
636  restrict2 A_WARN_UNUSED;
637 
638  std::string getMoveAction() const restrict2 A_WARN_UNUSED;
639 
640  std::string getDeadAction() const restrict2 A_WARN_UNUSED;
641 
642  std::string getStandAction() const restrict2 A_WARN_UNUSED;
643 
644  std::string getSpawnAction() const restrict2 A_WARN_UNUSED;
645 
646  std::string getWeaponAttackAction(const ItemInfo *restrict const
647  weapon) const
648  restrict2 A_WARN_UNUSED;
649 
650  std::string getAttackAction() const restrict2 A_WARN_UNUSED;
651 
652  std::string getAttackAction(const Attack *restrict const attack1) const
653  restrict2 A_WARN_UNUSED;
654 
658  bool isGM() const restrict2 noexcept2 A_WARN_UNUSED
659  { return mIsGM; }
660 
664  void setGM(const bool gm) restrict2;
665 
666  bool canTalk() const restrict2 noexcept2 A_WARN_UNUSED
667  { return mType == ActorType::Npc; }
668 
669  void talkTo() const restrict2;
670 
671  void draw(Graphics *restrict const graphics,
672  const int offsetX,
673  const int offsetY) const
674  restrict2 override final A_NONNULL(2);
675 
676  void drawPlayer(Graphics *restrict const graphics,
677  const int offsetX,
678  const int offsetY) const
679  restrict2 A_NONNULL(2);
680 
681  void drawOther(Graphics *restrict const graphics,
682  const int offsetX,
683  const int offsetY) const
684  restrict2 A_NONNULL(2);
685 
686  void drawNpc(Graphics *restrict const graphics,
687  const int offsetX,
688  const int offsetY) const
689  restrict2 A_NONNULL(2);
690 
691  void drawMonster(Graphics *restrict const graphics,
692  const int offsetX,
693  const int offsetY) const
694  restrict2 A_NONNULL(2);
695 
696  void drawPortal(Graphics *restrict const graphics,
697  const int offsetX,
698  const int offsetY) const
699  restrict2 A_NONNULL(2);
700 
701  void drawBasic(Graphics *restrict const graphics,
702  const int x,
703  const int y) const restrict2 A_NONNULL(2);
704 
705  void setMoveTime() restrict2 noexcept2
706  { mMoveTime = cur_time; }
707 
708  void setAttackTime() restrict2 noexcept2
709  { mAttackTime = cur_time; }
710 
711  void setTalkTime() restrict2 noexcept2
712  { mTalkTime = cur_time; }
713 
714  void setTestTime() restrict2 noexcept2
715  { mTestTime = cur_time; }
716 
717  void setOtherTime() restrict2 noexcept2
718  { mOtherTime = cur_time; }
719 
720  time_t getMoveTime() const restrict2 noexcept2
721  { return mMoveTime; }
722 
723  time_t getAttackTime() const restrict2 noexcept2
724  { return mAttackTime; }
725 
726  time_t getTalkTime() const restrict2 noexcept2
727  { return mTalkTime; }
728 
729  time_t getTestTime() const restrict2 noexcept2
730  { return mTestTime; }
731 
732  time_t getOtherTime() const restrict2 noexcept2
733  { return mOtherTime; }
734 
735  void resetCounters() restrict2;
736 
737  void updateColors() restrict2;
738 
739  void setEnemy(const bool n) restrict2 noexcept2
740  { mEnemy = n; }
741 
742  const std::string &getIp() const restrict2 noexcept2 A_WARN_UNUSED
743  { return mIp; }
744 
745  void setIp(const std::string &restrict ip) restrict2 noexcept2
746  { mIp = ip; }
747 
748  unsigned int getPvpRank() const restrict2 noexcept2 A_WARN_UNUSED
749  { return mPvpRank; }
750 
751  void setPvpRank(const unsigned int rank) restrict2 noexcept2
752  { mPvpRank = rank; }
753 
754  void setHP(const int hp) restrict2;
755 
756  void setMaxHP(const int hp) restrict2;
757 
758  int getHP() const restrict2 noexcept2 A_WARN_UNUSED
759  { return mHP; }
760 
761  int getMaxHP() const restrict2 noexcept2 A_WARN_UNUSED
762  { return mMaxHP; }
763 
764  uint8_t calcDirection(const int dstX,
765  const int dstY) const restrict2 A_WARN_UNUSED;
766 
767  uint8_t calcDirection() const restrict2 A_WARN_UNUSED;
768 
769  void setAttackDelay(const int n) restrict2 noexcept2
770  { mAttackDelay = n; }
771 
772  int getAttackDelay() const restrict2 noexcept2 A_WARN_UNUSED
773  { return mAttackDelay; }
774 
775  int getMinHit() const restrict2 noexcept2 A_WARN_UNUSED
776  { return mMinHit; }
777 
778  void setMinHit(const int n) restrict2 noexcept2
779  { mMinHit = n; }
780 
781  int getMaxHit() const restrict2 noexcept2 A_WARN_UNUSED
782  { return mMaxHit; }
783 
784  void setMaxHit(const int n) restrict2 noexcept2
785  { mMaxHit = n; }
786 
787  int getCriticalHit() const restrict2 A_WARN_UNUSED
788  { return mCriticalHit; }
789 
790  void setCriticalHit(const int n) restrict2 noexcept2
791  { mCriticalHit = n; }
792 
793  void updateHit(const int amount) restrict2;
794 
795  Equipment *getEquipment() restrict2 A_WARN_UNUSED;
796 
797  void undressItemById(const int id) restrict2;
798 
799  int getGoodStatus() const restrict2 noexcept2 A_WARN_UNUSED
800  { return mGoodStatus; }
801 
802  void setGoodStatus(const int n) restrict2 noexcept2
803  { mGoodStatus = n; }
804 
805  std::string getGenderSign() const restrict2 A_WARN_UNUSED;
806 
807  std::string getGenderSignWithSpace() const restrict2 A_WARN_UNUSED;
808 
809  void updateComment() restrict2;
810 
811  const std::string getComment() const restrict2 noexcept2 A_WARN_UNUSED
812  { return mComment; }
813 
814  void setComment(const std::string &restrict n) restrict2 noexcept2
815  { mComment = n; }
816 
817  static void clearCache();
818 
819  static std::string loadComment(const std::string &restrict name,
820  const ActorTypeT &restrict type)
822 
823  static void saveComment(const std::string &restrict name,
824  const std::string &restrict comment,
825  const ActorTypeT &restrict type);
826 
827  bool isAdvanced() const restrict2 noexcept2 A_WARN_UNUSED
828  { return mAdvanced; }
829 
830  void setAdvanced(const bool n) restrict2
831  { mAdvanced = n; addToCache(); }
832 
833  bool isBuyShopEnabled() const restrict2 A_WARN_UNUSED;
834 
835  bool isSellShopEnabled() const restrict2 A_WARN_UNUSED;
836 
837  void enableShop(const bool b) restrict2;
838 
842  void setAttackRange(const int range) restrict2 noexcept2
843  { mAttackRange = range; }
844 
845 /*
846  void attack(Being *restrict target = nullptr,
847  bool keep = false,
848  bool dontChangeEquipment = false) restrict2;
849 
850  void attack2(Being *restrict target = nullptr,
851  bool keep = false,
852  bool dontChangeEquipment = false) restrict2;
853 */
854 
855  void updatePercentHP() restrict2;
856 
857  void setRaceName(const std::string &restrict name) restrict2 noexcept2
858  { mRaceName = name; }
859 
860  std::string getRaceName() const restrict2 noexcept2 A_WARN_UNUSED
861  { return mRaceName; }
862 
863  int getSpriteID(const int slot) const restrict2 A_WARN_UNUSED;
864 
865  const BeingSlot &getSpriteSlot(const int slot) const
866  restrict2 A_WARN_UNUSED;
867 
868  ItemColor getSpriteColor(const int slot) const restrict2 A_WARN_UNUSED;
869 
870  void setHairStyle(const unsigned int slot,
871  const int id) restrict2;
872 
873  void setHairColor(const unsigned int slot,
874  const ItemColor color) restrict2;
875 
876  void setHairColor(const ItemColor color) restrict2 noexcept2
877  { mHairColor = color; }
878 
879  void setSpriteSlot(const unsigned int slot,
880  const BeingSlot &beingSlot);
881 
882  ItemColor getHairColor() const noexcept2 A_WARN_UNUSED
883  { return mHairColor; }
884 
886 
887  int getHitEffect(const Being *restrict const attacker,
888  const AttackTypeT type,
889  const int attackId,
890  const int level) const restrict2 A_WARN_UNUSED;
891 
892  CursorT getHoverCursor() const restrict2 A_WARN_UNUSED
893  {
894  return mInfo != nullptr ?
896  }
897 
898  void addAfkEffect() restrict2;
899 
900  void removeAfkEffect() restrict2;
901 
903 
904  void addSpecialEffect(const int effect) restrict2;
905 
907 
908  void addEffect(const std::string &restrict name) restrict2;
909 
910  void setOwner(Being *restrict const owner) restrict2 noexcept2
911  { mOwner = owner; }
912 
913  Being *getOwner() const restrict2 noexcept2
914  { return mOwner; }
915 
916  void playSfx(const SoundInfo &sound,
917  Being *const being,
918  const bool main,
919  const int x, const int y) const restrict2;
920 
921  uint16_t getLook() const restrict2 noexcept2
922  { return mLook; }
923 
924  void setLook(const uint16_t look) restrict2;
925 
926  constexpr2 static uint8_t genderToInt(const GenderT sex)
927  A_CONST A_WARN_UNUSED
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::OTHER:
938  return 3;
939  }
940  }
941 
942  constexpr2 static GenderT intToGender(const uint8_t sex)
943  A_CONST A_WARN_UNUSED
944  {
945  switch (sex)
946  {
947  case 0:
948  default:
949  return Gender::FEMALE;
950  case 1:
951  return Gender::MALE;
952  case 3:
953  return Gender::OTHER;
954  }
955  }
956 
958 
962  void setPath(const Path &restrict path) restrict2;
963 
964  int getSortPixelY() const restrict2 override A_WARN_UNUSED
965  { return CAST_S32(mPos.y) - mYDiff - mSortOffsetY; }
966 
967  void setMap(Map *restrict const map) restrict2 override;
968 
970 
971  void incUsage() restrict2 noexcept2
972  { mUsageCounter ++; }
973 
974  int decUsage() restrict2 noexcept2
975  { return --mUsageCounter; }
976 
977  virtual int getLastAttackX() const restrict2
978  { return mLastAttackX; }
979 
980  virtual int getLastAttackY() const restrict2
981  { return mLastAttackY; }
982 
983  void drawHomunculus(Graphics *restrict const graphics,
984  const int offsetX,
985  const int offsetY) const
986  restrict2 A_NONNULL(2);
987 
988  void drawMercenary(Graphics *restrict const graphics,
989  const int offsetX,
990  const int offsetY) const
991  restrict2 A_NONNULL(2);
992 
993  void drawElemental(Graphics *restrict const graphics,
994  const int offsetX,
995  const int offsetY) const
996  restrict2 A_NONNULL(2);
997 
998  void setTrickDead(const bool b) restrict2 override final;
999 
1000  void setChat(ChatObject *restrict const obj) restrict2;
1001 
1002  ChatObject *getChat() const restrict2 noexcept2
1003  { return mChat; }
1004 
1005  void setRiding(const bool b) restrict2 override final;
1006 
1007  void setHorse(const int horseId) restrict2;
1008 
1009  void removeHorse() restrict2;
1010 
1011  void setSellBoard(const std::string &restrict text) restrict2;
1012 
1013  std::string getSellBoard() const restrict2 noexcept2 A_WARN_UNUSED
1014  { return mSellBoard; }
1015 
1016  void setBuyBoard(const std::string &restrict text) restrict2;
1017 
1018  std::string getBuyBoard() const restrict2 noexcept2 A_WARN_UNUSED
1019  { return mBuyBoard; }
1020 
1021  void setSpiritBalls(const unsigned int balls) restrict2;
1022 
1023  unsigned int getSpiritBalls() const restrict2 noexcept2 A_WARN_UNUSED
1024  { return mSpiritBalls; }
1025 
1026  void stopCast(const bool b) override final;
1027 
1028  void setCreatorId(const BeingId id)
1029  { mCreatorId = id; }
1030 
1031  BeingId getCreatorId() const noexcept2 A_WARN_UNUSED
1032  { return mCreatorId; }
1033 
1034  void setKarma(const int karma) restrict2 noexcept2
1035  { mKarma = karma; }
1036 
1037  int getKarma() const restrict2 noexcept2 A_WARN_UNUSED
1038  { return mKarma; }
1039 
1040  void setManner(const int manner) restrict2 noexcept2
1041  { mManner = manner; }
1042 
1043  int getManner() const restrict2 noexcept2 A_WARN_UNUSED
1044  { return mManner; }
1045 
1046  void disableBotAi() restrict2 noexcept2
1047  { mBotAi = false; }
1048 
1049  void enableBotAi() restrict2 noexcept2
1050  { mBotAi = true; }
1051 
1052  int getAreaSize() const restrict2 noexcept2 A_WARN_UNUSED
1053  { return mAreaSize; }
1054 
1055  void setAreaSize(const int areaSize) restrict2 noexcept2
1056  { mAreaSize = areaSize; }
1057 
1058  void setTeamId(const uint16_t teamId) restrict2;
1059 
1060  void showTeamBadge(const bool show) restrict2;
1061 
1062  void showGuildBadge(const bool show) restrict2;
1063 
1064  void showClanBadge(const bool show) restrict2;
1065 
1066  void showGmBadge(const bool show) restrict2;
1067 
1068  void showPartyBadge(const bool show) restrict2;
1069 
1070  void showNameBadge(const bool show) restrict2;
1071 
1072  void showShopBadge(const bool show) restrict2;
1073 
1074  void showInactiveBadge(const bool show) restrict2;
1075 
1076  void showAwayBadge(const bool show) restrict2;
1077 
1078  void showBadges(const bool show) restrict2;
1079 
1080  void setLanguageId(const int lang) restrict2 noexcept2;
1081 
1082  int getLanguageId() restrict2 noexcept2 A_WARN_UNUSED
1083  { return mLanguageId; }
1084 
1085  uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED
1086  { return mTeamId; }
1087 
1088  virtual void setGroupId(const int id);
1089 
1090  int getGroupId() const noexcept2 A_WARN_UNUSED
1091  { return mGroupId; }
1092 
1093  void serverRemove() restrict2 noexcept2;
1094 
1095  void addCast(const int dstX,
1096  const int dstY,
1097  const int skillId,
1098  const int skillLevel,
1099  const int range,
1100  const int waitTimeTicks);
1101 
1102  void fixDirectionOffsets(int &offsetX,
1103  int &offsetY) const;
1104 
1105  bool getAllowNpcEquipment() const noexcept2 A_WARN_UNUSED
1106  { return mAllowNpcEquipment; }
1107 
1108  static Being *createBeing(const BeingId id,
1109  const ActorTypeT type,
1110  const BeingTypeId subtype,
1111  Map *const map);
1112 
1113  protected:
1114  void drawPlayerSpriteAt(Graphics *restrict const graphics,
1115  const int x,
1116  const int y) const restrict2 A_NONNULL(2);
1117 
1118  void drawOtherSpriteAt(Graphics *restrict const graphics,
1119  const int x,
1120  const int y) const restrict2 A_NONNULL(2);
1121 
1122  void drawNpcSpriteAt(Graphics *restrict const graphics,
1123  const int x,
1124  const int y) const restrict2 A_NONNULL(2);
1125 
1126  void drawPortalSpriteAt(Graphics *restrict const graphics,
1127  const int x,
1128  const int y) const restrict2 A_NONNULL(2);
1129 
1130  void drawMonsterSpriteAt(Graphics *restrict const graphics,
1131  const int x,
1132  const int y) const restrict2 A_NONNULL(2);
1133 
1134  void drawHomunculusSpriteAt(Graphics *restrict const graphics,
1135  const int x,
1136  const int y) const restrict2 A_NONNULL(2);
1137 
1138  void drawMercenarySpriteAt(Graphics *restrict const graphics,
1139  const int x,
1140  const int y) const restrict2 A_NONNULL(2);
1141 
1142  void drawElementalSpriteAt(Graphics *restrict const graphics,
1143  const int x,
1144  const int y) const restrict2 A_NONNULL(2);
1145 
1146  void drawCompound(Graphics *const graphics,
1147  const int posX,
1148  const int posY) const A_NONNULL(2);
1149 
1153  virtual void updateCoords() restrict2;
1154 
1155  void showName() restrict2;
1156 
1157  void addItemParticles(const int id,
1158  const SpriteDisplay &restrict display) restrict2;
1159 
1160  void addItemParticlesCards(const int id,
1161  const SpriteDisplay &restrict display,
1162  const CardsList &restrict cards) restrict2;
1163 
1165 
1166  void removeItemParticles(const int id) restrict2;
1167 
1169 
1170  void setDefaultNameColor(const UserColorIdT defaultColor) restrict2;
1171 
1173 
1174  static int getDefaultEffectId(const AttackTypeT &restrict type);
1175 
1181 
1182  std::string mSpriteAction;
1183  std::string mName;
1184  std::string mExtName;
1185  std::string mRaceName;
1186  std::string mPartyName;
1187  std::string mGuildName;
1188  std::string mClanName;
1189  std::string mSpeech;
1190 
1196 
1199 
1203 
1206  typedef std::map<int, ParticleInfo*> SpriteParticleInfo;
1207  typedef SpriteParticleInfo::iterator SpriteParticleInfoIter;
1208 
1209  STD_VECTOR<BeingSlot> mSlots;
1210  SpriteParticleInfo mSpriteParticles;
1211 
1212  // Character guild information
1213  std::map<int, Guild*> mGuilds;
1215 
1223  int mLevel;
1228 
1230 
1234  uint8_t mDirection;
1238  bool mIsGM;
1239 
1240  protected:
1241  void postInit(const BeingTypeId subType,
1242  Map *const map);
1243 
1244  void updateBadgesPosition();
1245 
1250  template<signed char pos, signed char neg>
1251  int getOffset() const restrict2 A_WARN_UNUSED;
1252 
1253  int searchSlotValue(const STD_VECTOR<int> &restrict slotRemap,
1254  const int val) const restrict2 A_WARN_UNUSED;
1255 
1256  static void searchSlotValueItr(STD_VECTOR<int>::iterator &restrict it,
1257  int &idx,
1258  STD_VECTOR<int> &restrict slotRemap,
1259  const int val);
1260 
1261  void addSpiritBalls(const unsigned int balls,
1262  const int effectId) restrict2;
1263 
1264  void removeSpiritBalls(const unsigned int balls) restrict2;
1265 
1266  void dumpSprites() const restrict2;
1267 
1268  void drawBeingCursor(Graphics *const graphics,
1269  const int offsetX,
1270  const int offsetY) const A_NONNULL(2);
1271 
1272  void drawCasting(Graphics *const graphics,
1273  const int offsetX,
1274  const int offsetY) const A_NONNULL(2);
1275 
1276  void updateBotFollow(int dstX,
1277  int dstY,
1278  const int divX,
1279  const int divY);
1280 
1281  void moveBotTo(int dstX,
1282  int dstY);
1283 
1284  void updateBotDirection(const int dstX,
1285  const int dstY);
1286 
1287  void botFixOffset(int &restrict dstX,
1288  int &restrict dstY) const;
1289 
1291 
1294 
1301  int mSpeed;
1302  std::string mIp;
1304  int *restrict mSpriteHide A_NONNULLPOINTER;
1305  int *restrict mSpriteDraw A_NONNULLPOINTER;
1306  std::string mComment;
1307  std::string mBuyBoard;
1308  std::string mSellBoard;
1316 
1317  int mX; // position in tiles
1318  int mY; // position in tiles
1321  int mSortOffsetY; // caculated offset in pixels based on mPixelOffsetY
1322  int mPixelOffsetY; // tile height offset in pixels
1323  // calculated between tiles
1324  int mFixedOffsetY; // fixed tile height offset in pixels for tile
1325  uint8_t mOldHeight;
1326 
1328  int mHP;
1329  int mMaxHP;
1333 
1334  static time_t mUpdateConfigTime;
1335  static unsigned int mConfLineLim;
1336  static int mSpeechType;
1339  static bool mLowTraffic;
1340  static bool mDrawHotKeys;
1341  static bool mShowBattleEvents;
1342  static bool mShowMobHP;
1343  static bool mShowOwnHP;
1344  static bool mShowGender;
1345  static bool mShowLevel;
1346  static bool mShowPlayersStatus;
1348  static bool mHideErased;
1350  static bool mUseDiagonal;
1352  static int mAwayEffect;
1354 
1355  time_t mMoveTime;
1356  time_t mAttackTime;
1357  time_t mTalkTime;
1358  time_t mOtherTime;
1359  time_t mTestTime;
1361  int mMinHit;
1362  int mMaxHit;
1364  unsigned int mPvpRank;
1365  unsigned int mNumber;
1366  unsigned int mSpiritBalls;
1368  int mKarma;
1369  int mManner;
1376  uint16_t mTeamId;
1377  uint16_t mLook;
1378  uint16_t mBadgesCount;
1380  bool mErased;
1381  bool mEnemy;
1384  bool mShop;
1385  bool mAway;
1388  bool mBotAi;
1390 };
1391 
1392 extern std::list<BeingCacheEntry*> beingInfoCache;
1393 
1394 #endif // BEING_BEING_H
int getMaxHit() const
Definition: being.h:781
void setDistance(const int n)
Definition: being.h:554
static bool mDrawHotKeys
Definition: being.h:1340
Definition: attack.h:28
int getHeight() const
#define A_DELETE_COPY(func)
Definition: localconsts.h:52
int getSpriteID(const int slot) const
Definition: being.cpp:4894
void setAttackSpeed(const int speed)
Definition: being.h:463
SpriteParticleInfo mSpriteParticles
Definition: being.h:1210
void drawHomunculusSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4059
void resetCounters()
Definition: being.cpp:4350
void setRaceName(const std::string &name)
Definition: being.h:857
std::string getDeadAction() const
Definition: being.cpp:1526
int mSpeechTime
Definition: being.h:1220
unsigned int mPvpRank
Definition: being.h:1364
int getTargetOffsetY() const
Definition: being.h:421
void updatePercentHP()
Definition: being.cpp:4876
void setHairTempSprite(const unsigned int slot, const int id)
Definition: being.cpp:3218
void updateBadgesCount()
Definition: being.cpp:5312
static bool mEnableReorderSprites
Definition: being.h:1347
unsigned int getSpiritBalls() const
Definition: being.h:1023
uint16_t getLook() const
Definition: being.h:921
const std::string & getPartyName() const
Definition: being.h:254
bool mBotAi
Definition: being.h:1388
void removeAllItemsParticles()
Definition: being.cpp:5037
int getOffset() const
Definition: being.cpp:2469
static const int DEFAULT_BEING_WIDTH
Definition: being.h:51
int mAttackSpeed
Definition: being.h:1221
void playSfx(const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const
Definition: being.cpp:4967
void updateCoords()
std::string getRaceName() const
Definition: being.h:860
static bool mHideErased
Definition: being.h:1348
int getNumberOfLayers() const
Definition: being.h:376
void showInactiveBadge(const bool show)
Definition: being.cpp:5274
int getTileY() const
Definition: being.h:173
bool skill(InputEvent &event)
Definition: commands.cpp:96
const std::string & getExtName() const
Definition: being.h:234
bool mEnemy
Definition: being.h:1381
BeingAction ::T BeingActionT
Definition: beingaction.h:40
void setShowName(const bool doShowName)
Definition: being.cpp:1165
NextSoundInfo()
Definition: being.h:77
void setAttackRange(const int range)
Definition: being.h:842
Being * createBeing(const BeingId id, const int job)
Definition: beingrecv.cpp:502
SpriteDirection::Type mSpriteDirection
Definition: being.h:1236
Definition: party.h:61
void setDestination(const int x, const int y)
void setLanguageId(const int lang)
Definition: being.cpp:5555
#define A_NONNULLPOINTER
Definition: localconsts.h:251
BlockTypeT getBlockType() const
Definition: beinginfo.h:128
void showBadges(const bool show)
Definition: being.cpp:5214
static bool mUseDiagonal
Definition: being.h:1350
void setDamageTaken(const int damage)
Definition: being.h:595
std::string mGuildName
Definition: being.h:1187
void drawMonsterSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4005
int getAttackDelay() const
Definition: being.h:772
int mKarma
Definition: being.h:1368
int16_t getNumberOfGuilds() const
Definition: being.h:317
Equipment * getEquipment()
Definition: playerinfo.cpp:217
time_t getTestTime() const
Definition: being.h:729
void setTileCoords(const int x, const int y)
Definition: being.cpp:5010
uint8_t mDirection
Definition: being.h:1234
std::string getBuyBoard() const
Definition: being.h:1018
std::string getSitAction() const
Definition: being.cpp:1418
void setDefaultNameColor(const UserColorIdT defaultColor)
Definition: being.cpp:2639
void updateColors()
Definition: being.cpp:2663
void setSpeech(const std::string &text)
Definition: being.cpp:571
bool isBuyShopEnabled() const
Definition: being.cpp:5351
int mFixedOffsetY
Definition: being.h:1324
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3937
void setGuildName(const std::string &name)
Definition: being.cpp:1195
void setTalkTime()
Definition: being.h:711
GenderT getGender() const
Definition: being.h:625
void setMap(Map *const map)
const Color * mNameColor
Definition: being.h:1195
time_t mAttackTime
Definition: being.h:1356
static bool mShowBattleEvents
Definition: being.h:1341
uint16_t mLook
Definition: being.h:1377
Definition: vector.h:38
unsigned int mSpiritBalls
Definition: being.h:1366
void setOtherTime()
Definition: being.h:717
std::vector< AnimatedSprite * > mDownHorseSprites
Definition: being.h:1313
virtual int getLastAttackX() const
Definition: being.h:977
int mEmotionTime
Definition: being.h:1217
#define constexpr2
Definition: localconsts.h:48
std::string getSellBoard() const
Definition: being.h:1013
int getCachedX() const
Definition: being.h:152
int getManner() const
Definition: being.h:1043
void setTrickDead(const bool b)
Definition: being.cpp:5465
time_t getOtherTime() const
Definition: being.h:732
const Vector & getDestination() const
Definition: being.h:161
void setGoodStatus(const int n)
Definition: being.h:802
void drawMonster(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3780
int searchSlotValue(const std::vector< int > &slotRemap, const int val) const
Definition: being.cpp:4650
#define A_WARN_UNUSED
Definition: localconsts.h:152
void setCachedDestination(const int dstX, const int dstY)
Definition: being.h:148
bool mIsGM
Definition: being.h:1238
void setGuildPos(const std::string &pos)
Definition: being.cpp:1232
int mCachedX
Definition: being.h:1319
void serverRemove()
Definition: being.cpp:5363
#define final
Definition: localconsts.h:45
virtual void setGender(const GenderT gender)
Definition: being.cpp:3581
Path mPath
Definition: being.h:1200
CastingEffect * mCastingEffect
Definition: being.h:1179
int BeingId
Definition: beingid.h:29
int mLevel
Definition: being.h:1223
void drawBasic(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3930
static const int DEFAULT_BEING_HEIGHT
Definition: being.h:52
SpriteParticleInfo::iterator SpriteParticleInfoIter
Definition: being.h:1207
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3734
BlockType ::T BlockTypeT
Definition: blocktype.h:40
void showAwayBadge(const bool show)
Definition: being.cpp:5293
AnimatedSprite * mAnimationEffect
Definition: being.h:1178
virtual unsigned char getBlockWalkMask() const
Definition: being.h:431
void drawElementalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4169
int mDistance
Definition: being.h:1330
static bool mHighlightMapPortals
Definition: being.h:1337
Being(const BeingId id, const ActorTypeT type)
Definition: being.cpp:161
int mAttackDelay
Definition: being.h:1360
static VisibleNamePos::Type mVisibleNamePos
Definition: being.h:1353
void setAttackDelay(const int n)
Definition: being.h:769
static bool mLowTraffic
Definition: being.h:1339
ActorType ::T ActorTypeT
Definition: actortype.h:42
Party * getParty() const
Definition: being.h:329
uint16_t ItemColor
Definition: itemcolor.h:29
uint8_t getDirection() const
Definition: being.h:493
int getDistance() const
Definition: being.h:551
std::string mPartyName
Definition: being.h:1186
int getMinHit() const
Definition: being.h:775
static time_t mUpdateConfigTime
Definition: being.h:1334
time_t getAttackTime() const
Definition: being.h:723
const Color * mTextColor
Definition: being.h:1202
int getNumberOfLayers() const
std::vector< AnimatedSprite * > mUpHorseSprites
Definition: being.h:1314
int mManner
Definition: being.h:1369
Guild * getGuild() const
Definition: being.cpp:1279
void setAreaSize(const int areaSize)
Definition: being.h:1055
void drawMercenarySpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4114
void setAdvanced(const bool n)
Definition: being.h:830
void setGroupId(const int id)
#define A_NONNULL(...)
Definition: localconsts.h:159
void setClanName(const std::string &name)
Definition: being.cpp:1222
void setWalkSpeed(const int speed)
Definition: being.h:451
Text * mText
Definition: being.h:1201
std::string mSellBoard
Definition: being.h:1308
void updateBadgesPosition()
Definition: being.cpp:2315
BeingId getCreatorId() const
Definition: being.h:1031
const std::string & getClanName() const
Definition: being.h:262
uint32_t party
void showClanBadge(const bool show)
Definition: being.cpp:1205
void setSpiritBalls(const unsigned int balls)
Definition: being.cpp:5474
static GenderT intToGender(const uint8_t sex) A_CONST
Definition: being.h:942
const std::map< int, Guild * > & getGuilds() const
Definition: being.h:305
#define STD_VECTOR
Definition: vector.h:29
Being * getOwner() const
Definition: being.h:913
bool isSellShopEnabled() const
Definition: being.cpp:5357
std::string getCastAction() const
Definition: being.cpp:1525
static void saveComment(const std::string &name, const std::string &comment, const ActorTypeT &type)
Definition: being.cpp:4771
Vector mDest
Definition: being.h:1204
SpriteDirection::Type getSpriteDirection() const
Definition: being.h:510
void setPartyName(const std::string &name)
Definition: being.cpp:5246
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
Definition: being.cpp:2890
void drawNpc(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3768
std::string mRaceName
Definition: being.h:1185
std::string mClanName
Definition: being.h:1188
const std::string getComment() const
Definition: being.h:811
Reachable ::T ReachableT
Definition: reachable.h:34
uint16_t mTeamId
Definition: being.h:1376
ReachableT mReachable
Definition: being.h:1331
void setHairColorSpriteID(const unsigned int slot, const int id)
Definition: being.cpp:3291
int getTargetOffsetX() const
Definition: being.h:414
std::vector< Particle * > mSpiritParticles
Definition: being.h:1315
int decUsage()
Definition: being.h:974
std::vector< BeingSlot > mSlots
Definition: being.h:1209
static uint8_t genderToInt(const GenderT sex) A_CONST
Definition: being.h:926
void removeItemParticles(const int id)
Definition: being.cpp:5148
int mMaxHit
Definition: being.h:1362
bool mErased
Definition: being.h:1380
std::string mName
Definition: being.h:1183
std::string getSpawnAction() const
Definition: being.cpp:1527
void setEmote(const uint8_t emotion, const int emote_time)
Definition: being.cpp:4829
void updateAwayEffect()
Definition: being.cpp:4951
void removeHorse()
Definition: being.cpp:5404
void addToCache() const
Definition: being.cpp:3513
int mGoodStatus
Definition: being.h:1332
virtual void setDirection(const uint8_t direction)
Definition: being.cpp:1689
void setHP(const int hp)
Definition: being.cpp:4334
time_t mTestTime
Definition: being.h:1359
void addGuild(Guild *const guild)
Definition: being.cpp:1236
void setCriticalHit(const int n)
Definition: being.h:790
void drawSpritesSDL(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3913
void setDirectionDelayed(const uint8_t direction)
Definition: being.h:501
void showShopBadge(const bool show)
Definition: being.cpp:5255
void setPath(const Path &path)
Definition: being.cpp:558
static bool mHighlightMonsterAttackRange
Definition: being.h:1338
int getSortPixelY() const
Definition: being.h:964
virtual int getLastAttackY() const
Definition: being.h:980
ReachableT getReachable() const
Definition: being.h:609
void drawNpcSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3998
bool mInactive
Definition: being.h:1386
BeingTypeId mSubType
Definition: being.h:1233
std::string mSpeech
Definition: being.h:1189
BlockTypeT getBlockType() const
Definition: being.h:441
Party * mParty
Definition: being.h:1214
static void searchSlotValueItr(std::vector< int >::iterator &it, int &idx, std::vector< int > &slotRemap, const int val)
Definition: being.cpp:4662
void drawPlayer(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3694
void optionChanged(const std::string &value)
void setSprite(const unsigned int slot, const int id, std::string color, ItemColor colorId)
void setHorse(const int horseId)
Definition: being.cpp:5425
bool mNeedPosUpdate
Definition: being.h:1387
void setState(const uint8_t state)
Definition: being.cpp:4803
void updateGuild()
Definition: being.cpp:1332
SpeechBubble * mSpeechBubble
Definition: being.h:1293
#define CAST_S32
Definition: cast.h:29
int getTargetOffsetX() const
Definition: beinginfo.h:134
void botLogic()
Definition: being.cpp:1998
int mUsageCounter
Definition: being.h:1367
void setActionTime(const int actionTime)
Definition: being.h:134
void clearGuilds()
Definition: being.cpp:1288
std::string mIp
Definition: being.h:1302
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
Definition: being.h:1180
uint8_t mDirectionDelayed
Definition: being.h:1235
void stopCast(const bool b)
Definition: being.cpp:5522
void setBuyBoard(const std::string &text)
Definition: being.cpp:5336
static bool mShowMobHP
Definition: being.h:1342
int mX
Definition: being.h:1317
NextSoundInfo mNextSound
Definition: being.h:957
int getGoodStatus() const
Definition: being.h:799
static int mAwayEffect
Definition: being.h:1352
void flashName(const int time)
Definition: being.cpp:2534
void setIp(const std::string &ip)
Definition: being.h:745
std::string getMoveAction() const
Definition: being.cpp:1436
int mMaxHP
Definition: being.h:1329
int mLanguageId
Definition: being.h:1372
void drawCasting(Graphics *const graphics, const int offsetX, const int offsetY) const
void setSpriteColorId(const unsigned int slot, const int id, ItemColor colorId)
Definition: being.cpp:2967
void updateHit(const int amount)
Definition: being.cpp:4686
const ItemInfo * mEquippedWeapon
Definition: being.h:1198
void setOwner(Being *const owner)
Definition: being.h:910
void showGmBadge(const bool show)
Definition: being.cpp:3646
time_t mMoveTime
Definition: being.h:1355
void drawOtherSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3991
void setPvpRank(const unsigned int rank)
Definition: being.h:751
int getWidth() const
void showPartyBadge(const bool show)
Definition: being.cpp:5226
int getWidth() const
Definition: being.h:529
void setEnemy(const bool n)
Definition: being.h:739
void removeAfkEffect()
Definition: being.cpp:4923
TargetCursorSizeT getTargetCursorSize() const
Definition: being.cpp:517
std::string mComment
Definition: being.h:1306
int * mSpriteHide
Definition: being.h:1304
int mMinHit
Definition: being.h:1361
uint8_t getDirectionDelayed() const
Definition: being.h:504
void handleSkill(Being *const victim, const int damage, const int skillId, const int skillLevel)
Definition: being.cpp:1049
ItemColor getHairColor() const
Definition: being.h:882
unsigned char getBlockWalkMask() const
Definition: beinginfo.h:122
bool isAlive() const
Definition: being.h:487
void addCast(const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const int waitTimeTicks)
Definition: being.cpp:5369
const Path & getPath() const
Definition: being.h:548
BeingActionT getCurrentAction() const
Definition: being.h:481
void enableBotAi()
Definition: being.h:1049
#define notfinal
Definition: localconsts.h:246
int mLastAttackY
Definition: being.h:1227
int mDamageTaken
Definition: being.h:1327
void setMaxHit(const int n)
Definition: being.h:784
void removeSpecialEffect()
Definition: being.cpp:4941
void disableBotAi()
Definition: being.h:1046
ActorTypeT getType() const
Definition: being.h:115
std::string getStandAction() const
Definition: being.cpp:1529
int * mSpriteRemap
Definition: being.h:1303
int mCastEndTime
Definition: being.h:1371
int time
Definition: being.h:90
ItemColor getSpriteColor(const int slot) const
Definition: being.cpp:4910
bool mGotComment
Definition: being.h:1382
void addAfkEffect()
Definition: being.cpp:4918
void setTempSprite(const unsigned int slot, const int id)
Definition: being.cpp:3143
void postInit(const BeingTypeId subType, Map *const map)
Definition: being.cpp:288
static bool mShowGender
Definition: being.h:1344
void setReachable(const ReachableT n)
Definition: being.h:606
bool isInParty() const
Definition: being.h:320
int mLastAttackX
Definition: being.h:1226
bool mShop
Definition: being.h:1384
std::string mExtName
Definition: being.h:1184
~Being()
Definition: being.cpp:336
void createSpeechBubble()
Definition: being.cpp:365
const ItemInfo * getEquippedWeapon() const
Definition: being.h:225
void setSpriteId(const unsigned int slot, const int id)
Definition: being.cpp:2789
uint8_t calcDirection() const
Definition: being.cpp:1752
const BeingSlot & getSpriteSlot(const int slot) const
Definition: being.cpp:4902
void addItemParticlesCards(const int id, const SpriteDisplay &display, const CardsList &cards)
Definition: being.cpp:5081
void setComment(const std::string &n)
Definition: being.h:814
int getLanguageId()
Definition: being.h:1082
void setGM(const bool gm)
Definition: being.cpp:3666
int getGroupId() const
Definition: being.h:1090
void setPixelPositionF(const float x, const float y, const float z) A_INLINE
Definition: being.h:521
void drawEmotion(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:2377
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
int getHP() const
Definition: being.h:758
int getAreaSize() const
Definition: being.h:1052
void setHairStyle(const unsigned int slot, const int id)
Definition: being.cpp:3372
AttackType ::T AttackTypeT
Definition: attacktype.h:46
static int getDefaultEffectId(const AttackTypeT &type)
Definition: being.cpp:952
void setRiding(const bool b)
Definition: being.cpp:5412
void setManner(const int manner)
Definition: being.h:1040
const std::string & getName() const
Definition: being.h:231
BeingId mCreatorId
Definition: being.h:1375
int mWalkSpeed
Definition: being.h:1300
void drawPlayerSprites(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3893
int mActionTime
Definition: being.h:1216
Definition: map.h:71
void drawMercenary(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3804
Gender ::T GenderT
Definition: gender.h:35
void takeDamage(Being *const attacker, const int amount, const AttackTypeT type, const int attackId, const int level)
Definition: being.cpp:666
void drawPlayerSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3967
void enableShop(const bool b)
Definition: being.cpp:5344
int getDamageTaken() const
Definition: being.h:592
void showNameBadge(const bool show)
Definition: being.cpp:1118
void dumpSprites() const
Definition: being.cpp:3409
void updateBotDirection(const int dstX, const int dstY)
Definition: being.cpp:2226
int mSortOffsetY
Definition: being.h:1321
int mGroupId
Definition: being.h:1224
void fixDirectionOffsets(int &offsetX, int &offsetY) const
Definition: being.cpp:5528
int getMaxHP() const
Definition: being.h:761
int mYDiff
Definition: actor.h:140
static int mSpeechType
Definition: being.h:1336
time_t getMoveTime() const
Definition: being.h:720
int mPreStandTime
Definition: being.h:1229
int mCachedY
Definition: being.h:1320
static bool mShowPlayersStatus
Definition: being.h:1346
Cursor ::T CursorT
Definition: cursor.h:43
bool isAdvanced() const
Definition: being.h:827
bool canTalk() const
Definition: being.h:666
void updateName()
Definition: being.cpp:3425
AnimatedSprite * mEmotionSprite
Definition: being.h:1177
void nextTile()
void setHairColor(const ItemColor color)
Definition: being.h:876
void updateSprite(const unsigned int slot, const int id, const std::string &color)
Definition: being.cpp:2771
void setCreatorId(const BeingId id)
Definition: being.h:1028
void drawPortal(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3828
void setPixelPositionF(const Vector &pos)
Definition: being.cpp:525
void addSpecialEffect(const int effect)
Definition: being.cpp:4928
static void reReadConfig()
Definition: being.cpp:3431
void setSubtype(const BeingTypeId subtype, const uint16_t look)
Definition: being.cpp:370
std::list< BeingCacheEntry * > beingInfoCache
Definition: being.cpp:147
void setKarma(const int karma)
Definition: being.h:1034
unsigned int getPvpRank() const
Definition: being.h:748
CursorT getHoverCursor() const
Definition: being.h:892
void setSpriteSlot(const unsigned int slot, const BeingSlot &beingSlot)
Definition: being.cpp:3403
HorseInfo * mHorseInfo
Definition: being.h:1312
GenderT mGender
Definition: being.h:1231
int mBadgesX
Definition: being.h:1373
const BeingInfo * getInfo() const
Definition: being.h:408
int mBadgesY
Definition: being.h:1374
int * mSpriteDraw
Definition: being.h:1305
void setParty(Party *const party)
Definition: being.cpp:1306
void removeSpiritBalls(const unsigned int balls)
Definition: being.cpp:5510
void showTeamBadge(const bool show)
Definition: being.cpp:5197
void drawPortalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4222
void drawElemental(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3816
int mY
Definition: being.h:1318
static BadgeDrawType::Type mShowBadges
Definition: being.h:1351
FlashText * mDispName
Definition: being.h:1194
void setName(const std::string &name)
Definition: being.cpp:1135
void handleSkillCasting(Being *const victim, const int skillId, const int skillLevel)
Definition: being.cpp:1024
bool mAway
Definition: being.h:1385
std::string mBuyBoard
Definition: being.h:1307
bool gm(InputEvent &event)
Definition: commands.cpp:74
int mAreaSize
Definition: being.h:1370
void setMinHit(const int n)
Definition: being.h:778
int getWalkSpeed() const
Definition: being.h:457
void moveBotTo(int dstX, int dstY)
Definition: being.cpp:2194
int getHitEffect(const Being *const attacker, const AttackTypeT type, const int attackId, const int level) const
Definition: being.cpp:869
int mCriticalHit
Definition: being.h:1363
int getHeight() const
Definition: being.h:535
static Move mMoveNames
Definition: being.h:1349
int getAttackSpeed() const
Definition: being.h:469
static BeingCacheEntry * getCacheEntry(const BeingId id)
Definition: being.cpp:3559
std::list< Position > Path
Definition: position.h:48
int getKarma() const
Definition: being.h:1037
int getActionTime() const
Definition: being.h:127
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:4253
bool getShowName() const
Definition: being.h:244
CursorT getHoverCursor() const
Definition: beinginfo.h:86
void removeGuild(const int id)
Definition: being.cpp:1247
uint16_t getTeamId() const
Definition: being.h:1085
Definition: color.h:74
void recalcSpritesOrder()
Definition: being.cpp:4359
void setTeamId(const uint16_t teamId)
Definition: being.cpp:5187
#define restrict
Definition: localconsts.h:156
static bool mShowOwnHP
Definition: being.h:1343
void showGuildBadge(const bool show)
Definition: being.cpp:1178
void drawHomunculus(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3792
int getTileX() const
Definition: being.h:167
void setLook(const uint16_t look)
Definition: being.cpp:5004
static unsigned int mConfLineLim
Definition: being.h:1335
std::string mSpriteAction
Definition: being.h:1182
#define override
Definition: localconsts.h:46
#define CAST_S16
Definition: cast.h:27
void setSellBoard(const std::string &text)
Definition: being.cpp:5328
uint8_t mOldHeight
Definition: being.h:1325
void draw(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3839
ItemColor mHairColor
Definition: being.h:1379
virtual int getLevel() const
Definition: being.h:603
void undressItemById(const int id)
Definition: being.cpp:4705
static std::string loadComment(const std::string &name, const ActorTypeT &type)
Definition: being.cpp:4734
void setHairColor(const unsigned int slot, const ItemColor color)
Definition: being.cpp:3389
std::string getWeaponAttackAction(const ItemInfo *const weapon) const
Definition: being.cpp:1451
std::map< int, Guild * > mGuilds
Definition: being.h:1213
void setTestTime()
Definition: being.h:714
Being * mOwner
Definition: being.h:1309
const SoundInfo * sound
Definition: being.h:87
int mAttackRange
Definition: being.h:1225
bool mAllowNpcEquipment
Definition: being.h:1389
int getCriticalHit() const
Definition: being.h:787
int mPixelOffsetY
Definition: being.h:1322
int getTargetOffsetY() const
Definition: beinginfo.h:140
UserColorId ::T UserColorIdT
Definition: usercolorid.h:98
time_t getTalkTime() const
Definition: being.h:726
std::string getGenderSignWithSpace() const
Definition: being.cpp:2540
std::string getGenderSign() const
Definition: being.cpp:2549
Particle * mSpecialParticle
Definition: being.h:1310
void addSpiritBalls(const unsigned int balls, const int effectId)
Definition: being.cpp:5495
void setChat(ChatObject *const obj)
Definition: being.cpp:5322
void handleAttack(Being *const victim, const int damage, const int attackId)
Definition: being.cpp:962
uint32_t guild
int main(int argc, char *argv[])
Definition: main.cpp:39
int BeingTypeId
Definition: beingtypeid.h:29
Definition: being.h:93
const std::string & getIp() const
Definition: being.h:742
Definition: guild.h:68
void addEffect(const std::string &name)
Definition: being.cpp:4959
int mSpeed
Definition: being.h:1301
void botFixOffset(int &dstX, int &dstY) const
Definition: being.cpp:2082
void setWeaponId(const int id)
Definition: being.cpp:3135
bool updateFromCache()
Definition: being.cpp:3464
uint16_t mBadgesCount
Definition: being.h:1378
void updateComment()
Definition: being.cpp:4725
static bool mShowLevel
Definition: being.h:1345
#define noexcept2
Definition: localconsts.h:49
BeingInfo * mInfo
Definition: being.h:1176
BeingTypeId getSubType() const
Definition: being.h:399
BeingActionT mAction
Definition: being.h:1232
#define restrict2
Definition: localconsts.h:157
void setSpriteCards(const unsigned int slot, const int id, const CardsList &cards)
Definition: being.cpp:3048
void incUsage()
Definition: being.h:971
std::map< int, ParticleInfo * > SpriteParticleInfo
Definition: being.h:1206
bool mAdvanced
Definition: being.h:1383
void unSetSprite(const unsigned int slot)
Definition: being.cpp:2861
void setAction(const BeingActionT &action, const int attackId)
int mHP
Definition: being.h:1328
TargetCursorSize ::T TargetCursorSizeT
void recreateItemParticles()
Definition: being.cpp:5163
void talkTo() const
Definition: being.cpp:3675
void drawOther(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3756
bool isGM() const
Definition: being.h:658
ChatObject * mChat
Definition: being.h:1311
ChatObject * getChat() const
Definition: being.h:1002
bool getAllowNpcEquipment() const
Definition: being.h:1105
void drawSpeech(const int offsetX, const int offsetY)
Definition: being.cpp:2407
void setGuild(Guild *const guild)
Definition: being.cpp:1353
time_t mOtherTime
Definition: being.h:1358
void fireMissile(Being *const victim, const MissileInfo &missile) const
Definition: being.cpp:1377
std::string getAttackAction() const
Definition: being.cpp:1524
void updateBotFollow(int dstX, int dstY, const int divX, const int divY)
Definition: being.cpp:2155
void setLevel(const int n)
Definition: being.h:600
void setMoveTime()
Definition: being.h:705
Definition: text.h:38
void setAttackTime()
Definition: being.h:708
void clearPath()
Definition: being.cpp:553
const ActorTypeT mType
Definition: being.h:1290
void setMaxHP(const int hp)
Definition: being.cpp:4343
int getCachedY() const
Definition: being.h:155
const std::string & getGuildName() const
Definition: being.h:258
void showName()
Definition: being.cpp:2578
void addItemParticles(const int id, const SpriteDisplay &display)
Definition: being.cpp:5044