-1 m a 1 ANT
-2 m z 3 ZOMBIE
-3 m S 9 SHOGGOTH
-4 i # THING
+1 m a 4 1 ANT
+2 m z 5 3 ZOMBIE
+3 m S 5 9 SHOGGOTH
+4 i # DIRT
5 i % SKELETON
update_log(world, msg);
free(msg);
monster->hitpoints--;
-
if (0 == monster->hitpoints)
{
hit_dsc = "You kill the ";
sprintf(msg, "\n%s%s.", hit_dsc, monster_dsc);
update_log(world, msg);
free(msg);
+ struct MonsterDef * md = (struct MonsterDef * ) mod;
+ struct Item * corpse = malloc(sizeof(struct Item));
+ corpse->map_obj.type = md->corpse_id;
+ corpse->map_obj.pos = monster->map_obj.pos;
+ corpse->map_obj.next = world->item;
+ world->item = corpse;
if (world->monster == monster)
{
world->monster = world->monster->map_obj.next;
}
return passable;
}
-
}
else
{
- md.hitpoints_start = atoi (line_p + 4);
- line_p = strchr (line_p + 4, ' ') + 1;
+ md.corpse_id = atoi (line_p + 4);
+ md.hitpoints_start = atoi (line_p + 6);
+ line_p = strchr (line_p + 6, ' ') + 1;
}
mod.desc = calloc (strlen (line_p), sizeof(char));
memcpy (mod.desc, line_p, strlen(line_p) - 1);
struct MonsterDef
{
struct MapObjDef map_obj_def;
+ uint8_t corpse_id; /* ID of object type killed monster changes to. */
uint8_t hitpoints_start; /* Hitpoints each monster starts with. */
};