• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

変愚蛮怒のメインリポジトリです


Commit MetaInfo

Revisione70ba712cf4b753e7d3876f60980c87cfeec09e3 (tree)
Time2019-01-11 21:32:26
AuthorDeskull <deskull@user...>
CommiterDeskull

Log Message

[Refactor] #37353 マジックナンバー修正(A_MAX) / Fix magic number (A_MAX).

Change Summary

Incremental Difference

--- a/src/birth.c
+++ b/src/birth.c
@@ -506,8 +506,6 @@ static void birth_quit(void)
506506 static void show_help(cptr helpfile)
507507 {
508508 screen_save();
509-
510- /* Peruse the help file */
511509 (void)show_file(TRUE, helpfile, NULL, 0, 0);
512510 screen_load();
513511 }
@@ -837,7 +835,7 @@ static bool get_player_realms(void)
837835
838836 roff_to_buf(realm_jouhou[technic2magic(p_ptr->realm2)-1], 74, temp, sizeof(temp));
839837 t = temp;
840- for (i = 0; i < 6; i++)
838+ for (i = 0; i < A_MAX; i++)
841839 {
842840 if(t[0] == 0)
843841 break;
@@ -891,7 +889,7 @@ static void save_prev_data(birther *birther_ptr)
891889 birther_ptr->au = p_ptr->au;
892890
893891 /* Save the stats */
894- for (i = 0; i < 6; i++)
892+ for (i = 0; i < A_MAX; i++)
895893 {
896894 birther_ptr->stat_max[i] = p_ptr->stat_max[i];
897895 birther_ptr->stat_max_max[i] = p_ptr->stat_max_max[i];
@@ -950,7 +948,7 @@ static void load_prev_data(bool swap)
950948 p_ptr->au = previous_char.au;
951949
952950 /* Load the stats */
953- for (i = 0; i < 6; i++)
951+ for (i = 0; i < A_MAX; i++)
954952 {
955953 p_ptr->stat_cur[i] = p_ptr->stat_max[i] = previous_char.stat_max[i];
956954 p_ptr->stat_max_max[i] = previous_char.stat_max_max[i];
@@ -1106,15 +1104,14 @@ static void get_stats(void)
11061104 */
11071105 void get_max_stats(void)
11081106 {
1109- int i, j;
1110-
1111- int dice[6];
1107+ int i, j;
1108+ int dice[6];
11121109
11131110 /* Roll and verify some stats */
11141111 while (TRUE)
11151112 {
11161113 /* Roll some dice */
1117- for (j = i = 0; i < 6; i++)
1114+ for (j = i = 0; i < A_MAX; i++)
11181115 {
11191116 /* Roll the dice */
11201117 dice[i] = randint1(7);
@@ -1128,7 +1125,7 @@ void get_max_stats(void)
11281125 }
11291126
11301127 /* Acquire the stats */
1131- for (i = 0; i < 6; i++)
1128+ for (i = 0; i < A_MAX; i++)
11321129 {
11331130 BASE_STATUS max_max = 18 + 60 + dice[i]*10;
11341131
@@ -1513,7 +1510,7 @@ static void get_money(void)
15131510 gold += 2000;
15141511
15151512 /* Process the stats */
1516- for (i = 0; i < 6; i++)
1513+ for (i = 0; i < A_MAX; i++)
15171514 {
15181515 /* Mega-Hack -- reduce gold for high stats */
15191516 if (p_ptr->stat_max[i] >= 18 + 50) gold -= 300;
@@ -1554,7 +1551,7 @@ static void birth_put_stats(void)
15541551 {
15551552 col = 42;
15561553 /* Put the stats (and percents) */
1557- for (i = 0; i < 6; i++)
1554+ for (i = 0; i < A_MAX; i++)
15581555 {
15591556 /* Race/Class bonus */
15601557 j = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
@@ -3025,7 +3022,7 @@ static bool get_stat_limits(void)
30253022 put_str(_(" 基本値 種族 職業 性格 合計値 最大値", " Base Rac Cla Per Total Maximum"), 13, 10);
30263023
30273024 /* Output the maximum stats */
3028- for (i = 0; i < 6; i++)
3025+ for (i = 0; i < A_MAX; i++)
30293026 {
30303027 /* Reset the "success" counter */
30313028 stat_match[i] = 0;
@@ -3085,7 +3082,7 @@ static bool get_stat_limits(void)
30853082 {
30863083 c_put_str(TERM_WHITE, _("決定する", "Accept"), 21, 35);
30873084 }
3088- else if(os < 6)
3085+ else if(os < A_MAX)
30893086 {
30903087 c_put_str(TERM_WHITE, cur, 14 + os, 10);
30913088 }
@@ -3144,7 +3141,7 @@ static bool get_stat_limits(void)
31443141 break;
31453142 case '2':
31463143 case 'j':
3147- if (cs < 6) cs++;
3144+ if (cs < A_MAX) cs++;
31483145 break;
31493146 case '4':
31503147 case 'h':
@@ -3218,7 +3215,7 @@ static bool get_stat_limits(void)
32183215 if(c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == 6))break;
32193216 }
32203217
3221- for (i = 0; i < 6; i++)
3218+ for (i = 0; i < A_MAX; i++)
32223219 {
32233220 /* Save the minimum stat */
32243221 stat_limit[i] = (s16b)cval[i];
@@ -4083,7 +4080,7 @@ static bool player_birth_aux(void)
40834080 roff_to_buf(seikaku_jouhou[p_ptr->pseikaku], 74, temp, sizeof(temp));
40844081 t = temp;
40854082
4086- for (i = 0; i< 6; i++)
4083+ for (i = 0; i< A_MAX; i++)
40874084 {
40884085 if(t[0] == 0)
40894086 break;
@@ -4215,7 +4212,7 @@ static bool player_birth_aux(void)
42154212
42164213
42174214 /* Put the minimal stats */
4218- for (i = 0; i < 6; i++)
4215+ for (i = 0; i < A_MAX; i++)
42194216 {
42204217 int j, m;
42214218
@@ -4252,7 +4249,7 @@ static bool player_birth_aux(void)
42524249
42534250 if (autoroller)
42544251 {
4255- for (i = 0; i < 6; i++)
4252+ for (i = 0; i < A_MAX; i++)
42564253 {
42574254 stat_match[i] = 0;
42584255 }
@@ -4262,7 +4259,7 @@ static bool player_birth_aux(void)
42624259 if (autoroller)
42634260 {
42644261 /* Check and count acceptable stats */
4265- for (i = 0; i < 6; i++)
4262+ for (i = 0; i < A_MAX; i++)
42664263 {
42674264 /* This stat is okay */
42684265 if (p_ptr->stat_max[i] >= stat_limit[i])
@@ -4691,7 +4688,7 @@ void dump_yourself(FILE *fff)
46914688 fprintf(fff, _("性格: %s\n", "Pesonality: %s\n"), seikaku_info[p_ptr->pseikaku].title);
46924689
46934690 t = temp;
4694- for (i = 0; i < 6; i++)
4691+ for (i = 0; i < A_MAX; i++)
46954692 {
46964693 if(t[0] == 0)
46974694 break;
@@ -4705,7 +4702,7 @@ void dump_yourself(FILE *fff)
47054702 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[p_ptr->realm1]);
47064703
47074704 t = temp;
4708- for (i = 0; i < 6; i++)
4705+ for (i = 0; i < A_MAX; i++)
47094706 {
47104707 if(t[0] == 0)
47114708 break;
@@ -4720,7 +4717,7 @@ void dump_yourself(FILE *fff)
47204717 fprintf(fff, _("魔法: %s\n", "Realm: %s\n"), realm_names[p_ptr->realm2]);
47214718
47224719 t = temp;
4723- for (i = 0; i < 6; i++)
4720+ for (i = 0; i < A_MAX; i++)
47244721 {
47254722 if(t[0] == 0)
47264723 break;
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1839,7 +1839,7 @@ void get_bloody_moon_flags(object_type *o_ptr)
18391839 for (i = 0; i < 2; i++)
18401840 {
18411841 int tmp = randint0(11);
1842- if (tmp < 6) add_flag(o_ptr->art_flags, TR_STR + tmp);
1842+ if (tmp < A_MAX) add_flag(o_ptr->art_flags, TR_STR + tmp);
18431843 else add_flag(o_ptr->art_flags, TR_STEALTH + tmp - 6);
18441844 }
18451845 }
--- a/src/cmd4.c
+++ b/src/cmd4.c
@@ -7672,7 +7672,7 @@ static void do_cmd_knowledge_stat(void)
76727672 else fprintf(fff, "Your current Life Rating is ???.\n\n");
76737673 fprintf(fff, "Limits of maximum stats\n\n");
76747674 #endif
7675- for (v_nr = 0; v_nr < 6; v_nr++)
7675+ for (v_nr = 0; v_nr < A_MAX; v_nr++)
76767676 {
76777677 if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
76787678 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
--- a/src/effects.c
+++ b/src/effects.c
@@ -3936,7 +3936,7 @@ void do_poly_self(void)
39363936 /* Harmful deformity */
39373937 power -= 15;
39383938
3939- while (tmp < 6)
3939+ while (tmp < A_MAX)
39403940 {
39413941 if (one_in_(2))
39423942 {
@@ -3987,7 +3987,7 @@ void do_poly_self(void)
39873987 power -= 20;
39883988 msg_format(_("%sの構成が変化した!", "Your internal organs are rearranged!"), p_ptr->prace == RACE_ANDROID ? "機械" : "内臓");
39893989
3990- while (tmp < 6)
3990+ while (tmp < A_MAX)
39913991 {
39923992 (void)dec_stat(tmp, randint1(6) + 6, one_in_(3));
39933993 tmp++;
--- a/src/files.c
+++ b/src/files.c
@@ -3533,7 +3533,7 @@ static void display_player_stat_info(void)
35333533 c_put_str(TERM_YELLOW, _("現在", "Current"), row, stat_col+35);
35343534
35353535 /* Display the stats */
3536- for (i = 0; i < 6; i++)
3536+ for (i = 0; i < A_MAX; i++)
35373537 {
35383538 int r_adj;
35393539
@@ -3630,7 +3630,7 @@ static void display_player_stat_info(void)
36303630 object_flags_known(o_ptr, flgs);
36313631
36323632 /* Initialize color based of sign of pval. */
3633- for (stat = 0; stat < 6; stat++)
3633+ for (stat = 0; stat < A_MAX; stat++)
36343634 {
36353635 /* Default */
36363636 a = TERM_SLATE;
@@ -3689,7 +3689,7 @@ static void display_player_stat_info(void)
36893689 player_flags(flgs);
36903690
36913691 /* Check stats */
3692- for (stat = 0; stat < 6; stat++)
3692+ for (stat = 0; stat < A_MAX; stat++)
36933693 {
36943694 /* Default */
36953695 a = TERM_SLATE;
@@ -3852,7 +3852,7 @@ void display_player(int mode)
38523852
38533853
38543854 /* Display the stats */
3855- for (i = 0; i < 6; i++)
3855+ for (i = 0; i < A_MAX; i++)
38563856 {
38573857 /* Special treatment of "injured" stats */
38583858 if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
@@ -4807,7 +4807,7 @@ static void dump_aux_virtues(FILE *fff)
48074807 else fprintf(fff, "Your current Life Rating is ???.\n\n");
48084808 fprintf(fff, "Limits of maximum stats\n");
48094809 #endif
4810- for (v_nr = 0; v_nr < 6; v_nr++)
4810+ for (v_nr = 0; v_nr < A_MAX; v_nr++)
48114811 {
48124812 if ((p_ptr->knowledge & KNOW_STAT) || p_ptr->stat_max[v_nr] == p_ptr->stat_max_max[v_nr]) fprintf(fff, "%s 18/%d\n", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
48134813 else fprintf(fff, "%s ???\n", stat_names[v_nr]);
--- a/src/floor-save.c
+++ b/src/floor-save.c
@@ -530,7 +530,7 @@ static void place_pet(void)
530530 int j;
531531 POSITION d;
532532
533- for (d = 1; d < 6; d++)
533+ for (d = 1; d < A_MAX; d++)
534534 {
535535 for (j = 1000; j > 0; j--)
536536 {
--- a/src/init1.c
+++ b/src/init1.c
@@ -3000,7 +3000,7 @@ errr parse_r_info(char *buf, header *head)
30003000 {
30013001 int id, ds, dd;
30023002 /* Find the next empty blow slot (if any) */
3003- for (i = 0; i < 6; i++) if (r_ptr->reinforce_id[i] == 0) break;
3003+ for (i = 0; i < A_MAX; i++) if (r_ptr->reinforce_id[i] == 0) break;
30043004
30053005 /* Oops, no more slots */
30063006 if (i == 6) return (1);
--- a/src/init2.c
+++ b/src/init2.c
@@ -1875,7 +1875,7 @@ static errr init_other(void)
18751875 * Window 1 : Display messages
18761876 * Window 2 : Display inven/equip
18771877 */
1878- window_flag[1] = 1L << 6;
1878+ window_flag[1] = 1L << A_MAX;
18791879 window_flag[2] = 1L << 0;
18801880
18811881
--- a/src/load.c
+++ b/src/load.c
@@ -1682,8 +1682,8 @@ static void load_quick_start(void)
16821682 rd_s16b(&previous_char.sc);
16831683 rd_s32b(&previous_char.au);
16841684
1685- for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max[i]);
1686- for (i = 0; i < 6; i++) rd_s16b(&previous_char.stat_max_max[i]);
1685+ for (i = 0; i < A_MAX; i++) rd_s16b(&previous_char.stat_max[i]);
1686+ for (i = 0; i < A_MAX; i++) rd_s16b(&previous_char.stat_max_max[i]);
16871687
16881688 for (i = 0; i < PY_MAX_LEVEL; i++)
16891689 {
@@ -1770,9 +1770,9 @@ static void rd_extra(void)
17701770 rd_s16b(&p_ptr->wt);
17711771
17721772 /* Read the stat info */
1773- for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_max[i]);
1774- for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_max_max[i]);
1775- for (i = 0; i < 6; i++) rd_s16b(&p_ptr->stat_cur[i]);
1773+ for (i = 0; i < A_MAX; i++) rd_s16b(&p_ptr->stat_max[i]);
1774+ for (i = 0; i < A_MAX; i++) rd_s16b(&p_ptr->stat_max_max[i]);
1775+ for (i = 0; i < A_MAX; i++) rd_s16b(&p_ptr->stat_cur[i]);
17761776
17771777 strip_bytes(24);
17781778 rd_s32b(&p_ptr->au);
--- a/src/mane.c
+++ b/src/mane.c
@@ -811,7 +811,7 @@ static bool use_mane(int spell)
811811 int k;
812812 if (!target_set(TARGET_KILL)) return FALSE;
813813 msg_print(_("モンスターを召喚した!", "You summon monsters!"));
814- for (k = 0;k < 6; k++)
814+ for (k = 0;k < A_MAX; k++)
815815 summon_specific(-1, target_row, target_col, plev, 0, (mode | u_mode), '\0');
816816 break;
817817 }
@@ -820,7 +820,7 @@ static bool use_mane(int spell)
820820 int k;
821821 if (!target_set(TARGET_KILL)) return FALSE;
822822 msg_print(_("アリを召喚した。", "You summon ants."));
823- for (k = 0;k < 6; k++)
823+ for (k = 0;k < A_MAX; k++)
824824 summon_specific(-1, target_row, target_col, plev, SUMMON_ANT, mode, '\0');
825825 break;
826826 }
@@ -829,7 +829,7 @@ static bool use_mane(int spell)
829829 int k;
830830 if (!target_set(TARGET_KILL)) return FALSE;
831831 msg_print(_("蜘蛛を召喚した。", "You summon spiders."));
832- for (k = 0;k < 6; k++)
832+ for (k = 0;k < A_MAX; k++)
833833 summon_specific(-1, target_row, target_col, plev, SUMMON_SPIDER, mode, '\0');
834834 break;
835835 }
@@ -892,7 +892,7 @@ static bool use_mane(int spell)
892892 int k;
893893 if (!target_set(TARGET_KILL)) return FALSE;
894894 msg_print(_("強力なアンデッドを召喚した!", "You summon greater undead!"));
895- for (k = 0;k < 6; k++)
895+ for (k = 0;k < A_MAX; k++)
896896 summon_specific(-1, target_row, target_col, plev, SUMMON_HI_UNDEAD, (mode | u_mode), '\0');
897897 break;
898898 }
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -2690,7 +2690,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
26902690 {
26912691 msg_print(_("あなたは以前ほど力強くなくなってしまった...。", "You're not as powerful as you used to be..."));
26922692
2693- for (k = 0; k < 6; k++)
2693+ for (k = 0; k < A_MAX; k++)
26942694 {
26952695 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
26962696 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
--- a/src/monster-process.c
+++ b/src/monster-process.c
@@ -2374,7 +2374,7 @@ void process_monster(MONSTER_IDX m_idx)
23742374 DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
23752375 BIT_FLAGS p_mode = is_pet(m_ptr) ? PM_FORCE_PET : 0L;
23762376
2377- for (k = 0; k < 6; k++)
2377+ for (k = 0; k < A_MAX; k++)
23782378 {
23792379 if (summon_specific(m_idx, m_ptr->fy, m_ptr->fx, rlev, SUMMON_MOLD, (PM_ALLOW_GROUP | p_mode), '\0'))
23802380 {
--- a/src/monster1.c
+++ b/src/monster1.c
@@ -258,7 +258,7 @@ static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
258258 flags7 = (r_ptr->flags7 & r_ptr->flags7);
259259 flagsr = (r_ptr->flagsr & r_ptr->r_flagsr);
260260
261- for(n = 0; n < 6; n++)
261+ for(n = 0; n < A_MAX; n++)
262262 {
263263 if(r_ptr->reinforce_id[n] > 0) reinforce = TRUE;
264264 }
@@ -738,7 +738,7 @@ static void roff_aux(MONRACE_IDX r_idx, BIT_FLAGS mode)
738738 #ifndef JP
739739 hooked_roff(" contain ");
740740 #endif
741- for(n = 0; n < 6; n++)
741+ for(n = 0; n < A_MAX; n++)
742742 {
743743 if(r_ptr->reinforce_id[n] && r_ptr->reinforce_dd[n] && r_ptr->reinforce_ds[n])
744744 {
--- a/src/monster2.c
+++ b/src/monster2.c
@@ -3581,7 +3581,7 @@ bool place_monster_aux(MONSTER_IDX who, POSITION y, POSITION x, MONRACE_IDX r_id
35813581 place_monster_m_idx = hack_m_idx_ii;
35823582
35833583 /* Reinforcement */
3584- for(i = 0; i < 6; i++)
3584+ for(i = 0; i < A_MAX; i++)
35853585 {
35863586 if(!r_ptr->reinforce_id[i]) break;
35873587 n = damroll(r_ptr->reinforce_dd[i], r_ptr->reinforce_ds[i]);
--- a/src/racial.c
+++ b/src/racial.c
@@ -745,7 +745,7 @@ static bool cmd_racial_power_aux(s32b command)
745745 int i;
746746 cave_type *c_ptr;
747747
748- for (i = 0; i < 6; i++)
748+ for (i = 0; i < A_MAX; i++)
749749 {
750750 dir = randint0(8);
751751 y = p_ptr->y + ddy_ddd[dir];
--- a/src/realm-hex.c
+++ b/src/realm-hex.c
@@ -873,7 +873,7 @@ cptr do_hex_spell(SPELL_IDX spell, BIT_FLAGS mode)
873873
874874 flag = TRUE;
875875 }
876- for (i = A_STR; i < 6; i++)
876+ for (i = A_STR; i < A_MAX; i++)
877877 {
878878 if (p_ptr->stat_cur[i] < p_ptr->stat_max[i])
879879 {
--- a/src/realm-song.c
+++ b/src/realm-song.c
@@ -331,7 +331,7 @@ cptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
331331 detect_monsters_invis(rad);
332332 detect_monsters_normal(rad);
333333
334- if (plev > 19 && count < 6)
334+ if (plev > 19 && count < A_MAX)
335335 SINGING_COUNT(p_ptr) = count + 1;
336336 }
337337 detect_traps(rad, TRUE);
--- a/src/save.c
+++ b/src/save.c
@@ -568,8 +568,8 @@ static void save_quick_start(void)
568568 wr_s16b(previous_char.sc);
569569 wr_s32b(previous_char.au);
570570
571- for (i = 0; i < 6; i++) wr_s16b(previous_char.stat_max[i]);
572- for (i = 0; i < 6; i++) wr_s16b(previous_char.stat_max_max[i]);
571+ for (i = 0; i < A_MAX; i++) wr_s16b(previous_char.stat_max[i]);
572+ for (i = 0; i < A_MAX; i++) wr_s16b(previous_char.stat_max_max[i]);
573573
574574 for (i = 0; i < PY_MAX_LEVEL; i++) wr_s16b((s16b)previous_char.player_hp[i]);
575575
@@ -626,9 +626,9 @@ static void wr_extra(void)
626626 wr_s16b(p_ptr->wt);
627627
628628 /* Dump the stats (maximum and current) */
629- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_max[i]);
630- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_max_max[i]);
631- for (i = 0; i < 6; ++i) wr_s16b(p_ptr->stat_cur[i]);
629+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_max[i]);
630+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_max_max[i]);
631+ for (i = 0; i < A_MAX; ++i) wr_s16b(p_ptr->stat_cur[i]);
632632
633633 /* Ignore the transient stats */
634634 for (i = 0; i < 12; ++i) wr_s16b(0);
--- a/src/selfinfo.c
+++ b/src/selfinfo.c
@@ -95,7 +95,7 @@ void self_knowledge(void)
9595
9696 info[i++] = _("能力の最大値", "Limits of maximum stats");
9797
98- for (v_nr = 0; v_nr < 6; v_nr++)
98+ for (v_nr = 0; v_nr < A_MAX; v_nr++)
9999 {
100100 char stat_desc[80];
101101
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4978,7 +4978,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
49784978 int i = 0;
49794979 if (one_in_(13))
49804980 {
4981- while (i < 6)
4981+ while (i < A_MAX)
49824982 {
49834983 do
49844984 {
@@ -5709,7 +5709,7 @@ static bool project_p(MONSTER_IDX who, cptr who_name, int r, POSITION y, POSITIO
57095709 msg_print(_("あなたは以前ほど力強くなくなってしまった...。",
57105710 "You're not as powerful as you used to be..."));
57115711
5712- for (k = 0; k < 6; k++)
5712+ for (k = 0; k < A_MAX; k++)
57135713 {
57145714 p_ptr->stat_cur[k] = (p_ptr->stat_cur[k] * 7) / 8;
57155715 if (p_ptr->stat_cur[k] < 3) p_ptr->stat_cur[k] = 3;
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -3496,7 +3496,7 @@ bool activate_ty_curse(bool stop_ty, int *count)
34963496 }
34973497 if (!one_in_(6)) break;
34983498 default:
3499- while (i < 6)
3499+ while (i < A_MAX)
35003500 {
35013501 do
35023502 {
--- a/src/util.c
+++ b/src/util.c
@@ -2506,7 +2506,7 @@ void message_add(cptr str)
25062506 if (*t)
25072507 {
25082508 /* Message is too small */
2509- if (strlen(buf) < 6) break;
2509+ if (strlen(buf) < A_MAX) break;
25102510
25112511 /* Drop the space */
25122512 *(t - 1) = '\0';
--- a/src/wizard2.c
+++ b/src/wizard2.c
@@ -379,7 +379,7 @@ static void do_cmd_wiz_change_aux(void)
379379
380380
381381 /* Query the stats */
382- for (i = 0; i < 6; i++)
382+ for (i = 0; i < A_MAX; i++)
383383 {
384384 /* Prompt */
385385 sprintf(ppp, "%s (3-%d): ", stat_names[i], p_ptr->stat_max_max[i]);
@@ -1211,7 +1211,7 @@ static void do_cmd_wiz_blue_mage(void)
12111211 int j = 0;
12121212 BIT_FLAGS f4 = 0L, f5 = 0L, f6 = 0L;
12131213
1214- for (j = 1; j < 6; j++)
1214+ for (j = 1; j < A_MAX; j++)
12151215 {
12161216 set_rf_masks(&f4, &f5, &f6, j);
12171217
--- a/src/xtra1.c
+++ b/src/xtra1.c
@@ -1539,7 +1539,7 @@ static void prt_frame_basic(void)
15391539 prt_exp();
15401540
15411541 /* All Stats */
1542- for (i = 0; i < 6; i++) prt_stat(i);
1542+ for (i = 0; i < A_MAX; i++) prt_stat(i);
15431543
15441544 /* Armor */
15451545 prt_ac();
@@ -3126,7 +3126,7 @@ void calc_bonuses(void)
31263126 extra_blows[0] = extra_blows[1] = 0;
31273127
31283128 /* Clear the stat modifiers */
3129- for (i = 0; i < 6; i++) p_ptr->stat_add[i] = 0;
3129+ for (i = 0; i < A_MAX; i++) p_ptr->stat_add[i] = 0;
31303130
31313131
31323132 /* Clear the Displayed/Real armor class */
@@ -3791,7 +3791,7 @@ void calc_bonuses(void)
37913791
37923792 /* Hack -- apply racial/class stat maxes */
37933793 /* Apply the racial modifiers */
3794- for (i = 0; i < 6; i++)
3794+ for (i = 0; i < A_MAX; i++)
37953795 {
37963796 /* Modify the stats for "race" */
37973797 p_ptr->stat_add[i] += (tmp_rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i]);
@@ -4352,7 +4352,7 @@ void calc_bonuses(void)
43524352
43534353 if (p_ptr->special_defense & KATA_KOUKIJIN)
43544354 {
4355- for (i = 0; i < 6; i++)
4355+ for (i = 0; i < A_MAX; i++)
43564356 p_ptr->stat_add[i] += 5;
43574357 p_ptr->to_a -= 50;
43584358 p_ptr->dis_to_a -= 50;
@@ -4412,7 +4412,7 @@ void calc_bonuses(void)
44124412 }
44134413
44144414 /* Calculate stats */
4415- for (i = 0; i < 6; i++)
4415+ for (i = 0; i < A_MAX; i++)
44164416 {
44174417 int top, use, ind;
44184418
--- a/src/xtra2.c
+++ b/src/xtra2.c
@@ -139,7 +139,7 @@ void check_experience(void)
139139 choice = inkey();
140140 if ((choice >= 'a') && (choice <= 'f')) break;
141141 }
142- for(n = 0; n < 6; n++)
142+ for(n = 0; n < A_MAX; n++)
143143 if (n != choice - 'a')
144144 prt("",n+2,14);
145145 if (get_check(_("よろしいですか?", "Are you sure? "))) break;
@@ -4414,7 +4414,7 @@ void gain_level_reward(int chosen_reward)
44144414 msg_print(_("「汝、謙虚たることを学ぶべし!」", "'Thou needst a lesson in humility, mortal!'"));
44154415 msg_print(_("あなたは以前より弱くなった!", "You feel less powerful!"));
44164416
4417- for (dummy = 0; dummy < 6; dummy++)
4417+ for (dummy = 0; dummy < A_MAX; dummy++)
44184418 {
44194419 (void)dec_stat(dummy, 10 + randint1(15), TRUE);
44204420 }
@@ -4435,7 +4435,7 @@ void gain_level_reward(int chosen_reward)
44354435
44364436 msg_print(_("「我がささやかなる賜物を受けとるがよい!」", "'Receive this modest gift from me!'"));
44374437
4438- for (dummy = 0; dummy < 6; dummy++)
4438+ for (dummy = 0; dummy < A_MAX; dummy++)
44394439 {
44404440 (void)do_inc_stat(dummy);
44414441 }
@@ -4526,7 +4526,7 @@ void gain_level_reward(int chosen_reward)
45264526 }
45274527 break;
45284528 default:
4529- for (dummy = 0; dummy < 6; dummy++)
4529+ for (dummy = 0; dummy < A_MAX; dummy++)
45304530 {
45314531 (void)dec_stat(dummy, 10 + randint1(15), TRUE);
45324532 }
@@ -4541,7 +4541,7 @@ void gain_level_reward(int chosen_reward)
45414541 msg_print(_("「死ぬがよい、下僕よ!」", "'Die, mortal!'"));
45424542
45434543 take_hit(DAMAGE_LOSELIFE, p_ptr->lev * 4, wrath_reason, -1);
4544- for (dummy = 0; dummy < 6; dummy++)
4544+ for (dummy = 0; dummy < A_MAX; dummy++)
45454545 {
45464546 (void)dec_stat(dummy, 10 + randint1(15), FALSE);
45474547 }
Show on old repository browser