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-2017 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  virtual ~Being();
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,
189  const std::string &restrict channel = "",
190  int time = 0) restrict2;
191 
201  void takeDamage(Being *restrict const attacker,
202  const int amount,
203  const AttackTypeT type,
204  const int attackId = 1,
205  const int level = 1) restrict2;
206 
214  void handleAttack(Being *restrict const victim,
215  const int damage,
216  const int attackId = 1) restrict2;
217 
218  void handleSkillCasting(Being *restrict const victim,
219  const int skillId,
220  const int skillLevel) restrict2;
221 
222  void handleSkill(Being *restrict const victim,
223  const int damage,
224  const int skillId,
225  const int skillLevel) restrict2;
226 
227  const ItemInfo *getEquippedWeapon() const restrict2 A_WARN_UNUSED
228  { return mEquippedWeapon; }
229 
233  const std::string &getName() const restrict2 noexcept2 A_WARN_UNUSED
234  { return mName; }
235 
236  const std::string &getExtName() const restrict2 noexcept2 A_WARN_UNUSED
237  { return mExtName; }
238 
244  void setName(const std::string &restrict name) restrict2;
245 
247  { return mShowName; }
248 
249  void setShowName(const bool doShowName) restrict2;
250 
254  void setPartyName(const std::string &restrict name) restrict2;
255 
256  const std::string &getPartyName() const restrict2 noexcept2
258  { return mPartyName; }
259 
260  const std::string &getGuildName() const restrict2 noexcept2
262  { return mGuildName; }
263 
268  void setGuildName(const std::string &restrict name) restrict2;
269 
270  void setGuildPos(const std::string &restrict pos) restrict2 A_CONST;
271 
275  void addGuild(Guild *restrict const guild) restrict2;
276 
280  void removeGuild(const int id) restrict2;
281 
285  const Guild *getGuild(const std::string &restrict guildName)
286  const restrict2 A_WARN_UNUSED;
287 
291  const Guild *getGuild(const int id) const restrict2 A_WARN_UNUSED;
292 
296  Guild *getGuild() const restrict2 A_WARN_UNUSED;
297 
301  const std::map<int, Guild*> &getGuilds() const restrict2 noexcept2
302  A_WARN_UNUSED
303  { return mGuilds; }
304 
308  void clearGuilds() restrict2;
309 
313  int16_t getNumberOfGuilds() const restrict2 A_WARN_UNUSED
314  { return CAST_S16(mGuilds.size()); }
315 
316  bool isInParty() const restrict2 noexcept2 A_WARN_UNUSED
317  { return mParty != nullptr; }
318 
319  void setParty(Party *restrict const party) restrict2;
320 
321  void setGuild(Guild *restrict const guild) restrict2;
322 
323  void updateGuild() restrict2;
324 
325  Party *getParty() const restrict2 noexcept2 A_WARN_UNUSED
326  { return mParty; }
327 
328  void setSprite(const unsigned int slot,
329  const int id,
330  std::string color,
331  ItemColor colorId) restrict2;
332 
333  void setSpriteColor(const unsigned int slot,
334  const int id,
335  const std::string &color) restrict2;
336 
337  void setSpriteColorId(const unsigned int slot,
338  const int id,
339  ItemColor colorId) restrict2;
340 
341  void setSpriteCards(const unsigned int slot,
342  const int id,
343  const CardsList &restrict cards) restrict2;
344 
345  void setSpriteId(const unsigned int slot,
346  const int id) restrict2;
347 
348  void unSetSprite(const unsigned int slot) restrict2;
349 
350  void setWeaponId(const int id) restrict2;
351 
352  void setTempSprite(const unsigned int slot,
353  const int id) restrict2;
354 
355  void setHairTempSprite(const unsigned int slot,
356  const int id) restrict2;
357 
358  void updateSprite(const unsigned int slot,
359  const int id,
360  const std::string &restrict color = "")
361  restrict2;
362 
363  void setHairColorSpriteID(const unsigned int slot,
364  const int id) restrict2;
365 
366  void setSpriteColor(const unsigned int slot,
367  const std::string &restrict color = "") restrict2;
368 
372  int getNumberOfLayers() const restrict2 override A_WARN_UNUSED
374 
378  void logic() restrict2 override;
379 
380  void botLogic() restrict2;
381 
385  void drawSpeech(const int offsetX,
386  const int offsetY) restrict2;
387 
391  void drawEmotion(Graphics *restrict const graphics,
392  const int offsetX,
393  const int offsetY) const restrict2 A_NONNULL(2);
394 
395  BeingTypeId getSubType() const restrict2 noexcept2 A_WARN_UNUSED
396  { return mSubType; }
397 
401  void setSubtype(const BeingTypeId subtype,
402  const uint16_t look) restrict2;
403 
404  const BeingInfo *getInfo() const restrict2 noexcept2 A_WARN_UNUSED
405  { return mInfo; }
406 
407  TargetCursorSizeT getTargetCursorSize() const restrict2 override final
409 
410  int getTargetOffsetX() const restrict2 override A_WARN_UNUSED
411  {
412  if (mInfo == nullptr)
413  return 0;
414  return mInfo->getTargetOffsetX();
415  }
416 
417  int getTargetOffsetY() const restrict2 override A_WARN_UNUSED
418  {
419  if (mInfo == nullptr)
420  return 0;
421  return mInfo->getTargetOffsetY();
422  }
423 
427  virtual unsigned char getBlockWalkMask() const restrict2 A_WARN_UNUSED
428  {
429  if (mInfo == nullptr)
430  return 0;
431  return mInfo->getBlockWalkMask();
432  }
433 
437  BlockTypeT getBlockType() const restrict2 override A_WARN_UNUSED
438  {
439  if (mInfo == nullptr)
440  return BlockType::NONE;
441  return mInfo->getBlockType();
442  }
443 
447  void setWalkSpeed(const int speed) restrict2
448  { mWalkSpeed = speed; mSpeed = speed; }
449 
453  int getWalkSpeed() const restrict2 noexcept2 A_WARN_UNUSED
454  { return mWalkSpeed; }
455 
459  void setAttackSpeed(const int speed) restrict2 noexcept2
460  { mAttackSpeed = speed; }
461 
465  int getAttackSpeed() const restrict2 noexcept2 A_WARN_UNUSED
466  { return mAttackSpeed; }
467 
471  virtual void setAction(const BeingActionT &restrict action,
472  const int attackId) restrict2;
473 
477  BeingActionT getCurrentAction() const restrict2 noexcept2 A_WARN_UNUSED
478  { return mAction; }
479 
483  bool isAlive() const restrict2 noexcept2 A_WARN_UNUSED
484  { return mAction != BeingAction::DEAD; }
485 
489  uint8_t getDirection() const restrict2 noexcept2 A_WARN_UNUSED
490  { return mDirection; }
491 
495  virtual void setDirection(const uint8_t direction) restrict2;
496 
497  void setDirectionDelayed(const uint8_t direction) restrict2 noexcept2
498  { mDirectionDelayed = direction; }
499 
500  uint8_t getDirectionDelayed() const restrict2 noexcept2 A_WARN_UNUSED
501  { return mDirectionDelayed; }
502 
507  A_WARN_UNUSED
508  { return mSpriteDirection; }
509 
510  void setPixelPositionF(const Vector &restrict pos) restrict2 override;
511 
517  inline void setPixelPositionF(const float x,
518  const float y,
519  const float z = 0.0F) restrict2 A_INLINE
520  { setPixelPositionF(Vector(x, y, z)); }
521 
525  int getWidth() const restrict2 override final A_WARN_UNUSED
526  { return std::max(CompoundSprite::getWidth(), DEFAULT_BEING_WIDTH); }
527 
531  int getHeight() const restrict2 override final A_WARN_UNUSED
532  { return std::max(CompoundSprite::getHeight(), DEFAULT_BEING_HEIGHT); }
533 
537  void fireMissile(Being *restrict const victim,
538  const MissileInfo &restrict missile) const restrict2;
539 
544  const Path &getPath() const restrict2 noexcept2 A_WARN_UNUSED
545  { return mPath; }
546 
547  int getDistance() const restrict2 noexcept2 A_WARN_UNUSED
548  { return mDistance; }
549 
550  void setDistance(const int n) restrict2 noexcept2
551  { mDistance = n; }
552 
557  void setEmote(const uint8_t emotion,
558  const int emote_time) restrict2;
559 
560  void setState(const uint8_t state) restrict2;
561 
562  void drawPlayerSprites(Graphics *restrict const graphics,
563  const int posX,
564  const int posY) const
565  restrict2 A_NONNULL(2);
566 
567  void drawSpritesSDL(Graphics *restrict const graphics,
568  const int posX,
569  const int posY) const
570  restrict2 override final A_NONNULL(2);
571 
572  void drawHpBar(Graphics *restrict const graphics,
573  const int maxHP,
574  const int hp,
575  const int damage,
576  const UserColorIdT color1,
577  const UserColorIdT color2,
578  const int x,
579  const int y,
580  const int width,
581  const int height) const restrict2 A_NONNULL(2);
582 
583  void optionChanged(const std::string &restrict value)
584  restrict2 override;
585 
586  void flashName(const int time) restrict2;
587 
588  int getDamageTaken() const restrict2 noexcept2 A_WARN_UNUSED
589  { return mDamageTaken; }
590 
591  void setDamageTaken(const int damage) restrict2 noexcept2
592  { mDamageTaken = damage; }
593 
594  void updateName() restrict2;
595 
596  void setLevel(const int n) restrict2 noexcept2
597  { mLevel = n; }
598 
599  virtual int getLevel() const restrict2 A_WARN_UNUSED
600  { return mLevel; }
601 
602  void setReachable(const ReachableT n) restrict2 noexcept2
603  { mReachable = n; }
604 
605  ReachableT getReachable() const restrict2 noexcept2 A_WARN_UNUSED
606  { return mReachable; }
607 
608  static void reReadConfig();
609 
611 
612  void addToCache() const restrict2;
613 
614  bool updateFromCache() restrict2;
615 
619  virtual void setGender(const GenderT gender) restrict2;
620 
621  GenderT getGender() const restrict2 noexcept2 A_WARN_UNUSED
622  { return mGender; }
623 
627  std::string getSitAction() const restrict2 A_WARN_UNUSED;
628 
629  std::string getCastAction() const restrict2 A_WARN_UNUSED;
630 
631  std::string getCastAction(const SkillInfo *restrict const skill) const
632  restrict2 A_WARN_UNUSED;
633 
634  std::string getMoveAction() const restrict2 A_WARN_UNUSED;
635 
636  std::string getDeadAction() const restrict2 A_WARN_UNUSED;
637 
638  std::string getStandAction() const restrict2 A_WARN_UNUSED;
639 
640  std::string getSpawnAction() const restrict2 A_WARN_UNUSED;
641 
642  std::string getWeaponAttackAction(const ItemInfo *restrict const
643  weapon) const
644  restrict2 A_WARN_UNUSED;
645 
646  std::string getAttackAction() const restrict2 A_WARN_UNUSED;
647 
648  std::string getAttackAction(const Attack *restrict const attack1) const
649  restrict2 A_WARN_UNUSED;
650 
654  bool isGM() const restrict2 noexcept2 A_WARN_UNUSED
655  { return mIsGM; }
656 
660  void setGM(const bool gm) restrict2;
661 
662  bool canTalk() const restrict2 noexcept2 A_WARN_UNUSED
663  { return mType == ActorType::Npc; }
664 
665  void talkTo() const restrict2;
666 
667  void draw(Graphics *restrict const graphics,
668  const int offsetX,
669  const int offsetY) const
670  restrict2 override final A_NONNULL(2);
671 
672  void drawPlayer(Graphics *restrict const graphics,
673  const int offsetX,
674  const int offsetY) const
675  restrict2 A_NONNULL(2);
676 
677  void drawOther(Graphics *restrict const graphics,
678  const int offsetX,
679  const int offsetY) const
680  restrict2 A_NONNULL(2);
681 
682  void drawNpc(Graphics *restrict const graphics,
683  const int offsetX,
684  const int offsetY) const
685  restrict2 A_NONNULL(2);
686 
687  void drawMonster(Graphics *restrict const graphics,
688  const int offsetX,
689  const int offsetY) const
690  restrict2 A_NONNULL(2);
691 
692  void drawPortal(Graphics *restrict const graphics,
693  const int offsetX,
694  const int offsetY) const
695  restrict2 A_NONNULL(2);
696 
697  void drawBasic(Graphics *restrict const graphics,
698  const int x,
699  const int y) const restrict2 A_NONNULL(2);
700 
701  void setMoveTime() restrict2 noexcept2
702  { mMoveTime = cur_time; }
703 
704  void setAttackTime() restrict2 noexcept2
705  { mAttackTime = cur_time; }
706 
707  void setTalkTime() restrict2 noexcept2
708  { mTalkTime = cur_time; }
709 
710  void setTestTime() restrict2 noexcept2
711  { mTestTime = cur_time; }
712 
713  void setOtherTime() restrict2 noexcept2
714  { mOtherTime = cur_time; }
715 
716  time_t getMoveTime() const restrict2 noexcept2
717  { return mMoveTime; }
718 
719  time_t getAttackTime() const restrict2 noexcept2
720  { return mAttackTime; }
721 
722  time_t getTalkTime() const restrict2 noexcept2
723  { return mTalkTime; }
724 
725  time_t getTestTime() const restrict2 noexcept2
726  { return mTestTime; }
727 
728  time_t getOtherTime() const restrict2 noexcept2
729  { return mOtherTime; }
730 
731  void resetCounters() restrict2;
732 
733  void updateColors() restrict2;
734 
735  void setEnemy(const bool n) restrict2 noexcept2
736  { mEnemy = n; }
737 
738  const std::string &getIp() const restrict2 noexcept2 A_WARN_UNUSED
739  { return mIp; }
740 
741  void setIp(const std::string &restrict ip) restrict2 noexcept2
742  { mIp = ip; }
743 
744  unsigned int getPvpRank() const restrict2 noexcept2 A_WARN_UNUSED
745  { return mPvpRank; }
746 
747  void setPvpRank(const unsigned int rank) restrict2 noexcept2
748  { mPvpRank = rank; }
749 
750  void setHP(const int hp) restrict2;
751 
752  void setMaxHP(const int hp) restrict2;
753 
754  int getHP() const restrict2 noexcept2 A_WARN_UNUSED
755  { return mHP; }
756 
757  int getMaxHP() const restrict2 noexcept2 A_WARN_UNUSED
758  { return mMaxHP; }
759 
760  uint8_t calcDirection(const int dstX,
761  const int dstY) const restrict2 A_WARN_UNUSED;
762 
763  uint8_t calcDirection() const restrict2 A_WARN_UNUSED;
764 
765  void setAttackDelay(const int n) restrict2 noexcept2
766  { mAttackDelay = n; }
767 
768  int getAttackDelay() const restrict2 noexcept2 A_WARN_UNUSED
769  { return mAttackDelay; }
770 
771  int getMinHit() const restrict2 noexcept2 A_WARN_UNUSED
772  { return mMinHit; }
773 
774  void setMinHit(const int n) restrict2 noexcept2
775  { mMinHit = n; }
776 
777  int getMaxHit() const restrict2 noexcept2 A_WARN_UNUSED
778  { return mMaxHit; }
779 
780  void setMaxHit(const int n) restrict2 noexcept2
781  { mMaxHit = n; }
782 
783  int getCriticalHit() const restrict2 A_WARN_UNUSED
784  { return mCriticalHit; }
785 
786  void setCriticalHit(const int n) restrict2 noexcept2
787  { mCriticalHit = n; }
788 
789  void updateHit(const int amount) restrict2;
790 
791  Equipment *getEquipment() restrict2 A_WARN_UNUSED;
792 
793  void undressItemById(const int id) restrict2;
794 
795  int getGoodStatus() const restrict2 noexcept2 A_WARN_UNUSED
796  { return mGoodStatus; }
797 
798  void setGoodStatus(const int n) restrict2 noexcept2
799  { mGoodStatus = n; }
800 
801  std::string getGenderSign() const restrict2 A_WARN_UNUSED;
802 
803  std::string getGenderSignWithSpace() const restrict2 A_WARN_UNUSED;
804 
805  void updateComment() restrict2;
806 
807  const std::string getComment() const restrict2 noexcept2 A_WARN_UNUSED
808  { return mComment; }
809 
810  void setComment(const std::string &restrict n) restrict2 noexcept2
811  { mComment = n; }
812 
813  static void clearCache();
814 
815  static std::string loadComment(const std::string &restrict name,
816  const ActorTypeT &restrict type)
818 
819  static void saveComment(const std::string &restrict name,
820  const std::string &restrict comment,
821  const ActorTypeT &restrict type);
822 
823  bool isAdvanced() const restrict2 noexcept2 A_WARN_UNUSED
824  { return mAdvanced; }
825 
826  void setAdvanced(const bool n) restrict2
827  { mAdvanced = n; addToCache(); }
828 
829  bool isBuyShopEnabled() const restrict2 A_WARN_UNUSED;
830 
831  bool isSellShopEnabled() const restrict2 A_WARN_UNUSED;
832 
833  void enableShop(const bool b) restrict2;
834 
838  void setAttackRange(const int range) restrict2 noexcept2
839  { mAttackRange = range; }
840 
841 /*
842  void attack(Being *restrict target = nullptr,
843  bool keep = false,
844  bool dontChangeEquipment = false) restrict2;
845 
846  void attack2(Being *restrict target = nullptr,
847  bool keep = false,
848  bool dontChangeEquipment = false) restrict2;
849 */
850 
851  void updatePercentHP() restrict2;
852 
853  void setRaceName(const std::string &restrict name) restrict2 noexcept2
854  { mRaceName = name; }
855 
856  std::string getRaceName() const restrict2 noexcept2 A_WARN_UNUSED
857  { return mRaceName; }
858 
859  int getSpriteID(const int slot) const restrict2 A_WARN_UNUSED;
860 
861  const BeingSlot &getSpriteSlot(const int slot) const
862  restrict2 A_WARN_UNUSED;
863 
864  ItemColor getSpriteColor(const int slot) const restrict2 A_WARN_UNUSED;
865 
866  void setHairStyle(const unsigned int slot,
867  const int id) restrict2;
868 
869  void setHairColor(const unsigned int slot,
870  const ItemColor color) restrict2;
871 
872  void setHairColor(const ItemColor color) restrict2 noexcept2
873  { mHairColor = color; }
874 
875  void setSpriteSlot(const unsigned int slot,
876  const BeingSlot &beingSlot);
877 
878  ItemColor getHairColor() const noexcept2 A_WARN_UNUSED
879  { return mHairColor; }
880 
882 
883  int getHitEffect(const Being *restrict const attacker,
884  const AttackTypeT type,
885  const int attackId,
886  const int level) const restrict2 A_WARN_UNUSED;
887 
888  CursorT getHoverCursor() const restrict2 A_WARN_UNUSED
889  {
890  return mInfo != nullptr ?
892  }
893 
894  void addAfkEffect() restrict2;
895 
896  void removeAfkEffect() restrict2;
897 
899 
900  void addSpecialEffect(const int effect) restrict2;
901 
903 
904  void addEffect(const std::string &restrict name) restrict2;
905 
906  void setOwner(Being *restrict const owner) restrict2 noexcept2
907  { mOwner = owner; }
908 
909  Being *getOwner() const restrict2 noexcept2
910  { return mOwner; }
911 
912  void playSfx(const SoundInfo &sound,
913  Being *const being,
914  const bool main,
915  const int x, const int y) const restrict2;
916 
917  uint16_t getLook() const restrict2 noexcept2
918  { return mLook; }
919 
920  void setLook(const uint16_t look) restrict2;
921 
922  constexpr2 static uint8_t genderToInt(const GenderT sex)
923  A_CONST A_WARN_UNUSED
924  {
925  switch (sex)
926  {
927  case Gender::FEMALE:
928  case Gender::UNSPECIFIED:
929  default:
930  return 0;
931  case Gender::MALE:
932  return 1;
933  case Gender::OTHER:
934  return 3;
935  }
936  }
937 
938  constexpr2 static GenderT intToGender(const uint8_t sex)
939  A_CONST A_WARN_UNUSED
940  {
941  switch (sex)
942  {
943  case 0:
944  default:
945  return Gender::FEMALE;
946  case 1:
947  return Gender::MALE;
948  case 3:
949  return Gender::OTHER;
950  }
951  }
952 
954 
958  void setPath(const Path &restrict path) restrict2;
959 
960  int getSortPixelY() const restrict2 override A_WARN_UNUSED
961  { return CAST_S32(mPos.y) - mYDiff - mSortOffsetY; }
962 
963  void setMap(Map *restrict const map) restrict2 override;
964 
966 
967  void incUsage() restrict2 noexcept2
968  { mUsageCounter ++; }
969 
970  int decUsage() restrict2 noexcept2
971  { return --mUsageCounter; }
972 
973  virtual int getLastAttackX() const restrict2
974  { return mLastAttackX; }
975 
976  virtual int getLastAttackY() const restrict2
977  { return mLastAttackY; }
978 
979  void drawHomunculus(Graphics *restrict const graphics,
980  const int offsetX,
981  const int offsetY) const
982  restrict2 A_NONNULL(2);
983 
984  void drawMercenary(Graphics *restrict const graphics,
985  const int offsetX,
986  const int offsetY) const
987  restrict2 A_NONNULL(2);
988 
989  void drawElemental(Graphics *restrict const graphics,
990  const int offsetX,
991  const int offsetY) const
992  restrict2 A_NONNULL(2);
993 
994  void setTrickDead(const bool b) restrict2 override final;
995 
996  void setChat(ChatObject *restrict const obj) restrict2;
997 
998  ChatObject *getChat() const restrict2 noexcept2
999  { return mChat; }
1000 
1001  void setRiding(const bool b) restrict2 override final;
1002 
1003  void setHorse(const int horseId) restrict2;
1004 
1005  void removeHorse() restrict2;
1006 
1007  void setSellBoard(const std::string &restrict text) restrict2;
1008 
1009  std::string getSellBoard() const restrict2 noexcept2 A_WARN_UNUSED
1010  { return mSellBoard; }
1011 
1012  void setBuyBoard(const std::string &restrict text) restrict2;
1013 
1014  std::string getBuyBoard() const restrict2 noexcept2 A_WARN_UNUSED
1015  { return mBuyBoard; }
1016 
1017  void setSpiritBalls(const unsigned int balls) restrict2;
1018 
1019  unsigned int getSpiritBalls() const restrict2 noexcept2 A_WARN_UNUSED
1020  { return mSpiritBalls; }
1021 
1022  void stopCast(const bool b) override final;
1023 
1024  void setCreatorId(const BeingId id)
1025  { mCreatorId = id; }
1026 
1027  BeingId getCreatorId() const noexcept2 A_WARN_UNUSED
1028  { return mCreatorId; }
1029 
1030  void setKarma(const int karma) restrict2 noexcept2
1031  { mKarma = karma; }
1032 
1033  int getKarma() const restrict2 noexcept2 A_WARN_UNUSED
1034  { return mKarma; }
1035 
1036  void setManner(const int manner) restrict2 noexcept2
1037  { mManner = manner; }
1038 
1039  int getManner() const restrict2 noexcept2 A_WARN_UNUSED
1040  { return mManner; }
1041 
1042  void disableBotAi() restrict2 noexcept2
1043  { mBotAi = false; }
1044 
1045  void enableBotAi() restrict2 noexcept2
1046  { mBotAi = true; }
1047 
1048  int getAreaSize() const restrict2 noexcept2 A_WARN_UNUSED
1049  { return mAreaSize; }
1050 
1051  void setAreaSize(const int areaSize) restrict2 noexcept2
1052  { mAreaSize = areaSize; }
1053 
1054  void setTeamId(const uint16_t teamId) restrict2;
1055 
1056  void showTeamBadge(const bool show) restrict2;
1057 
1058  void showGuildBadge(const bool show) restrict2;
1059 
1060  void showGmBadge(const bool show) restrict2;
1061 
1062  void showPartyBadge(const bool show) restrict2;
1063 
1064  void showNameBadge(const bool show) restrict2;
1065 
1066  void showShopBadge(const bool show) restrict2;
1067 
1068  void showInactiveBadge(const bool show) restrict2;
1069 
1070  void showAwayBadge(const bool show) restrict2;
1071 
1072  void showBadges(const bool show) restrict2;
1073 
1074  void setLanguageId(const int lang) restrict2 noexcept2;
1075 
1076  int getLanguageId() restrict2 noexcept2 A_WARN_UNUSED
1077  { return mLanguageId; }
1078 
1079  uint16_t getTeamId() const restrict2 noexcept2 A_WARN_UNUSED
1080  { return mTeamId; }
1081 
1082  virtual void setGroupId(const int id)
1083  { mGroupId = id; }
1084 
1085  int getGroupId() const noexcept2 A_WARN_UNUSED
1086  { return mGroupId; }
1087 
1088  void serverRemove() restrict2 noexcept2;
1089 
1090  void addCast(const int dstX,
1091  const int dstY,
1092  const int skillId,
1093  const int skillLevel,
1094  const int range,
1095  const int waitTimeTicks);
1096 
1097  void fixDirectionOffsets(int &offsetX,
1098  int &offsetY) const;
1099 
1100  bool getAllowNpcEquipment() const noexcept2 A_WARN_UNUSED
1101  { return mAllowNpcEquipment; }
1102 
1103  static Being *createBeing(const BeingId id,
1104  const ActorTypeT type,
1105  const BeingTypeId subtype,
1106  Map *const map);
1107 
1108  protected:
1109  void drawPlayerSpriteAt(Graphics *restrict const graphics,
1110  const int x,
1111  const int y) const restrict2 A_NONNULL(2);
1112 
1113  void drawOtherSpriteAt(Graphics *restrict const graphics,
1114  const int x,
1115  const int y) const restrict2 A_NONNULL(2);
1116 
1117  void drawNpcSpriteAt(Graphics *restrict const graphics,
1118  const int x,
1119  const int y) const restrict2 A_NONNULL(2);
1120 
1121  void drawPortalSpriteAt(Graphics *restrict const graphics,
1122  const int x,
1123  const int y) const restrict2 A_NONNULL(2);
1124 
1125  void drawMonsterSpriteAt(Graphics *restrict const graphics,
1126  const int x,
1127  const int y) const restrict2 A_NONNULL(2);
1128 
1129  void drawHomunculusSpriteAt(Graphics *restrict const graphics,
1130  const int x,
1131  const int y) const restrict2 A_NONNULL(2);
1132 
1133  void drawMercenarySpriteAt(Graphics *restrict const graphics,
1134  const int x,
1135  const int y) const restrict2 A_NONNULL(2);
1136 
1137  void drawElementalSpriteAt(Graphics *restrict const graphics,
1138  const int x,
1139  const int y) const restrict2 A_NONNULL(2);
1140 
1141  void drawCompound(Graphics *const graphics,
1142  const int posX,
1143  const int posY) const A_NONNULL(2);
1144 
1148  virtual void updateCoords() restrict2;
1149 
1150  void showName() restrict2;
1151 
1152  void addItemParticles(const int id,
1153  const SpriteDisplay &restrict display) restrict2;
1154 
1155  void addItemParticlesCards(const int id,
1156  const SpriteDisplay &restrict display,
1157  const CardsList &restrict cards) restrict2;
1158 
1160 
1161  void removeItemParticles(const int id) restrict2;
1162 
1164 
1165  void setDefaultNameColor(const UserColorIdT defaultColor) restrict2;
1166 
1168 
1169  static int getDefaultEffectId(const AttackTypeT &restrict type);
1170 
1176 
1177  std::string mSpriteAction;
1178  std::string mName;
1179  std::string mExtName;
1180  std::string mRaceName;
1181  std::string mPartyName;
1182  std::string mGuildName;
1183  std::string mSpeech;
1184 
1190 
1193 
1197 
1200  typedef std::map<int, ParticleInfo*> SpriteParticleInfo;
1201  typedef SpriteParticleInfo::iterator SpriteParticleInfoIter;
1202 
1203  STD_VECTOR<BeingSlot> mSlots;
1204  SpriteParticleInfo mSpriteParticles;
1205 
1206  // Character guild information
1207  std::map<int, Guild*> mGuilds;
1209 
1217  int mLevel;
1222 
1224 
1228  uint8_t mDirection;
1232  bool mIsGM;
1233 
1234  protected:
1235  void postInit(const BeingTypeId subType,
1236  Map *const map);
1237 
1238  void updateBadgesPosition();
1239 
1244  template<signed char pos, signed char neg>
1245  int getOffset() const restrict2 A_WARN_UNUSED;
1246 
1247  int searchSlotValue(const STD_VECTOR<int> &restrict slotRemap,
1248  const int val) const restrict2 A_WARN_UNUSED;
1249 
1250  static void searchSlotValueItr(STD_VECTOR<int>::iterator &restrict it,
1251  int &idx,
1252  STD_VECTOR<int> &restrict slotRemap,
1253  const int val);
1254 
1255  void addSpiritBalls(const unsigned int balls,
1256  const int effectId) restrict2;
1257 
1258  void removeSpiritBalls(const unsigned int balls) restrict2;
1259 
1260  void dumpSprites() const restrict2;
1261 
1262  void drawBeingCursor(Graphics *const graphics,
1263  const int offsetX,
1264  const int offsetY) const A_NONNULL(2);
1265 
1266  void drawCasting(Graphics *const graphics,
1267  const int offsetX,
1268  const int offsetY) const A_NONNULL(2);
1269 
1270  void updateBotFollow(int dstX,
1271  int dstY,
1272  const int divX,
1273  const int divY);
1274 
1275  void moveBotTo(int dstX,
1276  int dstY);
1277 
1278  void updateBotDirection(const int dstX,
1279  const int dstY);
1280 
1281  void botFixOffset(int &restrict dstX,
1282  int &restrict dstY) const;
1283 
1285 
1288 
1295  int mSpeed;
1296  std::string mIp;
1298  int *restrict mSpriteHide A_NONNULLPOINTER;
1299  int *restrict mSpriteDraw A_NONNULLPOINTER;
1300  std::string mComment;
1301  std::string mBuyBoard;
1302  std::string mSellBoard;
1310 
1311  int mX; // position in tiles
1312  int mY; // position in tiles
1315  int mSortOffsetY; // caculated offset in pixels based on mPixelOffsetY
1316  int mPixelOffsetY; // tile height offset in pixels
1317  // calculated between tiles
1318  int mFixedOffsetY; // fixed tile height offset in pixels for tile
1319  uint8_t mOldHeight;
1320 
1322  int mHP;
1323  int mMaxHP;
1327 
1328  static time_t mUpdateConfigTime;
1329  static unsigned int mConfLineLim;
1330  static int mSpeechType;
1333  static bool mLowTraffic;
1334  static bool mDrawHotKeys;
1335  static bool mShowBattleEvents;
1336  static bool mShowMobHP;
1337  static bool mShowOwnHP;
1338  static bool mShowGender;
1339  static bool mShowLevel;
1340  static bool mShowPlayersStatus;
1342  static bool mHideErased;
1344  static bool mUseDiagonal;
1346  static int mAwayEffect;
1348 
1349  time_t mMoveTime;
1350  time_t mAttackTime;
1351  time_t mTalkTime;
1352  time_t mOtherTime;
1353  time_t mTestTime;
1355  int mMinHit;
1356  int mMaxHit;
1358  unsigned int mPvpRank;
1359  unsigned int mNumber;
1360  unsigned int mSpiritBalls;
1362  int mKarma;
1363  int mManner;
1370  uint16_t mTeamId;
1371  uint16_t mLook;
1372  uint16_t mBadgesCount;
1374  bool mErased;
1375  bool mEnemy;
1378  bool mShop;
1379  bool mAway;
1382  bool mBotAi;
1384 };
1385 
1386 extern std::list<BeingCacheEntry*> beingInfoCache;
1387 
1388 #endif // BEING_BEING_H
int getMaxHit() const
Definition: being.h:777
void setDistance(const int n)
Definition: being.h:550
static bool mDrawHotKeys
Definition: being.h:1334
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:4821
void setAttackSpeed(const int speed)
Definition: being.h:459
SpriteParticleInfo mSpriteParticles
Definition: being.h:1204
void drawHomunculusSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3992
void resetCounters()
Definition: being.cpp:4282
void setRaceName(const std::string &name)
Definition: being.h:853
std::string getDeadAction() const
Definition: being.cpp:1486
int mSpeechTime
Definition: being.h:1214
unsigned int mPvpRank
Definition: being.h:1358
int getTargetOffsetY() const
Definition: being.h:417
void updatePercentHP()
Definition: being.cpp:4803
void setHairTempSprite(const unsigned int slot, const int id)
Definition: being.cpp:3153
void updateBadgesCount()
Definition: being.cpp:5232
static bool mEnableReorderSprites
Definition: being.h:1341
unsigned int getSpiritBalls() const
Definition: being.h:1019
uint16_t getLook() const
Definition: being.h:917
const std::string & getPartyName() const
Definition: being.h:256
bool mBotAi
Definition: being.h:1382
void removeAllItemsParticles()
Definition: being.cpp:4961
int getOffset() const
Definition: being.cpp:2426
static const int DEFAULT_BEING_WIDTH
Definition: being.h:51
int mAttackSpeed
Definition: being.h:1215
void playSfx(const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const
Definition: being.cpp:4891
void updateCoords()
std::string getRaceName() const
Definition: being.h:856
static bool mHideErased
Definition: being.h:1342
int getNumberOfLayers() const
Definition: being.h:372
void showInactiveBadge(const bool show)
Definition: being.cpp:5196
int getTileY() const
Definition: being.h:173
bool skill(InputEvent &event)
Definition: commands.cpp:96
const std::string & getExtName() const
Definition: being.h:236
bool mEnemy
Definition: being.h:1375
BeingAction ::T BeingActionT
Definition: beingaction.h:40
void setShowName(const bool doShowName)
Definition: being.cpp:1155
NextSoundInfo()
Definition: being.h:77
void setAttackRange(const int range)
Definition: being.h:838
Being * createBeing(const BeingId id, const int job)
Definition: beingrecv.cpp:500
SpriteDirection::Type mSpriteDirection
Definition: being.h:1230
Definition: party.h:61
void setDestination(const int x, const int y)
void setLanguageId(const int lang)
Definition: being.cpp:5474
#define A_NONNULLPOINTER
Definition: localconsts.h:294
BlockTypeT getBlockType() const
Definition: beinginfo.h:128
void showBadges(const bool show)
Definition: being.cpp:5138
static bool mUseDiagonal
Definition: being.h:1344
void setDamageTaken(const int damage)
Definition: being.h:591
std::string mGuildName
Definition: being.h:1182
void drawMonsterSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3938
int getAttackDelay() const
Definition: being.h:768
int mKarma
Definition: being.h:1362
void setSpeech(const std::string &text, const std::string &channel="", int time=0)
Definition: being.cpp:567
int16_t getNumberOfGuilds() const
Definition: being.h:313
Equipment * getEquipment()
Definition: playerinfo.cpp:232
time_t getTestTime() const
Definition: being.h:725
void setTileCoords(const int x, const int y)
Definition: being.cpp:4934
uint8_t mDirection
Definition: being.h:1228
std::string getBuyBoard() const
Definition: being.h:1014
std::string getSitAction() const
Definition: being.cpp:1378
void setDefaultNameColor(const UserColorIdT defaultColor)
Definition: being.cpp:2596
void updateColors()
Definition: being.cpp:2616
bool isBuyShopEnabled() const
Definition: being.cpp:5271
int mFixedOffsetY
Definition: being.h:1318
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3870
void setGuildName(const std::string &name)
Definition: being.cpp:1184
void setTalkTime()
Definition: being.h:707
GenderT getGender() const
Definition: being.h:621
void setMap(Map *const map)
const Color * mNameColor
Definition: being.h:1189
time_t mAttackTime
Definition: being.h:1350
static bool mShowBattleEvents
Definition: being.h:1335
uint16_t mLook
Definition: being.h:1371
Definition: vector.h:38
unsigned int mSpiritBalls
Definition: being.h:1360
void setOtherTime()
Definition: being.h:713
std::vector< AnimatedSprite * > mDownHorseSprites
Definition: being.h:1307
virtual int getLastAttackX() const
Definition: being.h:973
int mEmotionTime
Definition: being.h:1211
#define constexpr2
Definition: localconsts.h:48
std::string getSellBoard() const
Definition: being.h:1009
int getCachedX() const
Definition: being.h:152
int getManner() const
Definition: being.h:1039
void setTrickDead(const bool b)
Definition: being.cpp:5385
time_t getOtherTime() const
Definition: being.h:728
const Vector & getDestination() const
Definition: being.h:161
void setGoodStatus(const int n)
Definition: being.h:798
void drawMonster(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3713
int searchSlotValue(const std::vector< int > &slotRemap, const int val) const
Definition: being.cpp:4577
#define A_WARN_UNUSED
Definition: localconsts.h:172
void setCachedDestination(const int dstX, const int dstY)
Definition: being.h:148
bool mIsGM
Definition: being.h:1232
int mCachedX
Definition: being.h:1313
void serverRemove()
Definition: being.cpp:5283
#define final
Definition: localconsts.h:45
virtual void setGender(const GenderT gender)
Definition: being.cpp:3514
Path mPath
Definition: being.h:1194
void takeDamage(Being *const attacker, const int amount, const AttackTypeT type, const int attackId=1, const int level=1)
Definition: being.cpp:669
CastingEffect * mCastingEffect
Definition: being.h:1174
int BeingId
Definition: beingid.h:29
int mLevel
Definition: being.h:1217
void drawBasic(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3863
static const int DEFAULT_BEING_HEIGHT
Definition: being.h:52
SpriteParticleInfo::iterator SpriteParticleInfoIter
Definition: being.h:1201
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3667
virtual void setGroupId(const int id)
Definition: being.h:1082
BlockType ::T BlockTypeT
Definition: blocktype.h:40
void showAwayBadge(const bool show)
Definition: being.cpp:5214
AnimatedSprite * mAnimationEffect
Definition: being.h:1173
virtual unsigned char getBlockWalkMask() const
Definition: being.h:427
void drawElementalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4102
int mDistance
Definition: being.h:1324
static bool mHighlightMapPortals
Definition: being.h:1331
Being(const BeingId id, const ActorTypeT type)
Definition: being.cpp:163
int mAttackDelay
Definition: being.h:1354
static VisibleNamePos::Type mVisibleNamePos
Definition: being.h:1347
void setAttackDelay(const int n)
Definition: being.h:765
static bool mLowTraffic
Definition: being.h:1333
ActorType ::T ActorTypeT
Definition: actortype.h:42
Party * getParty() const
Definition: being.h:325
uint16_t ItemColor
Definition: itemcolor.h:29
uint8_t getDirection() const
Definition: being.h:489
int getDistance() const
Definition: being.h:547
std::string mPartyName
Definition: being.h:1181
int getMinHit() const
Definition: being.h:771
static time_t mUpdateConfigTime
Definition: being.h:1328
time_t getAttackTime() const
Definition: being.h:719
const Color * mTextColor
Definition: being.h:1196
int getNumberOfLayers() const
std::vector< AnimatedSprite * > mUpHorseSprites
Definition: being.h:1308
int mManner
Definition: being.h:1363
Guild * getGuild() const
Definition: being.cpp:1241
void setAreaSize(const int areaSize)
Definition: being.h:1051
void drawMercenarySpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4047
void setAdvanced(const bool n)
Definition: being.h:826
#define A_NONNULL(...)
Definition: localconsts.h:179
void setWalkSpeed(const int speed)
Definition: being.h:447
Text * mText
Definition: being.h:1195
std::string mSellBoard
Definition: being.h:1302
void updateBadgesPosition()
Definition: being.cpp:2272
BeingId getCreatorId() const
Definition: being.h:1027
uint32_t party
void setSpiritBalls(const unsigned int balls)
Definition: being.cpp:5394
static GenderT intToGender(const uint8_t sex) A_CONST
Definition: being.h:938
const std::map< int, Guild * > & getGuilds() const
Definition: being.h:301
#define STD_VECTOR
Definition: vector.h:29
Being * getOwner() const
Definition: being.h:909
bool isSellShopEnabled() const
Definition: being.cpp:5277
std::string getCastAction() const
Definition: being.cpp:1485
static void saveComment(const std::string &name, const std::string &comment, const ActorTypeT &type)
Definition: being.cpp:4698
Vector mDest
Definition: being.h:1198
SpriteDirection::Type getSpriteDirection() const
Definition: being.h:506
void setPartyName(const std::string &name)
Definition: being.cpp:5169
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
Definition: being.cpp:2828
void drawNpc(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3701
std::string mRaceName
Definition: being.h:1180
const std::string getComment() const
Definition: being.h:807
Reachable ::T ReachableT
Definition: reachable.h:34
uint16_t mTeamId
Definition: being.h:1370
ReachableT mReachable
Definition: being.h:1325
void setHairColorSpriteID(const unsigned int slot, const int id)
Definition: being.cpp:3225
int getTargetOffsetX() const
Definition: being.h:410
std::vector< Particle * > mSpiritParticles
Definition: being.h:1309
int decUsage()
Definition: being.h:970
std::vector< BeingSlot > mSlots
Definition: being.h:1203
static uint8_t genderToInt(const GenderT sex) A_CONST
Definition: being.h:922
void removeItemParticles(const int id)
Definition: being.cpp:5072
int mMaxHit
Definition: being.h:1356
bool mErased
Definition: being.h:1374
std::string mName
Definition: being.h:1178
std::string getSpawnAction() const
Definition: being.cpp:1487
void setEmote(const uint8_t emotion, const int emote_time)
Definition: being.cpp:4756
void updateAwayEffect()
Definition: being.cpp:4876
void removeHorse()
Definition: being.cpp:5324
void addToCache() const
Definition: being.cpp:3446
int mGoodStatus
Definition: being.h:1326
virtual void setDirection(const uint8_t direction)
Definition: being.cpp:1649
void setHP(const int hp)
Definition: being.cpp:4266
time_t mTestTime
Definition: being.h:1353
void addGuild(Guild *const guild)
Definition: being.cpp:1198
void setCriticalHit(const int n)
Definition: being.h:786
void updateSprite(const unsigned int slot, const int id, const std::string &color="")
Definition: being.cpp:2710
void drawSpritesSDL(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3846
void setDirectionDelayed(const uint8_t direction)
Definition: being.h:497
void showShopBadge(const bool show)
Definition: being.cpp:5178
void setPath(const Path &path)
Definition: being.cpp:554
static bool mHighlightMonsterAttackRange
Definition: being.h:1332
int getSortPixelY() const
Definition: being.h:960
virtual int getLastAttackY() const
Definition: being.h:976
ReachableT getReachable() const
Definition: being.h:605
void drawNpcSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3931
bool mInactive
Definition: being.h:1380
BeingTypeId mSubType
Definition: being.h:1227
std::string mSpeech
Definition: being.h:1183
BlockTypeT getBlockType() const
Definition: being.h:437
Party * mParty
Definition: being.h:1208
static void searchSlotValueItr(std::vector< int >::iterator &it, int &idx, std::vector< int > &slotRemap, const int val)
Definition: being.cpp:4589
void drawPlayer(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3627
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:5345
bool mNeedPosUpdate
Definition: being.h:1381
void setState(const uint8_t state)
Definition: being.cpp:4730
void updateGuild()
Definition: being.cpp:1294
SpeechBubble * mSpeechBubble
Definition: being.h:1287
#define CAST_S32
Definition: cast.h:29
int getTargetOffsetX() const
Definition: beinginfo.h:134
void botLogic()
Definition: being.cpp:1955
int mUsageCounter
Definition: being.h:1361
void setActionTime(const int actionTime)
Definition: being.h:134
void clearGuilds()
Definition: being.cpp:1250
std::string mIp
Definition: being.h:1296
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
Definition: being.h:1175
uint8_t mDirectionDelayed
Definition: being.h:1229
void stopCast(const bool b)
Definition: being.cpp:5441
void setBuyBoard(const std::string &text)
Definition: being.cpp:5256
static bool mShowMobHP
Definition: being.h:1336
int mX
Definition: being.h:1311
NextSoundInfo mNextSound
Definition: being.h:953
int getGoodStatus() const
Definition: being.h:795
static int mAwayEffect
Definition: being.h:1346
void flashName(const int time)
Definition: being.cpp:2491
void setIp(const std::string &ip)
Definition: being.h:741
std::string getMoveAction() const
Definition: being.cpp:1396
int mMaxHP
Definition: being.h:1323
int mLanguageId
Definition: being.h:1366
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:2904
void updateHit(const int amount)
Definition: being.cpp:4613
const ItemInfo * mEquippedWeapon
Definition: being.h:1192
void setOwner(Being *const owner)
Definition: being.h:906
void showGmBadge(const bool show)
Definition: being.cpp:3578
time_t mMoveTime
Definition: being.h:1349
void drawOtherSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3924
void setPvpRank(const unsigned int rank)
Definition: being.h:747
int getWidth() const
void showPartyBadge(const bool show)
Definition: being.cpp:5150
int getWidth() const
Definition: being.h:525
void setEnemy(const bool n)
Definition: being.h:735
void removeAfkEffect()
Definition: being.cpp:4850
TargetCursorSizeT getTargetCursorSize() const
Definition: being.cpp:518
std::string mComment
Definition: being.h:1300
int * mSpriteHide
Definition: being.h:1298
int mMinHit
Definition: being.h:1355
uint8_t getDirectionDelayed() const
Definition: being.h:500
void handleSkill(Being *const victim, const int damage, const int skillId, const int skillLevel)
Definition: being.cpp:1040
ItemColor getHairColor() const
Definition: being.h:878
void setGuildPos(const std::string &pos) A_CONST
Definition: being.cpp:1194
unsigned char getBlockWalkMask() const
Definition: beinginfo.h:122
bool isAlive() const
Definition: being.h:483
void addCast(const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const int waitTimeTicks)
Definition: being.cpp:5289
const Path & getPath() const
Definition: being.h:544
BeingActionT getCurrentAction() const
Definition: being.h:477
void enableBotAi()
Definition: being.h:1045
#define notfinal
Definition: localconsts.h:289
int mLastAttackY
Definition: being.h:1221
int mDamageTaken
Definition: being.h:1321
void setMaxHit(const int n)
Definition: being.h:780
void removeSpecialEffect()
Definition: being.cpp:4866
void disableBotAi()
Definition: being.h:1042
ActorTypeT getType() const
Definition: being.h:115
std::string getStandAction() const
Definition: being.cpp:1489
int * mSpriteRemap
Definition: being.h:1297
int mCastEndTime
Definition: being.h:1365
int time
Definition: being.h:90
ItemColor getSpriteColor(const int slot) const
Definition: being.cpp:4837
bool mGotComment
Definition: being.h:1376
void addAfkEffect()
Definition: being.cpp:4845
void setPixelPositionF(const float x, const float y, const float z=0.0F) A_INLINE
Definition: being.h:517
void setTempSprite(const unsigned int slot, const int id)
Definition: being.cpp:3079
void postInit(const BeingTypeId subType, Map *const map)
Definition: being.cpp:289
static bool mShowGender
Definition: being.h:1338
void setReachable(const ReachableT n)
Definition: being.h:602
bool isInParty() const
Definition: being.h:316
int mLastAttackX
Definition: being.h:1220
bool mShop
Definition: being.h:1378
std::string mExtName
Definition: being.h:1179
virtual ~Being()
Definition: being.cpp:337
void createSpeechBubble()
Definition: being.cpp:366
void handleAttack(Being *const victim, const int damage, const int attackId=1)
Definition: being.cpp:953
const ItemInfo * getEquippedWeapon() const
Definition: being.h:227
void setSpriteId(const unsigned int slot, const int id)
Definition: being.cpp:2728
uint8_t calcDirection() const
Definition: being.cpp:1712
const BeingSlot & getSpriteSlot(const int slot) const
Definition: being.cpp:4829
void addItemParticlesCards(const int id, const SpriteDisplay &display, const CardsList &cards)
Definition: being.cpp:5005
void setComment(const std::string &n)
Definition: being.h:810
int getLanguageId()
Definition: being.h:1076
void setGM(const bool gm)
Definition: being.cpp:3597
int getGroupId() const
Definition: being.h:1085
void drawEmotion(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:2334
time_t mTalkTime
Definition: being.h:1351
volatile time_t cur_time
Definition: timer.cpp:57
bool mShowName
Definition: being.h:1231
unsigned int mNumber
Definition: being.h:1359
int getHP() const
Definition: being.h:754
int getAreaSize() const
Definition: being.h:1048
void setHairStyle(const unsigned int slot, const int id)
Definition: being.cpp:3305
AttackType ::T AttackTypeT
Definition: attacktype.h:46
static int getDefaultEffectId(const AttackTypeT &type)
Definition: being.cpp:943
void setRiding(const bool b)
Definition: being.cpp:5332
void setManner(const int manner)
Definition: being.h:1036
const std::string & getName() const
Definition: being.h:233
BeingId mCreatorId
Definition: being.h:1369
int mWalkSpeed
Definition: being.h:1294
void drawPlayerSprites(Graphics *const graphics, const int posX, const int posY) const
Definition: being.cpp:3826
int mActionTime
Definition: being.h:1210
Definition: map.h:68
void drawMercenary(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3737
Gender ::T GenderT
Definition: gender.h:35
void drawPlayerSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:3900
void enableShop(const bool b)
Definition: being.cpp:5264
int getDamageTaken() const
Definition: being.h:588
void showNameBadge(const bool show)
Definition: being.cpp:1109
void dumpSprites() const
Definition: being.cpp:3342
void updateBotDirection(const int dstX, const int dstY)
Definition: being.cpp:2183
int mSortOffsetY
Definition: being.h:1315
int mGroupId
Definition: being.h:1218
void fixDirectionOffsets(int &offsetX, int &offsetY) const
Definition: being.cpp:5447
int getMaxHP() const
Definition: being.h:757
int mYDiff
Definition: actor.h:140
static int mSpeechType
Definition: being.h:1330
time_t getMoveTime() const
Definition: being.h:716
int mPreStandTime
Definition: being.h:1223
int mCachedY
Definition: being.h:1314
static bool mShowPlayersStatus
Definition: being.h:1340
Cursor ::T CursorT
Definition: cursor.h:43
bool isAdvanced() const
Definition: being.h:823
bool canTalk() const
Definition: being.h:662
void updateName()
Definition: being.cpp:3358
AnimatedSprite * mEmotionSprite
Definition: being.h:1172
void nextTile()
Definition: localplayer.h:88
void setHairColor(const ItemColor color)
Definition: being.h:872
void setCreatorId(const BeingId id)
Definition: being.h:1024
void drawPortal(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3761
void setPixelPositionF(const Vector &pos)
Definition: being.cpp:526
void addSpecialEffect(const int effect)
Definition: being.cpp:4855
static void reReadConfig()
Definition: being.cpp:3364
void setSubtype(const BeingTypeId subtype, const uint16_t look)
Definition: being.cpp:371
std::list< BeingCacheEntry * > beingInfoCache
Definition: being.cpp:149
void setKarma(const int karma)
Definition: being.h:1030
unsigned int getPvpRank() const
Definition: being.h:744
CursorT getHoverCursor() const
Definition: being.h:888
void setSpriteSlot(const unsigned int slot, const BeingSlot &beingSlot)
Definition: being.cpp:3336
HorseInfo * mHorseInfo
Definition: being.h:1306
GenderT mGender
Definition: being.h:1225
int mBadgesX
Definition: being.h:1367
const BeingInfo * getInfo() const
Definition: being.h:404
int mBadgesY
Definition: being.h:1368
int * mSpriteDraw
Definition: being.h:1299
void setParty(Party *const party)
Definition: being.cpp:1268
void removeSpiritBalls(const unsigned int balls)
Definition: being.cpp:5429
void showTeamBadge(const bool show)
Definition: being.cpp:5121
void drawPortalSpriteAt(Graphics *const graphics, const int x, const int y) const
Definition: being.cpp:4155
void drawElemental(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3749
int mY
Definition: being.h:1312
static BadgeDrawType::Type mShowBadges
Definition: being.h:1345
FlashText * mDispName
Definition: being.h:1188
void setName(const std::string &name)
Definition: being.cpp:1125
void handleSkillCasting(Being *const victim, const int skillId, const int skillLevel)
Definition: being.cpp:1015
bool mAway
Definition: being.h:1379
std::string mBuyBoard
Definition: being.h:1301
bool gm(InputEvent &event)
Definition: commands.cpp:74
int mAreaSize
Definition: being.h:1364
void setMinHit(const int n)
Definition: being.h:774
int getWalkSpeed() const
Definition: being.h:453
void moveBotTo(int dstX, int dstY)
Definition: being.cpp:2151
int getHitEffect(const Being *const attacker, const AttackTypeT type, const int attackId, const int level) const
Definition: being.cpp:860
int mCriticalHit
Definition: being.h:1357
int getHeight() const
Definition: being.h:531
static Move mMoveNames
Definition: being.h:1343
int getAttackSpeed() const
Definition: being.h:465
static BeingCacheEntry * getCacheEntry(const BeingId id)
Definition: being.cpp:3492
std::list< Position > Path
Definition: position.h:48
int getKarma() const
Definition: being.h:1033
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:4185
bool getShowName() const
Definition: being.h:246
CursorT getHoverCursor() const
Definition: beinginfo.h:86
void removeGuild(const int id)
Definition: being.cpp:1209
uint16_t getTeamId() const
Definition: being.h:1079
Definition: color.h:74
void recalcSpritesOrder()
Definition: being.cpp:4291
void setTeamId(const uint16_t teamId)
Definition: being.cpp:5111
#define restrict
Definition: localconsts.h:176
static bool mShowOwnHP
Definition: being.h:1337
void showGuildBadge(const bool show)
Definition: being.cpp:1168
void drawHomunculus(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3725
int getTileX() const
Definition: being.h:167
void setLook(const uint16_t look)
Definition: being.cpp:4928
static unsigned int mConfLineLim
Definition: being.h:1329
std::string mSpriteAction
Definition: being.h:1177
#define override
Definition: localconsts.h:46
#define CAST_S16
Definition: cast.h:27
void setSellBoard(const std::string &text)
Definition: being.cpp:5248
uint8_t mOldHeight
Definition: being.h:1319
void draw(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3772
ItemColor mHairColor
Definition: being.h:1373
virtual int getLevel() const
Definition: being.h:599
void undressItemById(const int id)
Definition: being.cpp:4632
static std::string loadComment(const std::string &name, const ActorTypeT &type)
Definition: being.cpp:4661
void setHairColor(const unsigned int slot, const ItemColor color)
Definition: being.cpp:3322
std::string getWeaponAttackAction(const ItemInfo *const weapon) const
Definition: being.cpp:1411
std::map< int, Guild * > mGuilds
Definition: being.h:1207
void setTestTime()
Definition: being.h:710
Being * mOwner
Definition: being.h:1303
const SoundInfo * sound
Definition: being.h:87
int mAttackRange
Definition: being.h:1219
bool mAllowNpcEquipment
Definition: being.h:1383
int getCriticalHit() const
Definition: being.h:783
int mPixelOffsetY
Definition: being.h:1316
int getTargetOffsetY() const
Definition: beinginfo.h:140
UserColorId ::T UserColorIdT
Definition: usercolorid.h:98
time_t getTalkTime() const
Definition: being.h:722
std::string getGenderSignWithSpace() const
Definition: being.cpp:2497
std::string getGenderSign() const
Definition: being.cpp:2506
Particle * mSpecialParticle
Definition: being.h:1304
void addSpiritBalls(const unsigned int balls, const int effectId)
Definition: being.cpp:5415
void setChat(ChatObject *const obj)
Definition: being.cpp:5242
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:738
Definition: guild.h:68
void addEffect(const std::string &name)
Definition: being.cpp:4884
int mSpeed
Definition: being.h:1295
void botFixOffset(int &dstX, int &dstY) const
Definition: being.cpp:2039
void setWeaponId(const int id)
Definition: being.cpp:3071
bool updateFromCache()
Definition: being.cpp:3397
uint16_t mBadgesCount
Definition: being.h:1372
void updateComment()
Definition: being.cpp:4652
static bool mShowLevel
Definition: being.h:1339
#define noexcept2
Definition: localconsts.h:49
BeingInfo * mInfo
Definition: being.h:1171
BeingTypeId getSubType() const
Definition: being.h:395
BeingActionT mAction
Definition: being.h:1226
#define restrict2
Definition: localconsts.h:177
void setSpriteCards(const unsigned int slot, const int id, const CardsList &cards)
Definition: being.cpp:2984
void incUsage()
Definition: being.h:967
std::map< int, ParticleInfo * > SpriteParticleInfo
Definition: being.h:1200
bool mAdvanced
Definition: being.h:1377
void unSetSprite(const unsigned int slot)
Definition: being.cpp:2799
void setAction(const BeingActionT &action, const int attackId)
int mHP
Definition: being.h:1322
TargetCursorSize ::T TargetCursorSizeT
void recreateItemParticles()
Definition: being.cpp:5087
void talkTo() const
Definition: being.cpp:3608
void drawOther(Graphics *const graphics, const int offsetX, const int offsetY) const
Definition: being.cpp:3689
bool isGM() const
Definition: being.h:654
ChatObject * mChat
Definition: being.h:1305
ChatObject * getChat() const
Definition: being.h:998
bool getAllowNpcEquipment() const
Definition: being.h:1100
void drawSpeech(const int offsetX, const int offsetY)
Definition: being.cpp:2364
void setGuild(Guild *const guild)
Definition: being.cpp:1315
time_t mOtherTime
Definition: being.h:1352
void fireMissile(Being *const victim, const MissileInfo &missile) const
Definition: being.cpp:1339
std::string getAttackAction() const
Definition: being.cpp:1484
void updateBotFollow(int dstX, int dstY, const int divX, const int divY)
Definition: being.cpp:2112
void setLevel(const int n)
Definition: being.h:596
void setMoveTime()
Definition: being.h:701
Definition: text.h:38
void setAttackTime()
Definition: being.h:704
void clearPath()
Definition: being.cpp:549
const ActorTypeT mType
Definition: being.h:1284
void setMaxHP(const int hp)
Definition: being.cpp:4275
int getCachedY() const
Definition: being.h:155
const std::string & getGuildName() const
Definition: being.h:260
void showName()
Definition: being.cpp:2535
void addItemParticles(const int id, const SpriteDisplay &display)
Definition: being.cpp:4968