• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionfc75bcc2930fa59b68dd0e5aea9cbe4b6f2791d1 (tree)
Time2019-06-27 00:20:48
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -3131,7 +3131,7 @@ static PRICE repair_broken_weapon_aux(PRICE bcost)
31313131 o_ptr->discount = 99;
31323132
31333133 p_ptr->total_weight += o_ptr->weight;
3134- calc_android_exp();
3134+ calc_android_exp(p_ptr);
31353135
31363136 /* Decrease material object */
31373137 inven_item_increase(mater, -1);
@@ -3254,7 +3254,7 @@ static bool enchant_item(PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_C
32543254 /* Charge the money */
32553255 p_ptr->au -= (cost * o_ptr->number);
32563256
3257- if (item >= INVEN_RARM) calc_android_exp();
3257+ if (item >= INVEN_RARM) calc_android_exp(p_ptr);
32583258
32593259 /* Something happened */
32603260 return (TRUE);
--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -618,7 +618,7 @@ void exe_activate(player_type *user_ptr, INVENTORY_IDX item)
618618 if (!success)
619619 msg_print(_("おっと、解放に失敗した。", "Oops. You failed to release your pet."));
620620 }
621- calc_android_exp();
621+ calc_android_exp(p_ptr);
622622 return;
623623 }
624624
@@ -1764,7 +1764,7 @@ bool activate_artifact(object_type *o_ptr)
17641764 if (o_ptr->name1 != ART_BLOOD) return FALSE;
17651765 msg_print(_("鎌が明るく輝いた...", "Your scythe glows brightly!"));
17661766 get_bloody_moon_flags(o_ptr);
1767- if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1767+ if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr);
17681768 p_ptr->update |= (PU_BONUS | PU_HP);
17691769 break;
17701770 }
--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2821,7 +2821,7 @@ bool do_cmd_throw(int mult, bool boomerang, OBJECT_IDX shuriken)
28212821 else if (equiped_item)
28222822 {
28232823 kamaenaoshi(item);
2824- calc_android_exp();
2824+ calc_android_exp(p_ptr);
28252825 }
28262826
28272827 if (do_drop)
--- a/src/cmd-dump.c
+++ b/src/cmd-dump.c
@@ -1014,7 +1014,7 @@ void do_cmd_redraw(void)
10141014
10151015 handle_stuff();
10161016
1017- if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
1017+ if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr);
10181018
10191019
10201020 /* Redraw every window */
--- a/src/cmd-item.c
+++ b/src/cmd-item.c
@@ -456,7 +456,7 @@ void do_cmd_wield(void)
456456 p_ptr->redraw |= (PR_EQUIPPY);
457457 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
458458
459- calc_android_exp();
459+ calc_android_exp(p_ptr);
460460 }
461461
462462 /*!
@@ -576,7 +576,7 @@ void do_cmd_takeoff(void)
576576 /* Take off the item */
577577 (void)inven_takeoff(item, 255);
578578 kamaenaoshi(item);
579- calc_android_exp();
579+ calc_android_exp(p_ptr);
580580 p_ptr->redraw |= (PR_EQUIPPY);
581581 }
582582
@@ -626,7 +626,7 @@ void do_cmd_drop(void)
626626 if (item >= INVEN_RARM)
627627 {
628628 kamaenaoshi(item);
629- calc_android_exp();
629+ calc_android_exp(p_ptr);
630630 }
631631
632632 p_ptr->redraw |= (PR_EQUIPPY);
@@ -824,7 +824,7 @@ void do_cmd_destroy(void)
824824 if (q_ptr->to_a != 0 || q_ptr->to_d != 0 || q_ptr->to_h != 0)
825825 chg_virtue(V_HARMONY, 1);
826826
827- if (item >= INVEN_RARM) calc_android_exp();
827+ if (item >= INVEN_RARM) calc_android_exp(p_ptr);
828828 }
829829
830830
--- a/src/core.c
+++ b/src/core.c
@@ -5582,7 +5582,7 @@ void play_game(bool new_game)
55825582 /* Hack -- Enforce "delayed death" */
55835583 if (p_ptr->chp < 0) p_ptr->is_dead = TRUE;
55845584
5585- if (p_ptr->prace == RACE_ANDROID) calc_android_exp();
5585+ if (p_ptr->prace == RACE_ANDROID) calc_android_exp(p_ptr);
55865586
55875587 if (new_game && ((p_ptr->pclass == CLASS_CAVALRY) || (p_ptr->pclass == CLASS_BEASTMASTER)))
55885588 {
--- a/src/player-damage.c
+++ b/src/player-damage.c
@@ -408,7 +408,7 @@ static bool acid_minus_ac(void)
408408 p_ptr->update |= (PU_BONUS);
409409 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
410410
411- calc_android_exp();
411+ calc_android_exp(p_ptr);
412412
413413 /* Item was damaged */
414414 return (TRUE);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3936,17 +3936,17 @@ void gain_exp(s32b amount)
39363936 }
39373937
39383938
3939-void calc_android_exp(void)
3939+void calc_android_exp(player_type *creature_ptr)
39403940 {
39413941 int i;
39423942 u32b total_exp = 0;
3943- if (p_ptr->is_dead) return;
3943+ if (creature_ptr->is_dead) return;
39443944
3945- if (p_ptr->prace != RACE_ANDROID) return;
3945+ if (creature_ptr->prace != RACE_ANDROID) return;
39463946
39473947 for (i = INVEN_RARM; i < INVEN_TOTAL; i++)
39483948 {
3949- object_type *o_ptr = &p_ptr->inventory_list[i];
3949+ object_type *o_ptr = &creature_ptr->inventory_list[i];
39503950 object_type forge;
39513951 object_type *q_ptr = &forge;
39523952 u32b value, exp;
@@ -3995,7 +3995,7 @@ void calc_android_exp(void)
39953995 value = object_value_real(q_ptr);
39963996
39973997 if (value <= 0) continue;
3998- if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (p_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
3998+ if ((o_ptr->tval == TV_SOFT_ARMOR) && (o_ptr->sval == SV_ABUNAI_MIZUGI) && (creature_ptr->pseikaku != SEIKAKU_SEXY)) value /= 32;
39993999 if (value > 5000000L) value = 5000000L;
40004000 if ((o_ptr->tval == TV_DRAG_ARMOR) || (o_ptr->tval == TV_CARD)) level /= 2;
40014001
@@ -4024,7 +4024,7 @@ void calc_android_exp(void)
40244024 else total_exp += exp / 16;
40254025 if (i == INVEN_BODY) total_exp += exp / 32;
40264026 }
4027- p_ptr->exp = p_ptr->max_exp = total_exp;
4027+ creature_ptr->exp = creature_ptr->max_exp = total_exp;
40284028
40294029 /* Check Experience */
40304030 check_experience();
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -68,7 +68,7 @@ extern bool restore_level(player_type *creature_ptr);
6868 extern bool lose_all_info(player_type *creature_ptr);
6969 extern void gain_exp_64(s32b amount, u32b amount_frac);
7070 extern void gain_exp(s32b amount);
71-extern void calc_android_exp(void);
71+extern void calc_android_exp(player_type *creature_ptr);
7272 extern void lose_exp(s32b amount);
7373 extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
7474 extern void do_poly_self(void);
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -771,7 +771,7 @@ bool rustproof(void)
771771 msg_format("%s %s %s now protected against corrosion.", ((item >= 0) ? "Your" : "The"), o_name, ((o_ptr->number > 1) ? "are" : "is"));
772772 #endif
773773
774- calc_android_exp();
774+ calc_android_exp(p_ptr);
775775 return TRUE;
776776 }
777777
@@ -1082,7 +1082,7 @@ bool bless_weapon(void)
10821082
10831083 p_ptr->update |= (PU_BONUS);
10841084 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
1085- calc_android_exp();
1085+ calc_android_exp(p_ptr);
10861086
10871087 return TRUE;
10881088 }
@@ -1136,7 +1136,7 @@ bool pulish_shield(void)
11361136 msg_print(_("失敗した。", "Failed."));
11371137 chg_virtue(V_ENCHANT, -2);
11381138 }
1139- calc_android_exp();
1139+ calc_android_exp(p_ptr);
11401140
11411141 return FALSE;
11421142 }
@@ -1265,7 +1265,7 @@ bool enchant(object_type *o_ptr, int n, int eflag)
12651265 p_ptr->update |= (PU_BONUS | PU_COMBINE | PU_REORDER);
12661266 p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
12671267
1268- calc_android_exp();
1268+ calc_android_exp(p_ptr);
12691269
12701270 /* Success */
12711271 return (TRUE);
@@ -1325,7 +1325,7 @@ bool enchant_spell(HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
13251325 else
13261326 chg_virtue(V_ENCHANT, 1);
13271327
1328- calc_android_exp();
1328+ calc_android_exp(p_ptr);
13291329
13301330 /* Something happened */
13311331 return (TRUE);
@@ -1473,5 +1473,5 @@ void brand_weapon(int brand_type)
14731473 msg_print(_("属性付加に失敗した。", "The Branding failed."));
14741474 chg_virtue(V_ENCHANT, -2);
14751475 }
1476- calc_android_exp();
1476+ calc_android_exp(p_ptr);
14771477 }
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -1018,7 +1018,7 @@ bool apply_disenchant(BIT_FLAGS mode)
10181018 p_ptr->update |= (PU_BONUS);
10191019 p_ptr->window |= (PW_EQUIP | PW_PLAYER);
10201020
1021- calc_android_exp();
1021+ calc_android_exp(p_ptr);
10221022 }
10231023
10241024 return (TRUE);
@@ -1672,7 +1672,7 @@ bool artifact_scroll(void)
16721672 chg_virtue(V_ENCHANT, 1);
16731673 }
16741674
1675- calc_android_exp();
1675+ calc_android_exp(p_ptr);
16761676
16771677 /* Something happened */
16781678 return (TRUE);
@@ -1831,7 +1831,7 @@ bool mundane_spell(bool only_equip)
18311831 o_ptr->inscription = inscription;
18321832 if (item >= 0) p_ptr->total_weight += (o_ptr->weight - weight);
18331833 }
1834- calc_android_exp();
1834+ calc_android_exp(p_ptr);
18351835
18361836 /* Something happened */
18371837 return TRUE;
--- a/src/store.c
+++ b/src/store.c
@@ -5181,7 +5181,7 @@ static void store_sell(void)
51815181
51825182 if ((choice == 0) && (item >= INVEN_RARM))
51835183 {
5184- calc_android_exp();
5184+ calc_android_exp(p_ptr);
51855185 kamaenaoshi(item);
51865186 }
51875187 }
Show on old repository browser