• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision783d095c8969f5c6c0f45dfe37d80d2357c1de9a (tree)
Time2019-06-27 11:55:59
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1359,7 +1359,7 @@ bool activate_artifact(object_type *o_ptr)
13591359
13601360 case ACT_WRAITH:
13611361 {
1362- set_wraith_form(randint1(plev / 2) + (plev / 2), FALSE);
1362+ set_wraith_form(p_ptr, randint1(plev / 2) + (plev / 2), FALSE);
13631363 break;
13641364 }
13651365
--- a/src/core.c
+++ b/src/core.c
@@ -1995,7 +1995,7 @@ static void process_world_aux_timeout(void)
19951995 /* Wraith form */
19961996 if (p_ptr->wraith_form)
19971997 {
1998- (void)set_wraith_form(p_ptr->wraith_form - 1, TRUE);
1998+ (void)set_wraith_form(p_ptr, p_ptr->wraith_form - 1, TRUE);
19991999 }
20002000
20012001 /* Heroism */
@@ -2397,7 +2397,7 @@ static void process_world_aux_mutation(void)
23972397 msg_print(_("非物質化した!", "You feel insubstantial!"));
23982398
23992399 msg_print(NULL);
2400- set_wraith_form(randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
2400+ set_wraith_form(p_ptr, randint1(p_ptr->lev / 2) + (p_ptr->lev / 2), FALSE);
24012401 }
24022402 if ((p_ptr->muta2 & MUT2_POLY_WOUND) && one_in_(3000))
24032403 {
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -300,7 +300,7 @@ void dispel_player(void)
300300 (void)set_shero(p_ptr, 0, TRUE);
301301 (void)set_protevil(p_ptr, 0, TRUE);
302302 (void)set_invuln(p_ptr, 0, TRUE);
303- (void)set_wraith_form(0, TRUE);
303+ (void)set_wraith_form(p_ptr, 0, TRUE);
304304 (void)set_kabenuke(p_ptr, 0, TRUE);
305305 (void)set_tim_res_nether(0, TRUE);
306306 (void)set_tim_res_time(0, TRUE);
@@ -1294,21 +1294,21 @@ bool set_protevil(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
12941294 * @param do_dec 現在の継続時間より長い値のみ上書きする
12951295 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
12961296 */
1297-bool set_wraith_form(TIME_EFFECT v, bool do_dec)
1297+bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
12981298 {
12991299 bool notice = FALSE;
13001300 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
13011301
1302- if (p_ptr->is_dead) return FALSE;
1302+ if (creature_ptr->is_dead) return FALSE;
13031303
13041304 /* Open */
13051305 if (v)
13061306 {
1307- if (p_ptr->wraith_form && !do_dec)
1307+ if (creature_ptr->wraith_form && !do_dec)
13081308 {
1309- if (p_ptr->wraith_form > v) return FALSE;
1309+ if (creature_ptr->wraith_form > v) return FALSE;
13101310 }
1311- else if (!p_ptr->wraith_form)
1311+ else if (!creature_ptr->wraith_form)
13121312 {
13131313 msg_print(_("物質界を離れて幽鬼のような存在になった!", "You leave the physical world and current_world_ptr->game_turn into a wraith-being!"));
13141314 notice = TRUE;
@@ -1317,37 +1317,37 @@ bool set_wraith_form(TIME_EFFECT v, bool do_dec)
13171317 chg_virtue(V_SACRIFICE, -2);
13181318 chg_virtue(V_VALOUR, -5);
13191319
1320- p_ptr->redraw |= (PR_MAP);
1321- p_ptr->update |= (PU_MONSTERS);
1320+ creature_ptr->redraw |= (PR_MAP);
1321+ creature_ptr->update |= (PU_MONSTERS);
13221322
1323- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1323+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
13241324 }
13251325 }
13261326
13271327 /* Shut */
13281328 else
13291329 {
1330- if (p_ptr->wraith_form)
1330+ if (creature_ptr->wraith_form)
13311331 {
13321332 msg_print(_("不透明になった感じがする。", "You feel opaque."));
13331333 notice = TRUE;
13341334
1335- p_ptr->redraw |= (PR_MAP);
1336- p_ptr->update |= (PU_MONSTERS);
1335+ creature_ptr->redraw |= (PR_MAP);
1336+ creature_ptr->update |= (PU_MONSTERS);
13371337
1338- p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
1338+ creature_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
13391339 }
13401340 }
13411341
13421342 /* Use the value */
1343- p_ptr->wraith_form = v;
1344- p_ptr->redraw |= (PR_STATUS);
1343+ creature_ptr->wraith_form = v;
1344+ creature_ptr->redraw |= (PR_STATUS);
13451345
13461346 /* Nothing to notice */
13471347 if (!notice) return (FALSE);
13481348
13491349 if (disturb_state) disturb(FALSE, FALSE);
1350- p_ptr->update |= (PU_BONUS);
1350+ creature_ptr->update |= (PU_BONUS);
13511351 handle_stuff();
13521352 return (TRUE);
13531353
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -77,7 +77,7 @@ extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
7777 extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
7878 extern bool choose_ele_attack(void);
7979 extern bool choose_ele_immune(TIME_EFFECT turn);
80-extern bool set_wraith_form(TIME_EFFECT v, bool do_dec);
80+extern bool set_wraith_form(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
8181 extern bool set_tim_esp(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
8282 extern bool set_superstealth(player_type *creature_ptr, bool set);
8383 extern void do_poly_wounds(player_type *creature_ptr);
--- a/src/realm-death.c
+++ b/src/realm-death.c
@@ -629,7 +629,7 @@ concptr do_death_spell(SPELL_IDX spell, BIT_FLAGS mode)
629629
630630 if (cast)
631631 {
632- set_wraith_form(randint1(base) + base, FALSE);
632+ set_wraith_form(p_ptr, randint1(base) + base, FALSE);
633633 }
634634 }
635635 break;
Show on old repository browser