void new_monster(THING *tp, int type, const coord *cp) { struct monster *mp; int lev_add; if ((lev_add = level - AMULETLEVEL) < 0) lev_add = 0; attach(mlist, tp); tp->t_type = type; tp->t_disguise = type; tp->t_pos = *cp; move(cp->y, cp->x); tp->t_oldch = CCHAR( inch() ); tp->t_room = roomin(cp); moat(cp->y, cp->x) = tp; mp = &monsters[tp->t_type-'A']; tp->t_stats.s_lvl = mp->m_stats.s_lvl + lev_add; tp->t_stats.s_maxhp = tp->t_stats.s_hpt = roll(tp->t_stats.s_lvl, 8); tp->t_stats.s_arm = mp->m_stats.s_arm - lev_add; strcpy(tp->t_stats.s_dmg,mp->m_stats.s_dmg); tp->t_stats.s_str = mp->m_stats.s_str; tp->t_stats.s_exp = mp->m_stats.s_exp + lev_add * 10 + exp_add(tp); tp->t_flags = mp->m_flags; if (level > 29) tp->t_flags |= ISHASTE; tp->t_turn = TRUE; tp->t_pack = NULL; if (ISWEARING(R_AGGR)) runto(cp); if (type == 'X') tp->t_disguise = rnd_thing(); }
/* * visuals: * change the characters for the player */ visuals() { register THING *tp; register bool seemonst; if (!after) return; /* * change the things */ for (tp = lvl_obj; tp != NULL; tp = next(tp)) if (cansee(tp->o_pos.y, tp->o_pos.x)) { PC_GFX_PASSGE_COLOR(tp->o_pos.y, tp->o_pos.x, 0, 0x70); mvaddrawch(tp->o_pos.y, tp->o_pos.x, rnd_thing()); PC_GFX_NOCOLOR(0x70); } /* * change the stairs */ if (!seenstairs && cansee(stairs.y, stairs.x)) { PC_GFX_PASSGE_COLOR(stairs.y, stairs.x, 0, 0x70); mvaddrawch(stairs.y, stairs.x, rnd_thing()); PC_GFX_NOCOLOR(0x70); } /* * change the monsters */ seemonst = on(player, SEEMONST); for (tp = mlist; tp != NULL; tp = next(tp)) if (see_monst(tp)){ PC_GFX_PASSGE_COLOR(tp->t_pos.y, tp->t_pos.x, 0, 0x70); if (tp->t_type == 'M' && tp->t_disguise != 'M') mvaddrawch(tp->t_pos.y, tp->t_pos.x, rnd_thing()); else mvaddrawch(tp->t_pos.y, tp->t_pos.x, rnd(26) + 'A'); PC_GFX_NOCOLOR(0x70); } else if (seemonst) { standout(); mvaddrawch(tp->t_pos.y, tp->t_pos.x, rnd(26) + 'A'); standend(); } }