• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision684a11baf6a5a897dee56f040d23377ac309c407 (tree)
Time2019-06-22 10:44:52
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/chest.c
+++ b/src/chest.c
@@ -182,7 +182,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
182182 msg_print(_("突如吹き出した黄色いガスに包み込まれた!", "A puff of yellow gas surrounds you!"));
183183 if (!p_ptr->free_act)
184184 {
185- (void)set_paralyzed(p_ptr->paralyzed + 10 + randint1(20));
185+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 10 + randint1(20));
186186 }
187187 }
188188
@@ -287,7 +287,7 @@ void chest_trap(POSITION y, POSITION x, OBJECT_IDX o_idx)
287287 else if (one_in_(4))
288288 {
289289 if (!p_ptr->free_act)
290- (void)set_paralyzed(p_ptr->paralyzed + 2 +
290+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 2 +
291291 randint0(6));
292292 else
293293 (void)set_stun(p_ptr->stun + 10 +
--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -1718,7 +1718,7 @@ static bool do_cmd_bash_aux(POSITION y, POSITION x, DIRECTION dir)
17181718 msg_print(_("体のバランスをくずしてしまった。", "You are off-balance."));
17191719
17201720 /* Hack -- Lose balance ala paralysis */
1721- (void)set_paralyzed(p_ptr->paralyzed + 2 + randint0(2));
1721+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 2 + randint0(2));
17221722 }
17231723 return (more);
17241724 }
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -130,7 +130,7 @@ void exe_eat_food(INVENTORY_IDX item)
130130 {
131131 if (!p_ptr->free_act)
132132 {
133- if (set_paralyzed(p_ptr->paralyzed + randint0(10) + 10))
133+ if (set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(10) + 10))
134134 {
135135 ident = TRUE;
136136 }
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -146,7 +146,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
146146 }
147147
148148 (void)set_poisoned(p_ptr, 0);
149- (void)set_paralyzed(p_ptr->paralyzed + 4);
149+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 4);
150150 ident = TRUE;
151151 break;
152152
@@ -186,7 +186,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
186186 /* Have some nightmares */
187187 sanity_blast(NULL, FALSE);
188188 }
189- if (set_paralyzed(p_ptr->paralyzed + randint0(4) + 4))
189+ if (set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4))
190190 {
191191 ident = TRUE;
192192 }
--- a/src/cmd-spell.c
+++ b/src/cmd-spell.c
@@ -1428,7 +1428,7 @@ void do_cmd_cast(void)
14281428 msg_print(_("精神を集中しすぎて気を失ってしまった!", "You faint from the effort!"));
14291429
14301430 /* Hack -- Bypass free action */
1431- (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
1431+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(5 * oops + 1));
14321432
14331433 switch (realm)
14341434 {
--- a/src/core.c
+++ b/src/core.c
@@ -1313,7 +1313,7 @@ static void process_world_aux_digestion(void)
13131313 disturb(TRUE, TRUE);
13141314
13151315 /* Hack -- faint (bypass free action) */
1316- (void)set_paralyzed(p_ptr->paralyzed + 1 + randint0(5));
1316+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + 1 + randint0(5));
13171317 }
13181318
13191319 /* Starve to death (slowly) */
@@ -1953,7 +1953,7 @@ static void process_world_aux_timeout(void)
19531953 /* Paralysis */
19541954 if (p_ptr->paralyzed)
19551955 {
1956- (void)set_paralyzed(p_ptr->paralyzed - dec_count);
1956+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed - dec_count);
19571957 }
19581958
19591959 /* Confusion */
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3278,7 +3278,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32783278 {
32793279 if (!p_ptr->paralyzed)
32803280 {
3281- if (set_paralyzed(3 + randint1(rlev)))
3281+ if (set_paralyzed(p_ptr, 3 + randint1(rlev)))
32823282 {
32833283 obvious = TRUE;
32843284 }
--- a/src/mind.c
+++ b/src/mind.c
@@ -2041,7 +2041,7 @@ void do_cmd_mind(void)
20412041 msg_format(_("%sを集中しすぎて気を失ってしまった!", "You faint from the effort!"),p);
20422042
20432043 /* Hack -- Bypass free action */
2044- (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
2044+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(5 * oops + 1));
20452045
20462046 /* Damage WIS (possibly permanently) */
20472047 if (randint0(100) < 50)
--- a/src/mspells3.c
+++ b/src/mspells3.c
@@ -1747,7 +1747,7 @@ bool do_cmd_cast_learned(void)
17471747 msg_print(_("精神を集中しすぎて気を失ってしまった!", "You faint from the effort!"));
17481748
17491749 /* Hack -- Bypass free action */
1750- (void)set_paralyzed(p_ptr->paralyzed + randint1(5 * oops + 1));
1750+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(5 * oops + 1));
17511751
17521752 chg_virtue(V_KNOWLEDGE, -10);
17531753
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -1681,7 +1681,7 @@ void spell_RF5_HOLD(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
16811681
16821682 if (!resist && !saving_throw)
16831683 {
1684- (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
1684+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
16851685 }
16861686 learn_spell(MS_SLEEP);
16871687 update_smart_learn(m_idx, DRS_FREE);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -668,30 +668,30 @@ bool set_afraid(player_type *creature_ptr, TIME_EFFECT v)
668668 }
669669
670670 /*!
671- * @brief 麻痺の継続時間をセットする / Set "p_ptr->paralyzed", notice observable changes
671+ * @brief 麻痺の継続時間をセットする / Set "paralyzed", notice observable changes
672672 * @param v 継続時間
673673 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
674674 */
675-bool set_paralyzed(TIME_EFFECT v)
675+bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v)
676676 {
677677 bool notice = FALSE;
678678 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
679679
680- if (p_ptr->is_dead) return FALSE;
680+ if (creature_ptr->is_dead) return FALSE;
681681
682682 /* Open */
683683 if (v)
684684 {
685- if (!p_ptr->paralyzed)
685+ if (!creature_ptr->paralyzed)
686686 {
687687 msg_print(_("体が麻痺してしまった!", "You are paralyzed!"));
688688 /* Sniper */
689- if (p_ptr->concent) reset_concentration(TRUE);
689+ if (creature_ptr->concent) reset_concentration(TRUE);
690690
691691 /* Hex */
692692 if (hex_spelling_any()) stop_hex_spell_all();
693693
694- p_ptr->counter = FALSE;
694+ creature_ptr->counter = FALSE;
695695 notice = TRUE;
696696 }
697697 }
@@ -699,7 +699,7 @@ bool set_paralyzed(TIME_EFFECT v)
699699 /* Shut */
700700 else
701701 {
702- if (p_ptr->paralyzed)
702+ if (creature_ptr->paralyzed)
703703 {
704704 msg_print(_("やっと動けるようになった。", "You can move again."));
705705 notice = TRUE;
@@ -707,14 +707,14 @@ bool set_paralyzed(TIME_EFFECT v)
707707 }
708708
709709 /* Use the value */
710- p_ptr->paralyzed = v;
711- p_ptr->redraw |= (PR_STATUS);
710+ creature_ptr->paralyzed = v;
711+ creature_ptr->redraw |= (PR_STATUS);
712712
713713 /* Nothing to notice */
714714 if (!notice) return (FALSE);
715715
716716 if (disturb_state) disturb(FALSE, FALSE);
717- p_ptr->redraw |= (PR_STATE);
717+ creature_ptr->redraw |= (PR_STATE);
718718 handle_stuff();
719719 return (TRUE);
720720 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -19,7 +19,7 @@ extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);
1919 extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v);
2020 extern bool set_poisoned(player_type *creature_ptr, TIME_EFFECT v);
2121 extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
22-extern bool set_paralyzed(TIME_EFFECT v);
22+extern bool set_paralyzed(player_type *creature_ptr, TIME_EFFECT v);
2323 extern bool set_image(TIME_EFFECT v);
2424 extern bool set_fast(TIME_EFFECT v, bool do_dec);
2525 extern bool set_slow(TIME_EFFECT v, bool do_dec);
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5451,7 +5451,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
54515451 }
54525452 if (!p_ptr->free_act)
54535453 {
5454- (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
5454+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
54555455 }
54565456 if (!p_ptr->resist_chaos)
54575457 {
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -843,7 +843,7 @@ bool perilous_secrets(player_type *creature_ptr)
843843
844844 msg_print(_("石を制御できない!", "You are too weak to control the stone!"));
845845 /* Hack -- Bypass free action */
846- (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
846+ (void)set_paralyzed(p_ptr, creature_ptr->paralyzed + randint1(5 * oops + 1));
847847
848848 /* Confusing. */
849849 (void)set_confused(p_ptr, creature_ptr->confused + randint1(5 * oops + 1));
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -1759,7 +1759,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
17591759 }
17601760 default:
17611761 if (!p_ptr->free_act)
1762- (void)set_paralyzed(p_ptr->paralyzed + randint1(dam));
1762+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(dam));
17631763 break;
17641764 }
17651765 }
@@ -4700,7 +4700,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
47004700 sanity_blast(NULL, FALSE);
47014701 }
47024702
4703- set_paralyzed(p_ptr->paralyzed + dam);
4703+ set_paralyzed(p_ptr, p_ptr->paralyzed + dam);
47044704 dam = 0;
47054705 break;
47064706 }
@@ -4934,7 +4934,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49344934 }
49354935 if (!p_ptr->free_act)
49364936 {
4937- (void)set_paralyzed(p_ptr->paralyzed + randint0(4) + 4);
4937+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
49384938 }
49394939 (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
49404940
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -2608,9 +2608,9 @@ bool activate_ty_curse(bool stop_ty, int *count)
26082608 {
26092609 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
26102610 if (p_ptr->free_act)
2611- set_paralyzed(p_ptr->paralyzed + randint1(3));
2611+ set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(3));
26122612 else
2613- set_paralyzed(p_ptr->paralyzed + randint1(13));
2613+ set_paralyzed(p_ptr, p_ptr->paralyzed + randint1(13));
26142614 stop_ty = TRUE;
26152615 }
26162616 if (!one_in_(6)) break;
--- a/src/trap.c
+++ b/src/trap.c
@@ -569,7 +569,7 @@ void hit_trap(bool break_trap)
569569 sanity_blast(NULL, FALSE);
570570
571571 }
572- (void)set_paralyzed(p_ptr->paralyzed + randint0(10) + 5);
572+ (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(10) + 5);
573573 }
574574 break;
575575 }
Show on old repository browser