• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision48921f3155e0eab811111fdaa470d6a682ee6735 (tree)
Time2019-06-21 23:39:48
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/bldg.c
+++ b/src/bldg.c
@@ -2066,7 +2066,7 @@ static bool inn_comm(int cmd)
20662066 else
20672067 {
20682068 set_blind(p_ptr, 0);
2069- set_confused(0);
2069+ set_confused(p_ptr, 0);
20702070 p_ptr->stun = 0;
20712071 p_ptr->chp = p_ptr->mhp;
20722072 p_ptr->csp = p_ptr->msp;
--- a/src/cmd-eat.c
+++ b/src/cmd-eat.c
@@ -106,7 +106,7 @@ void exe_eat_food(INVENTORY_IDX item)
106106 {
107107 if (!p_ptr->resist_conf)
108108 {
109- if (set_confused(p_ptr->confused + randint0(10) + 10))
109+ if (set_confused(p_ptr, p_ptr->confused + randint0(10) + 10))
110110 {
111111 ident = TRUE;
112112 }
@@ -206,7 +206,7 @@ void exe_eat_food(INVENTORY_IDX item)
206206
207207 case SV_FOOD_CURE_CONFUSION:
208208 {
209- if (set_confused(0)) ident = TRUE;
209+ if (set_confused(p_ptr, 0)) ident = TRUE;
210210 break;
211211 }
212212
--- a/src/core.c
+++ b/src/core.c
@@ -1959,7 +1959,7 @@ static void process_world_aux_timeout(void)
19591959 /* Confusion */
19601960 if (p_ptr->confused)
19611961 {
1962- (void)set_confused(p_ptr->confused - dec_count);
1962+ (void)set_confused(p_ptr, p_ptr->confused - dec_count);
19631963 }
19641964
19651965 /* Afraid */
@@ -2196,7 +2196,7 @@ static void process_world_aux_mutation(void)
21962196
21972197 if (!p_ptr->resist_conf)
21982198 {
2199- (void)set_confused(p_ptr->confused + randint0(20) + 15);
2199+ (void)set_confused(p_ptr, p_ptr->confused + randint0(20) + 15);
22002200 }
22012201
22022202 if (!p_ptr->resist_chaos)
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3206,7 +3206,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
32063206 /* Increase "confused" */
32073207 if (!p_ptr->resist_conf && !CHECK_MULTISHADOW())
32083208 {
3209- if (set_confused(p_ptr->confused + 3 + randint1(rlev)))
3209+ if (set_confused(p_ptr, p_ptr->confused + 3 + randint1(rlev)))
32103210 {
32113211 obvious = TRUE;
32123212 }
--- a/src/mind.c
+++ b/src/mind.c
@@ -1915,7 +1915,7 @@ void do_cmd_mind(void)
19151915 else if (b < 45)
19161916 {
19171917 msg_print(_("あなたの頭は混乱した!", "Your brain is addled!"));
1918- set_confused(p_ptr->confused + randint1(8));
1918+ set_confused(p_ptr, p_ptr->confused + randint1(8));
19191919 }
19201920 else if (b < 90)
19211921 {
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -1568,7 +1568,7 @@ void spell_RF5_CONF(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
15681568
15691569 if (!resist && !saving_throw)
15701570 {
1571- (void)set_confused(p_ptr->confused + randint0(4) + 4);
1571+ (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4);
15721572 }
15731573 learn_spell(MS_CONF);
15741574 update_smart_learn(m_idx, DRS_CONF);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -487,55 +487,55 @@ bool set_blind(player_type *creature_ptr, TIME_EFFECT v)
487487 * @param v 継続時間
488488 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
489489 */
490-bool set_confused(TIME_EFFECT v)
490+bool set_confused(player_type *creature_ptr, TIME_EFFECT v)
491491 {
492492 bool notice = FALSE;
493493 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
494494
495- if (p_ptr->is_dead) return FALSE;
495+ if (creature_ptr->is_dead) return FALSE;
496496
497497 /* Open */
498498 if (v)
499499 {
500- if (!p_ptr->confused)
500+ if (!creature_ptr->confused)
501501 {
502502 msg_print(_("あなたは混乱した!", "You are confused!"));
503503
504- if (p_ptr->action == ACTION_LEARN)
504+ if (creature_ptr->action == ACTION_LEARN)
505505 {
506506 msg_print(_("学習が続けられない!", "You cannot continue Learning!"));
507- p_ptr->new_mane = FALSE;
507+ creature_ptr->new_mane = FALSE;
508508
509- p_ptr->redraw |= (PR_STATE);
510- p_ptr->action = ACTION_NONE;
509+ creature_ptr->redraw |= (PR_STATE);
510+ creature_ptr->action = ACTION_NONE;
511511 }
512- if (p_ptr->action == ACTION_KAMAE)
512+ if (creature_ptr->action == ACTION_KAMAE)
513513 {
514514 msg_print(_("構えがとけた。", "Your posture gets loose."));
515- p_ptr->special_defense &= ~(KAMAE_MASK);
516- p_ptr->update |= (PU_BONUS);
517- p_ptr->redraw |= (PR_STATE);
518- p_ptr->action = ACTION_NONE;
515+ creature_ptr->special_defense &= ~(KAMAE_MASK);
516+ creature_ptr->update |= (PU_BONUS);
517+ creature_ptr->redraw |= (PR_STATE);
518+ creature_ptr->action = ACTION_NONE;
519519 }
520- else if (p_ptr->action == ACTION_KATA)
520+ else if (creature_ptr->action == ACTION_KATA)
521521 {
522522 msg_print(_("型が崩れた。", "Your posture gets loose."));
523- p_ptr->special_defense &= ~(KATA_MASK);
524- p_ptr->update |= (PU_BONUS);
525- p_ptr->update |= (PU_MONSTERS);
526- p_ptr->redraw |= (PR_STATE);
527- p_ptr->redraw |= (PR_STATUS);
528- p_ptr->action = ACTION_NONE;
523+ creature_ptr->special_defense &= ~(KATA_MASK);
524+ creature_ptr->update |= (PU_BONUS);
525+ creature_ptr->update |= (PU_MONSTERS);
526+ creature_ptr->redraw |= (PR_STATE);
527+ creature_ptr->redraw |= (PR_STATUS);
528+ creature_ptr->action = ACTION_NONE;
529529 }
530530
531531 /* Sniper */
532- if (p_ptr->concent) reset_concentration(TRUE);
532+ if (creature_ptr->concent) reset_concentration(TRUE);
533533
534534 /* Hex */
535535 if (hex_spelling_any()) stop_hex_spell_all();
536536
537537 notice = TRUE;
538- p_ptr->counter = FALSE;
538+ creature_ptr->counter = FALSE;
539539 chg_virtue(V_HARMONY, -1);
540540 }
541541 }
@@ -543,17 +543,17 @@ bool set_confused(TIME_EFFECT v)
543543 /* Shut */
544544 else
545545 {
546- if (p_ptr->confused)
546+ if (creature_ptr->confused)
547547 {
548548 msg_print(_("やっと混乱がおさまった。", "You feel less confused now."));
549- p_ptr->special_attack &= ~(ATTACK_SUIKEN);
549+ creature_ptr->special_attack &= ~(ATTACK_SUIKEN);
550550 notice = TRUE;
551551 }
552552 }
553553
554554 /* Use the value */
555- p_ptr->confused = v;
556- p_ptr->redraw |= (PR_STATUS);
555+ creature_ptr->confused = v;
556+ creature_ptr->redraw |= (PR_STATUS);
557557
558558 /* Nothing to notice */
559559 if (!notice) return (FALSE);
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -16,7 +16,7 @@ extern void reset_tim_flags(void);
1616 extern void dispel_player(void);
1717 extern bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec);
1818 extern bool set_blind(player_type *creature_ptr, TIME_EFFECT v);
19-extern bool set_confused(TIME_EFFECT v);
19+extern bool set_confused(player_type *creature_ptr, TIME_EFFECT v);
2020 extern bool set_poisoned(TIME_EFFECT v);
2121 extern bool set_afraid(TIME_EFFECT v);
2222 extern bool set_paralyzed(TIME_EFFECT v);
--- a/src/player-status.c
+++ b/src/player-status.c
@@ -5447,7 +5447,7 @@ void sanity_blast(monster_type *m_ptr, bool necro)
54475447 /* Brain smash */
54485448 if (!p_ptr->resist_conf)
54495449 {
5450- (void)set_confused(p_ptr->confused + randint0(4) + 4);
5450+ (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4);
54515451 }
54525452 if (!p_ptr->free_act)
54535453 {
--- a/src/spells-object.c
+++ b/src/spells-object.c
@@ -846,13 +846,13 @@ bool perilous_secrets(player_type *creature_ptr)
846846 (void)set_paralyzed(creature_ptr->paralyzed + randint1(5 * oops + 1));
847847
848848 /* Confusing. */
849- (void)set_confused(creature_ptr->confused + randint1(5 * oops + 1));
849+ (void)set_confused(p_ptr, creature_ptr->confused + randint1(5 * oops + 1));
850850 }
851851 creature_ptr->redraw |= (PR_MANA);
852852 }
853853 take_hit(DAMAGE_LOSELIFE, damroll(1, 12), _("危険な秘密", "perilous secrets"), -1);
854854 /* Confusing. */
855- if (one_in_(5)) (void)set_confused(creature_ptr->confused + randint1(10));
855+ if (one_in_(5)) (void)set_confused(p_ptr, creature_ptr->confused + randint1(10));
856856
857857 /* Exercise a little care... */
858858 if (one_in_(20)) take_hit(DAMAGE_LOSELIFE, damroll(4, 10), _("危険な秘密", "perilous secrets"), -1);
--- a/src/spells-status.c
+++ b/src/spells-status.c
@@ -279,7 +279,7 @@ bool_hack life_stream(bool_hack message, bool_hack virtue_change)
279279 restore_level();
280280 (void)set_poisoned(0);
281281 (void)set_blind(p_ptr, 0);
282- (void)set_confused(0);
282+ (void)set_confused(p_ptr, 0);
283283 (void)set_image(0);
284284 (void)set_stun(0);
285285 (void)set_cut(0);
@@ -324,7 +324,7 @@ bool_hack cure_serious_wounds(DICE_NUMBER dice, DICE_SID sides)
324324 bool_hack ident = FALSE;
325325 if (hp_player(p_ptr, damroll(dice, sides))) ident = TRUE;
326326 if (set_blind(p_ptr, 0)) ident = TRUE;
327- if (set_confused(0)) ident = TRUE;
327+ if (set_confused(p_ptr, 0)) ident = TRUE;
328328 if (set_cut((p_ptr->cut / 2) - 50)) ident = TRUE;
329329 if (set_shero(0, TRUE)) ident = TRUE;
330330 return ident;
@@ -335,7 +335,7 @@ bool_hack cure_critical_wounds(HIT_POINT pow)
335335 bool_hack ident = FALSE;
336336 if (hp_player(p_ptr, pow)) ident = TRUE;
337337 if (set_blind(p_ptr, 0)) ident = TRUE;
338- if (set_confused(0)) ident = TRUE;
338+ if (set_confused(p_ptr, 0)) ident = TRUE;
339339 if (set_poisoned(0)) ident = TRUE;
340340 if (set_stun(0)) ident = TRUE;
341341 if (set_cut(0)) ident = TRUE;
@@ -348,7 +348,7 @@ bool_hack true_healing(HIT_POINT pow)
348348 bool_hack ident = FALSE;
349349 if (hp_player(p_ptr, pow)) ident = TRUE;
350350 if (set_blind(p_ptr, 0)) ident = TRUE;
351- if (set_confused(0)) ident = TRUE;
351+ if (set_confused(p_ptr, 0)) ident = TRUE;
352352 if (set_poisoned(0)) ident = TRUE;
353353 if (set_stun(0)) ident = TRUE;
354354 if (set_cut(0)) ident = TRUE;
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -1744,7 +1744,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
17441744 switch (randint1(4))
17451745 {
17461746 case 1:
1747- set_confused(p_ptr->confused + 3 + randint1(dam));
1747+ set_confused(p_ptr, p_ptr->confused + 3 + randint1(dam));
17481748 break;
17491749 case 2:
17501750 set_stun(p_ptr->stun + randint1(dam));
@@ -1942,7 +1942,7 @@ static bool project_m(MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_P
19421942 set_stun(p_ptr->stun + dam / 2);
19431943 break;
19441944 case 2:
1945- set_confused(p_ptr->confused + dam / 2);
1945+ set_confused(p_ptr, p_ptr->confused + dam / 2);
19461946 break;
19471947 default:
19481948 {
@@ -4306,7 +4306,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43064306 }
43074307 if (!p_ptr->resist_conf && !p_ptr->resist_water)
43084308 {
4309- set_confused(p_ptr->confused + randint1(5) + 5);
4309+ set_confused(p_ptr, p_ptr->confused + randint1(5) + 5);
43104310 }
43114311
43124312 if (one_in_(5) && !p_ptr->resist_water)
@@ -4334,7 +4334,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
43344334 {
43354335 if (!p_ptr->resist_conf)
43364336 {
4337- (void)set_confused(p_ptr->confused + randint0(20) + 10);
4337+ (void)set_confused(p_ptr, p_ptr->confused + randint0(20) + 10);
43384338 }
43394339 if (!p_ptr->resist_chaos)
43404340 {
@@ -4416,7 +4416,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44164416 }
44174417 else if (!CHECK_MULTISHADOW())
44184418 {
4419- (void)set_confused(p_ptr->confused + randint1(20) + 10);
4419+ (void)set_confused(p_ptr, p_ptr->confused + randint1(20) + 10);
44204420 }
44214421 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
44224422 break;
@@ -4876,7 +4876,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
48764876
48774877 if (!p_ptr->resist_conf)
48784878 {
4879- (void)set_confused(p_ptr->confused + randint0(4) + 4);
4879+ (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4);
48804880 }
48814881
48824882 if (!p_ptr->resist_chaos && one_in_(3))
@@ -4930,7 +4930,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49304930 }
49314931 if (!p_ptr->resist_conf)
49324932 {
4933- (void)set_confused(p_ptr->confused + randint0(4) + 4);
4933+ (void)set_confused(p_ptr, p_ptr->confused + randint0(4) + 4);
49344934 }
49354935 if (!p_ptr->free_act)
49364936 {
--- a/src/spells2.c
+++ b/src/spells2.c
@@ -3563,7 +3563,7 @@ void cast_invoke_spirits(DIRECTION dir)
35633563 msg_print(_("あなたの頭に大量の幽霊たちの騒々しい声が押し寄せてきた...",
35643564 "Your head is invaded by a horde of gibbering spectral voices..."));
35653565
3566- set_confused(p_ptr->confused + randint1(4) + 4);
3566+ set_confused(p_ptr, p_ptr->confused + randint1(4) + 4);
35673567 }
35683568 else if (die < 31)
35693569 {
--- a/src/spells3.c
+++ b/src/spells3.c
@@ -3434,7 +3434,7 @@ bool booze(player_type *creature_ptr)
34343434 else if (!creature_ptr->resist_conf) creature_ptr->special_attack |= ATTACK_SUIKEN;
34353435 if (!creature_ptr->resist_conf)
34363436 {
3437- if (set_confused(randint0(20) + 15))
3437+ if (set_confused(p_ptr, randint0(20) + 15))
34383438 {
34393439 ident = TRUE;
34403440 }
--- a/src/trap.c
+++ b/src/trap.c
@@ -538,7 +538,7 @@ void hit_trap(bool break_trap)
538538
539539 case TRAP_CONFUSE:
540540 {
541- hit_trap_set_abnormal_status(
541+ hit_trap_set_abnormal_status_p(
542542 _("きらめくガスに包み込まれた!", "A gas of scintillating colors surrounds you!"),
543543 p_ptr->resist_conf,
544544 set_confused, p_ptr->confused + (TIME_EFFECT)randint0(20) + 10);
Show on old repository browser