diff --git src/cmd-context.c src/cmd-context.c index 2a7a697..9acb27f 100644 --- src/cmd-context.c +++ src/cmd-context.c @@ -298,11 +298,23 @@ int context_menu_player(int mx, int my) item_tester_full = TRUE; /* Prompt for a command */ +#if 0 prt(format("(Inventory) Burden %d.%d lb (%d.%d lb %s). Item for command: ", p_ptr->total_weight / 10, p_ptr->total_weight % 10, abs(diff) / 10, abs(diff) % 10, (diff < 0 ? "overweight" : "remaining")), 0, 0); +#else + { + char o_weight[2][80]; + get_weight_str(o_weight[0], sizeof(o_weight)/2, p_ptr->total_weight, TRUE, FALSE); + get_weight_str(o_weight[1], sizeof(o_weight)/2, abs(diff), TRUE, FALSE); + prt(format("(Inventory) Burden %s kg (%s kg %s). Item for command: ", + o_weight[0], o_weight[1], + (diff < 0 ? "overweight" : "remaining")), + 0, 0); + } +#endif /* Get an item to use a context command on */ diff --git src/cmd3.c src/cmd3.c index 08f4f31..5b6ecb1 100644 --- src/cmd3.c +++ src/cmd3.c @@ -113,11 +113,23 @@ void do_cmd_inven(void) screen_save(); /* Prompt for a command */ +#if 0 prt(format("(Inventory) Burden %d.%d lb (%d.%d lb %s). Select Item: ", p_ptr->total_weight / 10, p_ptr->total_weight % 10, abs(diff) / 10, abs(diff) % 10, (diff < 0 ? "overweight" : "remaining")), 0, 0); +#else + { + char o_weight[2][80]; + get_weight_str(o_weight[0], sizeof(o_weight)/2, p_ptr->total_weight, TRUE, FALSE); + get_weight_str(o_weight[1], sizeof(o_weight)/2, abs(diff), TRUE, FALSE); + prt(format("(Inventory) Burden %s kg (%s kg %s). Item for command: ", + o_weight[0], o_weight[1], + (diff < 0 ? "overweight" : "remaining")), + 0, 0); + } +#endif /* Get an item to use a context command on (Display the inventory) */ if (get_item(&item, NULL, NULL, CMD_NULL, USE_EQUIP|USE_INVEN|USE_FLOOR|IS_HARMLESS)) { diff --git src/files.c src/files.c index 6009935..e34da09 100644 --- src/files.c +++ src/files.c @@ -614,8 +614,13 @@ static const char *show_depth(void) if (p_ptr->max_depth == 0) return "Town"; +#if 0 strnfmt(buffer, sizeof(buffer), "%d' (L%d)", p_ptr->max_depth * 50, p_ptr->max_depth); +#else + strnfmt(buffer, sizeof(buffer), "%dm (L%d)", + p_ptr->max_depth * 20, p_ptr->max_depth); +#endif return buffer; } @@ -781,9 +786,21 @@ static int get_panel(int oid, data_panel *panel, size_t size) P_I(TERM_L_BLUE, "Blows", "%y.%y/turn", i2u(p_ptr->state.num_blows / 100), i2u((p_ptr->state.num_blows / 10) % 10) ); P_I(TERM_L_BLUE, "Blow power", "%y.%yx", i2u(p_ptr->state.dam_multiplier / 100), i2u((p_ptr->state.dam_multiplier / 10) % 10) ); P_I(TERM_L_BLUE, "Shots", "%y/turn", i2u(p_ptr->state.num_shots), END ); +#if 0 P_I(TERM_L_BLUE, "Infra", "%y ft", i2u(p_ptr->state.see_infra * 10), END ); +#else + P_I(TERM_L_BLUE, "Infra", " %y m", i2u(p_ptr->state.see_infra * 2), END ); +#endif P_I(TERM_L_BLUE, "Speed", "%y", s2u(show_speed()), END ); +#if 0 P_I(TERM_L_BLUE, "Burden","%.1y lbs", f2u(p_ptr->total_weight/10.0F), END ); +#else + if (p_ptr->total_weight % 2 == 0) { + P_I(TERM_L_BLUE, "Burden","%.1y kg", f2u(p_ptr->total_weight/20.0F), END ); + } else { + P_I(TERM_L_BLUE, "Burden","%.2y kg", f2u(p_ptr->total_weight/20.0F), END ); + } +#endif assert(i == boundaries[3].page_rows); return ret; } @@ -872,8 +889,13 @@ static int get_panel(int oid, data_panel *panel, size_t size) assert(ret >= boundaries[5].page_rows); ret = boundaries[5].page_rows; P_I(TERM_L_BLUE, "Age", "%y", i2u(p_ptr->age), END ); +#if 0 P_I(TERM_L_BLUE, "Height", "%y", i2u(p_ptr->ht), END ); P_I(TERM_L_BLUE, "Weight", "%y", i2u(p_ptr->wt), END ); +#else + P_I(TERM_L_BLUE, "Height", "%y", i2u((p_ptr->ht*5)/2), END ); + P_I(TERM_L_BLUE, "Weight", "%y", i2u(p_ptr->wt/2), END ); +#endif P_I(TERM_L_BLUE, "Social", "%y", s2u(show_status()), END ); P_I(TERM_L_BLUE, "Maximize", "%y", c2u(OPT(birth_maximize) ? 'Y' : 'N'), END); #if 0 diff --git src/list-effects.h src/list-effects.h index 8317104..b534f54 100644 --- src/list-effects.h +++ src/list-effects.h @@ -74,7 +74,11 @@ EFFECT(RESTORE_ALL, FALSE, 15, "restores all your stats") EFFECT(RESTORE_ST_LEV, FALSE, 17, "restores all your stats and your experience points") +#if 0 EFFECT(TMD_INFRA, FALSE, 5, "extends your infravision by 50 feet for 4d25+100 turns") +#else +EFFECT(TMD_INFRA, FALSE, 5, "extends your infravision by 10 metres for 4d25+100 turns") +#endif EFFECT(TMD_SINVIS, FALSE, 7, "cures blindness and allows you to see invisible things for 2d6+12 turns") EFFECT(TMD_ESP, FALSE, 10, "cures blindness and gives you telepathy for 6d6+12 turns") diff --git src/monster/mon-lore.c src/monster/mon-lore.c index 06a0078..2e524a2 100644 --- src/monster/mon-lore.c +++ src/monster/mon-lore.c @@ -1549,9 +1549,15 @@ static void describe_monster_abilities(const monster_race *r_ptr, text_out("%s %s intruders, which %s may notice from ", wd_he[msex], act, wd_he[msex]); +#if 0 text_out_c(TERM_L_BLUE, "%d", (OPT(birth_small_range) ? 5 : 10) * r_ptr->aaf); text_out(" feet. "); +#else + text_out_c(TERM_L_BLUE, "%d", + (OPT(birth_small_range) ? 1 : 2) * r_ptr->aaf); + text_out(" metres. "); +#endif } /* Describe escorts */ @@ -1825,8 +1831,13 @@ static void describe_monster_movement(const monster_race *r_ptr, text_out(" is normally found "); text_out("at depths of "); +#if 0 text_out_c(colour, "%d", r_ptr->level * 50); text_out(" feet (level "); +#else + text_out_c(colour, "%d", r_ptr->level * 20); + text_out(" metres (level "); +#endif text_out_c(colour, "%d", r_ptr->level); text_out(")"); diff --git src/object/obj-desc.c src/object/obj-desc.c index 6d03091..cf094f0 100644 --- src/object/obj-desc.c +++ src/object/obj-desc.c @@ -753,3 +753,15 @@ size_t object_desc(char *buf, size_t max, const object_type *o_ptr, return end; } +void get_weight_str(char *str, int max_size, int weight, bool metric, bool fillzero) +{ + if (metric == TRUE) { + if (weight % 2 == 0 && fillzero == FALSE) { + strnfmt(str, max_size, "%d.%1d", weight / 20, (weight / 2) % 10); + } else { + strnfmt(str, max_size, "%d.%02d", weight / 20, (weight * 5) % 100); + } + } else { + strnfmt(str, max_size, "%d.%1d", weight / 10, weight % 10); + } +} diff --git src/object/obj-info.c src/object/obj-info.c index 183a220..fe59503 100644 --- src/object/obj-info.c +++ src/object/obj-info.c @@ -620,8 +620,13 @@ static bool describe_combat(textblock *tb, const object_type *o_ptr, /* Output the range */ textblock_append(tb, "Hits targets up to "); +#if 0 textblock_append_c(tb, TERM_L_GREEN, format("%d", tdis * 10)); textblock_append(tb, " feet away.\n"); +#else + textblock_append_c(tb, TERM_L_GREEN, format("%d", tdis * 2)); + textblock_append(tb, " metres away.\n"); +#endif } /* Describe damage */ @@ -916,8 +921,13 @@ static bool describe_origin(textblock *tb, const object_type *o_ptr) char origin_text[80]; if (o_ptr->origin_depth) +#if 0 strnfmt(origin_text, sizeof(origin_text), "%d feet (level %d)", o_ptr->origin_depth * 50, o_ptr->origin_depth); +#else + strnfmt(origin_text, sizeof(origin_text), "%d metres (level %d)", + o_ptr->origin_depth * 20, o_ptr->origin_depth); +#endif else my_strcpy(origin_text, "town", sizeof(origin_text)); diff --git src/object/obj-ui.c src/object/obj-ui.c index 2ba342c..1ca7093 100644 --- src/object/obj-ui.c +++ src/object/obj-ui.c @@ -74,6 +74,11 @@ static void show_obj_list(int num_obj, int num_head, char labels[50][80], if (mode & OLIST_PRICE) ex_width += 9; if (mode & OLIST_FAIL) ex_width += 10; +#if 1 + /* for metric, more digits needed */ + if (mode & OLIST_WEIGHT) ex_width += 1; +#endif + /* Determine beginning row and column */ if (in_term) { @@ -155,7 +160,11 @@ static void show_obj_list(int num_obj, int num_head, char labels[50][80], if (mode & OLIST_WEIGHT) { int weight = o_ptr->weight * o_ptr->number; +#if 0 strnfmt(tmp_val, sizeof(tmp_val), "%4d.%1d lb", weight / 10, weight % 10); +#else + strnfmt(tmp_val, sizeof(tmp_val), "%4d.%02d kg", weight / 20, (weight * 5) % 100); +#endif put_str(tmp_val, row + i, col + ex_offset_ctr); ex_offset_ctr += 9; } @@ -229,11 +238,23 @@ void show_inven(olist_detail_t mode) /* Include burden for term windows */ if (in_term) { +#if 0 strnfmt(labels[num_obj], sizeof(labels[num_obj]), "Burden %d.%d lb (%d.%d lb %s) ", p_ptr->total_weight / 10, p_ptr->total_weight % 10, abs(diff) / 10, abs(diff) % 10, (diff < 0 ? "overweight" : "remaining")); +#else + { + char o_weight[2][80]; + get_weight_str(o_weight[0], sizeof(o_weight)/2, p_ptr->total_weight, TRUE, FALSE); + get_weight_str(o_weight[1], sizeof(o_weight)/2, abs(diff), TRUE, FALSE); + strnfmt(labels[num_obj], sizeof(labels[num_obj]), + "Burden %s kg (%s kg %s) ", + o_weight[0], o_weight[1], + (diff < 0 ? "overweight" : "remaining")); + } +#endif objects[num_obj] = NULL; num_obj++; diff --git src/object/object.h src/object/object.h index 62386ca..4c12c0c 100644 --- src/object/object.h +++ src/object/object.h @@ -645,6 +645,8 @@ void show_equip(olist_detail_t mode); void show_floor(const int *floor_list, int floor_num, olist_detail_t mode); bool verify_item(const char *prompt, int item); bool get_item(int *cp, const char *pmt, const char *str, cmd_code cmd, int mode); +void get_weight_str(char *str, int max_size, + int weight, bool metric, bool fillzero); /* obj-util.c */ struct object_kind *objkind_get(int tval, int sval); diff --git src/store.c src/store.c index e02439c..9d9bfa2 100644 --- src/store.c +++ src/store.c @@ -1755,6 +1755,11 @@ static void store_display_recalc(menu_type *m) if (store->sidx != STORE_HOME) scr_places_x[LOC_WEIGHT] -= 10; +#if 1 + /* for metric, more digits needed */ + scr_places_x[LOC_WEIGHT] -= 1; +#endif + /* Then Y */ scr_places_y[LOC_OWNER] = 1; scr_places_y[LOC_HEADER] = 3; @@ -1816,7 +1821,11 @@ static void store_display_entry(menu_type *menu, int oid, bool cursor, int row, /* Show weights */ colour = curs_attrs[CURS_KNOWN][(int)cursor]; +#if 0 strnfmt(out_val, sizeof out_val, "%3d.%d lb", o_ptr->weight / 10, o_ptr->weight % 10); +#else + strnfmt(out_val, sizeof out_val, "%3d.%02d kg", o_ptr->weight / 20, (o_ptr->weight * 5) % 100); +#endif c_put_str(colour, out_val, row, scr_places_x[LOC_WEIGHT]); /* Describe an object (fully) in a store */ @@ -1863,7 +1872,12 @@ static void store_display_frame(void) put_str("Home Inventory", scr_places_y[LOC_HEADER], 1); /* Show weight header */ +#if 0 put_str("Weight", scr_places_y[LOC_HEADER], scr_places_x[LOC_WEIGHT] + 2); +#else + /* for metric, more digits needed */ + put_str("Weight", scr_places_y[LOC_HEADER], scr_places_x[LOC_WEIGHT] + 3); +#endif } /* Normal stores */ @@ -1883,7 +1897,12 @@ static void store_display_frame(void) put_str("Store Inventory", scr_places_y[LOC_HEADER], 1); /* Showing weight label */ +#if 0 put_str("Weight", scr_places_y[LOC_HEADER], scr_places_x[LOC_WEIGHT] + 2); +#else + /* for metric, more digits needed */ + put_str("Weight", scr_places_y[LOC_HEADER], scr_places_x[LOC_WEIGHT] + 3); +#endif /* Label the asking price (in stores) */ put_str("Price", scr_places_y[LOC_HEADER], scr_places_x[LOC_PRICE] + 4); diff --git src/wiz-spoil.c src/wiz-spoil.c index aac9a8d..7419e17 100644 --- src/wiz-spoil.c +++ src/wiz-spoil.c @@ -497,11 +497,22 @@ static void spoil_artifact(const char *fname) * artifact can appear, its rarity, its weight, and * its power rating. */ +#if 0 text_out("\nMin Level %u, Max Level %u, Generation chance %u, Power %d, %d.%d lbs\n", a_ptr->alloc_min[0], a_ptr->alloc_max[0], a_ptr->alloc_prob[0], object_power(i_ptr, FALSE, NULL, TRUE), (a_ptr->weight / 10), (a_ptr->weight % 10)); +#else + { + char o_weight[80]; + get_weight_str(o_weight, sizeof(o_weight), a_ptr->weight, TRUE, FALSE); + text_out("\nMin Level %u, Max Level %u, Generation chance %u, Power %d, %s kg\n", + a_ptr->alloc_min[0], a_ptr->alloc_max[0], + a_ptr->alloc_prob[0], object_power(i_ptr, FALSE, + NULL, TRUE), o_weight); + } +#endif for (k = 1; k < ART_ALLOC_MAX && a_ptr->alloc_prob[k]; k++) text_out("Min Level %u, Max Level %u, Generation chance %u\n", diff --git src/xtra3.c src/xtra3.c index 63e385d..4215a22 100644 --- src/xtra3.c +++ src/xtra3.c @@ -478,8 +478,13 @@ static void prt_depth(int row, int col) } else { +#if 0 strnfmt(depths, sizeof(depths), "%d' (L%d)", p_ptr->depth * 50, p_ptr->depth); +#else + strnfmt(depths, sizeof(depths), "%dm (L%d)", + p_ptr->depth * 20, p_ptr->depth); +#endif } /* Right-Adjust the "depth", and clear old values */