summaryrefslogtreecommitdiff
path: root/src/being
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-05-19 01:11:52 +0300
committerAndrei Karas <akaras@inbox.ru>2014-05-19 01:11:52 +0300
commit0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b (patch)
tree4d03ab1e6b655bccafbad06e5cc3386a4f6480d7 /src/being
parent29a93440367af32463f285ae5f0bd2aa23aadc92 (diff)
downloadplus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.gz
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.bz2
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.tar.xz
plus-0d6ca48b79a596bec11fc7351fadbf3b1fc1f67b.zip
Move itemsoundevent into separate file.
Diffstat (limited to 'src/being')
-rw-r--r--src/being/being.cpp22
-rw-r--r--src/being/playerinfo.cpp22
2 files changed, 22 insertions, 22 deletions
diff --git a/src/being/being.cpp b/src/being/being.cpp
index fbbbfecae..3446351c9 100644
--- a/src/being/being.cpp
+++ b/src/being/being.cpp
@@ -594,7 +594,7 @@ void Being::takeDamage(Being *const attacker, const int amount,
mDamageTaken += amount;
if (mInfo)
{
- playSfx(mInfo->getSound(SOUND_EVENT_HURT), this, false, mX, mY);
+ playSfx(mInfo->getSound(ItemSoundEvent::HURT), this, false, mX, mY);
if (!mInfo->isStaticMaxHP())
{
@@ -754,13 +754,13 @@ void Being::handleAttack(Being *const victim, const int damage,
weaponId = -100 - mSubType;
const ItemInfo &info = ItemDB::get(weaponId);
playSfx(info.getSound((damage > 0) ?
- SOUND_EVENT_HIT : SOUND_EVENT_MISS), victim, true, mX, mY);
+ ItemSoundEvent::HIT : ItemSoundEvent::MISS), victim, true, mX, mY);
}
}
else
{
playSfx(mInfo->getSound((damage > 0) ?
- SOUND_EVENT_HIT : SOUND_EVENT_MISS), victim, true, mX, mY);
+ ItemSoundEvent::HIT : ItemSoundEvent::MISS), victim, true, mX, mY);
}
}
@@ -804,7 +804,7 @@ void Being::handleSkill(Being *const victim, const int damage,
else
{
playSfx(mInfo->getSound((damage > 0) ?
- SOUND_EVENT_HIT : SOUND_EVENT_MISS), victim, true, mX, mY);
+ ItemSoundEvent::HIT : ItemSoundEvent::MISS), victim, true, mX, mY);
}
}
@@ -1135,7 +1135,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
if (mInfo)
{
playSfx(mInfo->getSound(
- SOUND_EVENT_MOVE), nullptr, true, mX, mY);
+ ItemSoundEvent::MOVE), nullptr, true, mX, mY);
}
currentAction = getMoveAction();
// Note: When adding a run action,
@@ -1146,11 +1146,11 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
currentAction = getSitAction();
if (mInfo)
{
- ItemSoundEvent event;
+ ItemSoundEvent::Type event;
if (currentAction == SpriteAction::SITTOP)
- event = SOUND_EVENT_SITTOP;
+ event = ItemSoundEvent::SITTOP;
else
- event = SOUND_EVENT_SIT;
+ event = ItemSoundEvent::SIT;
playSfx(mInfo->getSound(event), nullptr, true, mX, mY);
}
break;
@@ -1198,7 +1198,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
case BeingAction::HURT:
if (mInfo)
{
- playSfx(mInfo->getSound(SOUND_EVENT_HURT),
+ playSfx(mInfo->getSound(ItemSoundEvent::HURT),
this, false, mX, mY);
}
break;
@@ -1206,7 +1206,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
currentAction = getDeadAction();
if (mInfo)
{
- playSfx(mInfo->getSound(SOUND_EVENT_DIE), this, false, mX, mY);
+ playSfx(mInfo->getSound(ItemSoundEvent::DIE), this, false, mX, mY);
if (mType == ActorType::MONSTER || mType == ActorType::NPC)
mYDiff = mInfo->getDeadSortOffsetY();
}
@@ -1217,7 +1217,7 @@ void Being::setAction(const BeingAction::Action &action, const int attackId)
case BeingAction::SPAWN:
if (mInfo)
{
- playSfx(mInfo->getSound(SOUND_EVENT_SPAWN),
+ playSfx(mInfo->getSound(ItemSoundEvent::SPAWN),
nullptr, true, mX, mY);
}
currentAction = getSpawnAction();
diff --git a/src/being/playerinfo.cpp b/src/being/playerinfo.cpp
index 4978bd494..5632c8d38 100644
--- a/src/being/playerinfo.cpp
+++ b/src/being/playerinfo.cpp
@@ -232,21 +232,21 @@ void setEquipmentBackend(Equipment::Backend *const backend)
void equipItem(const Item *const item, const bool sfx)
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_EQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP);
Net::getInventoryHandler()->equipItem(item);
}
void unequipItem(const Item *const item, const bool sfx)
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_UNEQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP);
Net::getInventoryHandler()->unequipItem(item);
}
void useItem(const Item *const item, const bool sfx)
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_USE);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::USE);
Net::getInventoryHandler()->useItem(item);
}
@@ -259,13 +259,13 @@ void useEquipItem(const Item *const item, const bool sfx)
if (item->isEquipped())
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_UNEQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP);
Net::getInventoryHandler()->unequipItem(item);
}
else
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_EQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP);
Net::getInventoryHandler()->equipItem(item);
}
}
@@ -275,7 +275,7 @@ void useEquipItem(const Item *const item, const bool sfx)
{
Net::getInventoryHandler()->useItem(item);
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_USE);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::USE);
}
}
}
@@ -290,13 +290,13 @@ void useEquipItem2(const Item *const item, const bool sfx)
if (item->isEquipped())
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_UNEQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::UNEQUIP);
Net::getInventoryHandler()->unequipItem(item);
}
else
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_EQUIP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::EQUIP);
Net::getInventoryHandler()->equipItem(item);
}
}
@@ -305,7 +305,7 @@ void useEquipItem2(const Item *const item, const bool sfx)
if (mProtectedItems.find(item->getId()) == mProtectedItems.end())
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_USE);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::USE);
Net::getInventoryHandler()->useItem(item);
}
}
@@ -317,7 +317,7 @@ void dropItem(const Item *const item, const int amount, const bool sfx)
if (item && mProtectedItems.find(item->getId()) == mProtectedItems.end())
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_DROP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::DROP);
Net::getInventoryHandler()->dropItem(item, amount);
}
}
@@ -325,7 +325,7 @@ void dropItem(const Item *const item, const int amount, const bool sfx)
void pickUpItem(const FloorItem *const item, const bool sfx)
{
if (sfx)
- ItemSoundManager::playSfx(item, SOUND_EVENT_PICKUP);
+ ItemSoundManager::playSfx(item, ItemSoundEvent::PICKUP);
Net::getPlayerHandler()->pickUp(item);
}