Finnished up with the rogue

- Add trip skill icon
- Add phase in and out fx
- Make traps and pits work when phase ends
- Fixed a tooltip
This commit is contained in:
Linus Probert 2018-10-18 22:34:48 +02:00
parent 94ec8cfba1
commit d034a69f44
7 changed files with 18 additions and 7 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

Binary file not shown.

View File

@ -85,6 +85,8 @@ load_effects(void)
effects[SLAM] = load_effect("Sounds/FX/slam.wav");
effects[MAGIC_PICKUP] = load_effect("Sounds/FX/magic_pickup.wav");
effects[CHEST_OPEN] = load_effect("Sounds/FX/chest_open.wav");
effects[FADE_IN] = load_effect("Sounds/FX/fade_in.wav");
effects[FADE_OUT] = load_effect("Sounds/FX/fade_out.wav");
}
void

View File

@ -61,6 +61,8 @@ typedef enum Fx_t {
SLAM,
MAGIC_PICKUP,
CHEST_OPEN,
FADE_IN,
FADE_OUT,
LAST_EFFECT
} Fx;

View File

@ -44,7 +44,7 @@
#define ENGINEER_STATS { 12, 12, 5, 7, 2, 2, 1, false, false }
#define MAGE_STATS { 12, 12, 5, 7, 1, 2, 1, false, false }
#define PALADIN_STATS { 12, 12, 8, 9, 3, 1, 1, false, false }
#define ROGUE_STATS { 9, 9, 4, 9, 4, 2, 1, false, false }
#define ROGUE_STATS { 9, 9, 6, 9, 4, 2, 1, false, false }
#define WARRIOR_STATS { 12, 12, 8, 9, 3, 1, 1, false, false }
void
@ -105,8 +105,12 @@ action_spent(Player *p)
if (p->skills[i] != NULL && p->skills[i]->resetCountdown > 0)
p->skills[i]->resetCountdown--;
}
if (p->phase_count > 0)
if (p->phase_count > 0) {
p->phase_count--;
if (p->phase_count <= 0) {
mixer_play_effect(FADE_IN);
}
}
}
}
@ -150,7 +154,6 @@ on_monster_collision(Player *player,
}
action_spent(player);
}
static void
@ -233,7 +236,9 @@ has_collided(Player *player, RoomMatrix *matrix, Vector2d direction)
else {
player_collect_items(player, space);
player_pickup_artifacts(player, space);
if (!player->phase_count) {
// If not phased or phase will end this turn, react to traps and pits
if (!player->phase_count || (player->phase_count == 1 && player->stats.speed == (player->stat_data.steps + 1))) {
player_interact_objects(player, space);
player_interact_traps_and_pits(player, space);
}

View File

@ -100,7 +100,7 @@ static char *backstab_tooltip[] = {
" You flip over an adjecant enemy taking it's place and", "",
" it taking yours, finnishing off with a stab in the back", "",
" of your foe.", "",
" A successful attack will also leave the enemy stunned." "",
" A successful attack will also leave the enemy stunned.", "",
"",
"COOLDOWN:", "",
" 5 turns", "",
@ -422,8 +422,9 @@ skill_trip(Skill *skill, SkillData *data)
mixer_play_effect(SWING0 + get_random(2));
animation_run(data->player->swordAnimation);
if (space->monster) {
mixer_play_effect(SWORD_HIT);
int dmg = stats_fight(&data->player->stats, &space->monster->stats);
if (dmg)
mixer_play_effect(SWORD_HIT);
gui_log("You trip %s causing it to fall away from you", space->monster->lclabel);
monster_hit(space->monster, dmg);
player_monster_kill_check(data->player, space->monster);
@ -452,7 +453,7 @@ create_trip(void)
Sprite *s = sprite_create();
sprite_set_texture(s, t, 0);
s->dim = GAME_DIMENSION;
s->clip = CLIP32(96, 0);
s->clip = CLIP32(32, 32);
s->fixed = true;
Skill *skill = create_default("Trip", s);
skill->levelcap = 3;
@ -530,6 +531,7 @@ static bool
skill_phase(Skill *skill, SkillData *data)
{
UNUSED(skill);
mixer_play_effect(FADE_OUT);
data->player->phase_count = 3;
return true;
}