• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionece9a03de78dd8511085c42756f72d440a543c3a (tree)
Time2019-06-23 14:52:14
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1875,13 +1875,13 @@ static void process_world_aux_timeout(void)
18751875 /* Timed levitation */
18761876 if (p_ptr->tim_levitation)
18771877 {
1878- (void)set_tim_levitation(p_ptr->tim_levitation - 1, TRUE);
1878+ (void)set_tim_levitation(p_ptr, p_ptr->tim_levitation - 1, TRUE);
18791879 }
18801880
18811881 /* Timed sh_touki */
18821882 if (p_ptr->tim_sh_touki)
18831883 {
1884- (void)set_tim_sh_touki(p_ptr->tim_sh_touki - 1, TRUE);
1884+ (void)set_tim_sh_touki(p_ptr, p_ptr->tim_sh_touki - 1, TRUE);
18851885 }
18861886
18871887 /* Timed sh_fire */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1208,7 +1208,7 @@ static bool cast_force_spell(int spell)
12081208 (void)lite_area(damroll(2, (plev / 2)), (plev / 10) + 1);
12091209 break;
12101210 case 2:
1211- set_tim_levitation(randint1(30) + 30 + boost / 5, FALSE);
1211+ set_tim_levitation(p_ptr, randint1(30) + 30 + boost / 5, FALSE);
12121212 break;
12131213 case 3:
12141214 project_length = plev / 8 + 3;
@@ -1232,7 +1232,7 @@ static bool cast_force_spell(int spell)
12321232 else return TRUE;
12331233 break;
12341234 case 6:
1235- set_tim_sh_touki(randint1(plev / 2) + 15 + boost / 7, FALSE);
1235+ set_tim_sh_touki(p_ptr, randint1(plev / 2) + 15 + boost / 7, FALSE);
12361236 break;
12371237 case 7:
12381238 return shock_power();
@@ -1601,7 +1601,7 @@ static bool cast_ninja_spell(int spell)
16011601 case 7:
16021602 return ident_spell(FALSE);
16031603 case 8:
1604- set_tim_levitation(randint1(20) + 20, FALSE);
1604+ set_tim_levitation(p_ptr, randint1(20) + 20, FALSE);
16051605 break;
16061606 case 9:
16071607 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -314,8 +314,8 @@ void dispel_player(void)
314314 (void)set_tim_esp(0, TRUE);
315315 (void)set_tim_regen(p_ptr, 0, TRUE);
316316 (void)set_tim_stealth(p_ptr, 0, TRUE);
317- (void)set_tim_levitation(0, TRUE);
318- (void)set_tim_sh_touki(0, TRUE);
317+ (void)set_tim_levitation(p_ptr, 0, TRUE);
318+ (void)set_tim_sh_touki(p_ptr, 0, TRUE);
319319 (void)set_tim_sh_fire(0, TRUE);
320320 (void)set_tim_sh_holy(0, TRUE);
321321 (void)set_tim_eyeeye(0, TRUE);
@@ -1738,21 +1738,21 @@ bool set_superstealth(bool set)
17381738 * @param do_dec 現在の継続時間より長い値のみ上書きする
17391739 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
17401740 */
1741-bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
1741+bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
17421742 {
17431743 bool notice = FALSE;
17441744 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
17451745
1746- if (p_ptr->is_dead) return FALSE;
1746+ if (creature_ptr->is_dead) return FALSE;
17471747
17481748 /* Open */
17491749 if (v)
17501750 {
1751- if (p_ptr->tim_levitation && !do_dec)
1751+ if (creature_ptr->tim_levitation && !do_dec)
17521752 {
1753- if (p_ptr->tim_levitation > v) return FALSE;
1753+ if (creature_ptr->tim_levitation > v) return FALSE;
17541754 }
1755- else if (!p_ptr->tim_levitation)
1755+ else if (!creature_ptr->tim_levitation)
17561756 {
17571757 msg_print(_("体が宙に浮き始めた。", "You begin to fly!"));
17581758 notice = TRUE;
@@ -1762,7 +1762,7 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
17621762 /* Shut */
17631763 else
17641764 {
1765- if (p_ptr->tim_levitation)
1765+ if (creature_ptr->tim_levitation)
17661766 {
17671767 msg_print(_("もう宙に浮かべなくなった。", "You stop flying."));
17681768 notice = TRUE;
@@ -1770,14 +1770,14 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
17701770 }
17711771
17721772 /* Use the value */
1773- p_ptr->tim_levitation = v;
1774- p_ptr->redraw |= (PR_STATUS);
1773+ creature_ptr->tim_levitation = v;
1774+ creature_ptr->redraw |= (PR_STATUS);
17751775
17761776 /* Nothing to notice */
17771777 if (!notice) return (FALSE);
17781778
17791779 if (disturb_state) disturb(FALSE, FALSE);
1780- p_ptr->update |= (PU_BONUS);
1780+ creature_ptr->update |= (PU_BONUS);
17811781 handle_stuff();
17821782 return (TRUE);
17831783 }
@@ -1788,21 +1788,21 @@ bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
17881788 * @param do_dec 現在の継続時間より長い値のみ上書きする
17891789 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
17901790 */
1791-bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
1791+bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
17921792 {
17931793 bool notice = FALSE;
17941794 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
17951795
1796- if (p_ptr->is_dead) return FALSE;
1796+ if (creature_ptr->is_dead) return FALSE;
17971797
17981798 /* Open */
17991799 if (v)
18001800 {
1801- if (p_ptr->tim_sh_touki && !do_dec)
1801+ if (creature_ptr->tim_sh_touki && !do_dec)
18021802 {
1803- if (p_ptr->tim_sh_touki > v) return FALSE;
1803+ if (creature_ptr->tim_sh_touki > v) return FALSE;
18041804 }
1805- else if (!p_ptr->tim_sh_touki)
1805+ else if (!creature_ptr->tim_sh_touki)
18061806 {
18071807 msg_print(_("体が闘気のオーラで覆われた。", "You have enveloped by the aura of the Force!"));
18081808 notice = TRUE;
@@ -1812,7 +1812,7 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
18121812 /* Shut */
18131813 else
18141814 {
1815- if (p_ptr->tim_sh_touki)
1815+ if (creature_ptr->tim_sh_touki)
18161816 {
18171817 msg_print(_("闘気が消えた。", "Aura of the Force disappeared."));
18181818 notice = TRUE;
@@ -1820,8 +1820,8 @@ bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
18201820 }
18211821
18221822 /* Use the value */
1823- p_ptr->tim_sh_touki = v;
1824- p_ptr->redraw |= (PR_STATUS);
1823+ creature_ptr->tim_sh_touki = v;
1824+ creature_ptr->redraw |= (PR_STATUS);
18251825
18261826 /* Nothing to notice */
18271827 if (!notice) return (FALSE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -36,8 +36,8 @@ extern bool set_tim_infra(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
3636 extern bool set_tim_regen(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3737 extern bool set_tim_stealth(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
3838 extern bool set_lightspeed(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
39-extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
40-extern bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec);
39+extern bool set_tim_levitation(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
40+extern bool set_tim_sh_touki(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4141 extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec);
4242 extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec);
4343 extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec);
Show on old repository browser