Added code for custom kart zipper sound

git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/branches/irrlicht@3907 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
rforder
2009-08-22 17:59:35 +00:00
parent e8dc5d4f4d
commit 0549c9c965
4 changed files with 10 additions and 6 deletions

View File

@@ -232,12 +232,12 @@ const char *SFXManager::getCustomTagName(int id)
{
case CUSTOM_HORN: return "horn-sound"; // Replaces horn
case CUSTOM_CRASH: return "crash-sound"; // Played when colliding with another kart
case CUSTOM_WIN: return "win-sound"; // Played when racer wins
case CUSTOM_WIN: return "win-sound"; // Played when racer wins (not yet implemented)
case CUSTOM_EXPLODE: return "explode-sound"; // Played when kart explodes
case CUSTOM_GOO: return "goo-sound"; // Played when driving through goo
case CUSTOM_PASS: return "pass-sound"; // Played when passing another kart
case CUSTOM_PASS: return "pass-sound"; // Played when passing another kart (not yet implemented)
case CUSTOM_ZIPPER: return "zipper-sound"; // Played when kart hits zipper
case CUSTOM_NAME: return "name-sound"; // Introduction "I'm Tux!"
case CUSTOM_NAME: return "name-sound"; // Introduction "I'm Tux!" (not yet implemented)
case CUSTOM_ATTACH: return "attach-sound"; // Played when something is attached to kart
case CUSTOM_SHOOT: return "shoot-sound"; // Played when weapon is used
};

View File

@@ -113,6 +113,10 @@ void Attachment::hitBanana(const Item &item, int new_attachment)
leftover_time = m_time_left;
break;
default:
// There is no attachment currently, but there will be one
// so play the character sound ("Uh-Oh")
m_kart->playCustomSFX(SFXManager::CUSTOM_ATTACH);
if(new_attachment==-1)
new_attachment = m_random.get(3);
} // switch

View File

@@ -119,7 +119,7 @@ Material *Powerup::getIcon()
void Powerup::use()
{
// Play custom kart sound when collectible is used
if (m_type != POWERUP_NOTHING) m_owner->playCustomSFX(SFXManager::CUSTOM_SHOOT);
if (m_type != POWERUP_NOTHING && m_type != POWERUP_ZIPPER) m_owner->playCustomSFX(SFXManager::CUSTOM_SHOOT);
// FIXME - for some collectibles, set() is never called
if(m_sound_use == NULL) m_sound_use = sfx_manager->newSFX(SFXManager::SOUND_SHOT);

View File

@@ -415,8 +415,6 @@ void Kart::collectedItem(const Item &item, int add_info)
{
case Item::ITEM_BANANA:
m_attachment.hitBanana(item, add_info);
// Play appropriate custom character sound
playCustomSFX(SFXManager::CUSTOM_ATTACH);
break;
case Item::ITEM_SILVER_COIN: m_collected_energy++ ; break;
@@ -730,6 +728,8 @@ void Kart::handleZipper()
(1 + stk_config->m_zipper_max_speed_fraction));
m_vehicle->activateZipper(speed);
// Play custom character sound (weee!)
playCustomSFX(SFXManager::CUSTOM_ZIPPER);
} // handleZipper
//-----------------------------------------------------------------------------