diff options
-rw-r--r-- | src/cmd4.c | 60 | ||||
-rw-r--r-- | src/cmd6.c | 10 | ||||
-rw-r--r-- | src/generate.c | 2 | ||||
-rw-r--r-- | src/skills.c | 13 | ||||
-rw-r--r-- | src/wild.c | 8 |
5 files changed, 49 insertions, 44 deletions
@@ -2368,10 +2368,10 @@ void do_cmd_visuals(void) /* Analyze */ if (i == 'n') r = (r + max_r_idx + 1) % max_r_idx; if (i == 'N') r = (r + max_r_idx - 1) % max_r_idx; - if (i == 'a') r_ptr->x_attr = (byte)(ca + 1); - if (i == 'A') r_ptr->x_attr = (byte)(ca - 1); - if (i == 'c') r_ptr->x_char = (byte)(cc + 1); - if (i == 'C') r_ptr->x_char = (byte)(cc - 1); + if (i == 'a') r_ptr->x_attr = (ca + 1); + if (i == 'A') r_ptr->x_attr = (ca - 1); + if (i == 'c') r_ptr->x_char = (cc + 1); + if (i == 'C') r_ptr->x_char = (cc - 1); } } @@ -2388,10 +2388,10 @@ void do_cmd_visuals(void) { object_kind *k_ptr = &k_info[k]; - byte da = (byte)k_ptr->d_attr; - char dc = (byte)k_ptr->d_char; - byte ca = (byte)k_ptr->x_attr; - char cc = (byte)k_ptr->x_char; + byte da = k_ptr->d_attr; + char dc = k_ptr->d_char; + byte ca = k_ptr->x_attr; + char cc = k_ptr->x_char; /* Label the object */ Term_putstr(5, 17, -1, TERM_WHITE, @@ -2437,10 +2437,10 @@ void do_cmd_visuals(void) /* Analyze */ if (i == 'n') k = (k + max_k_idx + 1) % max_k_idx; if (i == 'N') k = (k + max_k_idx - 1) % max_k_idx; - if (i == 'a') k_info[k].x_attr = (byte)(ca + 1); - if (i == 'A') k_info[k].x_attr = (byte)(ca - 1); - if (i == 'c') k_info[k].x_char = (byte)(cc + 1); - if (i == 'C') k_info[k].x_char = (byte)(cc - 1); + if (i == 'a') k_info[k].x_attr = (ca + 1); + if (i == 'A') k_info[k].x_attr = (ca - 1); + if (i == 'c') k_info[k].x_char = (cc + 1); + if (i == 'C') k_info[k].x_char = (cc - 1); } } @@ -2457,10 +2457,10 @@ void do_cmd_visuals(void) { feature_type *f_ptr = &f_info[f]; - byte da = (byte)f_ptr->d_attr; - char dc = (byte)f_ptr->d_char; - byte ca = (byte)f_ptr->x_attr; - char cc = (byte)f_ptr->x_char; + byte da = f_ptr->d_attr; + char dc = f_ptr->d_char; + byte ca = f_ptr->x_attr; + char cc = f_ptr->x_char; /* Label the object */ Term_putstr(5, 17, -1, TERM_WHITE, @@ -2506,10 +2506,10 @@ void do_cmd_visuals(void) /* Analyze */ if (i == 'n') f = (f + max_f_idx + 1) % max_f_idx; if (i == 'N') f = (f + max_f_idx - 1) % max_f_idx; - if (i == 'a') f_info[f].x_attr = (byte)(ca + 1); - if (i == 'A') f_info[f].x_attr = (byte)(ca - 1); - if (i == 'c') f_info[f].x_char = (byte)(cc + 1); - if (i == 'C') f_info[f].x_char = (byte)(cc - 1); + if (i == 'a') f_info[f].x_attr = (ca + 1); + if (i == 'A') f_info[f].x_attr = (ca - 1); + if (i == 'c') f_info[f].x_char = (cc + 1); + if (i == 'C') f_info[f].x_char = (cc - 1); if (i == 'd') { f_info[f].x_char = f_ptr->d_char; @@ -2734,16 +2734,16 @@ void do_cmd_colors(void) if (i == ESCAPE) break; /* Analyze */ - if (i == 'n') a = (byte)(a + 1); - if (i == 'N') a = (byte)(a - 1); - if (i == 'k') angband_color_table[a][0] = (byte)(angband_color_table[a][0] + 1); - if (i == 'K') angband_color_table[a][0] = (byte)(angband_color_table[a][0] - 1); - if (i == 'r') angband_color_table[a][1] = (byte)(angband_color_table[a][1] + 1); - if (i == 'R') angband_color_table[a][1] = (byte)(angband_color_table[a][1] - 1); - if (i == 'g') angband_color_table[a][2] = (byte)(angband_color_table[a][2] + 1); - if (i == 'G') angband_color_table[a][2] = (byte)(angband_color_table[a][2] - 1); - if (i == 'b') angband_color_table[a][3] = (byte)(angband_color_table[a][3] + 1); - if (i == 'B') angband_color_table[a][3] = (byte)(angband_color_table[a][3] - 1); + if (i == 'n') a = (a + 1); + if (i == 'N') a = (a - 1); + if (i == 'k') angband_color_table[a][0] = (angband_color_table[a][0] + 1); + if (i == 'K') angband_color_table[a][0] = (angband_color_table[a][0] - 1); + if (i == 'r') angband_color_table[a][1] = (angband_color_table[a][1] + 1); + if (i == 'R') angband_color_table[a][1] = (angband_color_table[a][1] - 1); + if (i == 'g') angband_color_table[a][2] = (angband_color_table[a][2] + 1); + if (i == 'G') angband_color_table[a][2] = (angband_color_table[a][2] - 1); + if (i == 'b') angband_color_table[a][3] = (angband_color_table[a][3] + 1); + if (i == 'B') angband_color_table[a][3] = (angband_color_table[a][3] - 1); /* Hack -- react to changes */ Term_xtra(TERM_XTRA_REACT, 0); @@ -4677,7 +4677,7 @@ int ring_of_power() /* Rewrite this -- pelpel */ if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), (plev > 47 ? SUMMON_HI_UNDEAD_NO_UNIQUES : SUMMON_UNDEAD), - (bool_)(((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE))) + (((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE))) { msg_print("Cold winds begin to blow around you, " "carrying with them the stench of decay..."); @@ -5677,7 +5677,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item) else { if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), - SUMMON_THUNDERLORD, (bool_)(plev == 50 ? TRUE : FALSE))) + SUMMON_THUNDERLORD, (plev == 50 ? TRUE : FALSE))) { msg_print("A Thunderlord comes from thin air!"); msg_print("'I will help you in your difficult task.'"); @@ -6372,7 +6372,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item) else { if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), - SUMMON_ELEMENTAL, (bool_)(plev == 50 ? TRUE : FALSE))) + SUMMON_ELEMENTAL, (plev == 50 ? TRUE : FALSE))) { msg_print("An elemental materialises..."); msg_print("It seems obedient to you."); @@ -6398,7 +6398,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item) else { if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), - SUMMON_DEMON, (bool_)(plev == 50 ? TRUE : FALSE))) + SUMMON_DEMON, (plev == 50 ? TRUE : FALSE))) { msg_print("The area fills with a stench of sulphur and brimstone."); msg_print("'What is thy bidding... Master?'"); @@ -6426,7 +6426,7 @@ const char *activation_aux(object_type * o_ptr, bool_ doit, int item) { if (summon_specific_friendly(p_ptr->py, p_ptr->px, ((plev * 3) / 2), (plev > 47 ? SUMMON_HI_UNDEAD_NO_UNIQUES : SUMMON_UNDEAD), - (bool_)(((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE))) + (((plev > 24) && (randint(3) == 1)) ? TRUE : FALSE))) { msg_print("Cold winds begin to blow around you, carrying with them the stench of decay..."); msg_print("Ancient, long-dead forms arise from the ground to serve you!"); diff --git a/src/generate.c b/src/generate.c index 652d2bee..b06129ab 100644 --- a/src/generate.c +++ b/src/generate.c @@ -1006,7 +1006,7 @@ static void place_random_door(int y, int x) else { /* Create jammed door */ - cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x08 + (byte)rand_int(8)); + cave_set_feat(y, x, FEAT_DOOR_HEAD + 0x08 + rand_int(8)); } } diff --git a/src/skills.c b/src/skills.c index 12d5da56..900b6452 100644 --- a/src/skills.c +++ b/src/skills.c @@ -37,9 +37,14 @@ void increase_skill(int i, s16b *invest) if (((s_info[i].value + s_info[i].mod) / SKILL_STEP) >= (p_ptr->lev + max_skill_overage + 1)) { int hgt, wid; + char buf[256]; + + sprintf(buf, + "Cannot raise a skill value above " FMTs32b " + player level.", + max_skill_overage); Term_get_size(&wid, &hgt); - msg_box(format("Cannot raise a skill value above %i + player level.", max_skill_overage), (int)(hgt / 2), (int)(wid / 2)); + msg_box(buf, hgt / 2, wid / 2); return; } @@ -576,7 +581,7 @@ void do_cmd_skill() flush(); /* Ask we can commit the change */ - if (msg_box("Save and use these skill values? (y/n)", (int)(hgt / 2), (int)(wid / 2)) != 'y') + if (msg_box("Save and use these skill values? (y/n)", hgt / 2, wid / 2) != 'y') { /* User declines -- restore the skill values before exiting */ @@ -1566,7 +1571,7 @@ void gain_ability(int ab) if (!can_learn_ability(ab)) { - msg_box("You cannot learn this ability.", (int)(hgt / 2), (int)(wid / 2)); + msg_box("You cannot learn this ability.", hgt / 2, wid / 2); return; } @@ -1574,7 +1579,7 @@ void gain_ability(int ab) flush(); /* Ask we can commit the change */ - if (msg_box("Learn this ability(this is permanent)? (y/n)", (int)(hgt / 2), (int)(wid / 2)) != 'y') + if (msg_box("Learn this ability(this is permanent)? (y/n)", hgt / 2, wid / 2) != 'y') { return; } @@ -191,10 +191,10 @@ int generate_area(int y, int x, bool_ border, bool_ corner, bool_ refresh) * ToDo: calculate the medium height of the adjacent * terrains for every corner. */ - cave_set_feat(1, 1, (byte)rand_int(MAX_WILD_TERRAIN)); - cave_set_feat(MAX_HGT - 2, 1, (byte)rand_int(MAX_WILD_TERRAIN)); - cave_set_feat(1, MAX_WID - 2, (byte)rand_int(MAX_WILD_TERRAIN)); - cave_set_feat(MAX_HGT - 2, MAX_WID - 2, (byte)rand_int(MAX_WILD_TERRAIN)); + cave_set_feat(1, 1, rand_int(MAX_WILD_TERRAIN)); + cave_set_feat(MAX_HGT - 2, 1, rand_int(MAX_WILD_TERRAIN)); + cave_set_feat(1, MAX_WID - 2, rand_int(MAX_WILD_TERRAIN)); + cave_set_feat(MAX_HGT - 2, MAX_WID - 2, rand_int(MAX_WILD_TERRAIN)); if (!corner) { |