• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionde4b6b56394a879cbfca0633790e5b2ca9a64c93 (tree)
Time2019-06-20 23:40:13
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -881,7 +881,7 @@ bool activate_artifact(object_type *o_ptr)
881881 for (dummy = 0; dummy < 3; dummy++)
882882 {
883883 if (hypodynamic_bolt(dir, 50))
884- hp_player(50);
884+ hp_player(p_ptr, 50);
885885 }
886886 break;
887887 }
@@ -906,7 +906,7 @@ bool activate_artifact(object_type *o_ptr)
906906 for (dummy = 0; dummy < 3; dummy++)
907907 {
908908 if (hypodynamic_bolt(dir, 100))
909- hp_player(100);
909+ hp_player(p_ptr, 100);
910910 }
911911 break;
912912 }
@@ -1036,7 +1036,7 @@ bool activate_artifact(object_type *o_ptr)
10361036 msg_print(_("鎧が様々な色に輝いた...", "Your armor glows many colours..."));
10371037 (void)set_afraid(0);
10381038 (void)set_hero(randint1(50) + 50, FALSE);
1039- (void)hp_player(10);
1039+ (void)hp_player(p_ptr, 10);
10401040 (void)set_blessed(randint1(50) + 50, FALSE);
10411041 (void)set_oppose_acid(randint1(50) + 50, FALSE);
10421042 (void)set_oppose_elec(randint1(50) + 50, FALSE);
@@ -1246,7 +1246,7 @@ bool activate_artifact(object_type *o_ptr)
12461246 case ACT_CURE_LW:
12471247 {
12481248 (void)set_afraid(0);
1249- (void)hp_player(30);
1249+ (void)hp_player(p_ptr, 30);
12501250 break;
12511251 }
12521252
@@ -1686,7 +1686,7 @@ bool activate_artifact(object_type *o_ptr)
16861686 TIME_EFFECT v = randint1(25) + 25;
16871687 (void)set_afraid(0);
16881688 (void)set_hero(v, FALSE);
1689- (void)hp_player(10);
1689+ (void)hp_player(p_ptr, 10);
16901690 (void)set_blessed(v, FALSE);
16911691 (void)set_oppose_acid(v, FALSE);
16921692 (void)set_oppose_elec(v, FALSE);
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -281,7 +281,7 @@ void exe_eat_food(INVENTORY_IDX item)
281281 {
282282 msg_print(_("これはひじょうに美味だ。", "That tastes good."));
283283 (void)set_poisoned(0);
284- (void)hp_player(damroll(4, 8));
284+ (void)hp_player(p_ptr, damroll(4, 8));
285285 ident = TRUE;
286286 break;
287287 }
--- a/src/cmd-mane.c
+++ b/src/cmd-mane.c
@@ -657,7 +657,7 @@ static bool use_mane(int spell)
657657 }
658658 case MS_HEAL:
659659 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
660- (void)hp_player(plev*6);
660+ (void)hp_player(p_ptr, plev*6);
661661 (void)set_stun(0);
662662 (void)set_cut(0);
663663 break;
--- a/src/core.c
+++ b/src/core.c
@@ -2333,7 +2333,7 @@ static void process_world_aux_mutation(void)
23332333 /* Absorb light from the current possition */
23342334 if ((current_floor_ptr->grid_array[p_ptr->y][p_ptr->x].info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW)
23352335 {
2336- hp_player(10);
2336+ hp_player(p_ptr, 10);
23372337 }
23382338
23392339 o_ptr = &p_ptr->inventory_list[INVEN_LITE];
@@ -2345,7 +2345,7 @@ static void process_world_aux_mutation(void)
23452345 if (!object_is_fixed_artifact(o_ptr) && (o_ptr->xtra4 > 0))
23462346 {
23472347 /* Heal the player a bit */
2348- hp_player(o_ptr->xtra4 / 20);
2348+ hp_player(p_ptr, o_ptr->xtra4 / 20);
23492349
23502350 /* Decrease life-span of lite */
23512351 o_ptr->xtra4 /= 2;
@@ -2531,7 +2531,7 @@ static void process_world_aux_mutation(void)
25312531 HIT_POINT healing = p_ptr->csp;
25322532 if (healing > wounds) healing = wounds;
25332533
2534- hp_player(healing);
2534+ hp_player(p_ptr, healing);
25352535 p_ptr->csp -= healing;
25362536 p_ptr->redraw |= (PR_HP | PR_MANA);
25372537 }
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -1910,7 +1910,7 @@ static void py_attack_aux(POSITION y, POSITION x, bool *fear, bool *mdeath, s16b
19101910
19111911 drain_heal = (drain_heal * p_ptr->mutant_regenerate_mod) / 100;
19121912
1913- hp_player(drain_heal);
1913+ hp_player(p_ptr, drain_heal);
19141914 /* We get to keep some of it! */
19151915 }
19161916 }
--- a/src/mind.c
+++ b/src/mind.c
@@ -1140,7 +1140,7 @@ static bool cast_mindcrafter_spell(int spell)
11401140 */
11411141 if (!IS_FAST() || !IS_HERO())
11421142 {
1143- hp_player(plev);
1143+ hp_player(p_ptr, plev);
11441144 }
11451145
11461146 t = 10 + randint1((plev * 3) / 2);
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1280,7 +1280,7 @@ static bool cast_learned_spell(int spell, bool success)
12801280 }
12811281 case MS_HEAL:
12821282 msg_print(_("自分の傷に念を集中した。", "You concentrate on your wounds!"));
1283- (void)hp_player(plev*4);
1283+ (void)hp_player(p_ptr, plev*4);
12841284 (void)set_stun(0);
12851285 (void)set_cut(0);
12861286 break;
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -3419,7 +3419,7 @@ bool res_stat(player_type *creature_ptr, int stat)
34193419 /*
34203420 * Increase players hit points, notice effects
34213421 */
3422-bool hp_player(int num)
3422+bool hp_player(player_type *creature_ptr, int num)
34233423 {
34243424 int vir;
34253425 vir = virtue_number(V_VITALITY);
@@ -3428,26 +3428,26 @@ bool hp_player(int num)
34283428
34293429 if(vir)
34303430 {
3431- num = num * (p_ptr->virtues[vir - 1] + 1250) / 1250;
3431+ num = num * (creature_ptr->virtues[vir - 1] + 1250) / 1250;
34323432 }
34333433 /* Healing needed */
3434- if (p_ptr->chp < p_ptr->mhp)
3434+ if (creature_ptr->chp < creature_ptr->mhp)
34353435 {
3436- if ((num > 0) && (p_ptr->chp < (p_ptr->mhp/3)))
3436+ if ((num > 0) && (creature_ptr->chp < (creature_ptr->mhp/3)))
34373437 chg_virtue(V_TEMPERANCE, 1);
34383438 /* Gain hitpoints */
3439- p_ptr->chp += num;
3439+ creature_ptr->chp += num;
34403440
34413441 /* Enforce maximum */
3442- if (p_ptr->chp >= p_ptr->mhp)
3442+ if (creature_ptr->chp >= creature_ptr->mhp)
34433443 {
3444- p_ptr->chp = p_ptr->mhp;
3445- p_ptr->chp_frac = 0;
3444+ creature_ptr->chp = creature_ptr->mhp;
3445+ creature_ptr->chp_frac = 0;
34463446 }
34473447
3448- p_ptr->redraw |= (PR_HP);
3448+ creature_ptr->redraw |= (PR_HP);
34493449
3450- p_ptr->window |= (PW_PLAYER);
3450+ creature_ptr->window |= (PW_PLAYER);
34513451
34523452 /* Heal 0-4 */
34533453 if (num < 5)
@@ -3691,7 +3691,7 @@ void do_poly_wounds(void)
36913691 if (!(wounds || hit_p || Nasty_effect)) return;
36923692
36933693 msg_print(_("傷がより軽いものに変化した。", "Your wounds are polymorphed into less serious ones."));
3694- hp_player(change);
3694+ hp_player(p_ptr, change);
36953695 if (Nasty_effect)
36963696 {
36973697 msg_print(_("新たな傷ができた!", "A new wound was created!"));
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -60,7 +60,7 @@ extern bool set_food(TIME_EFFECT v);
6060 extern bool inc_stat(player_type *creature_ptr, int stat);
6161 extern bool dec_stat(player_type *creature_ptr, int stat, int amount, int permanent);
6262 extern bool res_stat(player_type *creature_ptr, int stat);
63-extern bool hp_player(int num);
63+extern bool hp_player(player_type *creature_ptr, int num);
6464 extern bool do_dec_stat(player_type *creature_ptr, int stat);
6565 extern bool do_res_stat(player_type *creature_ptr, int stat);
6666 extern bool do_inc_stat(int stat);
--- a/src/realm-crusade.c
+++ b/src/realm-crusade.c
@@ -266,7 +266,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
266266 if (cast)
267267 {
268268 dispel_evil(randint1(dam_sides));
269- hp_player(heal);
269+ hp_player(p_ptr, heal);
270270 set_afraid(0);
271271 set_poisoned(0);
272272 set_stun(0);
@@ -531,7 +531,7 @@ concptr do_crusade_spell(SPELL_IDX spell, BIT_FLAGS mode)
531531 confuse_monsters(power);
532532 turn_monsters(power);
533533 stasis_monsters(power);
534- hp_player(heal);
534+ hp_player(p_ptr, heal);
535535 }
536536 }
537537 break;
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -313,7 +313,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
313313 chg_virtue(V_SACRIFICE, -1);
314314 chg_virtue(V_VITALITY, -1);
315315
316- hp_player(dam);
316+ hp_player(p_ptr, dam);
317317
318318 /*
319319 * Gain nutritional sustenance:
@@ -469,7 +469,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
469469 for (i = 0; i < 3; i++)
470470 {
471471 if (hypodynamic_bolt(dir, dam))
472- hp_player(dam);
472+ hp_player(p_ptr, dam);
473473 }
474474 }
475475 }
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -180,7 +180,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
180180
181181 if (cast)
182182 {
183- hp_player(damroll(dice, sides));
183+ hp_player(p_ptr, damroll(dice, sides));
184184 set_cut(0);
185185 set_poisoned(0);
186186 }
--- a/src/realm-song.c
+++ b/src/realm-song.c
@@ -172,7 +172,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
172172
173173 if (cont)
174174 {
175- hp_player(damroll(dice, sides));
175+ hp_player(p_ptr, damroll(dice, sides));
176176 }
177177 }
178178
@@ -237,7 +237,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
237237 {
238238 msg_print(_("激しい戦いの歌を歌った...", "You start singing a song of intense fighting..."));
239239
240- (void)hp_player(10);
240+ (void)hp_player(p_ptr, 10);
241241 (void)set_afraid(0);
242242
243243 /* Recalculate hitpoints */
@@ -789,7 +789,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
789789 if (cast)
790790 {
791791 msg_print(_("英雄の歌を口ずさんだ...", "You chant a powerful, heroic call to arms..."));
792- (void)hp_player(10);
792+ (void)hp_player(p_ptr, 10);
793793 (void)set_afraid(0);
794794
795795 /* Recalculate hitpoints */
@@ -847,7 +847,7 @@ concptr do_music_spell(SPELL_IDX spell, BIT_FLAGS mode)
847847
848848 if (cont)
849849 {
850- hp_player(damroll(dice, sides));
850+ hp_player(p_ptr, damroll(dice, sides));
851851 set_stun(0);
852852 set_cut(0);
853853 }
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -286,7 +286,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
286286 (void)restore_all_status();
287287 (void)set_shero(0, TRUE);
288288 handle_stuff();
289- hp_player(5000);
289+ hp_player(p_ptr, 5000);
290290
291291 return TRUE;
292292 }
@@ -296,7 +296,7 @@ bool_hack heroism(int base)
296296 bool_hack ident = FALSE;
297297 if (set_afraid(0)) ident = TRUE;
298298 if (set_hero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
299- if (hp_player(10)) ident = TRUE;
299+ if (hp_player(p_ptr, 10)) ident = TRUE;
300300 return ident;
301301 }
302302
@@ -305,14 +305,14 @@ bool_hack berserk(int base)
305305 bool_hack ident = FALSE;
306306 if (set_afraid(0)) ident = TRUE;
307307 if (set_shero(p_ptr->shero + randint1(base) + base, FALSE)) ident = TRUE;
308- if (hp_player(30)) ident = TRUE;
308+ if (hp_player(p_ptr, 30)) ident = TRUE;
309309 return ident;
310310 }
311311
312312 bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
313313 {
314314 bool_hack ident = FALSE;
315- if (hp_player(damroll(dice, sides))) ident = TRUE;
315+ if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
316316 if (set_blind(0)) ident = TRUE;
317317 if (set_cut(p_ptr->cut - 10)) ident = TRUE;
318318 if (set_shero(0, TRUE)) ident = TRUE;
@@ -322,7 +322,7 @@ bool_hack cure_light_wounds(DICE_NUMBER dice, DICE_SID sides)
322322 bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
323323 {
324324 bool_hack ident = FALSE;
325- if (hp_player(damroll(dice, sides))) ident = TRUE;
325+ if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
326326 if (set_blind(0)) ident = TRUE;
327327 if (set_confused(0)) ident = TRUE;
328328 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
@@ -333,7 +333,7 @@ bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
333333 bool_hack cure_critical_wounds(HIT_POINT pow)
334334 {
335335 bool_hack ident = FALSE;
336- if (hp_player(pow)) ident = TRUE;
336+ if (hp_player(p_ptr, pow)) ident = TRUE;
337337 if (set_blind(0)) ident = TRUE;
338338 if (set_confused(0)) ident = TRUE;
339339 if (set_poisoned(0)) ident = TRUE;
@@ -346,7 +346,7 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
346346 bool_hack true_healing(HIT_POINT pow)
347347 {
348348 bool_hack ident = FALSE;
349- if (hp_player(pow)) ident = TRUE;
349+ if (hp_player(p_ptr, pow)) ident = TRUE;
350350 if (set_blind(0)) ident = TRUE;
351351 if (set_confused(0)) ident = TRUE;
352352 if (set_poisoned(0)) ident = TRUE;
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -3122,7 +3122,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
31223122 else
31233123 {
31243124 msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), m_name);
3125- (void)hp_player(dam);
3125+ (void)hp_player(p_ptr, dam);
31263126 }
31273127 }
31283128 else
@@ -4283,7 +4283,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
42834283 if (PRACE_IS_(p_ptr, RACE_SPECTRE) && !CHECK_MULTISHADOW())
42844284 {
42854285 msg_print(_("気分がよくなった。", "You feel invigorated!"));
4286- hp_player(dam / 4);
4286+ hp_player(p_ptr, dam / 4);
42874287 learn_spell(monspell);
42884288 }
42894289 else
@@ -4668,7 +4668,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46684668 {
46694669 if (fuzzy) msg_print(_("何らかの攻撃によって気分がよくなった。", "You are hit by something invigorating!"));
46704670
4671- (void)hp_player(dam);
4671+ (void)hp_player(p_ptr, dam);
46724672 dam = 0;
46734673 break;
46744674 }
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -917,7 +917,7 @@ bool cleansing_nova(player_type *creature_ptr, bool magic, bool powerful)
917917 if (set_protevil((magic ? 0 : creature_ptr->protevil) + randint1(25) + k, FALSE)) ident = TRUE;
918918 if (set_poisoned(0)) ident = TRUE;
919919 if (set_afraid(0)) ident = TRUE;
920- if (hp_player(50)) ident = TRUE;
920+ if (hp_player(p_ptr, 50)) ident = TRUE;
921921 if (set_stun(0)) ident = TRUE;
922922 if (set_cut(0)) ident = TRUE;
923923 return ident;
@@ -3507,7 +3507,7 @@ void cast_wonder(DIRECTION dir)
35073507 dispel_monsters(150);
35083508 slow_monsters(plev);
35093509 sleep_monsters(plev);
3510- hp_player(300);
3510+ hp_player(p_ptr, 300);
35113511 }
35123512 }
35133513
@@ -3651,7 +3651,7 @@ void cast_invoke_spirits(DIRECTION dir)
36513651 dispel_monsters(150);
36523652 slow_monsters(plev);
36533653 sleep_monsters(plev);
3654- hp_player(300);
3654+ hp_player(p_ptr, 300);
36553655 }
36563656
36573657 if (die < 31)
@@ -3883,7 +3883,7 @@ bool_hack vampirism(void)
38833883 {
38843884 if (p_ptr->food < PY_FOOD_FULL)
38853885 /* No heal if we are "full" */
3886- (void)hp_player(dummy);
3886+ (void)hp_player(p_ptr, dummy);
38873887 else
38883888 msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
38893889
@@ -4292,7 +4292,7 @@ bool comvert_mp_to_hp(player_type *creature_ptr)
42924292 if (creature_ptr->csp >= creature_ptr->lev / 5)
42934293 {
42944294 creature_ptr->csp -= creature_ptr->lev / 5;
4295- hp_player(creature_ptr->lev);
4295+ hp_player(p_ptr, creature_ptr->lev);
42964296 }
42974297 else
42984298 {
Show on old repository browser