Adds monster bleed damage every turn

This commit is contained in:
Linus Probert 2019-05-08 12:59:15 +02:00
parent 0476d4d1bd
commit 2ca78e2ec7
1 changed files with 14 additions and 0 deletions

View File

@ -551,9 +551,22 @@ monster_perform_aoe_attack(Monster *m, RoomMatrix *rm)
return false; return false;
} }
static void
apply_bleed_damage(Monster *m)
{
if (!m->emitters.bleed->enabled)
return;
uint32_t dmg = m->stats.lvl * 2;
monster_hit(m, dmg);
m->stats.hp -= dmg;
}
bool bool
monster_move(Monster *m, RoomMatrix *rm, Map *map) monster_move(Monster *m, RoomMatrix *rm, Map *map)
{ {
apply_bleed_damage(m);
Player *player = roommatrix_get_player(rm); Player *player = roommatrix_get_player(rm);
if (player && player->phase_count) if (player && player->phase_count)
return true; return true;
@ -913,6 +926,7 @@ void
monster_set_bleeding(Monster *m) monster_set_bleeding(Monster *m)
{ {
m->emitters.bleed->enabled = true; m->emitters.bleed->enabled = true;
gui_log("%s starts bleeding profusely", m->label);
} }
void void