Esempio n. 1
0
void mvwputch_inv(WINDOW* w, int y, int x, nc_color FG, long ch)
{
 nc_color HC = invert_color(FG);
 wattron(w, HC);
 mvwaddch(w, y, x, ch);
 wattroff(w, HC);
}
Esempio n. 2
0
void mvputch_inv(int y, int x, nc_color FG, long ch)
{
 nc_color HC = invert_color(FG);
 attron(HC);
 mvaddch(y, x, ch);
 attroff(HC);
}
nc_color vehicle::part_color( const int p, const bool exact ) const
{
    if( p < 0 || p >= ( int )parts.size() ) {
        return c_black;
    }

    nc_color col;

    int parm = -1;

    //If armoring is present and the option is set, it colors the visible part
    if( get_option<bool>( "VEHICLE_ARMOR_COLOR" ) ) {
        parm = part_with_feature( p, VPFLAG_ARMOR, false );
    }

    if( parm >= 0 ) {
        col = part_info( parm ).color;
    } else {
        const int displayed_part = exact ? p : part_displayed_at( parts[p].mount.x, parts[p].mount.y );

        if( displayed_part < 0 || displayed_part >= ( int )parts.size() ) {
            return c_black;
        }
        if( parts[displayed_part].blood > 200 ) {
            col = c_red;
        } else if( parts[displayed_part].blood > 0 ) {
            col = c_light_red;
        } else if( parts[displayed_part].is_broken() ) {
            col = part_info( displayed_part ).color_broken;
        } else {
            col = part_info( displayed_part ).color;
        }

    }

    if( exact ) {
        return col;
    }

    // curtains turn windshields gray
    int curtains = part_with_feature( p, VPFLAG_CURTAIN, false );
    if( curtains >= 0 ) {
        if( part_with_feature( p, VPFLAG_WINDOW, true ) >= 0 && !parts[curtains].open ) {
            col = part_info( curtains ).color;
        }
    }

    //Invert colors for cargo parts with stuff in them
    int cargo_part = part_with_feature( p, VPFLAG_CARGO );
    if( cargo_part > 0 && !get_items( cargo_part ).empty() ) {
        return invert_color( col );
    } else {
        return col;
    }
}
Esempio n. 4
0
nc_color monster::color_with_effects() const
{
    nc_color ret = type->color;
    if (has_effect("beartrap") || has_effect("stunned") || has_effect("downed") || has_effect("tied")) {
        ret = hilite(ret);
    }
    if (has_effect("pacified")) {
        ret = invert_color(ret);
    }
    if (has_effect("onfire")) {
        ret = red_background(ret);
    }
    return ret;
}
Esempio n. 5
0
/*
flip sides ?
*/
void ENUMERATOR::check_flip() {
    int i,pic;
    int count[2] = {0,0},vcount[2] = {0,0};

    /*check whether to switch sides*/
    for(i = 0;i < n_piece; i++) {
        pic = piece[i];
        count[COLOR(pic)]++;
        vcount[COLOR(pic)] += piece_v[pic];
    }

    if(count[white] > count[black]);
    else if(count[white] == count[black] 
        && vcount[white] >= vcount[black]);
    else  {
        player = invert(player);
        for(i = 0;i < n_piece;i++) {
            piece[i] = invert_color(piece[i]);
            square[i] = MIRRORR64(square[i]);
        }
    }

}