ManaPlus
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
ActorManager Class Reference

#include <actormanager.h>

Inheritance diagram for ActorManager:
ConfigListener

Public Member Functions

 ActorManager ()
 
 ~ActorManager ()
 
void setMap (Map *const map)
 
void setPlayer (LocalPlayer *const player)
 
BeingcreateBeing (const BeingId id, const ActorTypeT type, const BeingTypeId subtype)
 
FloorItemcreateItem (const BeingId id, const int itemId, const int x, const int y, const ItemTypeT itemType, const int amount, const int refine, const ItemColor color, const Identified identified, const Damaged damaged, const int subX, const int subY, const int *const cards)
 
void destroy (ActorSprite *const actor)
 
void erase (ActorSprite *const actor)
 
void undelete (const ActorSprite *const actor)
 
BeingfindBeing (const BeingId id) const
 
ActorSpritefindActor (const BeingId id) const
 
BeingfindBeing (const int x, const int y, const ActorTypeT type) const
 
BeingfindBeingByPixel (const int x, const int y, const AllPlayers allPlayers) const
 
void findBeingsByPixel (std::vector< ActorSprite * > &beings, const int x, const int y, const AllPlayers allPlayers) const
 
BeingfindPortalByTile (const int x, const int y) const
 
FloorItemfindItem (const BeingId id) const
 
FloorItemfindItem (const int x, const int y) const
 
BeingfindNearestLivingBeing (const int x, const int y, int maxTileDist, const ActorTypeT type, const Being *const excluded) const
 
BeingfindNearestLivingBeing (const Being *const aroundBeing, const int maxTileDist, const ActorTypeT type, const AllowSort allowSort) const
 
BeingfindBeingByName (const std::string &name, const ActorTypeT type) const
 
BeingfindNearestByName (const std::string &name, const ActorTypeT &type) const
 
BeingfindMostDamagedPlayer (const int maxTileDist) const
 
BeingfindNearestPvpPlayer () const
 
void healTarget () const
 
void heal (const Being *const target) const
 
void itenplz () const
 
const ActorSpritesgetAll () const A_CONST
 
bool hasActorSprite (const ActorSprite *const actor) const
 
void logic ()
 
void clear ()
 
void addBlock (const BeingId id)
 
void deleteBlock (const BeingId id)
 
bool isBlocked (const BeingId id) const
 
void printAllToChat ()
 
void printBeingsToChat (const std::string &header) const
 
void getPlayerNames (StringVect &names, const NpcNames npcNames) const
 
void getMobNames (StringVect &names) const
 
void updatePlayerNames () const
 
void updatePlayerColors () const
 
void updatePlayerGuild () const
 
void parseLevels (std::string levels) const
 
bool pickUpAll (const int x1, const int y1, const int x2, const int y2, const bool serverBuggy) const
 
bool pickUpNearest (const int x, const int y, int maxdist) const
 
void optionChanged (const std::string &name)
 
void removeAttackMob (const std::string &name)
 
void removePickupItem (const std::string &name)
 
void addPriorityAttackMob (const std::string &name)
 
void addAttackMob (const std::string &name)
 
void addIgnoreAttackMob (const std::string &name)
 
void addPickupItem (const std::string &name)
 
void addIgnorePickupItem (const std::string &name)
 
void setPriorityAttackMobs (const std::list< std::string > &mobs)
 
void setAttackMobs (const std::list< std::string > &mobs)
 
int getPriorityAttackMobsSize () const
 
int getAttackMobsSize () const
 
int getPickupItemsSize () const
 
bool isInAttackList (const std::string &name) const
 
void rebuildAttackMobs ()
 
std::set< std::string > getAttackMobsSet () const noexcept2 A_WARN_UNUSED
 
std::list< std::string > getAttackMobs () const noexcept2 A_WARN_UNUSED
 
bool isInPriorityAttackList (const std::string &name) const
 
void rebuildPriorityAttackMobs ()
 
std::set< std::string > getPriorityAttackMobsSet () const noexcept2 A_WARN_UNUSED
 
std::list< std::string > getPriorityAttackMobs () const noexcept2 A_WARN_UNUSED
 
bool isInIgnoreAttackList (const std::string &name) const
 
void rebuildIgnoreAttackMobs ()
 
std::set< std::string > getIgnoreAttackMobsSet () const noexcept2 A_WARN_UNUSED
 
std::list< std::string > getIgnoreAttackMobs () const noexcept2 A_WARN_UNUSED
 
bool isInPickupList (const std::string &name) const
 
void rebuildPickupItems ()
 
std::set< std::string > getPickupItemsSet () const noexcept2 A_WARN_UNUSED
 
std::list< std::string > getPickupItems () const noexcept2 A_WARN_UNUSED
 
bool isInIgnorePickupList (const std::string &name) const
 
void rebuildIgnorePickupItems ()
 
std::set< std::string > getIgnorePickupItemsSet () const noexcept2 A_WARN_UNUSED
 
std::list< std::string > getIgnorePickupItems () const noexcept2 A_WARN_UNUSED
 
const StringIntMapgetAttackMobsMap () const
 
const StringIntMapgetPriorityAttackMobsMap () const
 
int getAttackMobIndex (const std::string &name) const
 
int getPriorityAttackMobIndex (const std::string &name) const
 
int getPickupItemIndex (const std::string &name) const
 
bool checkForPickup (const FloorItem *const item) const
 
bool checkDefaultPickup () const
 
void updateEffects (const std::map< BeingTypeId, int > &addEffects, const std::set< BeingTypeId > &removeEffects) const
 
void updateBadges () const
 
void updateNameId (const std::string &name, const BeingId beingId)
 
void updateSeenPlayers (const std::set< std::string > &onlinePlayers)
 
std::string getSeenPlayerById (const BeingId id) const
 
size_t size () const
 
void removeRoom (const int chatId)
 
void updateRoom (const ChatObject *const newChat)
 
std::string findCharById (const int32_t id)
 
void addChar (const int32_t id, const std::string &name)
 
- Public Member Functions inherited from ConfigListener
 ConfigListener ()
 
virtual ~ConfigListener ()
 

Static Public Member Functions

static BeingcloneBeing (const Being *const srcBeing, const int dx, const int dy, const int id)
 
static void printBeingsToChat (const std::vector< Being * > &beings, const std::string &header)
 
static int getIndexByName (const std::string &name, const StringIntMap &map)
 

Protected Member Functions

bool validateBeing (const Being *const aroundBeing, Being *const being, const ActorTypeT &type, const Being *const excluded, const int maxCost) const
 
BeingfindNearestLivingBeing (const Being *const aroundBeing, const int maxdist, const ActorTypeT &type, const int x, const int y, const Being *const excluded, const AllowSort allowSort) const
 
void loadAttackList ()
 
void storeAttackList () const
 

Protected Attributes

ActorSprites mActors
 
ActorSprites mDeleteActors
 
ActorSpritesMap mActorsIdMap
 
IdNameMapping mIdName
 
std::set< BeingIdmBlockedBeings
 
std::map< int32_t, std::string > mChars
 
MapmMap
 
std::string mSpellHeal1
 
std::string mSpellHeal2
 
std::string mSpellItenplz
 
bool mTargetDeadPlayers
 
bool mTargetOnlyReachable
 
bool mCyclePlayers
 
bool mCycleMonsters
 
bool mCycleNPC
 
bool mExtMouseTargeting
 
bool mEnableIdCollecting
 
std::list< std::string > mPriorityAttackMobs
 
std::set< std::string > mPriorityAttackMobsSet
 
StringIntMap mPriorityAttackMobsMap
 
std::list< std::string > mAttackMobs
 
std::set< std::string > mAttackMobsSet
 
StringIntMap mAttackMobsMap
 
std::list< std::string > mIgnoreAttackMobs
 
std::set< std::string > mIgnoreAttackMobsSet
 
std::list< std::string > mPickupItems
 
std::set< std::string > mPickupItemsSet
 
StringIntMap mPickupItemsMap
 
std::list< std::string > mIgnorePickupItems
 
std::set< std::string > mIgnorePickupItemsSet
 

Detailed Description

Definition at line 68 of file actormanager.h.

Constructor & Destructor Documentation

◆ ActorManager()

ActorManager::ActorManager ( )

Definition at line 208 of file actormanager.cpp.

208  :
209  mActors(),
210  mDeleteActors(),
211  mActorsIdMap(),
212  mIdName(),
213  mBlockedBeings(),
214  mChars(),
215  mMap(nullptr),
216 #ifdef TMWA_SUPPORT
217  mSpellHeal1(serverConfig.getValue("spellHeal1", "#lum")),
218  mSpellHeal2(serverConfig.getValue("spellHeal2", "#inma")),
219  mSpellItenplz(serverConfig.getValue("spellItenplz", "#itenplz")),
220 #endif // TMWA_SUPPORT
221  mTargetDeadPlayers(config.getBoolValue("targetDeadPlayers")),
222  mTargetOnlyReachable(config.getBoolValue("targetOnlyReachable")),
223  mCyclePlayers(config.getBoolValue("cyclePlayers")),
224  mCycleMonsters(config.getBoolValue("cycleMonsters")),
225  mCycleNPC(config.getBoolValue("cycleNPC")),
226  mExtMouseTargeting(config.getBoolValue("extMouseTargeting")),
227  mEnableIdCollecting(config.getBoolValue("enableIdCollecting")),
231  mAttackMobs(),
232  mAttackMobsSet(),
233  mAttackMobsMap(),
236  mPickupItems(),
237  mPickupItemsSet(),
238  mPickupItemsMap(),
241 {
242  config.addListener("targetDeadPlayers", this);
243  config.addListener("targetOnlyReachable", this);
244  config.addListener("cyclePlayers", this);
245  config.addListener("cycleMonsters", this);
246  config.addListener("cycleNPC", this);
247  config.addListener("extMouseTargeting", this);
248  config.addListener("showBadges", this);
249  config.addListener("enableIdCollecting", this);
250  config.addListener("visiblenamespos", this);
251 
252  loadAttackList();
253 }

References Configuration::addListener(), config, and loadAttackList().

◆ ~ActorManager()

ActorManager::~ActorManager ( )

Definition at line 255 of file actormanager.cpp.

256 {
257  config.removeListeners(this);
259  storeAttackList();
260  clear();
261 }

References CHECKLISTENERS, clear(), config, Configuration::removeListeners(), and storeAttackList().

Member Function Documentation

◆ addAttackMob()

void ActorManager::addAttackMob ( const std::string &  name)

Definition at line 1920 of file actormanager.cpp.

1921 {
1922  addMobToList(name, AttackMob)
1924  storeAttackList();
1925 }

References addMobToList, rebuildPriorityAttackMobs(), and storeAttackList().

◆ addBlock()

void ActorManager::addBlock ( const BeingId  id)

Definition at line 1571 of file actormanager.cpp.

1572 {
1573  mBlockedBeings.insert(id);
1574 }

References mBlockedBeings.

◆ addChar()

void ActorManager::addChar ( const int32_t  id,
const std::string &  name 
)

Definition at line 2273 of file actormanager.cpp.

2275 {
2276  mChars[id] = name;
2277 
2278  if (guiInput == nullptr)
2279  return;
2280 
2281  if (localPlayer != nullptr)
2282  {
2283  Guild *const guild = localPlayer->getGuild();
2284  if (guild != nullptr)
2285  {
2286  GuildMember *const member = guild->getMemberByCharId(id);
2287  if (member != nullptr)
2288  member->setName(name);
2289  }
2290  }
2292 }

References Being::getGuild(), guiInput, guild, localPlayer, mChars, Avatar::setName(), and SDLInput::simulateMouseMove().

Referenced by EAthena::BeingRecv::processSolveCharName().

◆ addIgnoreAttackMob()

void ActorManager::addIgnoreAttackMob ( const std::string &  name)

Definition at line 1933 of file actormanager.cpp.

1934 {
1935  mIgnoreAttackMobs.push_back(name);
1936  mIgnoreAttackMobsSet.insert(name);
1939  storeAttackList();
1940 }

References mIgnoreAttackMobs, mIgnoreAttackMobsSet, rebuildAttackMobs(), rebuildPriorityAttackMobs(), and storeAttackList().

◆ addIgnorePickupItem()

void ActorManager::addIgnorePickupItem ( const std::string &  name)

Definition at line 1949 of file actormanager.cpp.

1950 {
1951  mIgnorePickupItems.push_back(name);
1952  mIgnorePickupItemsSet.insert(name);
1954  storeAttackList();
1955 }

References mIgnorePickupItems, mIgnorePickupItemsSet, rebuildPickupItems(), and storeAttackList().

◆ addPickupItem()

void ActorManager::addPickupItem ( const std::string &  name)

Definition at line 1942 of file actormanager.cpp.

1943 {
1944  addMobToList(name, PickupItem)
1946  storeAttackList();
1947 }

References addMobToList, rebuildPickupItems(), and storeAttackList().

◆ addPriorityAttackMob()

void ActorManager::addPriorityAttackMob ( const std::string &  name)

Definition at line 1927 of file actormanager.cpp.

1928 {
1929  addMobToList(name, PriorityAttackMob)
1930  storeAttackList();
1931 }

References addMobToList, and storeAttackList().

◆ checkDefaultPickup()

bool ActorManager::checkDefaultPickup ( ) const

Definition at line 2070 of file actormanager.cpp.

2071 {
2072  return mPickupItemsSet.find(std::string()) != mPickupItemsSet.end();
2073 }

References mPickupItemsSet.

◆ checkForPickup()

bool ActorManager::checkForPickup ( const FloorItem *const  item) const

Definition at line 2052 of file actormanager.cpp.

2053 {
2054  if (mPickupItemsSet.find(std::string()) != mPickupItemsSet.end())
2055  {
2056  if (mIgnorePickupItemsSet.find(item->getName())
2057  == mIgnorePickupItemsSet.end())
2058  {
2059  return true;
2060  }
2061  }
2062  else if ((item != nullptr) && mPickupItemsSet.find(item->getName())
2063  != mPickupItemsSet.end())
2064  {
2065  return true;
2066  }
2067  return false;
2068 }

References FloorItem::getName(), mIgnorePickupItemsSet, and mPickupItemsSet.

Referenced by createItem(), and LocalPlayer::pickUp().

◆ clear()

void ActorManager::clear ( )

Destroys all ActorSprites except the local player

Definition at line 1005 of file actormanager.cpp.

1006 {
1007  if (beingEquipmentWindow != nullptr)
1008  beingEquipmentWindow->setBeing(nullptr);
1009 
1010  if (localPlayer != nullptr)
1011  {
1012  localPlayer->setTarget(nullptr);
1014  mActors.erase(localPlayer);
1015  }
1016 
1017  for_actors
1018  delete *it;
1019  mActors.clear();
1020  mDeleteActors.clear();
1021  mActorsIdMap.clear();
1022 
1023  if (localPlayer != nullptr)
1024  {
1025  mActors.insert(localPlayer);
1027  }
1028 
1029  mChars.clear();
1030 }

References beingEquipmentWindow, for_actors, ActorSprite::getId(), localPlayer, mActors, mActorsIdMap, mChars, mDeleteActors, EquipmentWindow::setBeing(), LocalPlayer::setTarget(), and LocalPlayer::unSetPickUpTarget().

Referenced by Game::changeMap(), and ~ActorManager().

◆ cloneBeing()

Being * ActorManager::cloneBeing ( const Being *const  srcBeing,
const int  dx,
const int  dy,
const int  id 
)
static

Definition at line 2097 of file actormanager.cpp.

2100 {
2101  returnNullptr(nullptr, srcBeing)
2102  Being *const dstBeing = actorManager->createBeing(fromInt(
2103  toInt(srcBeing->getId(), int) + id, BeingId),
2105  srcBeing->getSubType());
2106  if (dstBeing == nullptr)
2107  return nullptr;
2108  dstBeing->setGender(srcBeing->getGender());
2109  dstBeing->setAction(srcBeing->getCurrentAction(), 0);
2110  dstBeing->setTileCoords(srcBeing->getTileX() + dx,
2111  srcBeing->getTileY() + dy);
2112  dstBeing->setName(srcBeing->getName());
2113  dstBeing->setDirection(srcBeing->getDirection());
2114  const int sz = CAST_S32(srcBeing->mSprites.size());
2115  for (int slot = 0; slot < sz; slot ++)
2116  {
2117  const int spriteId = srcBeing->getSpriteID(slot);
2118  const ItemColor color = srcBeing->getSpriteColor(slot);
2119  dstBeing->setSpriteColorId(slot,
2120  spriteId,
2121  color);
2122  }
2123  const int hairSlot = charServerHandler->hairSprite();
2124  const int hairStyle = -srcBeing->getSpriteID(hairSlot);
2125  const ItemColor hairColor = srcBeing->getHairColor();
2126  if (hairStyle != 0)
2127  {
2128  dstBeing->setSpriteColor(hairSlot,
2129  hairStyle * -1,
2130  ItemDB::get(-hairStyle).getDyeColorsString(hairColor));
2131  }
2132  else
2133  {
2134  dstBeing->unSetSprite(hairSlot);
2135  }
2136  dstBeing->setHairColor(hairColor);
2137  return dstBeing;
2138 }

References actorManager, CAST_S32, charServerHandler, createBeing(), fromInt, ItemDB::get(), Being::getCurrentAction(), Being::getDirection(), Being::getGender(), Being::getHairColor(), ActorSprite::getId(), Being::getName(), Being::getSpriteColor(), Being::getSpriteID(), Being::getSubType(), Being::getTileX(), Being::getTileY(), Net::CharServerHandler::hairSprite(), CompoundSprite::mSprites, ActorType::Player, returnNullptr, Being::setAction(), Being::setDirection(), Being::setGender(), Being::setHairColor(), Being::setName(), Being::setSpriteColor(), Being::setSpriteColorId(), Being::setTileCoords(), toInt, and Being::unSetSprite().

◆ createBeing()

Being * ActorManager::createBeing ( const BeingId  id,
const ActorTypeT  type,
const BeingTypeId  subtype 
)

Create a Being and add it to the list of ActorSprites.

Definition at line 282 of file actormanager.cpp.

285 {
286  Being *const being = Being::createBeing(id,
287  type,
288  subtype,
289  mMap);
290 
291  mActors.insert(being);
292 
293  mActorsIdMap[being->getId()] = being;
294 
295  switch (type)
296  {
297  case ActorType::Player:
299  case ActorType::Pet:
301  case ActorType::Npc:
302  being->updateFromCache();
303  if (beingHandler != nullptr)
305  if (localPlayer != nullptr)
306  localPlayer->checkNewName(being);
307  break;
308  case ActorType::Monster:
309 #ifdef TMWA_SUPPORT
311 #endif // TMWA_SUPPORT
312  {
314  }
315  break;
316  case ActorType::Portal:
317  if ((beingHandler != nullptr) &&
318  (serverFeatures != nullptr) &&
320  {
322  }
323  break;
325  if (beingHandler != nullptr)
327  break;
329  break;
330  default:
332  case ActorType::Avatar:
333  case ActorType::Unknown:
334  reportAlways("CreateBeing for unknown type %d", CAST_S32(type))
335  break;
336  }
337 
338  if (type == ActorType::Player)
339  {
340  if (socialWindow != nullptr)
342  }
343  else if (type == ActorType::Npc)
344  {
345  if (questsWindow != nullptr)
346  questsWindow->addEffect(being);
347  }
348  return being;
349 }

References QuestsWindow::addEffect(), ActorType::Avatar, beingHandler, CAST_S32, LocalPlayer::checkNewName(), Being::createBeing(), ActorType::Elemental, ActorType::FloorItem, ActorSprite::getId(), Net::getNetworkType(), Net::ServerFeatures::haveServerWarpNames(), ActorType::Homunculus, localPlayer, mActors, mActorsIdMap, ActorType::Mercenary, mMap, ActorType::Monster, ActorType::Npc, ActorType::Pet, ActorType::Player, ActorType::Portal, questsWindow, reportAlways, Net::BeingHandler::requestNameById(), serverFeatures, ActorType::SkillUnit, socialWindow, ServerType::TMWATHENA, ActorType::Unknown, SocialWindow::updateActiveList(), and Being::updateFromCache().

Referenced by cloneBeing(), Ea::BeingRecv::createBeing(), and EAthena::BeingRecv::createBeing2().

◆ createItem()

FloorItem * ActorManager::createItem ( const BeingId  id,
const int  itemId,
const int  x,
const int  y,
const ItemTypeT  itemType,
const int  amount,
const int  refine,
const ItemColor  color,
const Identified  identified,
const Damaged  damaged,
const int  subX,
const int  subY,
const int *const  cards 
)

Create a FloorItem and add it to the list of ActorSprites.

Definition at line 351 of file actormanager.cpp.

362 {
363  FloorItem *const floorItem = new FloorItem(id,
364  itemId,
365  x, y,
366  itemType,
367  amount,
368  refine,
369  color,
370  identified,
371  damaged,
372  cards);
373  floorItem->postInit(mMap, subX, subY);
374 
375  if (!checkForPickup(floorItem))
376  floorItem->disableHightlight();
377  mActors.insert(floorItem);
378  mActorsIdMap[floorItem->getId()] = floorItem;
379  return floorItem;
380 }

References checkForPickup(), FloorItem::disableHightlight(), ActorType::FloorItem, ActorSprite::getId(), mActors, mActorsIdMap, mMap, FloorItem::postInit(), x, and y.

Referenced by EAthena::ItemRecv::processItemDropped(), TmwAthena::ItemRecv::processItemDropped(), EAthena::ItemRecv::processItemDropped2(), TmwAthena::ItemRecv::processItemVisible(), EAthena::ItemRecv::processItemVisible(), and EAthena::ItemRecv::processItemVisible2().

◆ deleteBlock()

void ActorManager::deleteBlock ( const BeingId  id)

Definition at line 1576 of file actormanager.cpp.

1577 {
1578  mBlockedBeings.erase(id);
1579 }

References mBlockedBeings.

◆ destroy()

void ActorManager::destroy ( ActorSprite *const  actor)

◆ erase()

void ActorManager::erase ( ActorSprite *const  actor)

Definition at line 392 of file actormanager.cpp.

393 {
394  returnNullptrV(actor)
395 
396  if (actor == localPlayer)
397  return;
398 
399  mActors.erase(actor);
400  const ActorSpritesMapIterator it = mActorsIdMap.find(actor->getId());
401  if (it != mActorsIdMap.end() && (*it).second == actor)
402  mActorsIdMap.erase(it);
403 }

References ActorSprite::getId(), localPlayer, mActors, mActorsIdMap, and returnNullptrV.

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

◆ findActor()

ActorSprite * ActorManager::findActor ( const BeingId  id) const

Definition at line 438 of file actormanager.cpp.

439 {
440  const ActorSpritesMapConstIterator it = mActorsIdMap.find(id);
441  if (it != mActorsIdMap.end())
442  {
443  ActorSprite *const actor = (*it).second;
444  if ((actor != nullptr) &&
445  actor->getId() == id)
446  {
447  return actor;
448  }
449  }
450  return nullptr;
451 }

References ActorSprite::getId(), and mActorsIdMap.

Referenced by Particle::~Particle().

◆ findBeing() [1/2]

Being * ActorManager::findBeing ( const BeingId  id) const

Returns a specific Being, by id;

Definition at line 422 of file actormanager.cpp.

423 {
424  const ActorSpritesMapConstIterator it = mActorsIdMap.find(id);
425  if (it != mActorsIdMap.end())
426  {
427  ActorSprite *const actor = (*it).second;
428  if ((actor != nullptr) &&
429  actor->getId() == id &&
430  actor->getType() != ActorType::FloorItem)
431  {
432  return static_cast<Being*>(actor);
433  }
434  }
435  return nullptr;
436 }

References ActorType::FloorItem, ActorSprite::getId(), ActorSprite::getType(), and mActorsIdMap.

Referenced by BuySellDialog::action(), PopupMenu::addBeingMenu(), Actions::getPet(), PopupMenu::handleLink(), Viewport::moveCameraToActor(), NpcDialog::postInit(), EAthena::NpcRecv::processArea(), EAthena::BattleGroundRecv::processBattleEmblem2(), Ea::BeingRecv::processBeingAction(), EAthena::BeingRecv::processBeingAction2(), EAthena::BeingRecv::processBeingAttrs(), TmwAthena::BeingRecv::processBeingChangeDirection(), EAthena::BeingRecv::processBeingChangeDirection(), TmwAthena::BeingRecv::processBeingChangeLook(), TmwAthena::BeingRecv::processBeingChangeLook2(), EAthena::BeingRecv::processBeingChangeLook2(), EAthena::BeingRecv::processBeingChangeLookCards(), TmwAthena::ChatRecv::processBeingChat(), EAthena::ChatRecv::processBeingChat(), Ea::BeingRecv::processBeingEmotion(), EAthena::BeingRecv::processBeingHp(), TmwAthena::BeingRecv::processBeingMove(), EAthena::BeingRecv::processBeingMove(), TmwAthena::BeingRecv::processBeingMove2(), EAthena::BeingRecv::processBeingMove2(), Ea::BeingRecv::processBeingMove3(), Ea::BeingRecv::processBeingRemove(), EAthena::BeingRecv::processBeingRemoveSkill(), TmwAthena::BeingRecv::processBeingResurrect(), EAthena::BeingRecv::processBeingResurrect(), TmwAthena::BeingRecv::processBeingSelfEffect(), EAthena::BeingRecv::processBeingSelfEffect(), EAthena::BeingRecv::processBeingSlide(), EAthena::BeingRecv::processBeingSpawn(), EAthena::BeingRecv::processBeingSpecialEffect(), EAthena::BeingRecv::processBeingStatUpdate1(), TmwAthena::BeingRecv::processBeingStatusChange(), EAthena::BeingRecv::processBeingStatusChange(), TmwAthena::BeingRecv::processBeingVisible(), EAthena::BeingRecv::processBeingVisible(), EAthena::BuyingStoreRecv::processBuyingStoreHideBoard(), EAthena::BuyingStoreRecv::processBuyingStoreItemsList(), EAthena::BuyingStoreRecv::processBuyingStoreShowBoard(), EAthena::ChatRecv::processChatDisplay(), EAthena::GuildRecv::processGuildSetPosition(), EAthena::VendingRecv::processHideBoard(), EAthena::HomunculusRecv::processHomunculusData(), EAthena::HomunculusRecv::processHomunculusInfo1(), EAthena::HomunculusRecv::processHomunculusInfo2(), EAthena::HomunculusRecv::processHomunculusInfo3(), TmwAthena::BeingRecv::processIpResponse(), EAthena::VendingRecv::processItemsList(), EAthena::PlayerRecv::processKilledBy(), EAthena::MercenaryRecv::processMercenaryInfo(), EAthena::BeingRecv::processMobInfo(), EAthena::BeingRecv::processMonsterHp(), Ea::ChatRecv::processMVPEffect(), Ea::BeingRecv::processNameResponse(), EAthena::BeingRecv::processNameResponse2(), EAthena::BeingRecv::processNameResponseTitle(), TmwAthena::PartyRecv::processPartyInvited(), Ea::PartyRecv::processPartyLeave(), TmwAthena::PartyRecv::processPartyUpdateHp(), EAthena::PetRecv::processPetData(), TmwAthena::BeingRecv::processPlayerGuilPartyInfo(), EAthena::BeingRecv::processPlayerGuilPartyInfo(), EAthena::BeingRecv::processPlayerGuilPartyInfo2(), EAthena::InventoryRecv::processPlayerInventoryUse(), TmwAthena::BeingRecv::processPlayerMove(), TmwAthena::BeingRecv::processPlayerStatusChange(), EAthena::BeingRecv::processPlayerStatusChange(), EAthena::BeingRecv::processPlayerStatusChange2(), Ea::BeingRecv::processPlayerStop(), TmwAthena::BeingRecv::processPlayerUpdate1(), TmwAthena::BeingRecv::processPlayerUpdate2(), TmwAthena::BeingRecv::processPvpSet(), EAthena::BeingRecv::processPvpSet(), EAthena::VendingRecv::processShowBoard(), EAthena::BeingRecv::processSkillCastingContinue(), TmwAthena::BeingRecv::processSkillDamage(), EAthena::BeingRecv::processSkillDamage(), Ea::BeingRecv::processSkillNoDamage(), EAthena::BeingRecv::processSpiritBalls(), Party::removeFromMembers(), Guild::removeFromMembers(), BuyingStoreSellDialog::sellAction(), PopupMenu::showPopup(), and LocalPlayer::updateCoords().

◆ findBeing() [2/2]

Being * ActorManager::findBeing ( const int  x,
const int  y,
const ActorTypeT  type 
) const

Returns a being at specific coordinates.

Definition at line 453 of file actormanager.cpp.

455 {
458  beingActorFinder.type = type;
459 
460  const ActorSpritesConstIterator it = std::find_if(
461  mActors.begin(), mActors.end(), beingActorFinder);
462 
463  return (it == mActors.end()) ? nullptr : static_cast<Being*>(*it);
464 }

References beingActorFinder, CAST_U16, mActors, nullptr, FindBeingFunctor::type, x, FindBeingFunctor::x, y, and FindBeingFunctor::y.

◆ findBeingByName()

Being * ActorManager::findBeingByName ( const std::string &  name,
const ActorTypeT  type 
) const

Finds a being by name and (optionally) by type.

Definition at line 869 of file actormanager.cpp.

871 {
873  {
874 // disabled for performance
875 // if (reportTrue(*it == nullptr))
876 // continue;
877 
878  if ((*it)->getType() == ActorType::FloorItem
879  || (*it)->getType() == ActorType::Portal)
880  {
881  continue;
882  }
883 
884  Being *const being = static_cast<Being*>(*it);
885  if (being->getName() == name &&
886  (type == ActorType::Unknown || type == being->getType()))
887  {
888  return being;
889  }
890  }
891  return nullptr;
892 }

References ActorType::FloorItem, for_actorsm, Being::getName(), Being::getType(), ActorType::Portal, and ActorType::Unknown.

Referenced by PlayerListener::action(), BuyDialog::action(), EAthena::PartyHandler::changeLeader(), Actions::findBeing(), LocalPlayer::followMoveTo(), SocialFriendsTab::getPlayersAvatars(), WhoIsOnline::handleLink(), PopupMenu::handleLink(), PlayerRelationsManager::hasPermission(), EAthena::PartyHandler::invite(), TmwAthena::PartyHandler::invite(), EAthena::GuildHandler::invite(), WhoIsOnline::loadWebList(), AvatarListBox::mousePressed(), parseLevels(), GuildManager::process(), EAthena::ChatRecv::processChatRoomLeave(), EAthena::GuildRecv::processGuildExpulsionContinue(), EAthena::GuildRecv::processGuildLeave(), EAthena::GuildRecv::processGuildLeave2(), EAthena::GuildRecv::processGuildMemberList(), ShopWindow::processRequest(), SocialPlayersTab::resetDamage(), WhoIsOnline::setNeutralColor(), OnlinePlayer::setText(), PopupMenu::showChatPopup(), PopupMenu::showPlayerGMCommands(), PlayerRelationsManager::signalUpdate(), ShopWindow::startTrade(), SocialPlayersTab::updateAvatar(), ChatWindow::updateOnline(), and updateSeenPlayers().

◆ findBeingByPixel()

Being * ActorManager::findBeingByPixel ( const int  x,
const int  y,
const AllPlayers  allPlayers 
) const

Returns a being at the specific pixel.

Definition at line 466 of file actormanager.cpp.

468 {
469  if (mMap == nullptr)
470  return nullptr;
471 
472  const bool targetDead = mTargetDeadPlayers;
473  const bool modActive = inputManager.isActionActive(
475 
476  if (mExtMouseTargeting)
477  {
478  Being *tempBeing = nullptr;
479  bool noBeing(false);
480 
482  {
483 // disabled for performance
484 // if (reportTrue(*it == nullptr))
485 // continue;
486 
487  if ((*it)->getType() == ActorType::Portal)
488  continue;
489 
490  if ((*it)->getType() == ActorType::FloorItem)
491  {
492  if (!noBeing)
493  {
494  const FloorItem *const floor
495  = static_cast<const FloorItem*>(*it);
496  const int px = floor->getPixelX();
497  const int py = floor->getPixelY();
498  if ((px - mapTileSize <= x) &&
499  (px + mapTileSize > x) &&
500  (py - mapTileSize * 2 <= y) &&
501  (py + mapTileSize / 2 > y))
502  {
503  noBeing = true;
504  }
505  }
506  continue;
507  }
508 
509  Being *const being = static_cast<Being*>(*it);
510 
511  if (being->getInfo() != nullptr &&
512  !(being->getInfo()->isTargetSelection() || modActive))
513  {
514  continue;
515  }
516 
517  if ((being->mAction != BeingAction::DEAD ||
518  (targetDead && being->getType() == ActorType::Player)) &&
519  (allPlayers == AllPlayers_true || being != localPlayer))
520  {
521  const int px = being->getPixelX();
522  const int py = being->getPixelY();
523  if ((px - mapTileSize / 2 <= x) &&
524  (px + mapTileSize / 2 > x) &&
525  (py - mapTileSize <= y) &&
526  (py > y))
527  {
528  return being;
529  }
530  else if (!noBeing &&
531  (px - mapTileSize <= x) &&
532  (px + mapTileSize > x) &&
533  (py - mapTileSize * 2 <= y) &&
534  (py + mapTileSize / 2 > y))
535  {
536  if (tempBeing != nullptr)
537  noBeing = true;
538  else
539  tempBeing = being;
540  }
541  }
542  }
543 
544  if (noBeing)
545  return nullptr;
546  return tempBeing;
547  }
549  {
550 // disabled for performance
551 // if (reportTrue(*it == nullptr))
552 // continue;
553 
554  if ((*it)->getType() == ActorType::Portal ||
555  (*it)->getType() == ActorType::FloorItem)
556  {
557  continue;
558  }
559 
560  Being *const being = static_cast<Being*>(*it);
561 
562  if (being->getInfo() != nullptr &&
563  !(being->getInfo()->isTargetSelection() || modActive))
564  {
565  continue;
566  }
567 
568  const int px = being->getPixelX();
569  const int py = being->getPixelY();
570  if ((px - mapTileSize / 2 <= x) &&
571  (px + mapTileSize / 2 > x) &&
572  (py - mapTileSize <= y) &&
573  (py > y))
574  {
575  return being;
576  }
577  }
578  return nullptr;
579 }

References AllPlayers_true, BeingAction::DEAD, ActorType::FloorItem, for_actorsm, Being::getInfo(), Actor::getPixelX(), Actor::getPixelY(), Being::getType(), inputManager, InputManager::isActionActive(), BeingInfo::isTargetSelection(), localPlayer, Being::mAction, mapTileSize, mExtMouseTargeting, mMap, mTargetDeadPlayers, ActorType::Player, ActorType::Portal, InputAction::STOP_ATTACK, x, and y.

◆ findBeingsByPixel()

void ActorManager::findBeingsByPixel ( std::vector< ActorSprite * > &  beings,
const int  x,
const int  y,
const AllPlayers  allPlayers 
) const

Returns a beings at the specific pixel.

Definition at line 581 of file actormanager.cpp.

584 {
585  if (mMap == nullptr)
586  return;
587 
588  const int xtol = mapTileSize / 2;
589  const int uptol = mapTileSize;
590  const bool modActive = inputManager.isActionActive(
592 
593  for_actors
594  {
595  ActorSprite *const actor = *it;
596 
597 // disabled for performance
598 // if (reportTrue(actor == nullptr))
599 // continue;
600 
601  const ActorTypeT actorType = actor->getType();
602  switch (actorType)
603  {
604  default:
605  case ActorType::Unknown:
606  case ActorType::Avatar:
607  case ActorType::Portal:
608  break;
610  if ((actor->getPixelX() - xtol <= x) &&
611  (actor->getPixelX() + xtol > x) &&
612  (actor->getPixelY() - uptol <= y) &&
613  (actor->getPixelY() > y))
614  {
615  beings.push_back(actor);
616  }
617  break;
618  case ActorType::Player:
619  case ActorType::Npc:
620  case ActorType::Monster:
621  case ActorType::Pet:
626  {
627  const Being *const being = static_cast<const Being*>(*it);
628  if (being == nullptr)
629  continue;
630  if ((being->getInfo() != nullptr) &&
631  !(being->getInfo()->isTargetSelection() || modActive))
632  {
633  continue;
634  }
635  if ((being->isAlive() ||
637  actorType == ActorType::Player)) &&
638  (allPlayers == AllPlayers_true ||
639  being != localPlayer))
640  {
641  if ((actor->getPixelX() - xtol <= x) &&
642  (actor->getPixelX() + xtol > x) &&
643  (actor->getPixelY() - uptol <= y) &&
644  (actor->getPixelY() > y))
645  {
646  beings.push_back(actor);
647  }
648  }
649  break;
650  }
651  }
652  }
653 }

References AllPlayers_true, ActorType::Avatar, ActorType::Elemental, ActorType::FloorItem, for_actors, Being::getInfo(), Actor::getPixelX(), Actor::getPixelY(), ActorSprite::getType(), ActorType::Homunculus, inputManager, InputManager::isActionActive(), Being::isAlive(), BeingInfo::isTargetSelection(), localPlayer, mapTileSize, ActorType::Mercenary, mMap, ActorType::Monster, mTargetDeadPlayers, ActorType::Npc, ActorType::Pet, ActorType::Player, ActorType::Portal, ActorType::SkillUnit, InputAction::STOP_ATTACK, ActorType::Unknown, x, and y.

◆ findCharById()

std::string ActorManager::findCharById ( const int32_t  id)

Definition at line 2265 of file actormanager.cpp.

2266 {
2267  const std::map<int32_t, std::string>::const_iterator it = mChars.find(id);
2268  if (it == mChars.end())
2269  return std::string();
2270  return (*it).second;
2271 }

References mChars.

Referenced by ItemPopup::getCardsString(), and EAthena::GuildRecv::processGuildMemberList().

◆ findItem() [1/2]

FloorItem * ActorManager::findItem ( const BeingId  id) const

Returns a specific FloorItem, by id.

Definition at line 678 of file actormanager.cpp.

679 {
680  const ActorSpritesMapConstIterator it = mActorsIdMap.find(id);
681  if (it != mActorsIdMap.end())
682  {
683  ActorSprite *const actor = (*it).second;
684  returnNullptr(nullptr, actor)
685  if (actor->getId() == id &&
686  actor->getType() == ActorType::FloorItem)
687  {
688  return static_cast<FloorItem*>(actor);
689  }
690  }
691  return nullptr;
692 }

References ActorType::FloorItem, ActorSprite::getId(), ActorSprite::getType(), mActorsIdMap, and returnNullptr.

Referenced by PopupMenu::handleLink(), LocalPlayer::pickedUp(), and LocalPlayer::pickUpItems().

◆ findItem() [2/2]

FloorItem * ActorManager::findItem ( const int  x,
const int  y 
) const

Returns a FloorItem at specific coordinates.

Definition at line 694 of file actormanager.cpp.

695 {
697  {
698 // disabled for performance
699 // if (reportTrue(*it == nullptr))
700 // continue;
701 
702  if ((*it)->getTileX() == x && (*it)->getTileY() == y &&
703  (*it)->getType() == ActorType::FloorItem)
704  {
705  return static_cast<FloorItem*>(*it);
706  }
707  }
708 
709  return nullptr;
710 }

References ActorType::FloorItem, for_actorsm, x, and y.

◆ findMostDamagedPlayer()

Being * ActorManager::findMostDamagedPlayer ( const int  maxTileDist) const

Finds most damaged player, non-enemy and alive

Parameters
maxTileDistmaximal distance.

Definition at line 1500 of file actormanager.cpp.

1501 {
1502  if (localPlayer == nullptr)
1503  return nullptr;
1504 
1505  int maxDamageTaken = 0;
1506  Being *target = nullptr;
1507 
1508  for_actors
1509  {
1510  if ((*it)->getType() != ActorType::Player)
1511  continue;
1512 
1513  Being *const being = static_cast<Being*>(*it);
1514 
1515  if ((being == nullptr) || !being->isAlive() || // don't heal dead
1516  playerRelations.getRelation(being->getName()) ==
1517  Relation::ENEMY2 || // don't heal enemy
1518  localPlayer == being) // don't heal self
1519  {
1520  continue;
1521  }
1522 
1523  const int dx = being->getTileX() - localPlayer->getTileX();
1524  const int dy = being->getTileY() - localPlayer->getTileY();
1525  const int distance = fastSqrtInt(dx * dx + dy * dy);
1526 
1527  if (distance > maxTileDist)
1528  continue;
1529 
1530  if (being->getDamageTaken() > maxDamageTaken)
1531  {
1532  maxDamageTaken = being->getDamageTaken();
1533  target = being;
1534  }
1535  }
1536 
1537  return target;
1538 }

References Relation::ENEMY2, fastSqrtInt(), for_actors, Being::getDamageTaken(), Being::getName(), PlayerRelationsManager::getRelation(), Being::getTileX(), Being::getTileY(), Being::isAlive(), localPlayer, ActorType::Player, and playerRelations.

◆ findNearestByName()

Being * ActorManager::findNearestByName ( const std::string &  name,
const ActorTypeT type 
) const

Finds a nearest being by name and (optionally) by type.

Definition at line 894 of file actormanager.cpp.

896 {
897  if (localPlayer == nullptr)
898  return nullptr;
899 
900  int dist = 0;
901  Being* closestBeing = nullptr;
902  int x = localPlayer->getTileX();
903  int y = localPlayer->getTileY();
904 
906  {
907 // disabled for performance
908 // if (reportTrue(*it == nullptr))
909 // continue;
910 
911  if ((*it)->getType() == ActorType::FloorItem
912  || (*it)->getType() == ActorType::Portal)
913  {
914  continue;
915  }
916 
917  Being *const being = static_cast<Being*>(*it);
918 
919  if ((being != nullptr) && being->getName() == name &&
920  (type == ActorType::Unknown || type == being->getType()))
921  {
922  if (being->getType() == ActorType::Player)
923  {
924  return being;
925  }
926  const int d = (being->getTileX() - x) * (being->getTileX() - x)
927  + (being->getTileY() - y) * (being->getTileY() - y);
928 
929  if (validateBeing(nullptr, being, type, nullptr, 50)
930  && (d < dist || closestBeing == nullptr))
931  {
932  dist = d;
933  closestBeing = being;
934  }
935  }
936  }
937  return closestBeing;
938 }

References ActorType::FloorItem, for_actorsm, Being::getName(), Being::getTileX(), Being::getTileY(), Being::getType(), localPlayer, ActorType::Player, ActorType::Portal, ActorType::Unknown, validateBeing(), x, and y.

◆ findNearestLivingBeing() [1/3]

Being * ActorManager::findNearestLivingBeing ( const Being *const  aroundBeing,
const int  maxdist,
const ActorTypeT type,
const int  x,
const int  y,
const Being *const  excluded,
const AllowSort  allowSort 
) const
protected

Definition at line 1120 of file actormanager.cpp.

1126 {
1127  if ((aroundBeing == nullptr) || (localPlayer == nullptr))
1128  return nullptr;
1129 
1130  std::set<std::string> attackMobs;
1131  std::set<std::string> priorityMobs;
1132  std::set<std::string> ignoreAttackMobs;
1133  StringIntMap attackMobsMap;
1134  StringIntMap priorityMobsMap;
1135  int defaultAttackIndex = 10000;
1136  int defaultPriorityIndex = 10000;
1137  const int attackRange = localPlayer->getAttackRange();
1138 
1139  bool specialDistance = false;
1140  if (settings.moveToTargetType == 11
1141  && localPlayer->getAttackRange() > 2)
1142  {
1143  specialDistance = true;
1144  }
1145 
1146  maxDist = maxDist * maxDist;
1147 
1148  const bool cycleSelect = allowSort == AllowSort_true
1149  && ((mCyclePlayers && type == ActorType::Player)
1150  || (mCycleMonsters && type == ActorType::Monster)
1151  || (mCycleNPC && type == ActorType::Npc));
1152 
1153  const bool filtered = allowSort == AllowSort_true
1154  && config.getBoolValue("enableAttackFilter")
1155  && type == ActorType::Monster;
1156  const bool modActive = inputManager.isActionActive(
1158 
1159  bool ignoreDefault = false;
1160  if (filtered)
1161  {
1162  attackMobs = mAttackMobsSet;
1163  priorityMobs = mPriorityAttackMobsSet;
1164  ignoreAttackMobs = mIgnoreAttackMobsSet;
1165  attackMobsMap = mAttackMobsMap;
1166  priorityMobsMap = mPriorityAttackMobsMap;
1167  beingActorSorter.attackBeings = &attackMobsMap;
1168  beingActorSorter.priorityBeings = &priorityMobsMap;
1169  beingActorSorter.specialDistance = specialDistance;
1170  beingActorSorter.attackRange = attackRange;
1171  if (ignoreAttackMobs.find(std::string()) != ignoreAttackMobs.end())
1172  ignoreDefault = true;
1173  StringIntMapCIter itr = attackMobsMap.find(std::string());
1174  if (itr != attackMobsMap.end())
1175  defaultAttackIndex = (*itr).second;
1176  itr = priorityMobsMap.find(std::string());
1177  if (itr != priorityMobsMap.end())
1178  defaultPriorityIndex = (*itr).second;
1179  }
1180 
1181  if (cycleSelect)
1182  {
1183  STD_VECTOR<Being*> sortedBeings;
1184 
1185  FOR_EACH (ActorSprites::iterator, i, mActors)
1186  {
1187 // disabled for performance
1188 // if (reportTrue(*i == nullptr))
1189 // continue;
1190 
1191  if ((*i)->getType() == ActorType::FloorItem
1192  || (*i)->getType() == ActorType::Portal)
1193  {
1194  continue;
1195  }
1196 
1197  Being *const being = static_cast<Being*>(*i);
1198 
1199  if (filtered)
1200  {
1201  if (ignoreAttackMobs.find(being->getName())
1202  != ignoreAttackMobs.end())
1203  {
1204  continue;
1205  }
1206  if (ignoreDefault && attackMobs.find(being->getName())
1207  == attackMobs.end() && priorityMobs.find(being->getName())
1208  == priorityMobs.end())
1209  {
1210  continue;
1211  }
1212  }
1213 
1214  if ((being->getInfo() != nullptr)
1215  && !(being->getInfo()->isTargetSelection() || modActive))
1216  {
1217  continue;
1218  }
1219 
1220  if (validateBeing(aroundBeing, being, type, nullptr, maxDist))
1221  {
1222  if (being != excluded)
1223  sortedBeings.push_back(being);
1224  }
1225  }
1226 
1227  // no selectable beings
1228  if (sortedBeings.empty())
1229  return nullptr;
1230 
1231  beingActorSorter.x = x;
1232  beingActorSorter.y = y;
1233  if (filtered)
1234  {
1235  beingActorSorter.attackBeings = &attackMobsMap;
1236  beingActorSorter.defaultAttackIndex = defaultAttackIndex;
1237  beingActorSorter.priorityBeings = &priorityMobsMap;
1238  beingActorSorter.defaultPriorityIndex = defaultPriorityIndex;
1239  }
1240  else
1241  {
1242  beingActorSorter.attackBeings = nullptr;
1243  beingActorSorter.priorityBeings = nullptr;
1244  }
1245  std::sort(sortedBeings.begin(), sortedBeings.end(), beingActorSorter);
1246  if (filtered)
1247  {
1248  beingActorSorter.attackBeings = nullptr;
1249  beingActorSorter.priorityBeings = nullptr;
1250  }
1251 
1252  if (localPlayer->getTarget() == nullptr)
1253  {
1254  Being *const target = sortedBeings.at(0);
1255 
1256  if (specialDistance && target->getType() == ActorType::Monster
1257  && target->getDistance() <= 2)
1258  {
1259  return nullptr;
1260  }
1261  // if no selected being in vector, return first nearest being
1262  return target;
1263  }
1264 
1266  STD_VECTOR<Being*>::const_iterator i = std::find_if(
1267  sortedBeings.begin(), sortedBeings.end(), beingEqualActorFinder);
1268 
1269  if (i == sortedBeings.end() || ++i == sortedBeings.end())
1270  {
1271  // if no selected being in vector, return first nearest being
1272  return sortedBeings.at(0);
1273  }
1274 
1275  // we find next being after target
1276  return *i;
1277  }
1278 
1279  int dist = 0;
1280  int index = defaultPriorityIndex;
1281  Being *closestBeing = nullptr;
1282 
1283  FOR_EACH (ActorSprites::iterator, i, mActors)
1284  {
1285 // disabled for performance
1286 // if (reportTrue(*i == nullptr))
1287 // continue;
1288 
1289  if ((*i)->getType() == ActorType::FloorItem ||
1290  (*i)->getType() == ActorType::Portal)
1291  {
1292  continue;
1293  }
1294  Being *const being = static_cast<Being*>(*i);
1295 
1296  if (filtered)
1297  {
1298  if (ignoreAttackMobs.find(being->getName())
1299  != ignoreAttackMobs.end())
1300  {
1301  continue;
1302  }
1303  if (ignoreDefault && attackMobs.find(being->getName())
1304  == attackMobs.end() && priorityMobs.find(being->getName())
1305  == priorityMobs.end())
1306  {
1307  continue;
1308  }
1309  }
1310 
1311  if ((being->getInfo() != nullptr)
1312  && !(being->getInfo()->isTargetSelection() || modActive))
1313  {
1314  continue;
1315  }
1316 
1317  const bool valid = validateBeing(aroundBeing, being,
1318  type, excluded, 50);
1319  int d = being->getDistance();
1320  if (being->getType() != ActorType::Monster
1322  { // if distance not calculated, use old distance
1323  d = (being->getTileX() - x) * (being->getTileX() - x)
1324  + (being->getTileY() - y) * (being->getTileY() - y);
1325  }
1326 
1327  if (!valid)
1328  continue;
1329 
1330  if (specialDistance && being->getDistance() <= 2
1331  && being->getType() == type)
1332  {
1333  continue;
1334  }
1335 
1336 // logger->log("being name:" + being->getName());
1337 // logger->log("index:" + toString(index));
1338 // logger->log("d:" + toString(d));
1339 
1340  if (!filtered && (d <= dist || (closestBeing == nullptr)))
1341  {
1342  dist = d;
1343  closestBeing = being;
1344  }
1345  else if (filtered)
1346  {
1347  int w2 = defaultPriorityIndex;
1348  if (closestBeing != nullptr)
1349  {
1350  const StringIntMapCIter it2 = priorityMobsMap.find(
1351  being->getName());
1352  if (it2 != priorityMobsMap.end())
1353  w2 = (*it2).second;
1354 
1355  if (w2 < index)
1356  {
1357  dist = d;
1358  closestBeing = being;
1359  index = w2;
1360  continue;
1361  }
1362  if (w2 == index && d <= dist)
1363  {
1364  dist = d;
1365  closestBeing = being;
1366  index = w2;
1367  continue;
1368  }
1369  }
1370 
1371  if (closestBeing == nullptr)
1372  {
1373  dist = d;
1374  closestBeing = being;
1375  const StringIntMapCIter it1 = priorityMobsMap.find(
1376  being->getName());
1377  if (it1 != priorityMobsMap.end())
1378  index = (*it1).second;
1379  else
1380  index = defaultPriorityIndex;
1381  }
1382  }
1383  }
1384  return (maxDist >= dist) ? closestBeing : nullptr;
1385 }

References AllowSort_true, SortBeingFunctor::attackBeings, SortBeingFunctor::attackRange, beingActorSorter, beingEqualActorFinder, config, SortBeingFunctor::defaultAttackIndex, SortBeingFunctor::defaultPriorityIndex, FindBeingEqualFunctor::findBeing, ActorType::FloorItem, FOR_EACH, LocalPlayer::getAttackRange(), Configuration::getBoolValue(), Being::getDistance(), Being::getInfo(), Being::getName(), LocalPlayer::getTarget(), Being::getTileX(), Being::getTileY(), Being::getType(), if(), inputManager, InputManager::isActionActive(), BeingInfo::isTargetSelection(), localPlayer, mActors, mAttackMobsMap, mAttackMobsSet, mCycleMonsters, mCycleNPC, mCyclePlayers, mIgnoreAttackMobsSet, ActorType::Monster, Settings::moveToTargetType, mPriorityAttackMobsMap, mPriorityAttackMobsSet, mTargetOnlyReachable, ActorType::Npc, ActorType::Player, ActorType::Portal, SortBeingFunctor::priorityBeings, settings, SortBeingFunctor::specialDistance, InputAction::STOP_ATTACK, anonymous_namespace{libxml.cpp}::valid, validateBeing(), x, SortBeingFunctor::x, y, and SortBeingFunctor::y.

◆ findNearestLivingBeing() [2/3]

Being * ActorManager::findNearestLivingBeing ( const Being *const  aroundBeing,
const int  maxTileDist,
const ActorTypeT  type,
const AllowSort  allowSort 
) const

Returns a being nearest to another being.

Parameters
aroundBeingThe being to search around.
maxTileDistMaximal distance in tiles. If minimal distance is larger, no being is returned.
typeThe type of being to look for.

Definition at line 1103 of file actormanager.cpp.

1107 {
1108  if (aroundBeing == nullptr)
1109  return nullptr;
1110 
1111  return findNearestLivingBeing(aroundBeing,
1112  maxDist,
1113  type,
1114  aroundBeing->getTileX(),
1115  aroundBeing->getTileY(),
1116  aroundBeing,
1117  allowSort);
1118 }

References findNearestLivingBeing(), Being::getTileX(), and Being::getTileY().

◆ findNearestLivingBeing() [3/3]

Being * ActorManager::findNearestLivingBeing ( const int  x,
const int  y,
int  maxTileDist,
const ActorTypeT  type,
const Being *const  excluded 
) const

Returns a being nearest to specific coordinates.

Parameters
xX coordinate in pixels.
yY coordinate in pixels.
maxTileDistMaximal distance in tiles. If minimal distance is larger, no being is returned.
typeThe type of being to look for.

Definition at line 1089 of file actormanager.cpp.

1093 {
1094  const int maxDist = maxTileDist * mapTileSize;
1095 
1096  return findNearestLivingBeing(nullptr, maxDist,
1097  type,
1098  x, y,
1099  excluded,
1100  AllowSort_true);
1101 }

References AllowSort_true, mapTileSize, x, and y.

Referenced by Actions::findBeing(), findNearestLivingBeing(), replaceVars(), and LocalPlayer::setNewTarget().

◆ findNearestPvpPlayer()

Being * ActorManager::findNearestPvpPlayer ( ) const

Finds the nearest player who has PVP on, or just the nearest player if map pvp is on

Definition at line 1032 of file actormanager.cpp.

1033 {
1034  if (localPlayer == nullptr)
1035  return nullptr;
1036 
1037  // don't attack players
1038  if (settings.pvpAttackType == 3)
1039  return nullptr;
1040 
1041  const Game *const game = Game::instance();
1042  if (game == nullptr)
1043  return nullptr;
1044 
1045  const Map *const map = game->getCurrentMap();
1046  if (map == nullptr)
1047  return nullptr;
1048 
1049  const int mapPvpMode = map->getPvpMode();
1050  Being *target = nullptr;
1051  int minDistSquared = 20000;
1052 
1053  for_actors
1054  {
1055  if ((*it)->getType() != ActorType::Player)
1056  continue;
1057 
1058  Being *const being = static_cast<Being*>(*it);
1059 
1060  if (reportTrue(being == nullptr) ||
1061  !being->isAlive() ||
1062  localPlayer == being)
1063  {
1064  continue;
1065  }
1066 
1067  const int teamId = being->getTeamId();
1068  // this condition is very TMW-specific
1069  if (!((mapPvpMode != 0) || (teamId != 0)))
1070  continue;
1071 
1073  continue;
1074 
1075  const int dx = being->getTileX() - localPlayer->getTileX();
1076  const int dy = being->getTileY() - localPlayer->getTileY();
1077  const int distSquared = dx * dx + dy * dy;
1078  if (distSquared < minDistSquared)
1079  {
1080  minDistSquared = distSquared;
1081  target = being;
1082  }
1083  }
1084 
1085  return target;
1086 }

References LocalPlayer::checAttackPermissions(), for_actors, Game::getCurrentMap(), Map::getPvpMode(), Being::getTeamId(), Being::getTileX(), Being::getTileY(), Game::instance(), Being::isAlive(), localPlayer, ActorType::Player, Settings::pvpAttackType, reportTrue, and settings.

◆ findPortalByTile()

Being * ActorManager::findPortalByTile ( const int  x,
const int  y 
) const

Returns a portal at the specific tile.

Definition at line 655 of file actormanager.cpp.

656 {
657  if (mMap == nullptr)
658  return nullptr;
659 
661  {
662 // disabled for performance
663 // if (reportTrue(*it == nullptr))
664 // continue;
665 
666  if ((*it)->getType() != ActorType::Portal)
667  continue;
668 
669  Being *const being = static_cast<Being*>(*it);
670 
671  if (being->getTileX() == x && being->getTileY() == y)
672  return being;
673  }
674 
675  return nullptr;
676 }

References for_actorsm, Being::getTileX(), Being::getTileY(), mMap, ActorType::Portal, x, and y.

Referenced by SocialNavigationTab::updateList().

◆ getAll()

const ActorSprites & ActorManager::getAll ( ) const

Returns the whole list of beings.

Definition at line 940 of file actormanager.cpp.

941 {
942  return mActors;
943 }

References mActors.

Referenced by ChatWindow::doPresent(), and Minimap::draw2().

◆ getAttackMobIndex()

int ActorManager::getAttackMobIndex ( const std::string &  name) const

Definition at line 1987 of file actormanager.cpp.

1988 {
1989  return getIndexByName(name, mAttackMobsMap);
1990 }

References getIndexByName(), and mAttackMobsMap.

Referenced by PopupMenu::showAttackMonsterPopup().

◆ getAttackMobs()

std::list<std::string> ActorManager::getAttackMobs ( ) const
inline

Definition at line 340 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getAttackMobsMap()

const StringIntMap& ActorManager::getAttackMobsMap ( ) const
inline

Definition at line 346 of file actormanager.h.

347  { return mAttackMobsMap; }

References mAttackMobsMap.

◆ getAttackMobsSet()

std::set<std::string> ActorManager::getAttackMobsSet ( ) const
inline

Definition at line 340 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getAttackMobsSize()

int ActorManager::getAttackMobsSize ( ) const
inline

Definition at line 324 of file actormanager.h.

325  { return CAST_S32(mAttackMobs.size()); }

References CAST_S32, and mAttackMobs.

Referenced by PopupMenu::showAttackMonsterPopup().

◆ getIgnoreAttackMobs()

std::list<std::string> ActorManager::getIgnoreAttackMobs ( ) const
inline

Definition at line 342 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getIgnoreAttackMobsSet()

std::set<std::string> ActorManager::getIgnoreAttackMobsSet ( ) const
inline

Definition at line 342 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getIgnorePickupItems()

std::list<std::string> ActorManager::getIgnorePickupItems ( ) const
inline

Definition at line 344 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getIgnorePickupItemsSet()

std::set<std::string> ActorManager::getIgnorePickupItemsSet ( ) const
inline

Definition at line 344 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getIndexByName()

int ActorManager::getIndexByName ( const std::string &  name,
const StringIntMap map 
)
static

Definition at line 1972 of file actormanager.cpp.

1974 {
1975  const StringIntMapCIter i = map.find(name);
1976  if (i == map.end())
1977  return -1;
1978 
1979  return (*i).second;
1980 }

Referenced by getAttackMobIndex(), getPickupItemIndex(), and getPriorityAttackMobIndex().

◆ getMobNames()

void ActorManager::getMobNames ( StringVect names) const

Definition at line 1722 of file actormanager.cpp.

1723 {
1724  names.clear();
1725 
1726  for_actors
1727  {
1728 // disabled for performance
1729 // if (reportTrue(*it == nullptr))
1730 // continue;
1731 
1732  if ((*it)->getType() == ActorType::FloorItem
1733  || (*it)->getType() == ActorType::Portal)
1734  {
1735  continue;
1736  }
1737 
1738  const Being *const being = static_cast<const Being*>(*it);
1739  if (being->getType() == ActorType::Monster &&
1740  !being->getName().empty())
1741  {
1742  names.push_back(being->getName());
1743  }
1744  }
1745 }

References ActorType::FloorItem, for_actors, Being::getName(), Being::getType(), ActorType::Monster, and ActorType::Portal.

Referenced by ChatWindow::autoComplete().

◆ getPickupItemIndex()

int ActorManager::getPickupItemIndex ( const std::string &  name) const

Definition at line 1992 of file actormanager.cpp.

1993 {
1994  return getIndexByName(name, mPickupItemsMap);
1995 }

References getIndexByName(), and mPickupItemsMap.

◆ getPickupItems()

std::list<std::string> ActorManager::getPickupItems ( ) const
inline

Definition at line 343 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getPickupItemsSet()

std::set<std::string> ActorManager::getPickupItemsSet ( ) const
inline

Definition at line 343 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getPickupItemsSize()

int ActorManager::getPickupItemsSize ( ) const
inline

Definition at line 327 of file actormanager.h.

328  { return CAST_S32(mPickupItems.size()); }

References CAST_S32, and mPickupItems.

◆ getPlayerNames()

void ActorManager::getPlayerNames ( StringVect names,
const NpcNames  npcNames 
) const

Definition at line 1694 of file actormanager.cpp.

1696 {
1697  names.clear();
1698 
1699  for_actors
1700  {
1701 // disabled for performance
1702 // if (reportTrue(*it == nullptr))
1703 // continue;
1704 
1705  if ((*it)->getType() == ActorType::FloorItem ||
1706  (*it)->getType() == ActorType::Portal)
1707  {
1708  continue;
1709  }
1710 
1711  const Being *const being = static_cast<const Being*>(*it);
1712  if ((being->getType() == ActorType::Player ||
1713  (being->getType() == ActorType::Npc &&
1714  npcNames == NpcNames_true)) &&
1715  !being->getName().empty())
1716  {
1717  names.push_back(being->getName());
1718  }
1719  }
1720 }

References ActorType::FloorItem, for_actors, Being::getName(), Being::getType(), ActorType::Npc, NpcNames_true, ActorType::Player, and ActorType::Portal.

Referenced by ChatWindow::autoComplete(), SocialPlayersTab::getPlayersAvatars(), and replaceVars().

◆ getPriorityAttackMobIndex()

int ActorManager::getPriorityAttackMobIndex ( const std::string &  name) const

Definition at line 1982 of file actormanager.cpp.

1983 {
1984  return getIndexByName(name, mPriorityAttackMobsMap);
1985 }

References getIndexByName(), and mPriorityAttackMobsMap.

◆ getPriorityAttackMobs()

std::list<std::string> ActorManager::getPriorityAttackMobs ( ) const
inline

Definition at line 341 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getPriorityAttackMobsMap()

const StringIntMap& ActorManager::getPriorityAttackMobsMap ( ) const
inline

Definition at line 349 of file actormanager.h.

351  { return mPriorityAttackMobsMap; }

References mPriorityAttackMobsMap.

◆ getPriorityAttackMobsSet()

std::set<std::string> ActorManager::getPriorityAttackMobsSet ( ) const
inline

Definition at line 341 of file actormanager.h.

347 { return mAttackMobsMap; }

◆ getPriorityAttackMobsSize()

int ActorManager::getPriorityAttackMobsSize ( ) const
inline

Definition at line 321 of file actormanager.h.

322  { return CAST_S32(mPriorityAttackMobs.size()); }

References CAST_S32, and mPriorityAttackMobs.

Referenced by PopupMenu::showAttackMonsterPopup().

◆ getSeenPlayerById()

std::string ActorManager::getSeenPlayerById ( const BeingId  id) const

Definition at line 2211 of file actormanager.cpp.

2212 {
2213  if (!mEnableIdCollecting)
2214  return std::string();
2215 
2216  const IdNameMappingCIter it = mIdName.find(id);
2217  if (it != mIdName.end())
2218  {
2219  if (!it->second.empty())
2220  return *(it->second.begin());
2221  }
2222  return std::string();
2223 }

References mEnableIdCollecting, and mIdName.

Referenced by TmwAthena::ChatRecv::processBeingChat(), and PopupMenu::showPopup().

◆ hasActorSprite()

bool ActorManager::hasActorSprite ( const ActorSprite *const  actor) const

Returns true if the given ActorSprite is in the manager's list, false otherwise.

Parameters
actorthe ActorSprite to search for

Definition at line 1560 of file actormanager.cpp.

1561 {
1562  for_actors
1563  {
1564  if (actor == *it)
1565  return true;
1566  }
1567 
1568  return false;
1569 }

References for_actors.

◆ heal()

void ActorManager::heal ( const Being *const  target) const

Definition at line 1412 of file actormanager.cpp.

1413 {
1415  return;
1416 
1417  if (localPlayer == nullptr ||
1418  chatWindow == nullptr ||
1419  !localPlayer->isAlive() ||
1421  {
1422  return;
1423  }
1424 
1425  // self
1426  if (target != nullptr &&
1427  localPlayer->getName() == target->getName())
1428  {
1432  {
1434  return;
1436  }
1437  }
1438  // magic levels < 2
1439  else if (PlayerInfo::getSkillLevel(340) < 2 ||
1440  PlayerInfo::getSkillLevel(341) < 2)
1441  {
1443  {
1444  if (target != nullptr &&
1445  target->getType() != ActorType::Monster)
1446  {
1448  return;
1450  + target->getName());
1451  }
1454  {
1456  return;
1458  }
1459  }
1460  }
1461  // magic level >= 2 and not self
1462  else
1463  {
1464  // mp > 10 and target not monster
1466  target != nullptr &&
1467  target->getType() != ActorType::Monster)
1468  {
1469  // target not enemy
1470  if (playerRelations.getRelation(target->getName()) !=
1472  {
1474  return;
1476  + target->getName());
1477  }
1478  // target enemy
1479  else
1480  {
1482  return;
1484  }
1485  }
1486  // heal self if selected monster or selection empty
1487  else if ((target == nullptr || target->getType() == ActorType::Monster)
1491  {
1493  return;
1495  }
1496  }
1497 }

References Net::PlayerHandler::canUseMagic(), chatWindow, Relation::ENEMY2, PlayerInfo::getAttribute(), Being::getName(), Net::getNetworkType(), PlayerRelationsManager::getRelation(), PlayerInfo::getSkillLevel(), Being::getType(), Being::isAlive(), PacketLimiter::limitPackets(), ChatWindow::localChatInput(), localPlayer, ActorType::Monster, mSpellHeal1, mSpellHeal2, PacketType::PACKET_CHAT, Attributes::PLAYER_HP, Attributes::PLAYER_MAX_HP, Attributes::PLAYER_MP, playerHandler, playerRelations, and ServerType::TMWATHENA.

Referenced by healTarget(), and AvatarListBox::mousePressed().

◆ healTarget()

void ActorManager::healTarget ( ) const

Heal all players in distance.

Parameters
maxdistmaximal distance. If minimal distance is larger, no being is returned

Definition at line 1404 of file actormanager.cpp.

1405 {
1406  if (localPlayer == nullptr)
1407  return;
1408 
1410 }

References LocalPlayer::getTarget(), heal(), and localPlayer.

◆ isBlocked()

bool ActorManager::isBlocked ( const BeingId  id) const

◆ isInAttackList()

bool ActorManager::isInAttackList ( const std::string &  name) const
inline

Definition at line 340 of file actormanager.h.

347 { return mAttackMobsMap; }

Referenced by PopupMenu::showPopup().

◆ isInIgnoreAttackList()

bool ActorManager::isInIgnoreAttackList ( const std::string &  name) const
inline

Definition at line 342 of file actormanager.h.

347 { return mAttackMobsMap; }

Referenced by PopupMenu::showPopup().

◆ isInIgnorePickupList()

bool ActorManager::isInIgnorePickupList ( const std::string &  name) const
inline

Definition at line 344 of file actormanager.h.

347 { return mAttackMobsMap; }

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

◆ isInPickupList()

bool ActorManager::isInPickupList ( const std::string &  name) const
inline

Definition at line 343 of file actormanager.h.

347 { return mAttackMobsMap; }

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

◆ isInPriorityAttackList()

bool ActorManager::isInPriorityAttackList ( const std::string &  name) const
inline

Definition at line 341 of file actormanager.h.

347 { return mAttackMobsMap; }

Referenced by PopupMenu::showPopup().

◆ itenplz()

void ActorManager::itenplz ( ) const

Definition at line 1541 of file actormanager.cpp.

1542 {
1544  return;
1545  if (localPlayer == nullptr ||
1546  chatWindow == nullptr ||
1547  !localPlayer->isAlive() ||
1549  {
1550  return;
1551  }
1552 
1554  return;
1555 
1557 }

References Net::PlayerHandler::canUseMagic(), chatWindow, Net::getNetworkType(), Being::isAlive(), PacketLimiter::limitPackets(), ChatWindow::localChatInput(), localPlayer, mSpellItenplz, PacketType::PACKET_CHAT, playerHandler, and ServerType::TMWATHENA.

◆ loadAttackList()

void ActorManager::loadAttackList ( )
protected

Definition at line 2012 of file actormanager.cpp.

2013 {
2014  bool empty = false;
2015  std::list<std::string> list;
2016  std::list<std::string>::const_iterator i;
2017  std::list<std::string>::const_iterator i_end;
2018 
2019  loadList("attackPriorityMobs", PriorityAttackMob)
2020  loadList("attackMobs", AttackMob)
2021  loadList("ignoreAttackMobs", IgnoreAttackMob)
2022  if (!empty)
2023  {
2024  mAttackMobs.push_back("");
2025  mAttackMobsSet.insert("");
2026  }
2027  empty = false;
2028 
2029  loadList("pickupItems", PickupItem)
2030  loadList("ignorePickupItems", IgnorePickupItem)
2031  if (!empty)
2032  {
2033  mPickupItems.push_back("");
2034  mPickupItemsSet.insert("");
2035  }
2036 
2040 }

References empty, loadList, mAttackMobs, mAttackMobsSet, mPickupItems, mPickupItemsSet, rebuildAttackMobs(), rebuildPickupItems(), and rebuildPriorityAttackMobs().

Referenced by ActorManager().

◆ logic()

void ActorManager::logic ( )

Performs ActorSprite logic and deletes ActorSprite scheduled to be deleted.

Definition at line 945 of file actormanager.cpp.

946 {
947  BLOCK_START("ActorManager::logic")
948  for_actors
949  {
950 // disabled for performance
951 // if (reportFalse(*it))
952  (*it)->logic();
953  }
954 
955  if (mDeleteActors.empty())
956  {
957  BLOCK_END("ActorManager::logic")
958  return;
959  }
960 
963  {
964  const ActorSprite *const actor = *it;
965  const ActorTypeT &type = actor->getType();
966  if (type == ActorType::Player)
967  {
968  const Being *const being = static_cast<const Being*>(actor);
969  being->addToCache();
970  if (beingEquipmentWindow != nullptr)
972  }
973  if (localPlayer != nullptr)
974  {
975  if (localPlayer->getTarget() == actor)
976  localPlayer->setTarget(nullptr);
977  if (localPlayer->getPickUpTarget() == actor)
979  }
980  if (viewport != nullptr)
981  viewport->clearHover(*it);
982  }
983 
985  {
986  ActorSprite *actor = *it;
987  mActors.erase(actor);
988 
989  if (actor != nullptr)
990  {
991  const ActorSpritesMapIterator itr = mActorsIdMap.find(
992  actor->getId());
993  if (itr != mActorsIdMap.end() && (*itr).second == actor)
994  mActorsIdMap.erase(itr);
995 
996  delete actor;
997  }
998  }
999 
1000  mDeleteActors.clear();
1001  BLOCK_END("ActorManager::logic 1")
1003 }

References Being::addToCache(), beingEquipmentWindow, BLOCK_END, BLOCK_START, Viewport::clearHover(), for_actors, FOR_EACH, ActorSprite::getId(), LocalPlayer::getPickUpTarget(), LocalPlayer::getTarget(), ActorSprite::getType(), localPlayer, mActors, mActorsIdMap, mDeleteActors, ActorType::Player, EquipmentWindow::resetBeing(), LocalPlayer::setTarget(), LocalPlayer::unSetPickUpTarget(), and viewport.

Referenced by Game::logic().

◆ optionChanged()

void ActorManager::optionChanged ( const std::string &  name)
virtual

Called when an option changed. The config listener will have to be registered to the option name first.

Implements ConfigListener.

Definition at line 1839 of file actormanager.cpp.

1840 {
1841  if (name == "targetDeadPlayers")
1842  mTargetDeadPlayers = config.getBoolValue("targetDeadPlayers");
1843  else if (name == "targetOnlyReachable")
1844  mTargetOnlyReachable = config.getBoolValue("targetOnlyReachable");
1845  else if (name == "cyclePlayers")
1846  mCyclePlayers = config.getBoolValue("cyclePlayers");
1847  else if (name == "cycleMonsters")
1848  mCycleMonsters = config.getBoolValue("cycleMonsters");
1849  else if (name == "cycleNPC")
1850  mCycleNPC = config.getBoolValue("cycleNPC");
1851  else if (name == "extMouseTargeting")
1852  mExtMouseTargeting = config.getBoolValue("extMouseTargeting");
1853  else if (name == "showBadges" || name == "visiblenamespos")
1854  updateBadges();
1855  else if (name == "enableIdCollecting")
1856  mEnableIdCollecting = config.getBoolValue("enableIdCollecting");
1857 }

References config, Configuration::getBoolValue(), mCycleMonsters, mCycleNPC, mCyclePlayers, mEnableIdCollecting, mExtMouseTargeting, mTargetDeadPlayers, mTargetOnlyReachable, and updateBadges().

◆ parseLevels()

void ActorManager::parseLevels ( std::string  levels) const

Definition at line 1809 of file actormanager.cpp.

1810 {
1811  levels.append(", ");
1812  size_t f = 0;
1813  const std::string brkEnd("), ");
1814  size_t pos = levels.find(brkEnd, f);
1815 
1816  while (pos != std::string::npos)
1817  {
1818  std::string part = levels.substr(f, pos - f);
1819  if (part.empty())
1820  break;
1821  const size_t bktPos = part.rfind('(');
1822  if (bktPos != std::string::npos)
1823  {
1824  Being *const being = findBeingByName(part.substr(0, bktPos),
1826  if (being != nullptr)
1827  {
1828  being->setLevel(atoi(part.substr(bktPos + 1).c_str()));
1829  being->addToCache();
1830  }
1831  }
1832  f = CAST_SIZE(pos + brkEnd.length());
1833  pos = levels.find(brkEnd, f);
1834  }
1836 }

References Being::addToCache(), CAST_SIZE, findBeingByName(), ActorType::Player, Being::setLevel(), and updatePlayerNames().

Referenced by TmwAthena::ChatRecv::processChatContinue().

◆ pickUpAll()

bool ActorManager::pickUpAll ( const int  x1,
const int  y1,
const int  x2,
const int  y2,
const bool  serverBuggy 
) const

Definition at line 712 of file actormanager.cpp.

715 {
716  if (localPlayer == nullptr)
717  return false;
718 
719  bool finded(false);
720  const bool allowAll = mPickupItemsSet.find(std::string()) !=
721  mPickupItemsSet.end();
722  if (!serverBuggy)
723  {
725  {
726 // disabled for performance
727 // if (reportTrue(*it == nullptr))
728 // continue;
729 
730  if ((*it)->getType() == ActorType::FloorItem
731  && ((*it)->getTileX() >= x1 && (*it)->getTileX() <= x2)
732  && ((*it)->getTileY() >= y1 && (*it)->getTileY() <= y2))
733  {
734  FloorItem *const item = static_cast<FloorItem*>(*it);
735  if (allowAll)
736  {
737  if (mIgnorePickupItemsSet.find(item->getName())
738  == mIgnorePickupItemsSet.end())
739  {
740  if (localPlayer->pickUp(item))
741  finded = true;
742  }
743  }
744  else
745  {
746  if (mPickupItemsSet.find(item->getName())
747  != mPickupItemsSet.end())
748  {
749  if (localPlayer->pickUp(item))
750  finded = true;
751  }
752  }
753  }
754  }
755  }
757  {
758  FloorItem *item = nullptr;
759  unsigned cnt = 65535;
761  {
762 // disabled for performance
763 // if (reportTrue(*it == nullptr))
764 // continue;
765 
766  if ((*it)->getType() == ActorType::FloorItem
767  && ((*it)->getTileX() >= x1 && (*it)->getTileX() <= x2)
768  && ((*it)->getTileY() >= y1 && (*it)->getTileY() <= y2))
769  {
770  FloorItem *const tempItem = static_cast<FloorItem*>(*it);
771  if (tempItem->getPickupCount() < cnt)
772  {
773  if (allowAll)
774  {
775  if (mIgnorePickupItemsSet.find(tempItem->getName())
776  == mIgnorePickupItemsSet.end())
777  {
778  item = tempItem;
779  cnt = item->getPickupCount();
780  if (cnt == 0)
781  {
782  item->incrementPickup();
783  localPlayer->pickUp(item);
784  return true;
785  }
786  }
787  }
788  else
789  {
790  if (mPickupItemsSet.find(tempItem->getName())
791  != mPickupItemsSet.end())
792  {
793  item = tempItem;
794  cnt = item->getPickupCount();
795  if (cnt == 0)
796  {
797  item->incrementPickup();
798  localPlayer->pickUp(item);
799  return true;
800  }
801  }
802  }
803  }
804  }
805  }
806  if ((item != nullptr) && localPlayer->pickUp(item))
807  finded = true;
808  }
809  return finded;
810 }

References PacketLimiter::checkPackets(), ActorType::FloorItem, for_actorsm, FloorItem::getName(), FloorItem::getPickupCount(), FloorItem::incrementPickup(), localPlayer, mIgnorePickupItemsSet, mPickupItemsSet, PacketType::PACKET_PICKUP, and LocalPlayer::pickUp().

Referenced by LocalPlayer::pickUpItems().

◆ pickUpNearest()

bool ActorManager::pickUpNearest ( const int  x,
const int  y,
int  maxdist 
) const

Definition at line 812 of file actormanager.cpp.

814 {
815  if (localPlayer == nullptr)
816  return false;
817 
818  maxdist = maxdist * maxdist;
819  FloorItem *closestItem = nullptr;
820  int dist = 0;
821  const bool allowAll = mPickupItemsSet.find(std::string()) !=
822  mPickupItemsSet.end();
823 
825  {
826 // disabled for performance
827 // if (reportTrue(*it == nullptr))
828 // continue;
829 
830  if ((*it)->getType() == ActorType::FloorItem)
831  {
832  FloorItem *const item = static_cast<FloorItem*>(*it);
833 
834  const int d = (item->getTileX() - x) * (item->getTileX() - x)
835  + (item->getTileY() - y) * (item->getTileY() - y);
836 
837  if ((d < dist || closestItem == nullptr) &&
839  item->getTileX(), item->getTileY(),
840  false)))
841  {
842  if (allowAll)
843  {
844  if (mIgnorePickupItemsSet.find(item->getName())
845  == mIgnorePickupItemsSet.end())
846  {
847  dist = d;
848  closestItem = item;
849  }
850  }
851  else
852  {
853  if (mPickupItemsSet.find(item->getName())
854  != mPickupItemsSet.end())
855  {
856  dist = d;
857  closestItem = item;
858  }
859  }
860  }
861  }
862  }
863  if ((closestItem != nullptr) && dist <= maxdist)
864  return localPlayer->pickUp(closestItem);
865 
866  return false;
867 }

References ActorType::FloorItem, for_actorsm, FloorItem::getName(), FloorItem::getTileX(), FloorItem::getTileY(), LocalPlayer::isReachable(), localPlayer, mIgnorePickupItemsSet, mPickupItemsSet, mTargetOnlyReachable, LocalPlayer::pickUp(), x, and y.

Referenced by LocalPlayer::pickUpItems().

◆ printAllToChat()

void ActorManager::printAllToChat ( )

Definition at line 1586 of file actormanager.cpp.

1587 {
1588  // TRANSLATORS: visible beings on map
1589  printBeingsToChat(_("Visible on map"));
1590 }

References _, and printBeingsToChat().

◆ printBeingsToChat() [1/2]

void ActorManager::printBeingsToChat ( const std::string &  header) const

Definition at line 1592 of file actormanager.cpp.

1593 {
1594  if (debugChatTab == nullptr)
1595  return;
1596 
1597  debugChatTab->chatLog("---------------------------------------",
1601  debugChatTab->chatLog(header,
1605  for_actors
1606  {
1607 // disabled for performance
1608 // if (reportTrue(*it == nullptr))
1609 // continue;
1610 
1611  if ((*it)->getType() == ActorType::FloorItem)
1612  continue;
1613 
1614  const Being *const being = static_cast<const Being*>(*it);
1615 
1616  debugChatTab->chatLog(strprintf("%s (%d,%d) %d",
1617  being->getName().c_str(), being->getTileX(), being->getTileY(),
1618  toInt(being->getSubType(), int)),
1622  if (mActorsIdMap.find(being->getId()) == mActorsIdMap.end())
1623  {
1624  debugChatTab->chatLog("missing in id map: %s",
1625  being->getName().c_str());
1626  }
1627  }
1628  debugChatTab->chatLog("---------------------------------------",
1633  {
1634  const ActorSprite *const actor = (*itr).second;
1635  if (actor == nullptr)
1636  continue;
1637  if (actor->getId() != (*itr).first)
1638  debugChatTab->chatLog("Actor with wrong key in map", "");
1639 
1640  bool found(false);
1641 
1642  for_actors
1643  {
1644 // disabled for performance
1645 // if (!*it)
1646 // continue;
1647 
1648  if ((*it)->getId() == actor->getId())
1649  {
1650  found = true;
1651  break;
1652  }
1653  }
1654  if (!found)
1655  debugChatTab->chatLog("Actor present in map but not in set", "");
1656  }
1657 }

References ChatMsgType::BY_SERVER, ChatTab::chatLog(), debugChatTab, ActorType::FloorItem, for_actors, FOR_EACH, ActorSprite::getId(), Being::getName(), Being::getSubType(), Being::getTileX(), Being::getTileY(), IgnoreRecord_false, mActorsIdMap, strprintf(), toInt, and TryRemoveColors_true.

Referenced by printAllToChat().

◆ printBeingsToChat() [2/2]

void ActorManager::printBeingsToChat ( const std::vector< Being * > &  beings,
const std::string &  header 
)
static

Definition at line 1659 of file actormanager.cpp.

1661 {
1662  if (debugChatTab == nullptr)
1663  return;
1664 
1665  debugChatTab->chatLog("---------------------------------------",
1669  debugChatTab->chatLog(header,
1673 
1674  FOR_EACH (STD_VECTOR<Being*>::const_iterator, i, beings)
1675  {
1676  if (*i == nullptr)
1677  continue;
1678 
1679  const Being *const being = *i;
1680 
1681  debugChatTab->chatLog(strprintf("%s (%d,%d) %d",
1682  being->getName().c_str(), being->getTileX(), being->getTileY(),
1683  toInt(being->getSubType(), int)),
1687  }
1688  debugChatTab->chatLog("---------------------------------------",
1692 }

References ChatMsgType::BY_SERVER, ChatTab::chatLog(), debugChatTab, FOR_EACH, Being::getName(), Being::getSubType(), Being::getTileX(), Being::getTileY(), IgnoreRecord_false, strprintf(), toInt, and TryRemoveColors_true.

◆ rebuildAttackMobs()

void ActorManager::rebuildAttackMobs ( )

Definition at line 1962 of file actormanager.cpp.

1963 {
1964  rebuildMobsList(AttackMob)
1965 }

References rebuildMobsList.

Referenced by addIgnoreAttackMob(), loadAttackList(), and removeAttackMob().

◆ rebuildIgnoreAttackMobs()

void ActorManager::rebuildIgnoreAttackMobs ( )

◆ rebuildIgnorePickupItems()

void ActorManager::rebuildIgnorePickupItems ( )

◆ rebuildPickupItems()

void ActorManager::rebuildPickupItems ( )

Definition at line 1967 of file actormanager.cpp.

1968 {
1969  rebuildMobsList(PickupItem)
1970 }

References rebuildMobsList.

Referenced by addIgnorePickupItem(), addPickupItem(), loadAttackList(), and removePickupItem().

◆ rebuildPriorityAttackMobs()

void ActorManager::rebuildPriorityAttackMobs ( )

Definition at line 1957 of file actormanager.cpp.

1958 {
1959  rebuildMobsList(PriorityAttackMob)
1960 }

References rebuildMobsList.

Referenced by addAttackMob(), addIgnoreAttackMob(), loadAttackList(), and removeAttackMob().

◆ removeAttackMob()

void ActorManager::removeAttackMob ( const std::string &  name)

Definition at line 1859 of file actormanager.cpp.

1860 {
1861  mPriorityAttackMobs.remove(name);
1862  mAttackMobs.remove(name);
1863  mIgnoreAttackMobs.remove(name);
1864  mPriorityAttackMobsSet.erase(name);
1865  mAttackMobsSet.erase(name);
1866  mIgnoreAttackMobsSet.erase(name);
1869  storeAttackList();
1870 }

References mAttackMobs, mAttackMobsSet, mIgnoreAttackMobs, mIgnoreAttackMobsSet, mPriorityAttackMobs, mPriorityAttackMobsSet, rebuildAttackMobs(), rebuildPriorityAttackMobs(), and storeAttackList().

◆ removePickupItem()

void ActorManager::removePickupItem ( const std::string &  name)

Definition at line 1872 of file actormanager.cpp.

1873 {
1874  mPickupItems.remove(name);
1875  mPickupItemsSet.erase(name);
1876  mIgnorePickupItems.remove(name);
1877  mIgnorePickupItemsSet.erase(name);
1879  storeAttackList();
1880 }

References mIgnorePickupItems, mIgnorePickupItemsSet, mPickupItems, mPickupItemsSet, rebuildPickupItems(), and storeAttackList().

◆ removeRoom()

void ActorManager::removeRoom ( const int  chatId)

Definition at line 2225 of file actormanager.cpp.

2226 {
2227  for_actors
2228  {
2229  ActorSprite *const actor = *it;
2230  if (actor->getType() == ActorType::Npc)
2231  {
2232  Being *const being = static_cast<Being*>(actor);
2233  const ChatObject *const chat = being->getChat();
2234  if ((chat != nullptr) && chat->chatId == chatId)
2235  {
2236  being->setChat(nullptr);
2237  }
2238  }
2239  }
2240 }

References ChatObject::chatId, for_actors, Being::getChat(), ActorSprite::getType(), ActorType::Npc, and Being::setChat().

Referenced by EAthena::ChatRecv::processChatRoomDestroy().

◆ setAttackMobs()

void ActorManager::setAttackMobs ( const std::list< std::string > &  mobs)
inline

Definition at line 318 of file actormanager.h.

319  { mAttackMobs = mobs; }

References mAttackMobs.

◆ setMap()

void ActorManager::setMap ( Map *const  map)

Sets the map on which ActorSprites are created.

Definition at line 263 of file actormanager.cpp.

264 {
265  mMap = map;
266 
267  if (localPlayer != nullptr)
268  localPlayer->setMap(map);
269 }

References localPlayer, mMap, and LocalPlayer::setMap().

Referenced by Game::changeMap().

◆ setPlayer()

void ActorManager::setPlayer ( LocalPlayer *const  player)

Sets the current player.

Definition at line 271 of file actormanager.cpp.

272 {
273  localPlayer = player;
274  mActors.insert(player);
275  mActorsIdMap[player->getId()] = player;
276  if (socialWindow != nullptr)
278  if (socialWindow != nullptr)
280 }

References ActorSprite::getId(), localPlayer, mActors, mActorsIdMap, socialWindow, SocialWindow::updateAttackFilter(), and SocialWindow::updatePickupFilter().

Referenced by Game::Game().

◆ setPriorityAttackMobs()

void ActorManager::setPriorityAttackMobs ( const std::list< std::string > &  mobs)
inline

Definition at line 315 of file actormanager.h.

316  { mPriorityAttackMobs = mobs; }

References mPriorityAttackMobs.

◆ size()

size_t ActorManager::size ( ) const
inline

Definition at line 380 of file actormanager.h.

381  { return mActors.size(); }

References mActors.

◆ storeAttackList()

void ActorManager::storeAttackList ( ) const
protected

◆ undelete()

void ActorManager::undelete ( const ActorSprite *const  actor)

◆ updateBadges()

void ActorManager::updateBadges ( ) const

Definition at line 2140 of file actormanager.cpp.

2141 {
2142  const BadgeDrawType::Type showBadges = static_cast<BadgeDrawType::Type>(
2143  config.getIntValue("showBadges"));
2144  Being::mShowBadges = showBadges;
2146  config.getIntValue("visiblenamespos"));
2147 
2148  for_actors
2149  {
2150  ActorSprite *const actor = *it;
2151  if (actor->getType() == ActorType::Player)
2152  {
2153  Being *const being = static_cast<Being*>(actor);
2154  being->showBadges(showBadges != BadgeDrawType::Hide);
2155  }
2156  }
2157 }

References config, for_actors, Configuration::getIntValue(), ActorSprite::getType(), BadgeDrawType::Hide, Being::mShowBadges, Being::mVisibleNamePos, ActorType::Player, and Being::showBadges().

Referenced by optionChanged().

◆ updateEffects()

void ActorManager::updateEffects ( const std::map< BeingTypeId, int > &  addEffects,
const std::set< BeingTypeId > &  removeEffects 
) const

Definition at line 2075 of file actormanager.cpp.

2078 {
2079  for_actorsm
2080  {
2081 // disabled for performance
2082 // if (reportTrue(*it == nullptr))
2083 // continue;
2084  if ((*it)->getType() != ActorType::Npc)
2085  continue;
2086  Being *const being = static_cast<Being*>(*it);
2087  const BeingTypeId type = being->getSubType();
2088  if (removeEffects.find(type) != removeEffects.end())
2089  being->removeSpecialEffect();
2090  const std::map<BeingTypeId, int>::const_iterator
2091  idAdd = addEffects.find(type);
2092  if (idAdd != addEffects.end())
2093  being->addSpecialEffect((*idAdd).second);
2094  }
2095 }

References Being::addSpecialEffect(), for_actorsm, Being::getSubType(), ActorType::Npc, and Being::removeSpecialEffect().

Referenced by QuestsWindow::updateEffects().

◆ updateNameId()

void ActorManager::updateNameId ( const std::string &  name,
const BeingId  beingId 
)

Definition at line 2159 of file actormanager.cpp.

2161 {
2162  if (!mEnableIdCollecting)
2163  return;
2164  const int id = CAST_S32(beingId);
2165  if ((id != 0) &&
2166  (id < 2000000 ||
2167  id >= 110000000))
2168  {
2169  return;
2170  }
2171 
2172  if (mIdName.find(beingId) == mIdName.end() ||
2173  mIdName[beingId].find(name) == mIdName[beingId].end())
2174  {
2175  mIdName[beingId].insert(name);
2176  const std::string idStr = toString(id);
2177  const std::string dateStr = getDateTimeString();
2178  std::string dir;
2179  if (beingId != BeingId_zero)
2180  {
2182  idStr,
2183  stringToHexPath(name));
2184  Files::saveTextFile(dir,
2185  "info.txt",
2186  (name + "\n").append(dateStr));
2187  }
2188 
2189  dir = settings.usersDir;
2190  dir.append(stringToHexPath(name));
2191  Files::saveTextFile(dir,
2192  "seen.txt",
2193  (name + "\n").append(idStr).append("\n").append(dateStr));
2194  }
2195 }

References BeingId_zero, CAST_S32, getDateTimeString(), mEnableIdCollecting, mIdName, pathJoin(), Files::saveTextFile(), settings, stringToHexPath(), Catch::toString(), Settings::usersDir, and Settings::usersIdDir.

Referenced by Ea::BeingRecv::processNameResponse(), EAthena::BeingRecv::processNameResponse2(), EAthena::BeingRecv::processNameResponseTitle(), TmwAthena::PlayerRecv::processOnlineList(), EAthena::BeingRecv::processPlayerGuilPartyInfo(), EAthena::BeingRecv::processPlayerGuilPartyInfo2(), and updateSeenPlayers().

◆ updatePlayerColors()

void ActorManager::updatePlayerColors ( ) const

Definition at line 1768 of file actormanager.cpp.

1769 {
1770  for_actorsm
1771  {
1772 // disabled for performance
1773 // if (reportTrue(*it == nullptr))
1774 // continue;
1775 
1776  if ((*it)->getType() == ActorType::FloorItem
1777  || (*it)->getType() == ActorType::Portal)
1778  {
1779  continue;
1780  }
1781 
1782  Being *const being = static_cast<Being*>(*it);
1783  if (being->getType() == ActorType::Player && !being->getName().empty())
1784  being->updateColors();
1785  }
1786 }

References ActorType::FloorItem, for_actorsm, Being::getName(), Being::getType(), ActorType::Player, ActorType::Portal, and Being::updateColors().

Referenced by GuildManager::afterRemove(), EAthena::GuildRecv::processGuildExpulsionContinue(), EAthena::GuildRecv::processGuildLeave(), EAthena::GuildRecv::processGuildLeave2(), EAthena::GuildRecv::processGuildMemberList(), and GuildManager::updateList().

◆ updatePlayerGuild()

void ActorManager::updatePlayerGuild ( ) const

Definition at line 1788 of file actormanager.cpp.

1789 {
1790  for_actorsm
1791  {
1792 // disabled for performance
1793 // if (reportTrue(*it == nullptr))
1794 // continue;
1795 
1796  if ((*it)->getType() == ActorType::FloorItem
1797  || (*it)->getType() == ActorType::Portal)
1798  {
1799  continue;
1800  }
1801 
1802  Being *const being = static_cast<Being*>(*it);
1803  if (being->getType() == ActorType::Player && !being->getName().empty())
1804  being->updateGuild();
1805  }
1806 }

References ActorType::FloorItem, for_actorsm, Being::getName(), Being::getType(), ActorType::Player, ActorType::Portal, and Being::updateGuild().

Referenced by GuildManager::afterRemove(), EAthena::GuildRecv::processGuildMemberList(), and GuildManager::updateList().

◆ updatePlayerNames()

void ActorManager::updatePlayerNames ( ) const

Definition at line 1747 of file actormanager.cpp.

1748 {
1749  for_actorsm
1750  {
1751 // disabled for performance
1752 // if (reportTrue(*it == nullptr))
1753 // continue;
1754 
1755  if ((*it)->getType() == ActorType::FloorItem
1756  || (*it)->getType() == ActorType::Portal)
1757  {
1758  continue;
1759  }
1760 
1761  Being *const being = static_cast<Being*>(*it);
1762  being->setGoodStatus(-1);
1763  if (being->getType() == ActorType::Player && !being->getName().empty())
1764  being->updateName();
1765  }
1766 }

References ActorType::FloorItem, for_actorsm, Being::getName(), Being::getType(), ActorType::Player, ActorType::Portal, Being::setGoodStatus(), and Being::updateName().

Referenced by Setup_Relations::apply(), and parseLevels().

◆ updateRoom()

void ActorManager::updateRoom ( const ChatObject *const  newChat)

Definition at line 2242 of file actormanager.cpp.

2243 {
2244  if (newChat == nullptr)
2245  return;
2246 
2247  for_actors
2248  {
2249  const ActorSprite *const actor = *it;
2250  if (actor->getType() == ActorType::Npc)
2251  {
2252  const Being *const being = static_cast<const Being*>(actor);
2253  ChatObject *const chat = being->getChat();
2254  if ((chat != nullptr) && chat->chatId == newChat->chatId)
2255  {
2256  chat->ownerId = newChat->ownerId;
2257  chat->maxUsers = newChat->maxUsers;
2258  chat->type = newChat->type;
2259  chat->title = newChat->title;
2260  }
2261  }
2262  }
2263 }

References ChatObject::chatId, for_actors, Being::getChat(), ActorSprite::getType(), ChatObject::maxUsers, ActorType::Npc, ChatObject::ownerId, ChatObject::title, and ChatObject::type.

Referenced by EAthena::ChatRecv::processChatRoomSettings().

◆ updateSeenPlayers()

void ActorManager::updateSeenPlayers ( const std::set< std::string > &  onlinePlayers)

Definition at line 2197 of file actormanager.cpp.

2199 {
2200  if (!mEnableIdCollecting)
2201  return;
2202 
2203  FOR_EACH (std::set<std::string>::const_iterator, it, onlinePlayers)
2204  {
2205  const std::string name = *it;
2206  if (findBeingByName(name, ActorType::Player) == nullptr)
2207  updateNameId(name, BeingId_zero);
2208  }
2209 }

References BeingId_zero, findBeingByName(), FOR_EACH, mEnableIdCollecting, ActorType::Player, and updateNameId().

Referenced by WhoIsOnline::loadList(), and WhoIsOnline::slowLogic().

◆ validateBeing()

bool ActorManager::validateBeing ( const Being *const  aroundBeing,
Being *const  being,
const ActorTypeT type,
const Being *const  excluded,
const int  maxCost 
) const
protected

Definition at line 1387 of file actormanager.cpp.

1392 {
1393  if (localPlayer == nullptr)
1394  return false;
1395  return (being != nullptr) && ((being->getType() == type
1396  || type == ActorType::Unknown) && (being->isAlive()
1397  || (mTargetDeadPlayers && type == ActorType::Player))
1398  && being != aroundBeing) && being != excluded
1400  || localPlayer->isReachable(being, maxCost));
1401 }

References Being::getType(), Being::isAlive(), LocalPlayer::isReachable(), localPlayer, ActorType::Monster, mTargetDeadPlayers, mTargetOnlyReachable, ActorType::Player, and ActorType::Unknown.

Referenced by findNearestByName(), and findNearestLivingBeing().

Field Documentation

◆ mActors

ActorSprites ActorManager::mActors
protected

◆ mActorsIdMap

ActorSpritesMap ActorManager::mActorsIdMap
protected

◆ mAttackMobs

std::list<std::string> ActorManager::mAttackMobs
protected

◆ mAttackMobsMap

StringIntMap ActorManager::mAttackMobsMap
protected

Definition at line 447 of file actormanager.h.

Referenced by findNearestLivingBeing(), getAttackMobIndex(), and getAttackMobsMap().

◆ mAttackMobsSet

std::set<std::string> ActorManager::mAttackMobsSet
protected

Definition at line 447 of file actormanager.h.

Referenced by findNearestLivingBeing(), loadAttackList(), and removeAttackMob().

◆ mBlockedBeings

std::set<BeingId> ActorManager::mBlockedBeings
protected

Definition at line 417 of file actormanager.h.

Referenced by addBlock(), deleteBlock(), and isBlocked().

◆ mChars

std::map<int32_t, std::string> ActorManager::mChars
protected

Definition at line 418 of file actormanager.h.

Referenced by addChar(), clear(), and findCharById().

◆ mCycleMonsters

bool ActorManager::mCycleMonsters
protected

Definition at line 429 of file actormanager.h.

Referenced by findNearestLivingBeing(), and optionChanged().

◆ mCycleNPC

bool ActorManager::mCycleNPC
protected

Definition at line 430 of file actormanager.h.

Referenced by findNearestLivingBeing(), and optionChanged().

◆ mCyclePlayers

bool ActorManager::mCyclePlayers
protected

Definition at line 428 of file actormanager.h.

Referenced by findNearestLivingBeing(), and optionChanged().

◆ mDeleteActors

ActorSprites ActorManager::mDeleteActors
protected

Definition at line 414 of file actormanager.h.

Referenced by clear(), destroy(), logic(), and undelete().

◆ mEnableIdCollecting

bool ActorManager::mEnableIdCollecting
protected

Definition at line 432 of file actormanager.h.

Referenced by getSeenPlayerById(), optionChanged(), updateNameId(), and updateSeenPlayers().

◆ mExtMouseTargeting

bool ActorManager::mExtMouseTargeting
protected

Definition at line 431 of file actormanager.h.

Referenced by findBeingByPixel(), and optionChanged().

◆ mIdName

IdNameMapping ActorManager::mIdName
protected

Definition at line 416 of file actormanager.h.

Referenced by getSeenPlayerById(), and updateNameId().

◆ mIgnoreAttackMobs

std::list<std::string> ActorManager::mIgnoreAttackMobs
protected

Definition at line 447 of file actormanager.h.

Referenced by addIgnoreAttackMob(), removeAttackMob(), and storeAttackList().

◆ mIgnoreAttackMobsSet

std::set<std::string> ActorManager::mIgnoreAttackMobsSet
protected

Definition at line 447 of file actormanager.h.

Referenced by addIgnoreAttackMob(), findNearestLivingBeing(), and removeAttackMob().

◆ mIgnorePickupItems

std::list<std::string> ActorManager::mIgnorePickupItems
protected

Definition at line 448 of file actormanager.h.

Referenced by addIgnorePickupItem(), removePickupItem(), and storeAttackList().

◆ mIgnorePickupItemsSet

std::set<std::string> ActorManager::mIgnorePickupItemsSet
protected

◆ mMap

Map* ActorManager::mMap
protected

◆ mPickupItems

std::list<std::string> ActorManager::mPickupItems
protected

◆ mPickupItemsMap

StringIntMap ActorManager::mPickupItemsMap
protected

Definition at line 448 of file actormanager.h.

Referenced by getPickupItemIndex().

◆ mPickupItemsSet

std::set<std::string> ActorManager::mPickupItemsSet
protected

◆ mPriorityAttackMobs

std::list<std::string> ActorManager::mPriorityAttackMobs
protected

◆ mPriorityAttackMobsMap

StringIntMap ActorManager::mPriorityAttackMobsMap
protected

◆ mPriorityAttackMobsSet

std::set<std::string> ActorManager::mPriorityAttackMobsSet
protected

Definition at line 446 of file actormanager.h.

Referenced by findNearestLivingBeing(), and removeAttackMob().

◆ mSpellHeal1

std::string ActorManager::mSpellHeal1
protected

Definition at line 421 of file actormanager.h.

Referenced by heal().

◆ mSpellHeal2

std::string ActorManager::mSpellHeal2
protected

Definition at line 422 of file actormanager.h.

Referenced by heal().

◆ mSpellItenplz

std::string ActorManager::mSpellItenplz
protected

Definition at line 423 of file actormanager.h.

Referenced by itenplz().

◆ mTargetDeadPlayers

bool ActorManager::mTargetDeadPlayers
protected

Definition at line 426 of file actormanager.h.

Referenced by findBeingByPixel(), findBeingsByPixel(), optionChanged(), and validateBeing().

◆ mTargetOnlyReachable

bool ActorManager::mTargetOnlyReachable
protected

The documentation for this class was generated from the following files:
Attributes::PLAYER_MP
@ PLAYER_MP
Definition: attributes.h:33
ActorManager::mCycleNPC
bool mCycleNPC
Definition: actormanager.h:430
ActorManager::findBeingByName
Being * findBeingByName(const std::string &name, const ActorTypeT type) const
Definition: actormanager.cpp:869
reportTrue
#define reportTrue(val)
Definition: checkutils.h:251
ActorManager
Definition: actormanager.h:68
ActorType::Unknown
@ Unknown
Definition: actortype.h:29
Net::ServerFeatures::haveServerWarpNames
virtual bool haveServerWarpNames() const =0
FloorItem::getPickupCount
unsigned getPickupCount() const
Definition: flooritem.h:101
ConfigurationObject::getValue
std::string getValue(const std::string &key, const std::string &deflt) const
Definition: configuration.cpp:268
ActorType::Elemental
@ Elemental
Definition: actortype.h:40
reportAlways
#define reportAlways(...)
Definition: checkutils.h:252
VisibleNamePos::Type
Type
Definition: visiblenamepos.h:26
ActorManager::mMap
Map * mMap
Definition: actormanager.h:419
stringToHexPath
std::string stringToHexPath(const std::string &str)
Definition: stringutils.cpp:609
CHECKLISTENERS
#define CHECKLISTENERS
Definition: localconsts.h:276
Being::setGoodStatus
void setGoodStatus(const int n)
Definition: being.h:802
StringIntMapCIter
StringIntMap::const_iterator StringIntMapCIter
Definition: stringmap.h:29
ActorManager::findNearestLivingBeing
Being * findNearestLivingBeing(const int x, const int y, int maxTileDist, const ActorTypeT type, const Being *const excluded) const
Definition: actormanager.cpp:1089
Being::setChat
void setChat(ChatObject *const obj)
Definition: being.cpp:5319
Being::showBadges
void showBadges(const bool show)
Definition: being.cpp:5211
SortBeingFunctor::y
int y
Definition: actormanager.cpp:201
SDLInput::simulateMouseMove
void simulateMouseMove()
Definition: sdlinput.cpp:379
Being::getSpriteID
int getSpriteID(const int slot) const
Definition: being.cpp:4891
Being::updateFromCache
bool updateFromCache()
Definition: being.cpp:3461
BeingId
int BeingId
Definition: beingid.h:29
Viewport::clearHover
void clearHover(const ActorSprite *const actor)
Clears any matching hovers.
Definition: viewport.cpp:1053
Being::mAction
BeingActionT mAction
Definition: being.h:1232
ActorType::Pet
@ Pet
Definition: actortype.h:36
ChatObject::type
uint8_t type
Definition: chatobject.h:49
CAST_SIZE
#define CAST_SIZE
Definition: cast.h:33
PacketType::PACKET_PICKUP
@ PACKET_PICKUP
Definition: packettype.h:29
BadgeDrawType::Hide
@ Hide
Definition: badgedrawtype.h:28
Being::unSetSprite
void unSetSprite(const unsigned int slot)
Definition: being.cpp:2858
Avatar::setName
void setName(const std::string &name)
Definition: avatar.h:58
rebuildMobsList
#define rebuildMobsList(mob)
Definition: actormanager.cpp:1907
ActorManager::clear
void clear()
Definition: actormanager.cpp:1005
Being::getGender
GenderT getGender() const
Definition: being.h:625
ActorManager::mExtMouseTargeting
bool mExtMouseTargeting
Definition: actormanager.h:431
PacketType::PACKET_CHAT
@ PACKET_CHAT
Definition: packettype.h:28
Being::getDirection
uint8_t getDirection() const
Definition: being.h:493
ActorManager::loadAttackList
void loadAttackList()
Definition: actormanager.cpp:2012
anonymous_namespace{libxml.cpp}::valid
bool valid
Definition: libxml.cpp:42
ActorManager::heal
void heal(const Being *const target) const
Definition: actormanager.cpp:1412
ActorManager::createBeing
Being * createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype)
Definition: actormanager.cpp:282
LocalPlayer::pickUp
bool pickUp(FloorItem *const item)
Definition: localplayer.cpp:511
ActorManager::mTargetDeadPlayers
bool mTargetDeadPlayers
Definition: actormanager.h:426
ChatTab::chatLog
void chatLog(std::string line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
Definition: chattab.cpp:110
BeingAction::DEAD
@ DEAD
Definition: beingaction.h:35
ActorManager::mIgnoreAttackMobsSet
std::set< std::string > mIgnoreAttackMobsSet
Definition: actormanager.h:447
fastSqrtInt
int fastSqrtInt(const unsigned int n)
Definition: mathutils.h:244
Being::setTileCoords
virtual void setTileCoords(const int x, const int y)
Definition: being.cpp:5007
PlayerInfo::getAttribute
int32_t getAttribute(const AttributesT id)
Definition: playerinfo.cpp:101
ActorType::Homunculus
@ Homunculus
Definition: actortype.h:38
BeingTypeId
int BeingTypeId
Definition: beingtypeid.h:29
beingHandler
Net::BeingHandler * beingHandler
Definition: net.cpp:98
Being::updateColors
void updateColors()
Definition: being.cpp:2660
ActorManager::updateBadges
void updateBadges() const
Definition: actormanager.cpp:2140
ActorManager::mChars
std::map< int32_t, std::string > mChars
Definition: actormanager.h:418
GuildMember
Definition: guild.h:38
ActorManager::storeAttackList
void storeAttackList() const
Definition: actormanager.cpp:2042
Being::mVisibleNamePos
static VisibleNamePos::Type mVisibleNamePos
Definition: being.h:1353
ActorManager::validateBeing
bool validateBeing(const Being *const aroundBeing, Being *const being, const ActorTypeT &type, const Being *const excluded, const int maxCost) const
Definition: actormanager.cpp:1387
settings
Settings settings
Definition: settings.cpp:31
Attributes::PLAYER_HP
@ PLAYER_HP
Definition: attributes.h:31
ActorManager::mPriorityAttackMobsMap
StringIntMap mPriorityAttackMobsMap
Definition: actormanager.h:446
ActorSprite::getId
BeingId getId() const
Definition: actorsprite.h:63
Being::getGuild
const Guild * getGuild(const std::string &guildName) const
Definition: being.cpp:1257
QuestsWindow::addEffect
void addEffect(Being *const being)
Definition: questswindow.cpp:463
Being::addToCache
void addToCache() const
Definition: being.cpp:3510
Being::setDirection
virtual void setDirection(const uint8_t direction)
Definition: being.cpp:1689
SocialWindow::updateAttackFilter
void updateAttackFilter()
Definition: socialwindow.cpp:594
SortBeingFunctor::specialDistance
bool specialDistance
Definition: actormanager.cpp:205
ActorManager::mCyclePlayers
bool mCyclePlayers
Definition: actormanager.h:428
actorManager
ActorManager * actorManager
Definition: actormanager.cpp:80
ActorManager::mIgnoreAttackMobs
std::list< std::string > mIgnoreAttackMobs
Definition: actormanager.h:447
ActorManager::printBeingsToChat
void printBeingsToChat(const std::string &header) const
Definition: actormanager.cpp:1592
returnNullptrV
#define returnNullptrV(val)
Definition: checkutils.h:257
Attributes::PLAYER_MAX_HP
@ PLAYER_MAX_HP
Definition: attributes.h:32
ActorManager::mCycleMonsters
bool mCycleMonsters
Definition: actormanager.h:429
beingEquipmentWindow
EquipmentWindow * beingEquipmentWindow
Definition: equipmentwindow.cpp:59
ActorManager::rebuildAttackMobs
void rebuildAttackMobs()
Definition: actormanager.cpp:1962
Game::instance
static Game * instance()
Definition: game.h:81
FloorItem::getTileY
int getTileY() const
Definition: flooritem.h:95
IgnoreRecord_false
const bool IgnoreRecord_false
Definition: ignorerecord.h:29
FindBeingFunctor::x
uint16_t x
Definition: actormanager.cpp:109
ActorManager::mSpellItenplz
std::string mSpellItenplz
Definition: actormanager.h:423
playerHandler
Net::PlayerHandler * playerHandler
Definition: net.cpp:95
IdNameMappingCIter
IdNameMapping::const_iterator IdNameMappingCIter
Definition: actormanager.h:66
ActorManager::updateNameId
void updateNameId(const std::string &name, const BeingId beingId)
Definition: actormanager.cpp:2159
loadList
#define loadList(key, mob)
Definition: actormanager.cpp:1997
ActorType::Avatar
@ Avatar
Definition: actortype.h:35
Net::BeingHandler::requestNameById
virtual void requestNameById(const BeingId id) const =0
TryRemoveColors_true
const bool TryRemoveColors_true
Definition: tryremovecolors.h:29
ActorSpritesConstIterator
ActorSprites::const_iterator ActorSpritesConstIterator
Definition: actormanager.h:60
pathJoin
std::string pathJoin(std::string str1, const std::string &str2)
Definition: stringutils.cpp:1036
ActorManager::rebuildPriorityAttackMobs
void rebuildPriorityAttackMobs()
Definition: actormanager.cpp:1957
NpcNames_true
const bool NpcNames_true
Definition: npcnames.h:29
BeingInfo::isTargetSelection
bool isTargetSelection() const
Definition: beinginfo.h:182
socialWindow
SocialWindow * socialWindow
Definition: socialwindow.cpp:48
Being::setSpriteColorId
void setSpriteColorId(const unsigned int slot, const int id, ItemColor colorId)
Definition: being.cpp:2964
ChatObject
Definition: chatobject.h:31
SortBeingFunctor::attackRange
int attackRange
Definition: actormanager.cpp:204
FindBeingFunctor::type
ActorTypeT type
Definition: actormanager.cpp:110
toInt
#define toInt(val, name)
Definition: intdefines.h:46
beingActorSorter
class SortBeingFunctor beingActorSorter
ActorType::Player
@ Player
Definition: actortype.h:30
LocalPlayer::unSetPickUpTarget
void unSetPickUpTarget()
Definition: localplayer.h:324
ChatObject::maxUsers
uint16_t maxUsers
Definition: chatobject.h:47
Being::setGender
virtual void setGender(const GenderT gender)
Definition: being.cpp:3578
ActorType::Mercenary
@ Mercenary
Definition: actortype.h:37
Configuration::addListener
void addListener(const std::string &key, ConfigListener *const listener)
Definition: configuration.cpp:905
Catch::toString
std::string toString(T const &value)
converts any type to a string
Definition: catch.hpp:1774
PacketLimiter::limitPackets
bool limitPackets(const PacketTypeT type)
Definition: packetlimiter.cpp:287
ActorManager::mPickupItems
std::list< std::string > mPickupItems
Definition: actormanager.h:448
SortBeingFunctor::defaultAttackIndex
int defaultAttackIndex
Definition: actormanager.cpp:202
Settings::pvpAttackType
unsigned int pvpAttackType
Definition: settings.h:141
serverFeatures
Net::ServerFeatures * serverFeatures
Definition: net.cpp:100
Being::createBeing
static Being * createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype, Map *const map)
Definition: being.cpp:5572
LocalPlayer::checkNewName
void checkNewName(Being *const being)
Definition: localplayer.cpp:2781
Configuration::setValue
void setValue(const std::string &key, const std::string &value)
Definition: configuration.cpp:238
ActorManager::mPickupItemsSet
std::set< std::string > mPickupItemsSet
Definition: actormanager.h:448
PacketLimiter::checkPackets
bool checkPackets(const PacketTypeT type)
Definition: packetlimiter.cpp:247
ActorSpritesMapIterator
ActorSpritesMap::iterator ActorSpritesMapIterator
Definition: actormanager.h:62
Being::removeSpecialEffect
void removeSpecialEffect()
Definition: being.cpp:4938
if
if(!vert) return
ChatMsgType::BY_SERVER
@ BY_SERVER
Definition: chatmsgtype.h:34
Being::getDistance
int getDistance() const
Definition: being.h:551
ActorManager::mIgnorePickupItemsSet
std::set< std::string > mIgnorePickupItemsSet
Definition: actormanager.h:448
ActorManager::mTargetOnlyReachable
bool mTargetOnlyReachable
Definition: actormanager.h:427
ActorManager::getIndexByName
static int getIndexByName(const std::string &name, const StringIntMap &map)
Definition: actormanager.cpp:1972
localPlayer
LocalPlayer * localPlayer
Definition: localplayer.cpp:108
FloorItem
Definition: flooritem.h:43
AllPlayers_true
const bool AllPlayers_true
Definition: allplayers.h:29
nullptr
#define nullptr
Definition: localconsts.h:44
inputManager
InputManager inputManager
Definition: inputmanager.cpp:68
InputAction::STOP_ATTACK
@ STOP_ATTACK
Definition: inputaction.h:56
StringIntMap
std::map< std::string, int > StringIntMap
Definition: stringmap.h:27
Being::getName
const std::string & getName() const
Definition: being.h:231
Being::getHairColor
ItemColor getHairColor() const
Definition: being.h:882
Being::isAlive
bool isAlive() const
Definition: being.h:487
Being::updateGuild
void updateGuild()
Definition: being.cpp:1332
guiInput
SDLInput * guiInput
Definition: sdlinput.cpp:100
Actor::getPixelY
virtual int getPixelY() const
Definition: actor.h:92
CompoundSprite::mSprites
std::vector< Sprite * > mSprites
Definition: compoundsprite.h:110
Relation::ENEMY2
@ ENEMY2
Definition: relation.h:36
Being::setSpriteColor
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
Definition: being.cpp:2887
Files::saveTextFile
void saveTextFile(const std::string &path, const std::string &name, const std::string &text)
Definition: files.cpp:249
ActorManager::mSpellHeal1
std::string mSpellHeal1
Definition: actormanager.h:421
LocalPlayer::checAttackPermissions
static bool checAttackPermissions(const Being *const target)
Definition: localplayer.cpp:2846
strprintf
std::string strprintf(const char *const format,...)
Definition: stringutils.cpp:99
ActorManager::mPickupItemsMap
StringIntMap mPickupItemsMap
Definition: actormanager.h:448
ActorManager::logic
void logic()
Definition: actormanager.cpp:945
EquipmentWindow::resetBeing
void resetBeing(const Being *const being)
Definition: equipmentwindow.cpp:622
ActorManager::checkForPickup
bool checkForPickup(const FloorItem *const item) const
Definition: actormanager.cpp:2052
ActorManager::mBlockedBeings
std::set< BeingId > mBlockedBeings
Definition: actormanager.h:417
FloorItem::postInit
void postInit(Map *const map, int subX, int subY)
Definition: flooritem.cpp:80
ActorSprite
Definition: actorsprite.h:54
Being::setAction
virtual void setAction(const BeingActionT &action, const int attackId)
Definition: being.cpp:1553
InputManager::isActionActive
bool isActionActive(const InputActionT index) const
Definition: inputmanager.cpp:364
SortBeingFunctor::priorityBeings
StringIntMap * priorityBeings
Definition: actormanager.cpp:199
returnNullptr
#define returnNullptr(ret, val)
Definition: checkutils.h:258
chatWindow
ChatWindow * chatWindow
Definition: chatwindow.cpp:93
x
x
Definition: graphics_calcImageRect.hpp:72
ActorManager::mAttackMobsMap
StringIntMap mAttackMobsMap
Definition: actormanager.h:447
addMobToList
#define addMobToList(name, mob)
Definition: actormanager.cpp:1882
Being
Definition: being.h:93
ActorTypeT
ActorType ::T ActorTypeT
Definition: actortype.h:42
Guild
Definition: guild.h:68
ActorManager::mIdName
IdNameMapping mIdName
Definition: actormanager.h:416
SocialWindow::updateActiveList
void updateActiveList()
Definition: socialwindow.cpp:499
debugChatTab
ChatTab * debugChatTab
Definition: chattab.cpp:62
ItemColor
uint16_t ItemColor
Definition: itemcolor.h:29
ActorManager::mPriorityAttackMobs
std::list< std::string > mPriorityAttackMobs
Definition: actormanager.h:446
serverConfig
Configuration serverConfig
Definition: configuration.cpp:52
Being::addSpecialEffect
void addSpecialEffect(const int effect)
Definition: being.cpp:4925
LocalPlayer::getPickUpTarget
const FloorItem * getPickUpTarget() const
Definition: localplayer.h:321
SortBeingFunctor::x
int x
Definition: actormanager.cpp:200
Configuration::getIntValue
int getIntValue(const std::string &key) const
Definition: configuration.cpp:403
CAST_U16
#define CAST_U16
Definition: cast.h:28
Actor::getPixelX
int getPixelX() const
Definition: actor.h:86
viewport
Viewport * viewport
Definition: viewport.cpp:35
Being::getInfo
const BeingInfo * getInfo() const
Definition: being.h:408
Game::getCurrentMap
Map * getCurrentMap() const
Definition: game.h:106
config
Configuration config
Definition: configuration.cpp:51
playerRelations
PlayerRelationsManager playerRelations
Definition: playerrelations.cpp:661
FloorItem::disableHightlight
void disableHightlight()
Definition: flooritem.h:113
Being::getCurrentAction
BeingActionT getCurrentAction() const
Definition: being.h:481
beingActorFinder
class FindBeingFunctor beingActorFinder
LocalPlayer::isReachable
bool isReachable(Being *const being, const int maxCost)
Definition: localplayer.cpp:1541
ChatWindow::localChatInput
void localChatInput(const std::string &msg) const
Definition: chatwindow.cpp:690
guild
uint32_t guild
Definition: maptypeproperty2.h:5
Being::mShowBadges
static BadgeDrawType::Type mShowBadges
Definition: being.h:1351
SortBeingFunctor::attackBeings
StringIntMap * attackBeings
Definition: actormanager.cpp:198
ActorType::FloorItem
@ FloorItem
Definition: actortype.h:33
empty
std::string empty
Definition: podict.cpp:25
for_actors
#define for_actors
Definition: actormanager.cpp:74
Settings::moveToTargetType
unsigned int moveToTargetType
Definition: settings.h:134
LocalPlayer::getAttackRange
int getAttackRange() const
Definition: localplayer.cpp:1004
Being::getType
ActorTypeT getType() const
Definition: being.h:115
Being::getSpriteColor
ItemColor getSpriteColor(const int slot) const
Definition: being.cpp:4907
LocalPlayer::getTarget
Being * getTarget() const
Definition: localplayer.cpp:561
ActorType::Npc
@ Npc
Definition: actortype.h:31
ActorType::Monster
@ Monster
Definition: actortype.h:32
Configuration::removeListeners
void removeListeners(ConfigListener *const listener)
Definition: configuration.cpp:938
EquipmentWindow::setBeing
void setBeing(Being *const being)
Definition: equipmentwindow.cpp:601
charServerHandler
Net::CharServerHandler * charServerHandler
Definition: net.cpp:84
ChatObject::title
std::string title
Definition: chatobject.h:50
ActorManager::mSpellHeal2
std::string mSpellHeal2
Definition: actormanager.h:422
Net::CharServerHandler::hairSprite
virtual unsigned int hairSprite() const =0
getDateTimeString
std::string getDateTimeString()
Definition: stringutils.cpp:743
Net::getNetworkType
ServerTypeT getNetworkType()
Definition: net.cpp:188
SocialWindow::updatePickupFilter
void updatePickupFilter()
Definition: socialwindow.cpp:600
AllowSort_true
const bool AllowSort_true
Definition: allowsort.h:29
ActorManager::mActors
ActorSprites mActors
Definition: actormanager.h:413
packList
std::string packList(const std::list< std::string > &list)
Definition: stringutils.cpp:589
PlayerRelationsManager::getRelation
RelationT getRelation(const std::string &name) const
Definition: playerrelations.cpp:415
questsWindow
QuestsWindow * questsWindow
Definition: questswindow.cpp:61
ServerType::TMWATHENA
@ TMWATHENA
Definition: servertype.h:31
Map
Definition: map.h:71
Being::getDamageTaken
int getDamageTaken() const
Definition: being.h:592
fromInt
#define fromInt(val, name)
Definition: intdefines.h:45
Being::getChat
ChatObject * getChat() const
Definition: being.h:1002
beingEqualActorFinder
class FindBeingEqualFunctor beingEqualActorFinder
Being::setName
void setName(const std::string &name)
Definition: being.cpp:1135
Settings::usersDir
std::string usersDir
Definition: settings.h:117
BLOCK_START
#define BLOCK_START(name)
Definition: perfomance.h:78
Net::PlayerHandler::canUseMagic
virtual bool canUseMagic() const =0
Being::setLevel
void setLevel(const int n)
Definition: being.h:600
for_actorsm
#define for_actorsm
Definition: actormanager.cpp:77
BLOCK_END
#define BLOCK_END(name)
Definition: perfomance.h:79
ChatObject::ownerId
BeingId ownerId
Definition: chatobject.h:45
CAST_S32
#define CAST_S32
Definition: cast.h:29
ActorManager::updatePlayerNames
void updatePlayerNames() const
Definition: actormanager.cpp:1747
Being::updateName
void updateName()
Definition: being.cpp:3422
ActorSpritesMapConstIterator
ActorSpritesMap::const_iterator ActorSpritesMapConstIterator
Definition: actormanager.h:63
ItemDB::get
const ItemInfo & get(const int id)
Definition: itemdb.cpp:792
BeingId_zero
const BeingId BeingId_zero
Definition: beingid.h:29
BadgeDrawType::Type
Type
Definition: badgedrawtype.h:26
Settings::usersIdDir
std::string usersIdDir
Definition: settings.h:118
_
#define _(s)
Definition: gettext.h:34
ActorManager::mDeleteActors
ActorSprites mDeleteActors
Definition: actormanager.h:414
PlayerInfo::getSkillLevel
int getSkillLevel(const int id)
Definition: playerinfo.cpp:119
Being::setHairColor
void setHairColor(const unsigned int slot, const ItemColor color)
Definition: being.cpp:3386
LocalPlayer::setMap
void setMap(Map *const map)
Definition: localplayer.cpp:1828
Being::getTileY
int getTileY() const
Definition: being.h:173
Game
Definition: game.h:62
FloorItem::getTileX
int getTileX() const
Definition: flooritem.h:92
ActorManager::mAttackMobsSet
std::set< std::string > mAttackMobsSet
Definition: actormanager.h:447
LocalPlayer::setTarget
void setTarget(Being *const target)
Definition: localplayer.cpp:566
ActorType::Portal
@ Portal
Definition: actortype.h:34
ActorSprite::getType
virtual ActorTypeT getType() const
Definition: actorsprite.h:72
y
y
Definition: graphics_calcImageRect.hpp:72
FloorItem::getName
std::string getName() const
Definition: flooritem.cpp:145
Map::getPvpMode
int getPvpMode() const
Definition: map.h:291
FloorItem::incrementPickup
void incrementPickup()
Definition: flooritem.h:98
FindBeingFunctor::y
uint16_t y
Definition: actormanager.cpp:109
Being::getTeamId
uint16_t getTeamId() const
Definition: being.h:1085
FindBeingEqualFunctor::findBeing
Being * findBeing
Definition: actormanager.cpp:125
ActorManager::mEnableIdCollecting
bool mEnableIdCollecting
Definition: actormanager.h:432
ActorManager::mActorsIdMap
ActorSpritesMap mActorsIdMap
Definition: actormanager.h:415
FOR_EACH
#define FOR_EACH(type, iter, array)
Definition: foreach.h:24
ActorManager::mIgnorePickupItems
std::list< std::string > mIgnorePickupItems
Definition: actormanager.h:448
Being::getTileX
int getTileX() const
Definition: being.h:167
Being::getSubType
BeingTypeId getSubType() const
Definition: being.h:399
ActorManager::mAttackMobs
std::list< std::string > mAttackMobs
Definition: actormanager.h:447
mapTileSize
static const int mapTileSize
Definition: map.h:26
SortBeingFunctor::defaultPriorityIndex
int defaultPriorityIndex
Definition: actormanager.cpp:203
ChatObject::chatId
int chatId
Definition: chatobject.h:46
Configuration::getBoolValue
bool getBoolValue(const std::string &key) const
Definition: configuration.cpp:596
ActorType::SkillUnit
@ SkillUnit
Definition: actortype.h:39
ActorManager::mPriorityAttackMobsSet
std::set< std::string > mPriorityAttackMobsSet
Definition: actormanager.h:446
ActorManager::rebuildPickupItems
void rebuildPickupItems()
Definition: actormanager.cpp:1967