OSDN Git Service

adj_str_wgt[]を直接参照する限界重量の計算を, xtra1.cにある関数
authornothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 24 Dec 2003 06:04:40 +0000 (06:04 +0000)
committernothere <nothere@0568b783-4c39-0410-ac80-bf13821ea2a2>
Wed, 24 Dec 2003 06:04:40 +0000 (06:04 +0000)
weight_limit()でまとめた. 全ての場合で2で割られて扱われていたことも併
せて整理したため, 元々呼ばれていたcalc_bonuses()では扱い方を少し変更.

src/cmd1.c
src/cmd3.c
src/dungeon.c
src/externs.h
src/xtra1.c

index d90c68a..a7c9c52 100644 (file)
@@ -4674,8 +4674,7 @@ static bool run_test(void)
 
                                /* Deep water */
                                else if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
-                                        (p_ptr->levitation || p_ptr->can_swim ||
-                                         p_ptr->total_weight <= (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]]*(p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2)))
+                                        (p_ptr->levitation || p_ptr->can_swim || (p_ptr->total_weight <= weight_limit())))
                                {
                                        /* Ignore */
                                        notice = FALSE;
index d12c54b..4d7844d 100644 (file)
@@ -47,12 +47,11 @@ void do_cmd_inven(void)
 #ifdef JP
        sprintf(out_val, "»ý¤Áʪ¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
            lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) 
-/ 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #else
        sprintf(out_val, "Inventory: carrying %d.%d pounds (%ld%% of capacity). Command: ",
            (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #endif
 
 
@@ -122,12 +121,11 @@ void do_cmd_equip(void)
 #ifdef JP
        sprintf(out_val, "ÁõÈ÷¡§ ¹ç·× %3d.%1d kg (¸Â³¦¤Î%ld%%) ¥³¥Þ¥ó¥É: ",
            lbtokg1(p_ptr->total_weight) , lbtokg2(p_ptr->total_weight) ,
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) 
-/ 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #else
        sprintf(out_val, "Equipment: carrying %d.%d pounds (%ld%% of capacity). Command: ",
            (int)(p_ptr->total_weight / 10), (int)(p_ptr->total_weight % 10),
-           (p_ptr->total_weight * 100) / ((adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2));
+           (p_ptr->total_weight * 100) / weight_limit());
 #endif
 
 
index ec5cefd..fb203b4 100644 (file)
@@ -2091,7 +2091,7 @@ sprintf(ouch, "%s
        if (have_flag(f_ptr->flags, FF_WATER) && have_flag(f_ptr->flags, FF_DEEP) &&
            !p_ptr->levitation && !p_ptr->can_swim)
        {
-               if (p_ptr->total_weight > (((u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * (p_ptr->pclass == CLASS_BERSERKER ? 150 : 100)) / 2))
+               if (p_ptr->total_weight > weight_limit())
                {
                        /* Take damage */
 #ifdef JP
index 2a2a5ed..aef6ec6 100644 (file)
@@ -1293,6 +1293,7 @@ extern bool is_daytime(void);
 extern void extract_day_hour_min(int *day, int *hour, int *min);
 extern void prt_time(void);
 extern cptr map_name(void);
+extern u32b weight_limit(void);
 extern bool buki_motteruka(int i);
 extern void calc_bonuses(void);
 extern void notice_stuff(void);
index f57eff8..be742f5 100644 (file)
@@ -2895,16 +2895,16 @@ static void calc_torch(void)
 /*
  * Computes current weight limit.
  */
-static int weight_limit(void)
+u32b weight_limit(void)
 {
-       int i;
+       u32b i;
 
        /* Weight limit based only on strength */
-       i = adj_str_wgt[p_ptr->stat_ind[A_STR]] * 100;
-       if (p_ptr->pclass == CLASS_BERSERKER) i = i*3/2;
+       i = (u32b)adj_str_wgt[p_ptr->stat_ind[A_STR]] * 50; /* Constant was 100 */
+       if (p_ptr->pclass == CLASS_BERSERKER) i = i * 3 / 2;
 
        /* Return the result */
-       return (i);
+       return i;
 }
 
 
@@ -4575,10 +4575,12 @@ void calc_bonuses(void)
        /* Extract the current weight (in tenth pounds) */
        j = p_ptr->total_weight;
 
-       /* Extract the "weight limit" (in tenth pounds) */
-       i = weight_limit();
-
-       if (p_ptr->riding)
+       if (!p_ptr->riding)
+       {
+               /* Extract the "weight limit" (in tenth pounds) */
+               i = (int)weight_limit();
+       }
+       else
        {
                monster_type *riding_m_ptr = &m_list[p_ptr->riding];
                monster_race *riding_r_ptr = &r_info[riding_m_ptr->r_idx];
@@ -4604,11 +4606,12 @@ void calc_bonuses(void)
 
                if (p_ptr->skill_exp[GINOU_RIDING] < RIDING_EXP_SKILLED) j += (p_ptr->wt * 3 * (RIDING_EXP_SKILLED - p_ptr->skill_exp[GINOU_RIDING])) / RIDING_EXP_SKILLED;
 
-               i = 3000 + riding_r_ptr->level * 50;
+               /* Extract the "weight limit" */
+               i = 1500 + riding_r_ptr->level * 25;
        }
 
        /* XXX XXX XXX Apply "encumbrance" from weight */
-       if (j > i/2) new_speed -= ((j - (i/2)) / (i / 10));
+       if (j > i) new_speed -= ((j - i) / (i / 5));
 
        /* Searching slows the player down */
        if (p_ptr->action == ACTION_SEARCH) new_speed -= 10;