Tuned the backstab skill slightly
This commit is contained in:
parent
743e4a3bac
commit
3301437b8f
|
@ -792,9 +792,10 @@ monster_push(Monster *m, Player *p, RoomMatrix *rm, Vector2d direction)
|
||||||
if (space->lethal) {
|
if (space->lethal) {
|
||||||
m->sprite->state = SPRITE_STATE_FALLING;
|
m->sprite->state = SPRITE_STATE_FALLING;
|
||||||
} else if (space->trap) {
|
} else if (space->trap) {
|
||||||
m->stats.hp -= space->trap->damage;
|
int dmg = space->trap->damage * 3;
|
||||||
monster_hit(m, space->trap->damage);
|
m->stats.hp -= dmg;
|
||||||
gui_log("%s takes %d damage from a trap", m->label, space->trap->damage);
|
monster_hit(m, dmg);
|
||||||
|
gui_log("%s takes %d damage from a trap", m->label, dmg);
|
||||||
} else if (space->damaging) {
|
} else if (space->damaging) {
|
||||||
LinkedList *objects = space->objects;
|
LinkedList *objects = space->objects;
|
||||||
while (objects) {
|
while (objects) {
|
||||||
|
@ -802,8 +803,8 @@ monster_push(Monster *m, Player *p, RoomMatrix *rm, Vector2d direction)
|
||||||
objects = objects->next;
|
objects = objects->next;
|
||||||
if (!o->damage)
|
if (!o->damage)
|
||||||
return;
|
return;
|
||||||
m->stats.hp -= o->damage;
|
m->stats.hp -= o->damage * 3;
|
||||||
monster_hit(m, o->damage);
|
monster_hit(m, o->damage * 3);
|
||||||
}
|
}
|
||||||
} else if (has_collided(m, rm, direction)) {
|
} else if (has_collided(m, rm, direction)) {
|
||||||
m->sprite->pos.x -= TILE_DIMENSION * (int) direction.x;
|
m->sprite->pos.x -= TILE_DIMENSION * (int) direction.x;
|
||||||
|
|
19
src/skill.c
19
src/skill.c
|
@ -404,7 +404,8 @@ skill_trip(Skill *skill, SkillData *data)
|
||||||
gui_log("You trip %s causing it to fall away from you", space->monster->lclabel);
|
gui_log("You trip %s causing it to fall away from you", space->monster->lclabel);
|
||||||
monster_hit(space->monster, dmg);
|
monster_hit(space->monster, dmg);
|
||||||
player_monster_kill_check(data->player, space->monster);
|
player_monster_kill_check(data->player, space->monster);
|
||||||
monster_push(space->monster, data->player, data->matrix, data->direction);
|
if (space->monster->stats.hp > 0)
|
||||||
|
monster_push(space->monster, data->player, data->matrix, data->direction);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
gui_log("You flail at the air");
|
gui_log("You flail at the air");
|
||||||
|
@ -457,17 +458,17 @@ skill_backstab(Skill *skill, SkillData *data)
|
||||||
animation_run(data->player->swordAnimation);
|
animation_run(data->player->swordAnimation);
|
||||||
|
|
||||||
if (targetSpace->monster) {
|
if (targetSpace->monster) {
|
||||||
targetSpace->monster->sprite->pos.x += (int) reverseDirection.x * TILE_DIMENSION;
|
Monster *m = targetSpace->monster;
|
||||||
targetSpace->monster->sprite->pos.y += (int) reverseDirection.y * TILE_DIMENSION;
|
monster_push(m, data->player, data->matrix, reverseDirection);
|
||||||
|
|
||||||
targetSpace->monster->stats.disadvantage = true;
|
m->stats.disadvantage = true;
|
||||||
int dmg = stats_fight(&data->player->stats, &targetSpace->monster->stats);
|
int dmg = stats_fight(&data->player->stats, &m->stats);
|
||||||
targetSpace->monster->stats.disadvantage = false;
|
m->stats.disadvantage = false;
|
||||||
monster_hit(targetSpace->monster, dmg);
|
monster_hit(m, dmg);
|
||||||
player_monster_kill_check(data->player, targetSpace->monster);
|
player_monster_kill_check(data->player, m);
|
||||||
if (dmg) {
|
if (dmg) {
|
||||||
mixer_play_effect(SWORD_HIT);
|
mixer_play_effect(SWORD_HIT);
|
||||||
monster_set_state(targetSpace->monster, STUNNED, 1);
|
monster_set_state(m, STUNNED, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue