- dsc_move = "You move ";
- world->player->pos = target;
- }
- char * msg = malloc(strlen(dsc_move) + strlen (dsc_dir) + 3);
- sprintf(msg, "\n%s%s.", dsc_move, dsc_dir);
- update_log(world, msg);
- free(msg);
-}
-
-
-
-extern void move_monster(struct World * world, struct Monster * monster)
-{
- char d = rrand() % 5;
- struct yx_uint16 t = mv_yx_in_dir(d, monster->map_obj.pos);
- struct MapObjDef * mod = get_map_obj_def(world, monster->map_obj.type);
- char * desc = mod->desc;
- if (yx_uint16_cmp(&t, &world->player->pos))
- {
- monster_hits_player(world, desc);
- return;
- }
- struct Monster * other_monster;
- for (other_monster = world->monster;
- other_monster != 0;
- other_monster = other_monster->map_obj.next)
- {
- if (other_monster == monster)