Adds the bash sound effect

This commit is contained in:
Linus Probert 2018-08-05 15:47:56 +02:00
parent 41a902181a
commit a3c3c634d6
4 changed files with 20 additions and 7 deletions

BIN
assets/Sounds/FX/slam.wav Normal file

Binary file not shown.

View File

@ -81,6 +81,7 @@ load_effects(void)
effects[DAGGER_PICKUP] = load_effect("Sounds/FX/dagger_pickup.wav"); effects[DAGGER_PICKUP] = load_effect("Sounds/FX/dagger_pickup.wav");
effects[FALL0] = load_effect("Sounds/FX/fall0.wav"); effects[FALL0] = load_effect("Sounds/FX/fall0.wav");
effects[FALL1] = load_effect("Sounds/FX/fall1.wav"); effects[FALL1] = load_effect("Sounds/FX/fall1.wav");
effects[SLAM] = load_effect("Sounds/FX/slam.wav");
} }
void void

View File

@ -57,6 +57,7 @@ typedef enum Fx_t {
PLAYER_HIT1, PLAYER_HIT1,
PLAYER_HIT2, PLAYER_HIT2,
DAGGER_PICKUP, DAGGER_PICKUP,
SLAM,
LAST_EFFECT LAST_EFFECT
} Fx; } Fx;

View File

@ -195,7 +195,7 @@ skill_bash(Skill *skill, SkillData *data)
animation_run(data->player->swordAnimation); animation_run(data->player->swordAnimation);
Monster *monster = data->matrix->spaces[targetPos.x][targetPos.y].monster; Monster *monster = data->matrix->spaces[targetPos.x][targetPos.y].monster;
mixer_play_effect(SWING1); mixer_play_effect(SWING0);
if (monster) { if (monster) {
gui_log("You bash %s with your shield", monster->lclabel); gui_log("You bash %s with your shield", monster->lclabel);
unsigned int dmg = stats_fight(&data->player->stats, &monster->stats); unsigned int dmg = stats_fight(&data->player->stats, &monster->stats);
@ -205,7 +205,7 @@ skill_bash(Skill *skill, SkillData *data)
gui_log("%s seems dazed and confused", monster->label); gui_log("%s seems dazed and confused", monster->label);
monster_set_stunned(monster); monster_set_stunned(monster);
} }
mixer_play_effect(SWORD_HIT); mixer_play_effect(SLAM);
data->player->stat_data.hits += 1; data->player->stat_data.hits += 1;
} else { } else {
gui_log("You missed %s", monster->lclabel); gui_log("You missed %s", monster->lclabel);
@ -368,21 +368,32 @@ create_charge(void)
Skill* Skill*
skill_create(enum SkillType t) skill_create(enum SkillType t)
{ {
Skill *skill;
switch (t) { switch (t) {
case FLURRY: case FLURRY:
return create_flurry(); skill = create_flurry();
break;
case SIP_HEALTH: case SIP_HEALTH:
return create_sip_health(); skill = create_sip_health();
break;
case CHARGE: case CHARGE:
return create_charge(); skill = create_charge();
break;
case DAGGER_THROW: case DAGGER_THROW:
return create_throw_dagger(); skill = create_throw_dagger();
break;
case BASH: case BASH:
return create_bash(); skill = create_bash();
break;
default: default:
fatal("Unknown SkillType %u", (unsigned int) t); fatal("Unknown SkillType %u", (unsigned int) t);
return NULL; return NULL;
} }
#ifdef DEBUG
skill->levelcap = 1;
#endif
return skill;
} }
void void