本文整理汇总了C++中player::has_active_item方法的典型用法代码示例。如果您正苦于以下问题:C++ player::has_active_item方法的具体用法?C++ player::has_active_item怎么用?C++ player::has_active_item使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类player
的用法示例。
在下文中一共展示了player::has_active_item方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawsq
void map::drawsq(WINDOW* w, player &u, int x, int y, bool invert,
bool show_items)
{
if (!inbounds(x, y))
return; // Out of bounds
int k = x + SEEX - u.posx;
int j = y + SEEY - u.posy;
nc_color tercol;
char sym = terlist[ter(x, y)].sym;
bool hi = false;
if (u.has_disease(DI_BOOMERED))
tercol = c_magenta;
else if ((u.is_wearing(itm_goggles_nv) && u.has_active_item(itm_UPS_on)) ||
u.has_active_bionic(bio_night_vision))
tercol = c_ltgreen;
else
tercol = terlist[ter(x, y)].color;
if (move_cost(x, y) == 0 && has_flag(swimmable, x, y) && !u.underwater)
show_items = false; // Can only see underwater items if WE are underwater
// If there's a trap here, and we have sufficient perception, draw that instead
if (tr_at(x, y) != tr_null &&
u.per_cur - u.encumb(bp_eyes) >= (*traps)[tr_at(x, y)]->visibility) {
tercol = (*traps)[tr_at(x, y)]->color;
if ((*traps)[tr_at(x, y)]->sym == '%') {
switch(rng(1, 5)) {
case 1:
sym = '*';
break;
case 2:
sym = '0';
break;
case 3:
sym = '8';
break;
case 4:
sym = '&';
break;
case 5:
sym = '+';
break;
}
} else
sym = (*traps)[tr_at(x, y)]->sym;
}
// If there's a field here, draw that instead (unless its symbol is %)
if (field_at(x, y).type != fd_null) {
tercol = fieldlist[field_at(x, y).type].color[field_at(x, y).density - 1];
if (fieldlist[field_at(x, y).type].sym == '*') {
switch (rng(1, 5)) {
case 1:
sym = '*';
break;
case 2:
sym = '0';
break;
case 3:
sym = '8';
break;
case 4:
sym = '&';
break;
case 5:
sym = '+';
break;
}
} else if (fieldlist[field_at(x, y).type].sym != '%')
sym = fieldlist[field_at(x, y).type].sym;
}
// If there's items here, draw those instead
if (show_items && i_at(x, y).size() > 0 && field_at(x, y).is_null()) {
if ((terlist[ter(x, y)].sym != '.'))
hi = true;
else {
tercol = i_at(x, y)[i_at(x, y).size() - 1].color();
if (i_at(x, y).size() > 1)
invert = !invert;
sym = i_at(x, y)[i_at(x, y).size() - 1].symbol();
}
}
if (invert)
mvwputch_inv(w, j, k, tercol, sym);
else if (hi)
mvwputch_hi (w, j, k, tercol, sym);
else
mvwputch (w, j, k, tercol, sym);
}