예제 #1
0
파일: use.c 프로젝트: AhmadTux/DragonFlyBSD
void
hallucinate(void)
{
	object *obj, *monster;
	short ch;

	if (blind) return;

	obj = level_objects.next_object;

	while (obj) {
		ch = mvinch(obj->row, obj->col);
		if (((ch < 'A') || (ch > 'Z')) &&
		    ((obj->row != rogue.row) || (obj->col != rogue.col)))
		{
			if ((ch != ' ') && (ch != '.') && (ch != '#') &&
			    (ch != '+'))
			{
				addch(gr_obj_char());
			}
		}
		obj = obj->next_object;
	}
	monster = level_monsters.next_monster;

	while (monster) {
		ch = mvinch(monster->row, monster->col);
		if ((ch >= 'A') && (ch <= 'Z')) {
			addch(get_rand('A', 'Z'));
		}
		monster = monster->next_monster;
	}
}
예제 #2
0
object * gr_monster(object *monster, int mn)
{
    if (!monster)
    {
        monster = alloc_object();

        for (;;)
        {
            mn = get_rand(0, MONSTERS-1);
            if ((cur_level >= mon_tab[mn].first_level) &&
                    (cur_level <= mon_tab[mn].last_level))
            {
                break;
            }
        }
    }
    *monster = mon_tab[mn];
    if (monster->m_flags & IMITATES)
    {
        monster->disguise = gr_obj_char();
    }
    if (cur_level > (AMULET_LEVEL + 2))
    {
        monster->m_flags |= HASTED;
    }
    monster->trow = NO_ROOM;
    return(monster);
}