• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision337f9fc4a2df7472180cea9cb63928f6889e2402 (tree)
Time2019-07-11 23:48:54
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

[Refactor] #38997 calc_num_fire() に player_type * 引数を追加.

Change Summary

Incremental Difference

--- a/src/object-flavor.c
+++ b/src/object-flavor.c
@@ -2400,7 +2400,7 @@ void object_desc(char *buf, object_type *o_ptr, BIT_FLAGS mode)
24002400 t = object_desc_num(t, power);
24012401 t = object_desc_chr(t, p2);
24022402
2403- fire_rate = calc_num_fire(o_ptr);
2403+ fire_rate = calc_num_fire(p_ptr, o_ptr);
24042404 /* Show Fire rate */
24052405 if (fire_rate != 0 && power > 0 && known)
24062406 {
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -3168,7 +3168,7 @@ void calc_bonuses(void)
31683168 if (o_ptr->k_idx && !p_ptr->heavy_shoot)
31693169 {
31703170 /* Extra shots */
3171- p_ptr->num_fire = calc_num_fire(o_ptr);
3171+ p_ptr->num_fire = calc_num_fire(p_ptr, o_ptr);
31723172
31733173 /* Snipers love Cross bows */
31743174 if ((p_ptr->pclass == CLASS_SNIPER) &&
@@ -4832,7 +4832,7 @@ static void calc_mana(player_type *creature_ptr)
48324832 * @param o_ptr 計算する射撃武器のアイテム情報参照ポインタ
48334833 * @return 射撃倍率の値(100で1.00倍)
48344834 */
4835-s16b calc_num_fire(object_type *o_ptr)
4835+s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr)
48364836 {
48374837 int extra_shots = 0;
48384838 int i;
@@ -4841,10 +4841,10 @@ s16b calc_num_fire(object_type *o_ptr)
48414841 object_type *q_ptr;
48424842 BIT_FLAGS flgs[TR_FLAG_SIZE];
48434843
4844- /* Scan the usable p_ptr->inventory_list */
4844+ /* Scan the usable creature_ptr->inventory_list */
48454845 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
48464846 {
4847- q_ptr = &p_ptr->inventory_list[i];
4847+ q_ptr = &creature_ptr->inventory_list[i];
48484848 if (!q_ptr->k_idx) continue;
48494849
48504850 /* Do not apply current equip */
@@ -4866,40 +4866,40 @@ s16b calc_num_fire(object_type *o_ptr)
48664866 num += (extra_shots * 100);
48674867
48684868 /* Hack -- Rangers love Bows */
4869- if ((p_ptr->pclass == CLASS_RANGER) &&
4869+ if ((creature_ptr->pclass == CLASS_RANGER) &&
48704870 (tval_ammo == TV_ARROW))
48714871 {
4872- num += (p_ptr->lev * 4);
4872+ num += (creature_ptr->lev * 4);
48734873 }
48744874
4875- if ((p_ptr->pclass == CLASS_CAVALRY) &&
4875+ if ((creature_ptr->pclass == CLASS_CAVALRY) &&
48764876 (tval_ammo == TV_ARROW))
48774877 {
4878- num += (p_ptr->lev * 3);
4878+ num += (creature_ptr->lev * 3);
48794879 }
48804880
4881- if (p_ptr->pclass == CLASS_ARCHER)
4881+ if (creature_ptr->pclass == CLASS_ARCHER)
48824882 {
48834883 if (tval_ammo == TV_ARROW)
4884- num += ((p_ptr->lev * 5) + 50);
4884+ num += ((creature_ptr->lev * 5) + 50);
48854885 else if ((tval_ammo == TV_BOLT) || (tval_ammo == TV_SHOT))
4886- num += (p_ptr->lev * 4);
4886+ num += (creature_ptr->lev * 4);
48874887 }
48884888
48894889 /*
48904890 * Addendum -- also "Reward" high level warriors,
48914891 * with _any_ missile weapon -- TY
48924892 */
4893- if (p_ptr->pclass == CLASS_WARRIOR &&
4893+ if (creature_ptr->pclass == CLASS_WARRIOR &&
48944894 (tval_ammo <= TV_BOLT) &&
48954895 (tval_ammo >= TV_SHOT))
48964896 {
4897- num += (p_ptr->lev * 2);
4897+ num += (creature_ptr->lev * 2);
48984898 }
4899- if ((p_ptr->pclass == CLASS_ROGUE) &&
4899+ if ((creature_ptr->pclass == CLASS_ROGUE) &&
49004900 (tval_ammo == TV_SHOT))
49014901 {
4902- num += (p_ptr->lev * 4);
4902+ num += (creature_ptr->lev * 4);
49034903 }
49044904 }
49054905 return (s16b)num;
--- a/src/player-status.h
+++ b/src/player-status.h
@@ -730,7 +730,7 @@ extern int weapon_exp_level(int weapon_exp);
730730 extern int riding_exp_level(int riding_exp);
731731 extern int spell_exp_level(int spell_exp);
732732
733-extern s16b calc_num_fire(object_type *o_ptr);
733+extern s16b calc_num_fire(player_type *creature_ptr, object_type *o_ptr);
734734 extern void calc_bonuses(void);
735735 extern WEIGHT weight_limit(player_type *creature_ptr);
736736 extern bool has_melee_weapon(player_type *creature_ptr, int i);
Show on old repository browser