X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/decks/%7B%7Bdeck_id%7D%7D/cards/%7B%7Bcard_id%7D%7D/static/git-logo.png?a=blobdiff_plain;f=src%2Fobjects_on_map.c;h=d74981b6f652ac95f5e0f6430c60761910bf1233;hb=868c0fd39978607ad2f68edd426f48a491ac1a2d;hp=70d4378ade18f3996c0a4752b69e24bb64ea9e71;hpb=d46d650d78b1e9830934d912998f17fae7ac592c;p=plomrogue diff --git a/src/objects_on_map.c b/src/objects_on_map.c index 70d4378..d74981b 100644 --- a/src/objects_on_map.c +++ b/src/objects_on_map.c @@ -3,7 +3,9 @@ #include #include "yx_uint16.h" #include "readwrite.h" -#include "roguelike.h" +#include "misc.h" +#include "map.h" +#include "main.h" static struct ChainMapObject * get_next_cmo (void *, char *, size_t, struct ChainMapObject *); @@ -105,6 +107,9 @@ extern void move_monster (struct World * world, struct Monster * monster) { struct yx_uint16 t = mv_yx_in_dir (d, monster->cmo.pos); if (yx_uint16_cmp (t, world->player->pos)) { update_log (world, "\nThe monster hits you."); + world->player->hitpoints--; + if (0 == world->player->hitpoints) + update_log (world, "\nYou are dead."); return; } struct Monster * other_monster; for (other_monster = world->monster; other_monster != 0; other_monster = other_monster->cmo.next) {