diff --git a/Adventures in Lestoria/EnvironmentalAudio.cpp b/Adventures in Lestoria/EnvironmentalAudio.cpp index 128f1622..9edad25e 100644 --- a/Adventures in Lestoria/EnvironmentalAudio.cpp +++ b/Adventures in Lestoria/EnvironmentalAudio.cpp @@ -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); } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/config/audio/events.txt b/Adventures in Lestoria/assets/config/audio/events.txt index 8d8104ca..5e8277dd 100644 --- a/Adventures in Lestoria/assets/config/audio/events.txt +++ b/Adventures in Lestoria/assets/config/audio/events.txt @@ -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 + } + } } \ No newline at end of file diff --git a/Adventures in Lestoria/assets/sounds/consume_item.ogg b/Adventures in Lestoria/assets/sounds/consume_item.ogg new file mode 100644 index 00000000..5f641e9a Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/consume_item.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/consume_potion.ogg b/Adventures in Lestoria/assets/sounds/consume_potion.ogg new file mode 100644 index 00000000..af5354fc Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/consume_potion.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/equip.ogg b/Adventures in Lestoria/assets/sounds/equip.ogg new file mode 100644 index 00000000..e4731a8f Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/equip.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/equip2.ogg b/Adventures in Lestoria/assets/sounds/equip2.ogg new file mode 100644 index 00000000..c7b3e175 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/equip2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/equip_ring.ogg b/Adventures in Lestoria/assets/sounds/equip_ring.ogg new file mode 100644 index 00000000..a559fab4 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/equip_ring.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/footsteps.ogg b/Adventures in Lestoria/assets/sounds/footsteps.ogg new file mode 100644 index 00000000..4739c86a Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/footsteps.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/footsteps_wet.ogg b/Adventures in Lestoria/assets/sounds/footsteps_wet.ogg new file mode 100644 index 00000000..eec6b9dc Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/footsteps_wet.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/item_buy.ogg b/Adventures in Lestoria/assets/sounds/item_buy.ogg new file mode 100644 index 00000000..ee49153b Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/item_buy.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/item_craft.ogg b/Adventures in Lestoria/assets/sounds/item_craft.ogg new file mode 100644 index 00000000..8767e1c3 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/item_craft.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/item_enhance.ogg b/Adventures in Lestoria/assets/sounds/item_enhance.ogg new file mode 100644 index 00000000..dc897cd5 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/item_enhance.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/item_sell.ogg b/Adventures in Lestoria/assets/sounds/item_sell.ogg new file mode 100644 index 00000000..3b2b977c Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/item_sell.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/monster_hurt.ogg b/Adventures in Lestoria/assets/sounds/monster_hurt.ogg new file mode 100644 index 00000000..1c312187 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/monster_hurt.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_auto1.ogg b/Adventures in Lestoria/assets/sounds/ranger_auto1.ogg new file mode 100644 index 00000000..a9f44287 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_auto1.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_auto2.ogg b/Adventures in Lestoria/assets/sounds/ranger_auto2.ogg new file mode 100644 index 00000000..605f83da Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_auto2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_backstep.ogg b/Adventures in Lestoria/assets/sounds/ranger_backstep.ogg new file mode 100644 index 00000000..cef96ac2 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_backstep.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_charged_shot.ogg b/Adventures in Lestoria/assets/sounds/ranger_charged_shot.ogg new file mode 100644 index 00000000..b5edb0a9 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_charged_shot.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_multishot.ogg b/Adventures in Lestoria/assets/sounds/ranger_multishot.ogg new file mode 100644 index 00000000..b6da7b16 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_multishot.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/ranger_rapid_fire.ogg b/Adventures in Lestoria/assets/sounds/ranger_rapid_fire.ogg new file mode 100644 index 00000000..34a1a3cf Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/ranger_rapid_fire.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_dead.ogg b/Adventures in Lestoria/assets/sounds/slime_dead.ogg new file mode 100644 index 00000000..bf9db106 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_dead.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_dead2.ogg b/Adventures in Lestoria/assets/sounds/slime_dead2.ogg new file mode 100644 index 00000000..979e46ac Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_dead2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_king_landing.ogg b/Adventures in Lestoria/assets/sounds/slime_king_landing.ogg new file mode 100644 index 00000000..5af44df9 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_king_landing.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_king_shoot.ogg b/Adventures in Lestoria/assets/sounds/slime_king_shoot.ogg new file mode 100644 index 00000000..639338d3 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_king_shoot.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_shoot.ogg b/Adventures in Lestoria/assets/sounds/slime_shoot.ogg new file mode 100644 index 00000000..60c34f4f Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_shoot.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_shoot2.ogg b/Adventures in Lestoria/assets/sounds/slime_shoot2.ogg new file mode 100644 index 00000000..ed50d52a Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_shoot2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_walk.ogg b/Adventures in Lestoria/assets/sounds/slime_walk.ogg new file mode 100644 index 00000000..578dc2ce Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_walk.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_walk2.ogg b/Adventures in Lestoria/assets/sounds/slime_walk2.ogg new file mode 100644 index 00000000..174f6552 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_walk2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/slime_walk3.ogg b/Adventures in Lestoria/assets/sounds/slime_walk3.ogg new file mode 100644 index 00000000..ed50d52a Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/slime_walk3.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/spell_cast.ogg b/Adventures in Lestoria/assets/sounds/spell_cast.ogg new file mode 100644 index 00000000..a095b882 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/spell_cast.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_auto1.ogg b/Adventures in Lestoria/assets/sounds/warrior_auto1.ogg new file mode 100644 index 00000000..3b3a47f6 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_auto1.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_battlecry.ogg b/Adventures in Lestoria/assets/sounds/warrior_battlecry.ogg new file mode 100644 index 00000000..d030bcc7 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_battlecry.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_blockhit1.ogg b/Adventures in Lestoria/assets/sounds/warrior_blockhit1.ogg new file mode 100644 index 00000000..2f93af8f Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_blockhit1.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_blockhit2.ogg b/Adventures in Lestoria/assets/sounds/warrior_blockhit2.ogg new file mode 100644 index 00000000..207e4897 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_blockhit2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_groundslam.ogg b/Adventures in Lestoria/assets/sounds/warrior_groundslam.ogg new file mode 100644 index 00000000..63196fb5 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_groundslam.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/warrior_sonicslash.ogg b/Adventures in Lestoria/assets/sounds/warrior_sonicslash.ogg new file mode 100644 index 00000000..9f0c93ba Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/warrior_sonicslash.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_auto1.ogg b/Adventures in Lestoria/assets/sounds/wizard_auto1.ogg new file mode 100644 index 00000000..8f1bb98e Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_auto1.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_auto2.ogg b/Adventures in Lestoria/assets/sounds/wizard_auto2.ogg new file mode 100644 index 00000000..a8fade20 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_auto2.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_firebolt.ogg b/Adventures in Lestoria/assets/sounds/wizard_firebolt.ogg new file mode 100644 index 00000000..6084704d Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_firebolt.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_firebolt_hit.ogg b/Adventures in Lestoria/assets/sounds/wizard_firebolt_hit.ogg new file mode 100644 index 00000000..d4b95483 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_firebolt_hit.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_lightningbolt.ogg b/Adventures in Lestoria/assets/sounds/wizard_lightningbolt.ogg new file mode 100644 index 00000000..a8cbb4da Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_lightningbolt.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_meteor.ogg b/Adventures in Lestoria/assets/sounds/wizard_meteor.ogg new file mode 100644 index 00000000..82cf89c5 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_meteor.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_meteor_lingering.ogg b/Adventures in Lestoria/assets/sounds/wizard_meteor_lingering.ogg new file mode 100644 index 00000000..289e262b Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_meteor_lingering.ogg differ diff --git a/Adventures in Lestoria/assets/sounds/wizard_teleport.ogg b/Adventures in Lestoria/assets/sounds/wizard_teleport.ogg new file mode 100644 index 00000000..5dd4c5f1 Binary files /dev/null and b/Adventures in Lestoria/assets/sounds/wizard_teleport.ogg differ diff --git a/Adventures in Lestoria/olcPGEX_MiniAudio.h b/Adventures in Lestoria/olcPGEX_MiniAudio.h index c29bdd2c..e0d3c292 100644 --- a/Adventures in Lestoria/olcPGEX_MiniAudio.h +++ b/Adventures in Lestoria/olcPGEX_MiniAudio.h @@ -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); }