Sound Effects.

pull/29/head
sigonasr2 11 months ago
parent ac8bca2396
commit 6539bbdb50
  1. 2
      Adventures in Lestoria/EnvironmentalAudio.cpp
  2. 159
      Adventures in Lestoria/assets/config/audio/events.txt
  3. BIN
      Adventures in Lestoria/assets/sounds/consume_item.ogg
  4. BIN
      Adventures in Lestoria/assets/sounds/consume_potion.ogg
  5. BIN
      Adventures in Lestoria/assets/sounds/equip.ogg
  6. BIN
      Adventures in Lestoria/assets/sounds/equip2.ogg
  7. BIN
      Adventures in Lestoria/assets/sounds/equip_ring.ogg
  8. BIN
      Adventures in Lestoria/assets/sounds/footsteps.ogg
  9. BIN
      Adventures in Lestoria/assets/sounds/footsteps_wet.ogg
  10. BIN
      Adventures in Lestoria/assets/sounds/item_buy.ogg
  11. BIN
      Adventures in Lestoria/assets/sounds/item_craft.ogg
  12. BIN
      Adventures in Lestoria/assets/sounds/item_enhance.ogg
  13. BIN
      Adventures in Lestoria/assets/sounds/item_sell.ogg
  14. BIN
      Adventures in Lestoria/assets/sounds/monster_hurt.ogg
  15. BIN
      Adventures in Lestoria/assets/sounds/ranger_auto1.ogg
  16. BIN
      Adventures in Lestoria/assets/sounds/ranger_auto2.ogg
  17. BIN
      Adventures in Lestoria/assets/sounds/ranger_backstep.ogg
  18. BIN
      Adventures in Lestoria/assets/sounds/ranger_charged_shot.ogg
  19. BIN
      Adventures in Lestoria/assets/sounds/ranger_multishot.ogg
  20. BIN
      Adventures in Lestoria/assets/sounds/ranger_rapid_fire.ogg
  21. BIN
      Adventures in Lestoria/assets/sounds/slime_dead.ogg
  22. BIN
      Adventures in Lestoria/assets/sounds/slime_dead2.ogg
  23. BIN
      Adventures in Lestoria/assets/sounds/slime_king_landing.ogg
  24. BIN
      Adventures in Lestoria/assets/sounds/slime_king_shoot.ogg
  25. BIN
      Adventures in Lestoria/assets/sounds/slime_shoot.ogg
  26. BIN
      Adventures in Lestoria/assets/sounds/slime_shoot2.ogg
  27. BIN
      Adventures in Lestoria/assets/sounds/slime_walk.ogg
  28. BIN
      Adventures in Lestoria/assets/sounds/slime_walk2.ogg
  29. BIN
      Adventures in Lestoria/assets/sounds/slime_walk3.ogg
  30. BIN
      Adventures in Lestoria/assets/sounds/spell_cast.ogg
  31. BIN
      Adventures in Lestoria/assets/sounds/warrior_auto1.ogg
  32. BIN
      Adventures in Lestoria/assets/sounds/warrior_battlecry.ogg
  33. BIN
      Adventures in Lestoria/assets/sounds/warrior_blockhit1.ogg
  34. BIN
      Adventures in Lestoria/assets/sounds/warrior_blockhit2.ogg
  35. BIN
      Adventures in Lestoria/assets/sounds/warrior_groundslam.ogg
  36. BIN
      Adventures in Lestoria/assets/sounds/warrior_sonicslash.ogg
  37. BIN
      Adventures in Lestoria/assets/sounds/wizard_auto1.ogg
  38. BIN
      Adventures in Lestoria/assets/sounds/wizard_auto2.ogg
  39. BIN
      Adventures in Lestoria/assets/sounds/wizard_firebolt.ogg
  40. BIN
      Adventures in Lestoria/assets/sounds/wizard_firebolt_hit.ogg
  41. BIN
      Adventures in Lestoria/assets/sounds/wizard_lightningbolt.ogg
  42. BIN
      Adventures in Lestoria/assets/sounds/wizard_meteor.ogg
  43. BIN
      Adventures in Lestoria/assets/sounds/wizard_meteor_lingering.ogg
  44. BIN
      Adventures in Lestoria/assets/sounds/wizard_teleport.ogg
  45. 5
      Adventures in Lestoria/olcPGEX_MiniAudio.h

@ -94,6 +94,6 @@ void EnvironmentalAudio::Update(){
float distRatio=1-distanceFromPlayer/ACTIVATION_RANGE; //0-1 where 1 is full volume.
float xDistRatio=(pos.x-game->GetPlayer()->GetX())/ACTIVATION_RANGE; //0-1 where 1 is full volume.
Audio::Engine().SetVolume(soundInstance,distRatio);
Audio::Engine().SetVolume(soundInstance,distRatio*SOUND_DATA[audioName].volume);
Audio::Engine().SetPan(soundInstance,xDistRatio);
}

@ -3,4 +3,163 @@ Events
LowHealth = "Occurs when the player is low in health."
InCombat = "Occurs when the player is in combat."
Underwater = "Occurs when the player is in water."
SFX
{
Consume Potion
{
File[0] = consume_potion.ogg
}
Consume Item
{
File[0] = consume_item.ogg
}
Equip Armor
{
File[0] = equip.ogg
File[1] = equip2.ogg
}
Equip Accessory
{
File[0] = equip_ring.ogg
}
Footstep
{
File[0] = footsteps.ogg
}
Footstep - Wet
{
File[0] = footsteps_wet.ogg
}
Buy Item
{
File[0] = item_buy.ogg
}
Sell Item
{
File[0] = item_sell.ogg
}
Craft Item
{
File[0] = item_craft.ogg
}
Enhance Item
{
File[0] = item_enhance.ogg
}
Monster Hurt
{
File[0] = monster_hurt.ogg
}
Ranger Auto Attack
{
File[0] = ranger_auto1.ogg
File[1] = ranger_auto2.ogg
}
Ranger Backstep
{
File[0] = ranger_backstep.ogg
}
Ranger Multishot
{
File[0] = ranger_multishot.ogg
}
Ranger Rapid Fire
{
File[0] = ranger_rapid_fire.ogg
}
Ranger Charged Shot
{
File[0] = ranger_charged_shot.ogg
}
Ranger Multishot
{
File[0] = ranger_multishot.ogg
}
Slime Dead
{
File[0] = slime_dead.ogg
}
Monster Dead
{
File[0] = slime_dead2.ogg
}
Slime King Land
{
File[0] = slime_king_landing.ogg
}
Slime King Shoot
{
File[0] = slime_king_shoot.ogg
}
Slime Shoot
{
File[0] = slime_shoot.ogg
File[1] = slime_shoot2.ogg
}
Slime Walk
{
File[0] = slime_walk.ogg
File[1] = slime_walk2.ogg
File[2] = slime_walk3.ogg
}
Spell Cast
{
File[0] = spell_cast.ogg
}
Warrior Auto Attack
{
File[0] = warrior_auto1.ogg
}
Warrior Battlecry
{
File[0] = warrior_battlecry.ogg
}
Warrior Block Hit
{
File[0] = warrior_blockhit1.ogg
File[1] = warrior_blockhit2.ogg
}
Warrior Ground Slam
{
File[0] = warrior_groundslam.ogg
}
Warrior Sonic Slash
{
File[0] = warrior_sonicslash.ogg
}
Wizard Auto Attack
{
File[0] = wizard_auto1.ogg
File[1] = wizard_auto2.ogg
}
Wizard Fire Bolt
{
File[0] = wizard_firebolt.ogg
}
Wizard Fire Bolt Hit
{
File[0] = wizard_firebolt_hit.ogg
}
Wizard Lightning Bolt
{
File[0] = wizard_lightningbolt.ogg
}
Wizard Lightning Bolt Hit
{
File[0] = wizard_firebolt_hit.ogg
}
Wizard Meteor
{
File[0] = wizard_meteor.ogg
}
Wizard Meteor Flames
{
File[0] = wizard_meteor_lingering.ogg
}
Wizard Teleport
{
File[0] = wizard_teleport.ogg
}
}
}

@ -89,7 +89,7 @@ namespace olc
// plays a sample, can be set to loop
void Play(const int id, const bool loop = false);
// plays a sound file, as a one off, and automatically unloads it
void Play(const std::string& path);
void Play(const std::string& path,const float&vol=1.0f);
// stops a sample, rewinds to beginning
void Stop(const int id);
// pauses a sample, does not change position
@ -335,7 +335,7 @@ namespace olc
ma_sound_start(vecSounds.at(id));
}
void MiniAudio::Play(const std::string& path)
void MiniAudio::Play(const std::string& path,const float&vol)
{
// create the sound
ma_sound* sound = new ma_sound();
@ -344,6 +344,7 @@ namespace olc
if(ma_sound_init_from_file(&engine, path.c_str(), MA_SOUND_FLAG_DECODE | MA_SOUND_FLAG_ASYNC, NULL, NULL, sound) != MA_SUCCESS)
throw MiniAudioSoundException();
ma_sound_set_volume(sound,vol);
ma_sound_start(sound);
vecOneOffSounds.push_back(sound);
}

Loading…
Cancel
Save