• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionb0947c3d13398b1f59106a06994c498235cb7cf4 (tree)
Time2019-06-22 11:37:42
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -2019,13 +2019,13 @@ static void process_world_aux_timeout(void)
20192019 /* Shield */
20202020 if (p_ptr->shield)
20212021 {
2022- (void)set_shield(p_ptr->shield - 1, TRUE);
2022+ (void)set_shield(p_ptr, p_ptr->shield - 1, TRUE);
20232023 }
20242024
20252025 /* Tsubureru */
20262026 if (p_ptr->tsubureru)
20272027 {
2028- (void)set_tsubureru(p_ptr->tsubureru - 1, TRUE);
2028+ (void)set_tsubureru(p_ptr, p_ptr->tsubureru - 1, TRUE);
20292029 }
20302030
20312031 /* Magicdef */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1106,7 +1106,7 @@ static bool cast_mindcrafter_spell(int spell)
11061106 break;
11071107 case 6:
11081108 /* Character Armour */
1109- set_shield((TIME_EFFECT)plev, FALSE);
1109+ set_shield(p_ptr, (TIME_EFFECT)plev, FALSE);
11101110 if (plev > 14) set_oppose_acid((TIME_EFFECT)plev, FALSE);
11111111 if (plev > 19) set_oppose_fire((TIME_EFFECT)plev, FALSE);
11121112 if (plev > 24) set_oppose_cold((TIME_EFFECT)plev, FALSE);
@@ -1403,7 +1403,7 @@ static bool cast_mirror_spell(int spell)
14031403 /* shield of water */
14041404 case 12:
14051405 t = 20 + randint1(20);
1406- set_shield(t, FALSE);
1406+ set_shield(p_ptr, t, FALSE);
14071407 if (plev > 31)set_tim_reflect(t, FALSE);
14081408 if (plev > 39)set_resist_magic(t, FALSE);
14091409 break;
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -293,7 +293,7 @@ void dispel_player(void)
293293 (void)set_fast(p_ptr, 0, TRUE);
294294 (void)set_lightspeed(0, TRUE);
295295 (void)set_slow(p_ptr, 0, TRUE);
296- (void)set_shield(0, TRUE);
296+ (void)set_shield(p_ptr, 0, TRUE);
297297 (void)set_blessed(0, TRUE);
298298 (void)set_tsuyoshi(0, TRUE);
299299 (void)set_hero(0, TRUE);
@@ -935,21 +935,21 @@ bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
935935 * @param do_dec 現在の継続時間より長い値のみ上書きする
936936 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
937937 */
938-bool set_shield(TIME_EFFECT v, bool do_dec)
938+bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
939939 {
940940 bool notice = FALSE;
941941 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
942942
943- if (p_ptr->is_dead) return FALSE;
943+ if (creature_ptr->is_dead) return FALSE;
944944
945945 /* Open */
946946 if (v)
947947 {
948- if (p_ptr->shield && !do_dec)
948+ if (creature_ptr->shield && !do_dec)
949949 {
950- if (p_ptr->shield > v) return FALSE;
950+ if (creature_ptr->shield > v) return FALSE;
951951 }
952- else if (!p_ptr->shield)
952+ else if (!creature_ptr->shield)
953953 {
954954 msg_print(_("肌が石になった。", "Your skin turns to stone."));
955955 notice = TRUE;
@@ -959,7 +959,7 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
959959 /* Shut */
960960 else
961961 {
962- if (p_ptr->shield)
962+ if (creature_ptr->shield)
963963 {
964964 msg_print(_("肌が元に戻った。", "Your skin returns to normal."));
965965 notice = TRUE;
@@ -967,14 +967,14 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
967967 }
968968
969969 /* Use the value */
970- p_ptr->shield = v;
971- p_ptr->redraw |= (PR_STATUS);
970+ creature_ptr->shield = v;
971+ creature_ptr->redraw |= (PR_STATUS);
972972
973973 /* Nothing to notice */
974974 if (!notice) return (FALSE);
975975
976976 if (disturb_state) disturb(FALSE, FALSE);
977- p_ptr->update |= (PU_BONUS);
977+ creature_ptr->update |= (PU_BONUS);
978978 handle_stuff();
979979 return (TRUE);
980980 }
@@ -986,21 +986,21 @@ bool set_shield(TIME_EFFECT v, bool do_dec)
986986 * @param do_dec 現在の継続時間より長い値のみ上書きする
987987 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
988988 */
989-bool set_tsubureru(TIME_EFFECT v, bool do_dec)
989+bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
990990 {
991991 bool notice = FALSE;
992992 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
993993
994- if (p_ptr->is_dead) return FALSE;
994+ if (creature_ptr->is_dead) return FALSE;
995995
996996 /* Open */
997997 if (v)
998998 {
999- if (p_ptr->tsubureru && !do_dec)
999+ if (creature_ptr->tsubureru && !do_dec)
10001000 {
1001- if (p_ptr->tsubureru > v) return FALSE;
1001+ if (creature_ptr->tsubureru > v) return FALSE;
10021002 }
1003- else if (!p_ptr->tsubureru)
1003+ else if (!creature_ptr->tsubureru)
10041004 {
10051005 msg_print(_("横に伸びた。", "Your body expands horizontally."));
10061006 notice = TRUE;
@@ -1010,7 +1010,7 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
10101010 /* Shut */
10111011 else
10121012 {
1013- if (p_ptr->tsubureru)
1013+ if (creature_ptr->tsubureru)
10141014 {
10151015 msg_print(_("もう横に伸びていない。", "Your body returns to normal."));
10161016 notice = TRUE;
@@ -1018,14 +1018,14 @@ bool set_tsubureru(TIME_EFFECT v, bool do_dec)
10181018 }
10191019
10201020 /* Use the value */
1021- p_ptr->tsubureru = v;
1022- p_ptr->redraw |= (PR_STATUS);
1021+ creature_ptr->tsubureru = v;
1022+ creature_ptr->redraw |= (PR_STATUS);
10231023
10241024 /* Nothing to notice */
10251025 if (!notice) return (FALSE);
10261026
10271027 if (disturb_state) disturb(FALSE, FALSE);
1028- p_ptr->update |= (PU_BONUS);
1028+ creature_ptr->update |= (PU_BONUS);
10291029 handle_stuff();
10301030 return (TRUE);
10311031 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -23,8 +23,8 @@ extern bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v);
2323 extern bool set_image(player_type *creature_ptr, TIME_EFFECT v);
2424 extern bool set_fast(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2525 extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
26-extern bool set_shield(TIME_EFFECT v, bool do_dec);
27-extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
26+extern bool set_shield(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
27+extern bool set_tsubureru(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2828 extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
2929 extern bool set_blessed(TIME_EFFECT v, bool do_dec);
3030 extern bool set_hero(TIME_EFFECT v, bool do_dec);
--- a/src/racial.c
+++ b/src/racial.c
@@ -774,7 +774,7 @@ static bool cmd_racial_power_aux(s32b command)
774774 break;
775775
776776 case RACE_GOLEM:
777- (void)set_shield(randint1(20) + 30, FALSE);
777+ (void)set_shield(p_ptr, randint1(20) + 30, FALSE);
778778 break;
779779
780780 case RACE_SKELETON:
@@ -805,7 +805,7 @@ static bool cmd_racial_power_aux(s32b command)
805805 break;
806806
807807 case RACE_KUTAR:
808- (void)set_tsubureru(randint1(20) + 30, FALSE);
808+ (void)set_tsubureru(p_ptr, randint1(20) + 30, FALSE);
809809 break;
810810
811811 case RACE_ANDROID:
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -304,7 +304,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
304304
305305 if (cast)
306306 {
307- set_shield(randint1(sides) + base, FALSE);
307+ set_shield(p_ptr, randint1(sides) + base, FALSE);
308308 }
309309 }
310310 break;
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -344,7 +344,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
344344
345345 if (cast)
346346 {
347- set_shield(randint1(sides) + base, FALSE);
347+ set_shield(p_ptr, randint1(sides) + base, FALSE);
348348 }
349349 }
350350 break;
Show on old repository browser