• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision470a0d829075a14f3149eb418b83072cdd4714c5 (tree)
Time2019-06-22 11:05:24
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-basic.c
+++ b/src/cmd-basic.c
@@ -2308,7 +2308,7 @@ void do_cmd_fire(SPELL_IDX snipe_type)
23082308 if (snipe_type == SP_FINAL)
23092309 {
23102310 msg_print(_("射撃の反動が体を襲った。", "A reactionary of shooting attacked you. "));
2311- (void)set_slow(p_ptr->slow + randint0(7) + 7, FALSE);
2311+ (void)set_slow(p_ptr, p_ptr->slow + randint0(7) + 7, FALSE);
23122312 (void)set_stun(p_ptr->stun + randint1(25));
23132313 }
23142314 }
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -128,7 +128,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
128128 break;
129129
130130 case SV_POTION_SLOWNESS:
131- if (set_slow(randint1(25) + 15, FALSE)) ident = TRUE;
131+ if (set_slow(p_ptr, randint1(25) + 15, FALSE)) ident = TRUE;
132132 break;
133133
134134 case SV_POTION_SALT_WATER:
--- a/src/cmd-usestaff.c
+++ b/src/cmd-usestaff.c
@@ -49,7 +49,7 @@ int staff_effect(OBJECT_SUBTYPE_VALUE sval, bool *use_charge, bool powerful, boo
4949
5050 case SV_STAFF_SLOWNESS:
5151 {
52- if (set_slow(p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
52+ if (set_slow(p_ptr, p_ptr->slow + randint1(30) + 15, FALSE)) ident = TRUE;
5353 break;
5454 }
5555
--- a/src/core.c
+++ b/src/core.c
@@ -1977,7 +1977,7 @@ static void process_world_aux_timeout(void)
19771977 /* Slow */
19781978 if (p_ptr->slow)
19791979 {
1980- (void)set_slow(p_ptr->slow - dec_count, TRUE);
1980+ (void)set_slow(p_ptr, p_ptr->slow - dec_count, TRUE);
19811981 }
19821982
19831983 /* Protection from evil */
@@ -2282,7 +2282,7 @@ static void process_world_aux_mutation(void)
22822282 }
22832283 else
22842284 {
2285- set_slow(randint1(30) + 10, FALSE);
2285+ set_slow(p_ptr, randint1(30) + 10, FALSE);
22862286 }
22872287 }
22882288 else
@@ -2291,7 +2291,7 @@ static void process_world_aux_mutation(void)
22912291
22922292 if (p_ptr->slow > 0)
22932293 {
2294- set_slow(0, TRUE);
2294+ set_slow(p_ptr, 0, TRUE);
22952295 }
22962296 else
22972297 {
--- a/src/melee1.c
+++ b/src/melee1.c
@@ -3633,7 +3633,7 @@ bool make_attack_normal(MONSTER_IDX m_idx)
36333633 }
36343634 else
36353635 {
3636- if (set_slow((p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
3636+ if (set_slow(p_ptr, (p_ptr->slow + 4 + randint0(rlev / 10)), FALSE))
36373637 {
36383638 obvious = TRUE;
36393639 }
--- a/src/mspells4.c
+++ b/src/mspells4.c
@@ -1618,7 +1618,7 @@ void spell_RF5_SLOW(MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
16181618
16191619 if (!resist && !saving_throw)
16201620 {
1621- (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
1621+ (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
16221622 }
16231623 learn_spell(MS_SLOW);
16241624 update_smart_learn(m_idx, DRS_FREE);
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -292,7 +292,7 @@ void dispel_player(void)
292292 {
293293 (void)set_fast(p_ptr, 0, TRUE);
294294 (void)set_lightspeed(0, TRUE);
295- (void)set_slow(0, TRUE);
295+ (void)set_slow(p_ptr, 0, TRUE);
296296 (void)set_shield(0, TRUE);
297297 (void)set_blessed(0, TRUE);
298298 (void)set_tsuyoshi(0, TRUE);
@@ -885,21 +885,21 @@ bool set_lightspeed(TIME_EFFECT v, bool do_dec)
885885 * @param do_dec 現在の継続時間より長い値のみ上書きする
886886 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
887887 */
888-bool set_slow(TIME_EFFECT v, bool do_dec)
888+bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
889889 {
890890 bool notice = FALSE;
891891 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
892892
893- if (p_ptr->is_dead) return FALSE;
893+ if (creature_ptr->is_dead) return FALSE;
894894
895895 /* Open */
896896 if (v)
897897 {
898- if (p_ptr->slow && !do_dec)
898+ if (creature_ptr->slow && !do_dec)
899899 {
900- if (p_ptr->slow > v) return FALSE;
900+ if (creature_ptr->slow > v) return FALSE;
901901 }
902- else if (!p_ptr->slow)
902+ else if (!creature_ptr->slow)
903903 {
904904 msg_print(_("体の動きが遅くなってしまった!", "You feel yourself moving slower!"));
905905 notice = TRUE;
@@ -909,7 +909,7 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
909909 /* Shut */
910910 else
911911 {
912- if (p_ptr->slow)
912+ if (creature_ptr->slow)
913913 {
914914 msg_print(_("動きの遅さがなくなったようだ。", "You feel yourself speed up."));
915915 notice = TRUE;
@@ -917,13 +917,13 @@ bool set_slow(TIME_EFFECT v, bool do_dec)
917917 }
918918
919919 /* Use the value */
920- p_ptr->slow = v;
920+ creature_ptr->slow = v;
921921
922922 /* Nothing to notice */
923923 if (!notice) return (FALSE);
924924
925925 if (disturb_state) disturb(FALSE, FALSE);
926- p_ptr->update |= (PU_BONUS);
926+ creature_ptr->update |= (PU_BONUS);
927927 handle_stuff();
928928 return (TRUE);
929929 }
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -22,7 +22,7 @@ extern bool set_afraid(player_type *creature_ptr, TIME_EFFECT v);
2222 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);
25-extern bool set_slow(TIME_EFFECT v, bool do_dec);
25+extern bool set_slow(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
2626 extern bool set_shield(TIME_EFFECT v, bool do_dec);
2727 extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
2828 extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
--- a/src/spells1.c
+++ b/src/spells1.c
@@ -4498,7 +4498,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
44984498 case GF_INERTIAL:
44994499 {
45004500 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4501- if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4501+ if (!CHECK_MULTISHADOW()) (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
45024502 get_damage = take_hit(DAMAGE_ATTACK, dam, killer, monspell);
45034503 break;
45044504 }
@@ -4634,7 +4634,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46344634 {
46354635 teleport_player(5, TELEPORT_PASSIVE);
46364636 if (!p_ptr->levitation)
4637- (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4637+ (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
46384638 if (!(p_ptr->resist_sound || p_ptr->levitation))
46394639 {
46404640 int plus_stun = (randint1((dam > 90) ? 35 : (dam / 3 + 5)));
@@ -4684,7 +4684,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
46844684 case GF_OLD_SLOW:
46854685 {
46864686 if (fuzzy) msg_print(_("何か遅いもので攻撃された!", "You are hit by something slow!"));
4687- (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4687+ (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
46884688 break;
46894689 }
46904690
@@ -4936,7 +4936,7 @@ static bool project_p(MONSTER_IDX who, concptr who_name, int r, POSITION y, POSI
49364936 {
49374937 (void)set_paralyzed(p_ptr, p_ptr->paralyzed + randint0(4) + 4);
49384938 }
4939- (void)set_slow(p_ptr->slow + randint0(4) + 4, FALSE);
4939+ (void)set_slow(p_ptr, p_ptr->slow + randint0(4) + 4, FALSE);
49404940
49414941 while (randint0(100 + rlev / 2) > (MAX(5, p_ptr->skill_sav)))
49424942 (void)do_dec_stat(p_ptr, A_INT);
--- a/src/trap.c
+++ b/src/trap.c
@@ -366,7 +366,7 @@ static void hit_trap_slow(void)
366366 {
367367 if (hit_trap_dart())
368368 {
369- set_slow(p_ptr->slow + randint0(20) + 20, FALSE);
369+ set_slow(p_ptr, p_ptr->slow + randint0(20) + 20, FALSE);
370370 }
371371 }
372372
Show on old repository browser