Adds PUSH_BACK and SKILL_RADIUS effects to erupt skill
This commit is contained in:
parent
b00e607dec
commit
ef5cd4e244
14
src/skill.c
14
src/skill.c
|
@ -872,8 +872,9 @@ skill_erupt(Skill *skill, SkillData *data)
|
|||
mixer_play_effect(BLAST_EFFECT);
|
||||
|
||||
Position playerMPos = position_to_matrix_coords(&player->sprite->pos);
|
||||
for (Sint32 i = -1; i <= 1; ++i) {
|
||||
for (Sint32 j = -1; j <= 1; ++j) {
|
||||
int range = player_has_artifact(player, SKILL_RADIUS);
|
||||
for (Sint32 i = -1 - range; i <= 1 + range; ++i) {
|
||||
for (Sint32 j = -1 - range; j <= 1 + range; ++j) {
|
||||
|
||||
if (i == 0 && j == 0)
|
||||
continue;
|
||||
|
@ -886,6 +887,15 @@ skill_erupt(Skill *skill, SkillData *data)
|
|||
monster_hit(r->monster, dmg);
|
||||
gui_log("%s takes %d damage from the explosion", r->monster->label, dmg);
|
||||
monster_set_bleeding(r->monster);
|
||||
if (player_has_artifact(player, PUSH_BACK)) {
|
||||
int lvl = player_has_artifact(player, PUSH_BACK);
|
||||
monster_push(r->monster,
|
||||
player,
|
||||
rm,
|
||||
VEC2D((float) (i*lvl),
|
||||
(float) (j*lvl))
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
#define VECTOR2D_UP (Vector2d) { 0, -1 }
|
||||
#define VECTOR2D_DOWN (Vector2d) { 0, 1 }
|
||||
|
||||
#define VEC2D(x, y) (Vector2d) { x, y }
|
||||
|
||||
typedef struct Vector2d_t {
|
||||
float x;
|
||||
float y;
|
||||
|
|
Loading…
Reference in New Issue