… | |
… | |
948 | if (op->stats.maxsp > 1000) |
948 | if (op->stats.maxsp > 1000) |
949 | { /*higher capacity crystals */ |
949 | { /*higher capacity crystals */ |
950 | i = (op->stats.maxsp % 1000) / 100; |
950 | i = (op->stats.maxsp % 1000) / 100; |
951 | |
951 | |
952 | if (i) |
952 | if (i) |
953 | buf.printf ("(capacity %d.%dk). It is ", op->stats.maxsp / 1000, i); |
953 | buf.printf ("(capacity %d.%dk; it is ", op->stats.maxsp / 1000, i); |
954 | else |
954 | else |
955 | buf.printf ("(capacity %dk). It is ", op->stats.maxsp / 1000); |
955 | buf.printf ("(capacity %dk; it is ", op->stats.maxsp / 1000); |
956 | } |
956 | } |
957 | else |
957 | else |
958 | buf.printf ("(capacity %d). It is ", op->stats.maxsp); |
958 | buf.printf ("(capacity %d; it is ", op->stats.maxsp); |
959 | |
959 | |
960 | i = (op->stats.sp * 10) / op->stats.maxsp; |
960 | i = (op->stats.sp * 10) / op->stats.maxsp; |
961 | if (op->stats.sp == 0) |
961 | if (op->stats.sp == 0) |
962 | buf << "empty."; |
962 | buf << "empty"; |
963 | else if (i == 0) |
963 | else if (i == 0) |
964 | buf << "almost empty."; |
964 | buf << "almost empty"; |
965 | else if (i < 3) |
965 | else if (i < 3) |
966 | buf << "partially filled."; |
966 | buf << "partially filled"; |
967 | else if (i < 6) |
967 | else if (i < 6) |
968 | buf << "half full."; |
968 | buf << "half full"; |
969 | else if (i < 9) |
969 | else if (i < 9) |
970 | buf << "well charged."; |
970 | buf << "well charged"; |
971 | else if (op->stats.sp == op->stats.maxsp) |
971 | else if (op->stats.sp == op->stats.maxsp) |
972 | buf << "fully charged."; |
972 | buf << "fully charged"; |
973 | else |
973 | else |
974 | buf << "almost full."; |
974 | buf << "almost full"; |
|
|
975 | |
|
|
976 | buf << ')'; |
975 | break; |
977 | break; |
976 | |
978 | |
977 | case LAMP: |
979 | case LAMP: |
978 | { |
980 | { |
979 | int percent = ((double) 100 / op->arch->stats.food) * op->stats.food; |
981 | int percent = ((double) 100 / op->arch->stats.food) * op->stats.food; |