/
LIB3/
LIB3/D/ADMIN/
LIB3/D/ADMIN/OBJ/
LIB3/D/ADMIN/ROOM/W/
LIB3/D/HOME/
LIB3/D/HOME/CITY/ARENA/
LIB3/D/HOME/CITY/ITEMS/
LIB3/D/HOME/CITY/POSTOFFI/
LIB3/DOC/
LIB3/GLOBAL/SPECIAL/
LIB3/GLOBAL/VIRTUAL/
LIB3/NET/
LIB3/NET/CONFIG/
LIB3/NET/DAEMON/CHARS/
LIB3/NET/GOPHER/
LIB3/NET/INHERIT/
LIB3/NET/OBJ/
LIB3/NET/SAVE/
LIB3/NET/VIRTUAL/
LIB3/OBJ/B_DAY/
LIB3/OBJ/HANDLERS/TERM_TYP/
LIB3/PLAYERS/B/
LIB3/PLAYERS/N/
LIB3/ROOM/
LIB3/SAVE/
LIB3/SAVE/BOARDS/
LIB3/SAVE/ENVIRON/
LIB3/SAVE/POST/
LIB3/STD/COMMANDS/SHADOWS/
LIB3/STD/CREATOR/
LIB3/STD/DOM/
LIB3/STD/EFFECTS/
LIB3/STD/EFFECTS/HEALING/
LIB3/STD/EFFECTS/OTHER/
LIB3/STD/EFFECTS/POISONS/
LIB3/STD/ENVIRON/
LIB3/STD/GUILDS/
LIB3/STD/LIQUIDS/
LIB3/STD/ROOM/
LIB3/STD/TRIGGER/SHADOW/
LIB3/W/
LIB3/W/BANNOR/
LIB3/W/NEWSTYLE/
#pragma save_binary
int     cond, max_cond, lowest_cond;

void    create()
{
    max_cond = 1;
}

/* This should be masked by the object */
void    break_me()
{
    this_object()->dest_me();
}

string  cond_string()
{
    string  tit;

    if( living( this_object() ) )
	tit = this_object()->query_pronoun();
    else
	tit = "It ";
    switch( (100 * cond) / max_cond )
    {
	case 0:
	    return tit + "is ruined.\n";
	case 1..10:
	    return tit + "is in terrible condition.\n";
	case 11..20:
	    return tit + "is in very bad condition.\n";
	case 21..30:
	    return tit + "is in bad condition.\n";
	case 31..40:
	    return tit + "is poor condition.\n";
	case 51..60:
	    return tit + "is in average condition.\n";
	case 61..70:
	    return tit + "is in reasonable condition.\n";
	case 71..80:
	    return tit + "is in good condition.\n";
	case 81..90:
	    return tit + "is in very good condition.\n";
	case 91..99:
	    return tit + "is in excellent condition.\n";
	case 100:
	    return tit + "is in perfect condition.\n";
	default:
	    return "";
    }
}

int     query_cond()
{
    return cond;
}
void    set_cond( int i )
{
    cond = i;
    if( cond < lowest_cond )
	lowest_cond = cond;
    if( cond > max_cond )
	max_cond = cond;
    if( cond <= 0 )
    {
	this_object()->break_me();
	return 0;
    }
}
int     adjust_cond( int i )
{
    cond += i;
    if( cond < lowest_cond )
	lowest_cond = cond;
    if( cond > max_cond )
	cond = max_cond;
    if( cond <= 0 )
    {
	this_object()->break_me();
	return 0;
    }
    return cond;
}

void    set_lowest_cond( int i )
{
    lowest_cond = i;
}
int     query_lowest_cond()
{
    return lowest_cond;
}

void    set_max_cond( int i )
{
    max_cond = i;
}
int     query_max_cond()
{
    return max_cond;
}

int     set_percentage( int i )
{
    if( i > 100 )
	i = 100;
    cond = (max_cond * i) / 100;
    lowest_cond = (cond * (random( 30 ) + 70)) / 100;
}