106 #include "resources/map/map.h"
121 #include "utils/timer.h"
156 #define for_each_badges() \
157 for (int f = 0; f < BadgeIndex::BadgeIndexSize; f++)
159 #define for_each_horses(name) \
160 FOR_EACH (STD_VECTOR<AnimatedSprite*>::const_iterator, it, name)
204 mDirectionDelayed(0),
215 mSpriteRemap(
new int[20]),
216 mSpriteHide(
new int[20]),
217 mSpriteDraw(
new int[20]),
274 mNeedPosUpdate(true),
276 mAllowNpcEquipment(false)
278 for (
int f = 0; f < 20; f ++)
374 if (mInfo ==
nullptr)
377 if (subtype == mSubType && mLook == look)
387 if (mInfo !=
nullptr)
389 setName(mInfo->getName());
390 setupSpriteDisplay(mInfo->getDisplay(),
394 mYDiff = mInfo->getSortOffsetY();
399 if (mInfo !=
nullptr)
401 setName(mInfo->getName());
402 setupSpriteDisplay(mInfo->getDisplay(),
406 mYDiff = mInfo->getSortOffsetY();
411 if (mInfo !=
nullptr)
413 setName(mInfo->getName());
414 setupSpriteDisplay(mInfo->getDisplay(),
418 mYDiff = mInfo->getSortOffsetY();
423 if (mInfo !=
nullptr)
425 setName(mInfo->getName());
426 setupSpriteDisplay(mInfo->getDisplay(),
430 mYDiff = mInfo->getSortOffsetY();
435 if (mInfo !=
nullptr)
437 setName(mInfo->getName());
438 setupSpriteDisplay(mInfo->getDisplay(),
442 mYDiff = mInfo->getSortOffsetY();
447 if (mInfo !=
nullptr)
449 setName(mInfo->getName());
450 setupSpriteDisplay(mInfo->getDisplay(),
454 mYDiff = mInfo->getSortOffsetY();
459 if (mInfo !=
nullptr)
461 setupSpriteDisplay(mInfo->getDisplay(),
465 mYDiff = mInfo->getSortOffsetY();
466 mAllowNpcEquipment = mInfo->getAllowEquipment();
471 if (mInfo !=
nullptr)
473 setupSpriteDisplay(mInfo->getDisplay(),
481 int id = -100 -
toInt(subtype,
int);
487 setRaceName(
_(
"Human"));
497 setRaceName(
info.getName());
520 if (
mInfo ==
nullptr)
532 if (mText !=
nullptr)
535 CAST_S32(pos.y) - getHeight() - mText->getHeight() - 9,
546 setPath(
mMap->findPath(mX,
583 const unsigned int lineLim = mConfLineLim;
584 if (lineLim > 0 && mSpeech.length() > lineLim)
585 mSpeech = mSpeech.substr(0, lineLim);
591 const size_t sz = mSpeech.size();
600 size_t start = mSpeech.find(
'[');
601 size_t e = mSpeech.find(
']',
start);
603 while (
start != std::string::npos && e != std::string::npos)
606 while ((mSpeech.find(
'[',
start + 1) != std::string::npos) &&
607 (mSpeech.find(
'[',
start + 1) < e))
612 size_t position = mSpeech.find(
'|');
613 if (mSpeech[
start + 1] ==
'@' && mSpeech[
start + 2] ==
'@')
618 position = mSpeech.find(
"@@");
620 while (position != std::string::npos)
622 mSpeech.erase(position, 2);
623 position = mSpeech.find(
'@');
627 e = mSpeech.find(
']',
start);
630 if (!mSpeech.empty())
636 const int speech = mSpeechType;
641 mText =
new Text(mSpeech,
643 mPixelY - getHeight(),
648 mText->adviseXY(mPixelX,
649 (mY + 1) *
mapTileSize - getHeight() - mText->getHeight() - 9,
654 if (mSpeechBubble ==
nullptr)
655 createSpeechBubble();
656 if (mSpeechBubble !=
nullptr)
659 mSpeechBubble->setCaption(isShowName ? mName :
"",
662 mSpeechBubble->setText(mSpeech, isShowName);
678 Font *font =
nullptr;
688 attacker->setCriticalHit(amount);
702 else if (amount == 0)
743 attacker->setEnemy(
true);
744 attacker->updateColors();
752 if (
chatWindow !=
nullptr && mShowBattleEvents)
759 attacker->getName().c_str(), amount),
768 attacker->mName.c_str(),
778 const std::string damage = amount != 0 ?
toString(amount) :
793 attacker->updateHit(amount);
800 mDamageTaken += amount;
801 if (mInfo !=
nullptr)
809 if (!mInfo->isStaticMaxHP())
811 if ((mHP == 0) && mInfo->getMaxHP() < mDamageTaken)
812 mInfo->setMaxHP(mDamageTaken);
815 if ((mHP != 0) && isAlive())
836 const int hitEffectId = getHitEffect(attacker,
840 if (hitEffectId >= 0)
848 int hitEffectId = -1;
851 hitEffectId = getHitEffect(attacker,
858 hitEffectId = getHitEffect(attacker,
863 if (hitEffectId >= 0)
890 hitEffectId =
data->hitEffectId;
891 if (hitEffectId == -1)
896 hitEffectId =
data->missEffectId;
897 if (hitEffectId == -1)
903 if (attacker !=
nullptr)
906 = attacker->getEquippedWeapon();
907 if (attackerWeapon !=
nullptr &&
911 hitEffectId = attackerWeapon->getMissEffectId();
913 hitEffectId = attackerWeapon->getHitEffectId();
915 hitEffectId = attackerWeapon->getCriticalHitEffectId();
923 info->getAttack(attackId);
927 hitEffectId = atk->mMissEffectId;
929 hitEffectId = atk->mHitEffectId;
931 hitEffectId = atk->mCriticalHitEffectId;
967 if ((victim ==
nullptr) || (mInfo ==
nullptr))
975 mLastAttackX = victim->mX;
976 mLastAttackY = victim->mY;
979 fireMissile(victim, mEquippedWeapon->getMissileConst());
980 else if (mInfo->getAttack(attackId) !=
nullptr)
981 fireMissile(victim, mInfo->getAttack(attackId)->mMissile);
989 const uint8_t dir = calcDirection(victim->mX,
1003 if (mSlots.size() >= 10)
1006 int weaponId = mSlots[10].spriteId;
1008 weaponId = -100 -
toInt(mSubType,
int);
1010 playSfx(
info.getSound(
1019 playSfx(mInfo->getSound((damage > 0) ?
1029 if ((victim ==
nullptr) || (mInfo ==
nullptr) || (
skillDialog ==
nullptr))
1038 if (
data !=
nullptr)
1046 fireMissile(victim,
data->castingMissile);
1055 if ((victim ==
nullptr) || (mInfo ==
nullptr) || (
skillDialog ==
nullptr))
1060 ?
skill->getData1(skillLevel) :
nullptr;
1061 if (
data !=
nullptr)
1069 fireMissile(victim,
data->missile);
1092 const uint8_t dir = calcDirection(victim->mX,
1102 if (
data !=
nullptr)
1105 playSfx(
data->soundHit, victim,
true, mX, mY);
1107 playSfx(
data->soundMiss, victim,
true, mX, mY);
1111 playSfx(mInfo->getSound((damage > 0) ?
1141 mName = name.substr(0, name.find(
'#', 0));
1149 showNameBadge(!mName.empty());
1157 mName = name.substr(0, name.find(
'#', 0));
1168 if (mShowName == doShowName)
1171 mShowName = doShowName;
1183 !mGuildName.empty() &&
1198 if (mGuildName != name)
1201 showGuildBadge(!mGuildName.empty());
1202 updateBadgesCount();
1210 !mClanName.empty() &&
1225 if (mClanName != name)
1228 showClanBadge(!mClanName.empty());
1229 updateBadgesCount();
1239 if (
guild ==
nullptr)
1254 mGuilds[id]->removeMember(mName);
1264 if ((
guild !=
nullptr) &&
guild->getName() == guildName)
1273 const std::map<int, Guild*>::const_iterator itr =
mGuilds.find(
id);
1282 const std::map<int, Guild*>::const_iterator itr =
mGuilds.begin();
1295 if (
guild !=
nullptr)
1309 if (
party == mParty)
1312 Party *
const old = mParty;
1318 if (
party !=
nullptr)
1319 party->addMember(mId, mName);
1328 if (
party !=
nullptr)
1339 if (
guild ==
nullptr)
1348 if (!
guild->getName().empty())
1364 old->removeMember(mName);
1373 if (
guild !=
nullptr)
1383 if (victim ==
nullptr ||
1384 missile.particle.empty() ||
1393 if (target ==
nullptr)
1406 target->moveBy(
Vector(0.0F, 0.0F, missile.z));
1407 target->setLifetime(missile.lifeTime);
1408 victim->controlAutoParticle(target);
1410 if (missileParticle !=
nullptr)
1412 missileParticle->setDestination(target, missile.speed, 0.0F);
1413 missileParticle->setDieDistance(missile.dieDistance);
1414 missileParticle->setLifetime(missile.lifeTime);
1423 if (
mMap !=
nullptr)
1441 if (
mMap !=
nullptr)
1455 if (weapon ==
nullptr)
1456 return getAttackAction();
1459 return weapon->getRideAttackAction();
1460 if (
mMap !=
nullptr)
1462 const unsigned char mask =
mMap->getBlockMask(mX, mY);
1464 return weapon->getSkyAttackAction();
1466 return weapon->getWaterAttackAction();
1468 return weapon->getAttackAction();
1474 if (attack1 ==
nullptr)
1475 return getAttackAction();
1478 return attack1->mRideAction;
1479 if (
mMap !=
nullptr)
1481 const unsigned char mask =
mMap->getBlockMask(mX, mY);
1483 return attack1->mSkyAction;
1485 return attack1->mWaterAction;
1487 return attack1->mAction;
1493 if (
skill ==
nullptr)
1494 return getCastAction();
1497 return skill->castingRideAction;
1498 if (
mMap !=
nullptr)
1500 const unsigned char mask =
mMap->getBlockMask(mX, mY);
1502 return skill->castingSkyAction;
1504 return skill->castingWaterAction;
1506 return skill->castingAction;
1509 #define getSpriteAction(func, action) \
1510 std::string Being::get##func##Action() const restrict2\
1512 if (mHorseId != 0) \
1513 return SpriteAction::action##RIDE; \
1516 const unsigned char mask = mMap->getBlockMask(mX, mY); \
1517 if (mask & BlockMask::AIR) \
1518 return SpriteAction::action##SKY; \
1519 else if (mask & BlockMask::WATER) \
1520 return SpriteAction::action##WATER; \
1522 return SpriteAction::action; \
1534 if (
mMap !=
nullptr)
1536 const unsigned char mask =
mMap->getBlockMask(mX, mY);
1562 if (mInfo !=
nullptr)
1564 playSfx(mInfo->getSound(
1567 currentAction = getMoveAction();
1573 currentAction = getSitAction();
1574 if (mInfo !=
nullptr)
1581 playSfx(mInfo->getSound(event),
nullptr,
true, mX, mY);
1585 if (mEquippedWeapon !=
nullptr)
1587 currentAction = getWeaponAttackAction(mEquippedWeapon);
1592 if (mInfo ==
nullptr || mInfo->getAttack(attackId) ==
nullptr)
1595 currentAction = getAttackAction(mInfo->getAttack(attackId));
1601 const int effectId = mInfo->getAttack(attackId)->mEffectId;
1616 currentAction = getCastAction(
info);
1620 if (mInfo !=
nullptr)
1623 this,
false, mX, mY);
1627 currentAction = getDeadAction();
1628 if (mInfo !=
nullptr)
1638 mYDiff = mInfo->getDeadSortOffsetY();
1643 currentAction = getStandAction();
1646 if (mInfo !=
nullptr)
1649 nullptr,
true, mX, mY);
1651 currentAction = getSpawnAction();
1656 logger->
log(
"Being::setAction unknown action: "
1663 mSpriteAction = currentAction;
1664 play(currentAction);
1665 if (mEmotionSprite !=
nullptr)
1666 mEmotionSprite->play(currentAction);
1667 if (mAnimationEffect !=
nullptr)
1668 mAnimationEffect->play(currentAction);
1672 if (sprite !=
nullptr)
1673 sprite->
play(currentAction);
1676 (*it)->play(currentAction);
1678 (*it)->play(currentAction);
1692 if (mDirection == direction)
1695 mDirection = direction;
1697 mDirectionDelayed = 0;
1700 int mFaceDirection = mDirection & direction;
1701 if (mFaceDirection == 0)
1702 mFaceDirection = direction;
1731 mSpriteDirection = dir;
1734 if (mEmotionSprite !=
nullptr)
1735 mEmotionSprite->setSpriteDirection(dir);
1736 if (mAnimationEffect !=
nullptr)
1737 mAnimationEffect->setSpriteDirection(dir);
1742 if (sprite !=
nullptr)
1747 (*it)->setSpriteDirection(dir);
1749 (*it)->setSpriteDirection(dir);
1750 recalcSpritesOrder();
1798 if (
mMap ==
nullptr ||
1807 &&
mX != pos.
x &&
mY != pos.
y)
1816 if (
mX != pos.
x ||
mY != pos.
y)
1857 (*it)->update(time);
1859 (*it)->update(time);
1882 if (sprite !=
nullptr)
1918 if (
this ==
localPlayer && curFrame >= frameCount)
1938 int offset = xOffset;
1942 if ((xOffset == 0) && (yOffset == 0))
1946 const float offset2 =
static_cast<float>(
1970 if (frameCount < 10)
2014 const int divX = abs(dstX -
mX);
2015 const int divY = abs(dstY -
mY);
2017 if (divX >= warpDist || divY >= warpDist)
2053 if (target ==
nullptr)
2121 int offsetX = offsetX1;
2122 int offsetY = offsetY1;
2126 offsetX = -offsetY1;
2131 offsetY = -offsetX1;
2143 if (
mMap !=
nullptr)
2160 if (divX > followDist || divY > followDist)
2164 if (divX > followDist)
2166 if (dstX >
mX + dist)
2168 else if (dstX + dist <=
mX)
2175 if (divY > followDist)
2177 if (dstY >
mY + dist)
2179 else if (dstX + dist <=
mX)
2206 else if (dstY != dstY0)
2213 if (
mX != dstX ||
mY != dstY)
2227 int directionType = 0;
2251 switch (directionType)
2267 else if (dstX < dstX0)
2271 else if (dstY < dstY0)
2281 else if (dstX < dstX0)
2285 else if (dstY < dstY0)
2295 else if (dstX < dstX2)
2299 else if (dstY < dstY2)
2382 const int px = mPixelX - offsetX -
mapTileSize / 2;
2384 if (mAnimationEffect !=
nullptr)
2385 mAnimationEffect->draw(graphics, px, py);
2389 int x = mBadgesX - offsetX;
2390 const int y = mBadgesY - offsetY;
2394 if (sprite !=
nullptr)
2396 sprite->draw(graphics,
x,
y);
2401 if (mEmotionSprite !=
nullptr)
2402 mEmotionSprite->draw(graphics, px, py);
2410 if (mSpeech.empty())
2413 const int px = mPixelX - offsetX;
2414 const int py = mPixelY - offsetY;
2415 const int speech = mSpeechType;
2418 if (mSpeechTime == 0)
2420 if (mSpeechBubble !=
nullptr &&
2432 if (mSpeechBubble !=
nullptr)
2434 mSpeechBubble->setPosition(px - (mSpeechBubble->getWidth() / 2),
2435 py - getHeight() - (mSpeechBubble->getHeight()));
2441 if (mSpeechBubble !=
nullptr)
2444 if ((mText ==
nullptr) && (
userPalette !=
nullptr))
2446 mText =
new Text(mSpeech,
2448 mPixelY - getHeight(),
2453 mText->adviseXY(mPixelX,
2454 (mY + 1) *
mapTileSize - getHeight() - mText->getHeight() - 9,
2460 if (mSpeechBubble !=
nullptr)
2466 template<
signed char pos,
signed char neg>
2507 if (
mInfo !=
nullptr)
2528 updateBadgesPosition();
2534 if (mDispName !=
nullptr)
2535 mDispName->flash(time);
2544 return std::string(
" ").append(str);
2588 std::string displayName(
mName);
2592 displayName.append(
" ");
2605 Font *font =
nullptr;
2617 if (
mInfo !=
nullptr)
2778 if (slot >=
CAST_U32(mSlots.size()))
2781 if ((slot != 0U) && mSlots[slot].spriteId ==
id)
2783 setSpriteColor(slot,
2795 if (slot >=
CAST_U32(mSprites.size()))
2796 ensureSize(slot + 1);
2798 if (slot >=
CAST_U32(mSlots.size()))
2805 mSpriteDraw[slot] = 0;
2807 const int id1 = mSlots[slot].spriteId;
2809 removeItemParticles(id1);
2820 if (!filename.empty())
2827 if (equipmentSprite !=
nullptr)
2829 equipmentSprite->setSpriteDirection(getSpriteDirection());
2830 startTime = getStartTime();
2831 lastTime = getLastTime();
2835 mSpriteDraw[slot] = id;
2837 addItemParticles(
id,
info.getDisplay());
2839 setAction(mAction, 0);
2840 if (equipmentSprite !=
nullptr)
2844 equipmentSprite->setLastTime(startTime);
2845 equipmentSprite->update(lastTime);
2852 beingSlot.
color.clear();
2855 recalcSpritesOrder();
2866 if (slot >=
CAST_U32(mSprites.size()))
2867 ensureSize(slot + 1);
2869 if (slot >=
CAST_U32(mSlots.size()))
2873 mSpriteDraw[slot] = 0;
2876 const int id1 = beingSlot.
spriteId;
2878 removeItemParticles(id1);
2881 beingSlot.
color.clear();
2884 recalcSpritesOrder();
2897 if (slot >=
CAST_U32(mSprites.size()))
2898 ensureSize(slot + 1);
2900 if (slot >=
CAST_U32(mSlots.size()))
2911 mSpriteDraw[slot] = 0;
2913 const int id1 = mSlots[slot].spriteId;
2915 removeItemParticles(id1);
2926 if (!filename.empty())
2934 if (equipmentSprite !=
nullptr)
2936 equipmentSprite->setSpriteDirection(getSpriteDirection());
2937 startTime = getStartTime();
2938 lastTime = getLastTime();
2942 mSpriteDraw[slot] = id;
2943 addItemParticles(
id,
info.getDisplay());
2945 setAction(mAction, 0);
2946 if (equipmentSprite !=
nullptr)
2950 equipmentSprite->setLastTime(startTime);
2951 equipmentSprite->update(lastTime);
2958 beingSlot.
color = color;
2961 recalcSpritesOrder();
2974 if (slot >=
CAST_U32(mSprites.size()))
2975 ensureSize(slot + 1);
2977 if (slot >=
CAST_U32(mSlots.size()))
2990 mSpriteDraw[slot] = 0;
2992 const int id1 = mSlots[slot].spriteId;
2994 removeItemParticles(id1);
3005 if (!filename.empty())
3007 color =
info.getDyeColorsString(colorId);
3014 if (equipmentSprite !=
nullptr)
3016 equipmentSprite->setSpriteDirection(getSpriteDirection());
3017 startTime = getStartTime();
3018 lastTime = getLastTime();
3022 mSpriteDraw[slot] = id;
3024 addItemParticles(
id,
info.getDisplay());
3026 setAction(mAction, 0);
3027 if (equipmentSprite !=
nullptr)
3031 equipmentSprite->setLastTime(startTime);
3032 equipmentSprite->update(lastTime);
3042 recalcSpritesOrder();
3055 if (slot >=
CAST_U32(mSprites.size()))
3056 ensureSize(slot + 1);
3058 if (slot >=
CAST_U32(mSlots.size()))
3072 mSpriteDraw[slot] = 0;
3074 const int id1 = mSlots[slot].spriteId;
3076 removeItemParticles(id1);
3087 if (!cards.isEmpty())
3090 if (!filename.empty())
3092 color =
info.getDyeColorsString(colorId);
3100 if (equipmentSprite !=
nullptr)
3102 equipmentSprite->setSpriteDirection(getSpriteDirection());
3103 startTime = getStartTime();
3104 lastTime = getLastTime();
3108 mSpriteDraw[slot] = id;
3110 addItemParticlesCards(
id,
3114 setAction(mAction, 0);
3115 if (equipmentSprite !=
nullptr)
3119 equipmentSprite->setLastTime(startTime);
3120 equipmentSprite->update(lastTime);
3130 recalcSpritesOrder();
3138 mEquippedWeapon =
nullptr;
3149 if (slot >=
CAST_U32(mSprites.size()))
3150 ensureSize(slot + 1);
3152 if (slot >=
CAST_U32(mSlots.size()))
3161 mSpriteDraw[slot] = 0;
3163 const int id1 = beingSlot.
spriteId;
3165 removeItemParticles(id1);
3177 if (!filename.empty())
3183 std::string color = beingSlot.
color;
3185 color =
info.getDyeColorsString(colorId);
3193 if (equipmentSprite !=
nullptr)
3195 equipmentSprite->setSpriteDirection(getSpriteDirection());
3196 startTime = getStartTime();
3197 lastTime = getLastTime();
3201 mSpriteDraw[slot] = id;
3204 addItemParticles(
id,
info.getDisplay());
3206 setAction(mAction, 0);
3207 if (equipmentSprite !=
nullptr)
3211 equipmentSprite->setLastTime(startTime);
3212 equipmentSprite->update(lastTime);
3224 if (slot >=
CAST_U32(mSprites.size()))
3225 ensureSize(slot + 1);
3227 if (slot >=
CAST_U32(mSlots.size()))
3230 const CardsList &cards = mSlots[slot].cardsId;
3236 mSpriteDraw[slot] = 0;
3238 const int id1 = mSlots[slot].spriteId;
3240 removeItemParticles(id1);
3251 if (!filename.empty())
3257 std::string color =
info.getDyeColorsString(mHairColor);
3259 color =
info.getDyeColorsString(colorId);
3267 if (equipmentSprite !=
nullptr)
3269 equipmentSprite->setSpriteDirection(getSpriteDirection());
3270 startTime = getStartTime();
3271 lastTime = getLastTime();
3275 mSpriteDraw[slot] = id;
3277 addItemParticles(
id,
info.getDisplay());
3279 setAction(mAction, 0);
3280 if (equipmentSprite !=
nullptr)
3284 equipmentSprite->setLastTime(startTime);
3285 equipmentSprite->update(lastTime);
3297 if (slot >=
CAST_U32(mSprites.size()))
3298 ensureSize(slot + 1);
3300 if (slot >=
CAST_U32(mSlots.size()))
3304 setSpriteColor(slot,
3315 if (slot >=
CAST_U32(mSprites.size()))
3316 ensureSize(slot + 1);
3318 if (slot >=
CAST_U32(mSlots.size()))
3338 if (!filename.empty())
3346 if (equipmentSprite !=
nullptr)
3348 equipmentSprite->setSpriteDirection(getSpriteDirection());
3349 startTime = getStartTime();
3350 lastTime = getLastTime();
3355 setAction(mAction, 0);
3356 if (equipmentSprite !=
nullptr)
3360 equipmentSprite->setLastTime(startTime);
3361 equipmentSprite->update(lastTime);
3366 beingSlot.
color = color;
3377 setSpriteColor(slot,
3383 setSpriteColor(slot,
3397 setSpriteColor(slot,
3406 mSlots[slot] = beingSlot;
3411 STD_VECTOR<BeingSlot>::const_iterator it1 =
mSlots.begin();
3412 const STD_VECTOR<BeingSlot>::const_iterator it1_end =
mSlots.end();
3415 for (; it1 != it1_end;
3420 (*it1).color.c_str(),
3421 toInt((*it1).colorId,
int));
3469 if ((entry !=
nullptr) && entry->getTime() + 120 >=
cur_time)
3471 if (!entry->getName().empty())
3477 setIp(entry->getIp());
3483 const int flags = entry->getFlags();
3519 if (entry ==
nullptr)
3566 if (
id == (*i)->getId())
3569 if ((*i)->getTime() + 120 <
cur_time)
3586 if (gender != mGender)
3590 const unsigned int sz =
CAST_U32(mSlots.size());
3592 if (sz >
CAST_U32(mSprites.size()))
3596 for (
unsigned int i = 0;
3611 if (!filename.empty())
3619 if (equipmentSprite !=
nullptr)
3621 equipmentSprite->setSpriteDirection(getSpriteDirection());
3622 startTime = getStartTime();
3623 lastTime = getLastTime();
3627 setAction(mAction, 0);
3628 if (equipmentSprite !=
nullptr)
3632 equipmentSprite->setLastTime(startTime);
3633 equipmentSprite->update(lastTime);
3655 if (!gmBadge.empty())
3662 updateBadgesCount();
3663 updateBadgesPosition();
3701 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3704 if (mHorseInfo !=
nullptr)
3706 HorseOffset &offset = mHorseInfo->offsets[mSpriteDirection];
3709 (*it)->draw(graphics,
3714 drawBeingCursor(graphics, px, py);
3715 drawPlayerSpriteAt(graphics,
3721 (*it)->draw(graphics,
3728 drawBeingCursor(graphics, px, py);
3729 drawPlayerSpriteAt(graphics, px, py);
3736 const int offsetY)
const
3741 if (
mInfo ==
nullptr)
3761 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3764 drawBeingCursor(graphics, px, py);
3765 drawOtherSpriteAt(graphics, px, py);
3773 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3776 drawBeingCursor(graphics, px, py);
3777 drawNpcSpriteAt(graphics, px, py);
3785 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3788 drawBeingCursor(graphics, px, py);
3789 drawMonsterSpriteAt(graphics, px, py);
3797 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3800 drawBeingCursor(graphics, px, py);
3801 drawHomunculusSpriteAt(graphics, px, py);
3809 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3812 drawBeingCursor(graphics, px, py);
3813 drawMercenarySpriteAt(graphics, px, py);
3821 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3824 drawBeingCursor(graphics, px, py);
3825 drawElementalSpriteAt(graphics, px, py);
3833 const int px = mPixelX -
mapTileSize / 2 + offsetX;
3836 drawPortalSpriteAt(graphics, px, py);
3846 drawPlayer(graphics,
3851 drawPortal(graphics,
3856 drawHomunculus(graphics,
3861 drawMercenary(graphics,
3866 drawElemental(graphics,
3871 drawMonster(graphics,
3898 for (
int f = 0; f < sz; f ++)
3900 const int rSprite = mSpriteHide[mSpriteRemap[f]];
3905 if (sprite !=
nullptr)
3907 sprite->setAlpha(mAlpha);
3908 sprite->draw(graphics, posX, posY);
3917 const size_t sz = mSprites.size();
3918 for (
size_t f = 0; f < sz; f ++)
3920 const int rSprite = mSpriteHide[mSpriteRemap[f]];
3925 if (sprite !=
nullptr)
3926 sprite->draw(graphics, posX, posY);
3934 drawCompound(graphics,
x,
y);
3939 const int posY)
const
3971 drawCompound(graphics,
x,
y);
3974 (mInfo !=
nullptr) &&
4002 drawCompound(graphics,
x,
y);
4009 if (mHighlightMonsterAttackRange &&
4020 if (mAttackRange != 0)
4028 graphics->fillRectangle(
Rect(
4029 x - attackRange,
y - attackRange,
4036 (mInfo !=
nullptr) &&
4044 maxHP = mInfo->getMaxHP();
4063 if (mHighlightMonsterAttackRange &&
4073 if (mAttackRange != 0)
4081 graphics->fillRectangle(
Rect(
4082 x - attackRange,
y - attackRange,
4092 if ((
info !=
nullptr) &&
4098 maxHP = mInfo->getMaxHP();
4118 if (mHighlightMonsterAttackRange &&
4128 if (mAttackRange != 0)
4136 graphics->fillRectangle(
Rect(
4137 x - attackRange,
y - attackRange,
4147 if ((
info !=
nullptr) &&
4153 maxHP = mInfo->getMaxHP();
4173 if (mHighlightMonsterAttackRange &&
4183 if (mAttackRange != 0)
4191 graphics->fillRectangle(
Rect(
4192 x - attackRange,
y - attackRange,
4206 maxHP = mInfo->getMaxHP();
4226 if (mHighlightMapPortals &&
4227 (
mMap !=
nullptr) &&
4228 !
mMap->getHasWarps())
4239 graphics->fillRectangle(
Rect(
x,
y,
4242 if (mDrawHotKeys && !mName.empty())
4271 p =
static_cast<float>(maxHP) /
static_cast<float>(hp);
4273 else if (maxHP != damage)
4275 p =
static_cast<float>(maxHP)
4276 /
static_cast<float>(maxHP - damage);
4283 if (p <= 0 || p > width)
4286 const int dx =
static_cast<int>(
static_cast<float>(width) / p);
4291 if ((damage == 0 && (
this !=
localPlayer || hp == maxHP))
4292 || (hp == 0 && maxHP == damage))
4295 graphics->fillRectangle(
Rect(
4299 else if (width - dx <= 0)
4302 graphics->fillRectangle(
Rect(
4303 x,
y, width, height));
4313 graphics->fillRectangle(
Rect(
4317 else if (width - dx <= 0)
4320 graphics->fillRectangle(
Rect(
4321 x,
y, width, height));
4327 graphics->fillRectangle(
Rect(
4331 graphics->fillRectangle(
Rect(
x + dx,
y, width - dx, height));
4369 STD_VECTOR<int> slotRemap;
4372 STD_VECTOR<int>::iterator it;
4374 bool updatedSprite[20];
4376 if (dir < 0 || dir >= 9)
4384 for (
size_t slot = sz; slot < 20; slot ++)
4387 updatedSprite[slot] =
false;
4390 for (
size_t slot = 0; slot < sz; slot ++)
4394 updatedSprite[slot] =
false;
4397 size_t spriteIdSize =
mSlots.size();
4401 for (
size_t slot = 0; slot < sz; slot ++)
4403 slotRemap.push_back(
CAST_S32(slot));
4405 if (spriteIdSize <= slot)
4408 const int id =
mSlots[slot].spriteId;
4414 if (
info.isRemoveSprites())
4417 =
info.getSpriteToItemReplaceMap(dir);
4419 if (spriteToItems !=
nullptr)
4423 const int remSlot = itr->first;
4427 if (
CAST_U32(remSlot) >= spriteIdSize)
4429 if (itemReplacer.empty())
4436 mSlots[remSlot].spriteId);
4437 if (repIt == itemReplacer.end())
4439 repIt = itemReplacer.find(0);
4440 if (repIt == itemReplacer.end() ||
4443 repIt = itemReplacer.end();
4446 if (repIt != itemReplacer.end())
4449 if (repIt->second != 1)
4462 updatedSprite[remSlot] =
true;
4471 for (
unsigned int slot2 = 0; slot2 < sz; slot2 ++)
4473 if (
mSlots[slot2].spriteId == repIt->first)
4476 if (repIt->second != 1)
4478 if (slot2 != hairSlot)
4488 updatedSprite[slot2] =
true;
4498 if (
info.mDrawBefore[dir] > 0)
4500 const int id2 =
mSlots[
info.mDrawBefore[dir]].spriteId;
4501 if (itemSlotRemap.find(id2) != itemSlotRemap.end())
4513 itemSlotRemap.erase(id2);
4517 itemSlotRemap[id] = -
info.mDrawBefore[dir];
4519 else if (
info.mDrawAfter[dir] > 0)
4521 const int id2 =
mSlots[
info.mDrawAfter[dir]].spriteId;
4522 if (itemSlotRemap.find(id2) != itemSlotRemap.end())
4533 itemSlotRemap.erase(id2);
4537 itemSlotRemap[id] =
info.mDrawAfter[dir];
4546 while (cnt < 15 && lastRemap >= 0)
4552 for (
unsigned int slot0 = 0; slot0 < sz; slot0 ++)
4555 const int val = slotRemap.at(slot);
4559 id =
mSlots[val].spriteId;
4565 const IntMapCIter orderIt = itemSlotRemap.find(
id);
4566 if (orderIt != itemSlotRemap.end())
4567 reorder = orderIt->second;
4573 if (it == slotRemap.end())
4576 if (it == slotRemap.end())
4579 if (idx1 + 1 != idx)
4581 slotRemap.erase(it);
4583 slotRemap.insert(it, val);
4586 else if (reorder > 0)
4591 if (it == slotRemap.end())
4594 if (idx1 != idx + 1)
4596 slotRemap.erase(it);
4598 if (it != slotRemap.end())
4601 if (it != slotRemap.end())
4602 slotRemap.insert(it, val);
4604 slotRemap.push_back(val);
4608 slotRemap.push_back(val);
4616 for (
unsigned int slot = 0; slot < sz; slot ++)
4621 if (oldHide[slot] != 0 && oldHide[slot] != 1)
4628 updatedSprite[slot] =
true;
4634 for (
size_t slot = 0; slot < spriteIdSize; slot ++)
4640 if (updatedSprite[slot] ==
false &&
4653 const size_t sz = mSprites.size();
4654 for (
size_t slot = 0; slot < sz; slot ++)
4656 if (slotRemap[slot] == val)
4664 STD_VECTOR<int> &
restrict slotRemap,
4668 it = slotRemap.begin();
4669 const STD_VECTOR<int>::iterator it_end = slotRemap.end();
4671 while (it != it_end)
4690 if ((mMinHit == 0) || amount < mMinHit)
4692 if (amount != mCriticalHit && ((mMaxHit == 0) || amount > mMaxHit))
4707 const size_t sz = mSlots.size();
4709 for (
size_t f = 0; f < sz; f ++)
4711 if (
id == mSlots[f].spriteId)
4765 if (lines.size() >= 2)
4768 return std::string();
4772 const std::string &
restrict comment,
4800 (name +
"\n").append(comment));
4808 const bool needUpdate = (shop != mShop ||
away != mAway
4809 || inactive != mInactive);
4814 mInactive = inactive;
4816 showShopBadge(mShop);
4817 showInactiveBadge(mInactive);
4818 showAwayBadge(mAway);
4822 if (shop ||
away || inactive)
4839 const int emotionIndex = emotion - 1;
4844 if (
info !=
nullptr)
4847 info->sprites.front();
4848 if (sprite !=
nullptr)
4851 if (mEmotionSprite !=
nullptr)
4852 mEmotionTime =
info->time;
4854 mEmotionTime = emote_time;
4856 const int effectId =
info->effectId;
4864 if (mEmotionSprite !=
nullptr)
4866 mEmotionSprite->play(mSpriteAction);
4867 mEmotionSprite->setSpriteDirection(mSpriteDirection);
4883 const unsigned num =
mHP * 100 /
mMaxHP;
4896 if (slot < 0 ||
CAST_SIZE(slot) >= mSlots.size())
4899 return mSlots[slot].spriteId;
4904 if (slot < 0 ||
CAST_SIZE(slot) >= mSlots.size())
4907 return mSlots[slot];
4912 if (slot < 0 ||
CAST_SIZE(slot) >= mSlots.size())
4915 return mSlots[slot].colorId;
4932 (mSpecialParticle ==
nullptr) &&
4961 delete mAnimationEffect;
4974 if (being !=
nullptr)
4980 being->mNextSound.sound =
nullptr;
4981 being->mNextSound.time = time + sound.delay;
4984 else if (mNextSound.time <= time)
4986 being->mNextSound.sound =
nullptr;
4987 being->mNextSound.time = time + sound.delay;
4992 being->mNextSound.sound = &sound;
4993 being->mNextSound.x =
x;
4994 being->mNextSound.y =
y;
5007 setSubtype(mSubType, look);
5014 if (
mMap !=
nullptr)
5017 mFixedOffsetY = mPixelOffsetY;
5018 mOldHeight =
mMap->getHeightOffset(mX, mY);
5019 mNeedPosUpdate =
true;
5028 if (
mMap !=
nullptr)
5030 mPixelOffsetY =
mMap->getHeightOffset(mX, mY);
5031 mFixedOffsetY = mPixelOffsetY;
5033 mNeedPosUpdate =
true;
5040 delete (*it).second;
5049 if (it == mSpriteParticles.end())
5052 mSpriteParticles[id] = pi;
5059 if ((pi ==
nullptr) || !pi->particles.empty())
5069 controlCustomParticle(p);
5070 pi->files.push_back(*itr);
5071 pi->particles.push_back(p);
5077 pi->files.push_back(*itr);
5087 if (it == mSpriteParticles.end())
5090 mSpriteParticles[id] = pi;
5097 if ((pi ==
nullptr) || !pi->particles.empty())
5107 controlCustomParticle(p);
5108 pi->files.push_back(*itr);
5109 pi->particles.push_back(p);
5111 for (
int f = 0; f <
maxCards; f ++)
5113 const int cardId = cards.cards[f];
5121 controlCustomParticle(p);
5122 pi->files.push_back(*itr);
5123 pi->particles.push_back(p);
5131 pi->files.push_back(*itr);
5133 for (
int f = 0; f <
maxCards; f ++)
5135 const int cardId = cards.cards[f];
5142 pi->files.push_back(*itr);
5151 if (it == mSpriteParticles.end())
5156 FOR_EACH (STD_VECTOR<Particle*>::const_iterator, itp, pi->particles)
5157 mChildParticleEffects.removeLocally(*itp);
5160 mSpriteParticles.erase(it);
5168 if ((pi !=
nullptr) && !pi->files.empty())
5170 FOR_EACH (STD_VECTOR<Particle*>::const_iterator,
5176 FOR_EACH (STD_VECTOR<std::string>::const_iterator, str, pi->files)
5181 pi->particles.push_back(p);
5189 if (mTeamId != teamId)
5192 showTeamBadge(mTeamId != 0);
5210 updateBadgesCount();
5211 updateBadgesPosition();
5216 showTeamBadge(show);
5217 showGuildBadge(show);
5219 showPartyBadge(show);
5220 showNameBadge(show);
5221 showShopBadge(show);
5222 showInactiveBadge(show);
5223 showAwayBadge(show);
5230 !mPartyName.empty() &&
5241 updateBadgesCount();
5242 updateBadgesPosition();
5248 if (mPartyName != name)
5251 showPartyBadge(!mPartyName.empty());
5270 updateBadgesCount();
5271 updateBadgesPosition();
5289 updateBadgesCount();
5290 updateBadgesPosition();
5308 updateBadgesCount();
5309 updateBadgesPosition();
5330 mShop = !text.empty() || !mBuyBoard.empty();
5333 showShopBadge(mShop);
5338 mShop = !text.empty() || !mSellBoard.empty();
5341 showShopBadge(mShop);
5348 showShopBadge(mShop);
5372 const int skillLevel,
5374 const int waitTimeTicks)
5376 if (waitTimeTicks <= 0)
5386 if (
data !=
nullptr)
5388 const std::string castingAnimation =
data->castingAnimation;
5399 reportAlways(
"Want to draw casting for unknown skill %d",
5417 if (b == (mHorseId != 0))
5427 if (mHorseId == horseId)
5430 setAction(mAction, 0);
5435 if (mHorseInfo !=
nullptr)
5443 mDownHorseSprites.push_back(sprite);
5444 sprite->
play(mSpriteAction);
5453 mUpHorseSprites.push_back(sprite);
5454 sprite->
play(mSpriteAction);
5461 mHorseInfo =
nullptr;
5467 if (b != mTrickDead)
5470 setAction(mAction, 0);
5478 mSpiritBalls = balls;
5482 if (balls > mSpiritBalls)
5486 addSpiritBalls(balls - mSpiritBalls, effectId);
5488 else if (balls < mSpiritBalls)
5490 removeSpiritBalls(mSpiritBalls - balls);
5492 mSpiritBalls = balls;
5500 for (
unsigned int f = 0; f < balls; f ++)
5506 mSpiritParticles.push_back(particle);
5514 for (
unsigned int f = 0; f < balls && !mSpiritParticles.empty(); f ++)
5517 mChildParticleEffects.removeLocally(particle);
5518 mSpiritParticles.pop_back();
5543 const int tmp = offsetY;
5549 const int tmp = offsetY;
5557 if (lang != mLanguageId)
5571 updateBadgesCount();
5572 updateBadgesPosition();
ActorManager * actorManager
AttackType ::T AttackTypeT
const unsigned int CACHE_SIZE
#define getSpriteAction(func, action)
#define for_each_badges()
#define for_each_horses(name)
std::map< int, Guild * >::const_iterator GuildsMapCIter
std::list< BeingCacheEntry * > beingInfoCache
std::map< int, int >::const_iterator IntMapCIter
static const unsigned int SPEECH_TIME
static const unsigned int SPEECH_MAX_TIME
static const unsigned int SPEECH_MIN_TIME
BeingAction ::T BeingActionT
const BeingId BeingId_zero
BeingSlot * emptyBeingSlot
#define fromBool(val, name)
Net::CharServerHandler * charServerHandler
#define reportAlways(...)
void destroy(ActorSprite *const actor)
AnimatedSprite * mUsedTargetCursor
ParticleList mChildParticleEffects
void setMap(Map *const map)
void controlCustomParticle(Particle *const particle)
virtual void setPixelPositionF(const Vector &pos)
virtual void setMap(Map *const map)
bool setSpriteDirection(const SpriteDirection::Type direction)
static AnimatedSprite * delayedLoad(const std::string &filename, const int variant)
bool play(const std::string &spriteAction)
void draw(Graphics *const graphics, const int posX, const int posY) const
static AnimatedSprite * load(const std::string &filename, const int variant)
bool isTerminated() const
static AnimatedSprite * clone(const AnimatedSprite *const anim)
bool update(const int time)
void setFlags(const int flags)
void setGuildName(const std::string &name)
void setPartyName(const std::string &name)
void setIp(const std::string &ip)
void setLevel(const int n)
void setTime(const time_t n)
void setAdvanced(const bool a)
void setTeamId(const uint16_t teamId)
void setName(const std::string &name)
void setPvpRank(const int r)
TargetCursorSizeT getTargetCursorSize() const
int getTargetOffsetY() const
int getDeadOffsetX() const
int getSitOffsetX() const
int getSitDirectionType() const
int getSitOffsetY() const
int getAttackOffsetX() const
int getFollowDist() const
int getMoveOffsetY() const
int getAttackDirectionType() const
int getTargetOffsetX() const
int getDirectionType() const
int getNameOffsetY() const
int getDeadOffsetY() const
int getAttackOffsetY() const
int getMoveOffsetX() const
int getStartFollowDist() const
int getNameOffsetX() const
int getDeadDirectionType() const
void setTempSprite(const unsigned int slot, const int id)
Being(const BeingId id, const ActorTypeT type)
void setHairStyle(const unsigned int slot, const int id)
void updateBotFollow(int dstX, int dstY, const int divX, const int divY)
void setWeaponId(const int id)
void setPixelPositionF(const Vector &pos)
static void searchSlotValueItr(std::vector< int >::iterator &it, int &idx, std::vector< int > &slotRemap, const int val)
void addEffect(const std::string &name)
std::string getSitAction() const
void moveBotTo(int dstX, int dstY)
void setLanguageId(const int lang)
void showAwayBadge(const bool show)
SpriteParticleInfo mSpriteParticles
void stopCast(const bool b)
virtual void setDirection(const uint8_t direction)
void updateHit(const int amount)
virtual void setAction(const BeingActionT &action, const int attackId)
void setTrickDead(const bool b)
const Guild * getGuild(const std::string &guildName) const
void showGuildBadge(const bool show)
void setHairTempSprite(const unsigned int slot, const int id)
static BeingCacheEntry * getCacheEntry(const BeingId id)
void drawBeingCursor(Graphics *const graphics, const int offsetX, const int offsetY) const
void drawNpcSpriteAt(Graphics *const graphics, const int x, const int y) const
void setGuildName(const std::string &name)
void addItemParticlesCards(const int id, const SpriteDisplay &display, const CardsList &cards)
static bool mHighlightMonsterAttackRange
void drawEmotion(Graphics *const graphics, const int offsetX, const int offsetY) const
void setDefaultNameColor(const UserColorIdT defaultColor)
virtual int getLevel() const
void drawPortalSpriteAt(Graphics *const graphics, const int x, const int y) const
void setParty(Party *const party)
void drawElemental(Graphics *const graphics, const int offsetX, const int offsetY) const
void showNameBadge(const bool show)
std::string getAttackAction() const
virtual void setTileCoords(const int x, const int y)
CastingEffect * mCastingEffect
static bool mEnableReorderSprites
std::string getWeaponAttackAction(const ItemInfo *const weapon) const
void drawMercenarySpriteAt(Graphics *const graphics, const int x, const int y) const
void setClanName(const std::string &name)
void drawOtherSpriteAt(Graphics *const graphics, const int x, const int y) const
void showBadges(const bool show)
std::string getMoveAction() const
void showGmBadge(const bool show)
SpriteDirection::Type mSpriteDirection
AnimatedSprite * mAnimationEffect
uint16_t getTeamId() const
void addGuild(Guild *const guild)
static BadgeDrawType::Type mShowBadges
void drawOther(Graphics *const graphics, const int offsetX, const int offsetY) const
void drawSpeech(const int offsetX, const int offsetY)
Equipment * getEquipment()
void setLevel(const int n)
const std::string & getPartyName() const
void undressItemById(const int id)
void updateSprite(const unsigned int slot, const int id, const std::string &color)
void enableShop(const bool b)
void drawHpBar(Graphics *const graphics, const int maxHP, const int hp, const int damage, const UserColorIdT color1, const UserColorIdT color2, const int x, const int y, const int width, const int height) const
void setSpriteCards(const unsigned int slot, const int id, const CardsList &cards)
void drawHomunculusSpriteAt(Graphics *const graphics, const int x, const int y) const
AnimatedSprite * mEmotionSprite
void setChat(ChatObject *const obj)
void playSfx(const SoundInfo &sound, Being *const being, const bool main, const int x, const int y) const
void addItemParticles(const int id, const SpriteDisplay &display)
std::map< int, Guild * > mGuilds
void addSpiritBalls(const unsigned int balls, const int effectId)
TargetCursorSizeT getTargetCursorSize() const
void drawElementalSpriteAt(Graphics *const graphics, const int x, const int y) const
SpeechBubble * mSpeechBubble
void drawBasic(Graphics *const graphics, const int x, const int y) const
std::string getGenderSignWithSpace() const
void setPath(const Path &path)
std::vector< Particle * > mSpiritParticles
virtual void updateCoords()
void drawPlayer(Graphics *const graphics, const int offsetX, const int offsetY) const
int getSpriteID(const int slot) const
void drawCompound(Graphics *const graphics, const int posX, const int posY) const
void drawNpc(Graphics *const graphics, const int offsetX, const int offsetY) const
void drawSpritesSDL(Graphics *const graphics, const int posX, const int posY) const
void setHorse(const int horseId)
void flashName(const int time)
void postInit(const BeingTypeId subType, Map *const map)
void setPvpRank(const unsigned int rank)
static VisibleNamePos::Type mVisibleNamePos
void drawPlayerSpriteAt(Graphics *const graphics, const int x, const int y) const
void removeSpiritBalls(const unsigned int balls)
void setLook(const uint16_t look)
std::vector< BeingSlot > mSlots
void recalcSpritesOrder()
void setShowName(const bool doShowName)
std::string getGenderSign() const
void handleAttack(Being *const victim, const int damage, const int attackId)
void handleSkillCasting(Being *const victim, const int skillId, const int skillLevel)
AnimatedSprite * mBadges[BadgeIndex::BadgeIndexSize]
void setName(const std::string &name)
void removeSpecialEffect()
friend class BeingEquipBackend
void removeAllItemsParticles()
static void saveComment(const std::string &name, const std::string &comment, const ActorTypeT &type)
void setSubtype(const BeingTypeId subtype, const uint16_t look)
void optionChanged(const std::string &value)
void showShopBadge(const bool show)
void takeDamage(Being *const attacker, const int amount, const AttackTypeT type, const int attackId, const int level)
void setHairColorSpriteID(const unsigned int slot, const int id)
void setHairColor(const unsigned int slot, const ItemColor color)
void setEmote(const uint8_t emotion, const int emote_time)
void setMaxHP(const int hp)
void addCast(const int dstX, const int dstY, const int skillId, const int skillLevel, const int range, const int waitTimeTicks)
void setSpriteSlot(const unsigned int slot, const BeingSlot &beingSlot)
static bool mShowBattleEvents
void setSpriteId(const unsigned int slot, const int id)
uint8_t calcDirection() const
void setState(const uint8_t state)
static bool mShowPlayersStatus
void setBuyBoard(const std::string &text)
void updateBadgesPosition()
bool isBuyShopEnabled() const
static int getDefaultEffectId(const AttackTypeT &type)
const std::string & getGuildName() const
void drawMonster(Graphics *const graphics, const int offsetX, const int offsetY) const
int searchSlotValue(const std::vector< int > &slotRemap, const int val) const
void drawMonsterSpriteAt(Graphics *const graphics, const int x, const int y) const
void setTeamId(const uint16_t teamId)
void setGuildPos(const std::string &pos)
void setPartyName(const std::string &name)
static std::string loadComment(const std::string &name, const ActorTypeT &type)
virtual void setGender(const GenderT gender)
void setSpeech(const std::string &text)
static unsigned int mConfLineLim
void setMap(Map *const map)
void unSetSprite(const unsigned int slot)
virtual unsigned char getBlockWalkMask() const
SpriteParticleInfo::iterator SpriteParticleInfoIter
virtual void setGroupId(const int id)
BeingActionT getCurrentAction() const
void removeGuild(const int id)
void drawHomunculus(Graphics *const graphics, const int offsetX, const int offsetY) const
void createSpeechBubble()
void setIp(const std::string &ip)
static void reReadConfig()
const std::string & getIp() const
GenderT getGender() const
void removeItemParticles(const int id)
std::vector< AnimatedSprite * > mDownHorseSprites
void handleSkill(Being *const victim, const int damage, const int skillId, const int skillLevel)
virtual int getLastAttackX() const
void fixDirectionOffsets(int &offsetX, int &offsetY) const
Particle * mSpecialParticle
void showClanBadge(const bool show)
void showPartyBadge(const bool show)
void updateBotDirection(const int dstX, const int dstY)
void drawPlayerSprites(Graphics *const graphics, const int posX, const int posY) const
bool isSellShopEnabled() const
virtual int getLastAttackY() const
static time_t mUpdateConfigTime
static int getHitEffect(const Being *const attacker, const AttackTypeT type, const int attackId, const int level)
std::string getCastAction() const
void recreateItemParticles()
void setRiding(const bool b)
ItemColor getSpriteColor(const int slot) const
void drawMercenary(Graphics *const graphics, const int offsetX, const int offsetY) const
void setSpiritBalls(const unsigned int balls)
unsigned int getPvpRank() const
void showInactiveBadge(const bool show)
void setGuild(Guild *const guild)
void addSpecialEffect(const int effect)
static Being * createBeing(const BeingId id, const ActorTypeT type, const BeingTypeId subtype, Map *const map)
void setGM(const bool gm)
void setSpriteColor(const unsigned int slot, const int id, const std::string &color)
void setSpriteColorId(const unsigned int slot, const int id, ItemColor colorId)
void drawPortal(Graphics *const graphics, const int offsetX, const int offsetY) const
void setDestination(const int dstX, const int dstY)
void botFixOffset(int &dstX, int &dstY) const
std::vector< AnimatedSprite * > mUpHorseSprites
void setSellBoard(const std::string &text)
static bool mHighlightMapPortals
void draw(Graphics *const graphics, const int offsetX, const int offsetY) const
void showTeamBadge(const bool show)
int getDamageTaken() const
void fireMissile(Being *const victim, const MissileInfo &missile) const
const BeingSlot & getSpriteSlot(const int slot) const
void update(const int time)
bool isTerminated() const
static void battleChatLog(const std::string &line, ChatMsgTypeT own, const IgnoreRecord ignoreRecord, const TryRemoveColors tryRemoveColors)
void updateImages() const
void drawSimple(Graphics *const graphics, const int posX, const int posY) const
bool setSpriteDirection(const SpriteDirection::Type direction)
std::vector< Sprite * > mSprites
int getNumberOfLayers() const
unsigned int getFrameCount() const
bool updateNumber(const unsigned num)
void setSprite(const size_t layer, Sprite *const sprite)
bool getBoolValue(const std::string &key) const
std::string getStringValue(const std::string &key) const
void addListener(const std::string &key, ConfigListener *const listener)
void removeListener(const std::string &key, ConfigListener *const listener)
int getIntValue(const std::string &key) const
Particle * triggerReturn(const int id, Being *const being, const int rotation)
bool triggerDirection(const int id, Being *const being, const SpriteDirection::Type &direction)
bool trigger(const int id, Being *const being, const int rotation)
void triggerDefault(int effectId, Being *const being, const int defaultEffectId)
void updateBeing(Being *const being)
void drawString(Graphics *const graphics, Color col, const Color &col2, const std::string &text, const int x, const int y)
virtual void drawImage(const Image *const image, int dstX, int dstY)=0
Font * getInfoParticleFont() const
Font * getSecureFont() const
static ItemColor getColorFromCards(const int *const cards)
static bool isItem(const int id)
void setLastHitFrom(const std::string &n)
Being * getTarget() const
void log(const char *const log_text,...)
uint8_t getHeightOffset(const int x, const int y) const
int getTileHeight() const
bool getWalk(const int x, const int y, const unsigned char blockWalkMask) const
unsigned char getBlockMask(const int x, const int y) const
virtual unsigned int baseSprite() const =0
virtual unsigned int hairSprite() const =0
virtual unsigned int maxSprite() const =0
virtual bool removeDeadBeings() const =0
virtual void move(const int x, const int y) const =0
virtual void moveToMaster() const =0
virtual void attack(const BeingId targetId, const Keep keep) const =0
virtual void setDirection(const unsigned char type) const =0
virtual void moveToMaster() const =0
virtual void attack(const BeingId targetId, const Keep keep) const =0
virtual void move(const int x, const int y) const =0
virtual void setDirection(const unsigned char type) const =0
virtual void talk(const Being *const being) const =0
virtual void attack(const BeingId id, const Keep keep) const =0
virtual bool haveExtendedRiding() const =0
virtual bool haveServerHp() const =0
Particle * addEffect(const std::string &particleEffectFile, const int pixelX, const int pixelY, const int rotation)
Particle * addTextSplashEffect(const std::string &text, const int x, const int y, const Color *const color, Font *const font, const bool outline)
void removeLocally(const Particle *const particle)
void removeMember(const PartyMember *const member)
bool isGoodName(Being *const being) const
RelationT getRelation(const std::string &name) const
int playerBadgeAtRightOffset
SkillInfo * getSkill(const int id) const
SkillData * getSkillDataByLevel(const int id, const int level) const
void updateAvatar(const std::string &name)
bool removeTab(Guild *const guild)
bool addTab(Guild *const guild)
void playSfx(const std::string &path, const int x, const int y) const
void setColor(const Color *const color)
void adviseXY(const int x, const int y, const Move move)
const Color & getColor(const ThemeColorIdT type, const unsigned int alpha)
const Color & getColor(UserColorIdT type, const unsigned int alpha)
const Color & getColorWithAlpha(const UserColorIdT type)
static const int mapTileSize
static const int MILLISECONDS_IN_A_TICK
void delete_all(Container &c)
EffectManager * effectManager
EquipmentWindow * beingEquipmentWindow
const bool ForceDisplay_true
const bool ForceDisplay_false
#define FOR_EACHP(type, iter, array)
#define FOR_EACH(type, iter, array)
Net::GameHandler * gameHandler
Net::HomunculusHandler * homunculusHandler
const bool IgnoreRecord_false
#define fromInt(val, name)
std::map< int, int > IntMap
const ItemColor ItemColor_one
const ItemColor ItemColor_zero
SpriteToItemMap::const_iterator SpriteToItemMapCIter
std::map< int, IntMap > SpriteToItemMap
LocalPlayer * localPlayer
int main(int argc, char *argv[])
Net::MercenaryHandler * mercenaryHandler
bool gm(InputEvent &event)
bool away(InputEvent &event)
bool info(InputEvent &event)
bool skill(InputEvent &event)
BeingInfo * get(const BeingTypeId id)
const std::string getClanBadge(const std::string &name)
const std::string getPartyBadge(const std::string &name)
const std::string getGuildBadge(const std::string &name)
const std::string getNameBadge(const std::string &name)
std::string trim(std::string const &str)
std::string toString(T const &value)
converts any type to a string
BeingInfo * get(const BeingTypeId id)
const int & getLast() A_CONST
const EmoteInfo * get2(int id, const bool allowNull)
bool loadTextFileLocal(const std::string &fileName, StringVect &lines)
bool existsLocal(const std::string &path)
void saveTextFile(const std::string &path, const std::string &name, const std::string &text)
const std::string & getBadge(const int id)
bool getShowBadge(const int id)
bool getHighlightName(const int id)
BeingInfo * get(const BeingTypeId id)
HorseInfo * get(const int id, const bool allowNull)
bool exists(const int id)
const ItemInfo & get(const int id)
const std::string & getIcon(const int id)
BeingInfo * get(const BeingTypeId id)
BeingInfo * get(const BeingTypeId id)
BeingInfo * get(const BeingTypeId id)
ServerTypeT getNetworkType()
BeingInfo * get(const BeingTypeId id)
bool limitPackets(const PacketTypeT type)
int getStatBase(const AttributesT id)
int32_t getAttribute(const AttributesT id)
HomunculusInfo * getHomunculus()
MercenaryInfo * getMercenary()
BeingInfo * get(const BeingTypeId id)
static const std::string STANDWATER("standwater")
static const std::string STANDRIDE("standride")
static const std::string RIDE("ride")
static const std::string SIT("sit")
static const std::string SWIM("swim")
static const std::string FLY("fly")
static const std::string STAND("stand")
static const std::string SITRIDE("sitride")
static const std::string SITSKY("sitsky")
static const std::string MOVE("walk")
static const std::string DEAD("dead")
static const std::string SITWATER("sitwater")
static const std::string STANDSKY("standsky")
static const std::string DEADSKY("deadsky")
static const std::string INVALID
static const std::string DEADWATER("deadwater")
static const std::string SITTOP("sittop")
@ HIT_LOCAL_PLAYER_MONSTER
@ HIT_LOCAL_PLAYER_CRITICAL
static const int blockWalkMask
Net::ServerFeatures * serverFeatures
Net::NpcHandler * npcHandler
Net::PlayerHandler * playerHandler
ParticleEngine * particleEngine
#define FUNC_BLOCK(name, id)
#define BLOCK_START(name)
PlayerRelationsManager playerRelations
std::list< Position > Path
SkillDialog * skillDialog
SocialWindow * socialWindow
SoundManager soundManager
std::vector< SpriteReference * >::const_iterator SpriteRefs
std::string removeColors(std::string msg)
std::string combineDye(std::string file, const std::string &dye)
std::string stringToHexPath(const std::string &str)
std::string strprintf(const char *const format,...)
std::string pathJoin(std::string str1, const std::string &str2)
StringVect::const_iterator StringVectCIter
std::vector< std::string > StringVect
TargetCursorSize ::T TargetCursorSizeT
int get_elapsed_time1(const int startTime)
int get_elapsed_time(const int startTime)
const bool TryRemoveColors_true
UserColorId ::T UserColorIdT
UserPalette * userPalette