diff --git a/assets/Sounds/FX/double_sword_hit.wav b/assets/Sounds/FX/double_sword_hit.wav new file mode 100644 index 0000000..931b3bc Binary files /dev/null and b/assets/Sounds/FX/double_sword_hit.wav differ diff --git a/assets/Sounds/FX/sword_hit.wav b/assets/Sounds/FX/sword_hit.wav index eef4581..87359b3 100644 Binary files a/assets/Sounds/FX/sword_hit.wav and b/assets/Sounds/FX/sword_hit.wav differ diff --git a/assets/Sounds/FX/tripple_swing.wav b/assets/Sounds/FX/tripple_swing.wav new file mode 100644 index 0000000..9ab07e1 Binary files /dev/null and b/assets/Sounds/FX/tripple_swing.wav differ diff --git a/assets/Sounds/FX/tripple_sword_hit.wav b/assets/Sounds/FX/tripple_sword_hit.wav new file mode 100644 index 0000000..20619cd Binary files /dev/null and b/assets/Sounds/FX/tripple_sword_hit.wav differ diff --git a/src/mixer.c b/src/mixer.c index bfa1c8b..7fa22bb 100644 --- a/src/mixer.c +++ b/src/mixer.c @@ -28,8 +28,8 @@ static Music loaded_song = LAST_MUSIC; static char *music[LAST_MUSIC] = { "Sounds/Music/fantasy-game-background-looping.ogg", // GAME_MUSIC0 "Sounds/Music/bog-creatures-on-the-move-looping.ogg", // GAME_MUSIC1 - "Sounds/Music/fantascape-looping.ogg", // GAME_MUSIC2 - "Sounds/Music/fantasy-forest-battle.ogg" // MENU_MUSIC + "Sounds/Music/fantascape-looping.ogg", // GAME_MUSIC2 + "Sounds/Music/fantasy-forest-battle.ogg" // MENU_MUSIC }; static bool sound_enabled = true; @@ -60,7 +60,10 @@ load_effects(void) effects[SWING0] = load_effect("Sounds/FX/swing.wav"); effects[SWING1] = load_effect("Sounds/FX/swing2.wav"); effects[SWING2] = load_effect("Sounds/FX/swing3.wav"); + effects[TRIPPLE_SWING] = load_effect("Sounds/FX/tripple_swing.wav"); effects[SWORD_HIT] = load_effect("Sounds/FX/sword_hit.wav"); + effects[DOUBLE_SWORD_HIT] = load_effect("Sounds/FX/double_sword_hit.wav"); + effects[TRIPPLE_SWORD_HIT] = load_effect("Sounds/FX/tripple_sword_hit.wav"); effects[BONK] = load_effect("Sounds/FX/bonk.wav"); effects[DEATH] = load_effect("Sounds/FX/death.wav"); effects[COIN] = load_effect("Sounds/FX/coin.wav"); diff --git a/src/mixer.h b/src/mixer.h index 1dd42f7..14f6838 100644 --- a/src/mixer.h +++ b/src/mixer.h @@ -34,7 +34,10 @@ typedef enum Fx_t { SWING0, SWING1, SWING2, + TRIPPLE_SWING, SWORD_HIT, + DOUBLE_SWORD_HIT, + TRIPPLE_SWORD_HIT, BONK, DEATH, COIN, diff --git a/src/skill.c b/src/skill.c index b0fd2b4..c2a64ed 100644 --- a/src/skill.c +++ b/src/skill.c @@ -55,17 +55,26 @@ skill_use_flurry(Skill *skill, SkillData *data) targetPos.y += (int) data->direction.y; Monster *monster = data->matrix->spaces[targetPos.x][targetPos.y].monster; + mixer_play_effect(TRIPPLE_SWING); if (monster) { gui_log("You attack %s with a flurry of strikes", monster->lclabel); + unsigned int hitCount = 0; for (size_t i = 0; i < 3; ++i) { + unsigned int originalHp = monster->stats.hp; unsigned int dmg = stats_fight(&data->player->stats, &monster->stats); - mixer_play_effect((SWING0 - 1) + get_random(3)); - if (dmg > 0) { + if (dmg > 0 && originalHp > 0) { gui_log("You hit for %u damage", dmg); - mixer_play_effect(SWORD_HIT); monster_hit(monster, dmg); + hitCount++; } } + if (hitCount == 1) { + mixer_play_effect(SWORD_HIT); + } else if (hitCount == 2) { + mixer_play_effect(DOUBLE_SWORD_HIT); + } else if (hitCount == 3) { + mixer_play_effect(TRIPPLE_SWORD_HIT); + } } else { gui_log("You swing at thin air with a flurry of strikes");