• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione4ff3bb031398f9c1ce37283c8b8b792bf5269cc (tree)
Time2019-06-25 23:47:12
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1041,7 +1041,7 @@ bool activate_artifact(object_type *o_ptr)
10411041 (void)set_oppose_acid(p_ptr, randint1(50) + 50, FALSE);
10421042 (void)set_oppose_elec(p_ptr, randint1(50) + 50, FALSE);
10431043 (void)set_oppose_fire(p_ptr, randint1(50) + 50, FALSE);
1044- (void)set_oppose_cold(randint1(50) + 50, FALSE);
1044+ (void)set_oppose_cold(p_ptr, randint1(50) + 50, FALSE);
10451045 (void)set_oppose_pois(randint1(50) + 50, FALSE);
10461046 break;
10471047 }
@@ -1063,7 +1063,7 @@ bool activate_artifact(object_type *o_ptr)
10631063 fire_breath(GF_COLD, dir, 200, 2);
10641064 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_ICE))
10651065 {
1066- (void)set_oppose_cold(randint1(20) + 20, FALSE);
1066+ (void)set_oppose_cold(p_ptr, randint1(20) + 20, FALSE);
10671067 }
10681068 break;
10691069 }
@@ -1338,7 +1338,7 @@ bool activate_artifact(object_type *o_ptr)
13381338 (void)set_oppose_acid(p_ptr, randint1(40) + 40, FALSE);
13391339 (void)set_oppose_elec(p_ptr, randint1(40) + 40, FALSE);
13401340 (void)set_oppose_fire(p_ptr, randint1(40) + 40, FALSE);
1341- (void)set_oppose_cold(randint1(40) + 40, FALSE);
1341+ (void)set_oppose_cold(p_ptr, randint1(40) + 40, FALSE);
13421342 (void)set_oppose_pois(randint1(40) + 40, FALSE);
13431343 break;
13441344 }
@@ -1414,7 +1414,7 @@ bool activate_artifact(object_type *o_ptr)
14141414 if (!get_aim_dir(&dir)) return FALSE;
14151415 fire_ball(GF_COLD, dir, 100, 2);
14161416 }
1417- (void)set_oppose_cold(randint1(20) + 20, FALSE);
1417+ (void)set_oppose_cold(p_ptr, randint1(20) + 20, FALSE);
14181418 break;
14191419 }
14201420
@@ -1691,7 +1691,7 @@ bool activate_artifact(object_type *o_ptr)
16911691 (void)set_oppose_acid(p_ptr, v, FALSE);
16921692 (void)set_oppose_elec(p_ptr, v, FALSE);
16931693 (void)set_oppose_fire(p_ptr, v, FALSE);
1694- (void)set_oppose_cold(v, FALSE);
1694+ (void)set_oppose_cold(p_ptr, v, FALSE);
16951695 (void)set_oppose_pois(v, FALSE);
16961696 (void)set_ultimate_res(v, FALSE);
16971697 break;
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -298,7 +298,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
298298 break;
299299
300300 case SV_POTION_RESIST_COLD:
301- if (set_oppose_cold(p_ptr->oppose_cold + randint1(10) + 10, FALSE))
301+ if (set_oppose_cold(p_ptr, p_ptr->oppose_cold + randint1(10) + 10, FALSE))
302302 {
303303 ident = TRUE;
304304 }
@@ -452,7 +452,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
452452 (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid + randint1(20) + 20, FALSE);
453453 (void)set_oppose_elec(p_ptr, p_ptr->oppose_elec + randint1(20) + 20, FALSE);
454454 (void)set_oppose_fire(p_ptr, p_ptr->oppose_fire + randint1(20) + 20, FALSE);
455- (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
455+ (void)set_oppose_cold(p_ptr, p_ptr->oppose_cold + randint1(20) + 20, FALSE);
456456 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
457457 ident = TRUE;
458458 break;
--- a/src/core.c
+++ b/src/core.c
@@ -2061,7 +2061,7 @@ static void process_world_aux_timeout(void)
20612061 /* Oppose Cold */
20622062 if (p_ptr->oppose_cold)
20632063 {
2064- (void)set_oppose_cold(p_ptr->oppose_cold - 1, TRUE);
2064+ (void)set_oppose_cold(p_ptr, p_ptr->oppose_cold - 1, TRUE);
20652065 }
20662066
20672067 /* Oppose Poison */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1109,7 +1109,7 @@ static bool cast_mindcrafter_spell(int spell)
11091109 set_shield(p_ptr, (TIME_EFFECT)plev, FALSE);
11101110 if (plev > 14) set_oppose_acid(p_ptr, (TIME_EFFECT)plev, FALSE);
11111111 if (plev > 19) set_oppose_fire(p_ptr, (TIME_EFFECT)plev, FALSE);
1112- if (plev > 24) set_oppose_cold((TIME_EFFECT)plev, FALSE);
1112+ if (plev > 24) set_oppose_cold(p_ptr, (TIME_EFFECT)plev, FALSE);
11131113 if (plev > 29) set_oppose_elec(p_ptr, (TIME_EFFECT)plev, FALSE);
11141114 if (plev > 34) set_oppose_pois((TIME_EFFECT)plev, FALSE);
11151115 break;
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2244,7 +2244,7 @@ bool mutation_power_aux(int power)
22442244 }
22452245 if (randint0(2) < num)
22462246 {
2247- (void)set_oppose_cold(dur, FALSE);
2247+ (void)set_oppose_cold(p_ptr, dur, FALSE);
22482248 num--;
22492249 }
22502250 if (num)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -324,7 +324,7 @@ void dispel_player(void)
324324 (void)set_oppose_acid(p_ptr, 0, TRUE);
325325 (void)set_oppose_elec(p_ptr, 0, TRUE);
326326 (void)set_oppose_fire(p_ptr, 0, TRUE);
327- (void)set_oppose_cold(0, TRUE);
327+ (void)set_oppose_cold(p_ptr, 0, TRUE);
328328 (void)set_oppose_pois(0, TRUE);
329329 (void)set_ultimate_res(0, TRUE);
330330 (void)set_mimic(p_ptr, 0, 0, TRUE);
@@ -2578,19 +2578,19 @@ bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
25782578 * @param do_dec 現在の継続時間より長い値のみ上書きする
25792579 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
25802580 */
2581-bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
2581+bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
25822582 {
25832583 bool notice = FALSE;
25842584 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
25852585
2586- if (p_ptr->is_dead) return FALSE;
2586+ if (creature_ptr->is_dead) return FALSE;
25872587
25882588 /* Open */
25892589 if (v)
25902590 {
2591- if (p_ptr->oppose_cold && !do_dec)
2591+ if (creature_ptr->oppose_cold && !do_dec)
25922592 {
2593- if (p_ptr->oppose_cold > v) return FALSE;
2593+ if (creature_ptr->oppose_cold > v) return FALSE;
25942594 }
25952595 else if (!IS_OPPOSE_COLD())
25962596 {
@@ -2602,7 +2602,7 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
26022602 /* Shut */
26032603 else
26042604 {
2605- if (p_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2605+ if (creature_ptr->oppose_cold && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
26062606 {
26072607 msg_print(_("冷気への耐性が薄れた気がする。", "You feel less resistant to cold."));
26082608 notice = TRUE;
@@ -2610,11 +2610,11 @@ bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
26102610 }
26112611
26122612 /* Use the value */
2613- p_ptr->oppose_cold = v;
2613+ creature_ptr->oppose_cold = v;
26142614
26152615 /* Nothing to notice */
26162616 if (!notice) return (FALSE);
2617- p_ptr->redraw |= (PR_STATUS);
2617+ creature_ptr->redraw |= (PR_STATUS);
26182618
26192619 if (disturb_state) disturb(FALSE, FALSE);
26202620 handle_stuff();
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -52,7 +52,7 @@ extern bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFF
5252 extern bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5353 extern bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5454 extern bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
55-extern bool set_oppose_cold(TIME_EFFECT v, bool do_dec);
55+extern bool set_oppose_cold(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5656 extern bool set_oppose_pois(TIME_EFFECT v, bool do_dec);
5757 extern bool set_stun(TIME_EFFECT v);
5858 extern bool set_cut(TIME_EFFECT v);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -259,7 +259,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
259259
260260 if (cast)
261261 {
262- set_oppose_cold(randint1(base) + base, FALSE);
262+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
263263 }
264264 }
265265 break;
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -86,7 +86,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
8686
8787 if (cast)
8888 {
89- set_oppose_cold(randint1(base) + base, FALSE);
89+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
9090 }
9191 }
9292 break;
@@ -324,7 +324,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
324324 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
325325 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
326326 set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
327- set_oppose_cold(randint1(base) + base, FALSE);
327+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
328328 set_oppose_pois(randint1(base) + base, FALSE);
329329 }
330330 }
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -344,7 +344,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
344344 TIME_EFFECT dur = randint1(base) + base;
345345
346346 set_oppose_fire(p_ptr, dur, FALSE);
347- set_oppose_cold(dur, FALSE);
347+ set_oppose_cold(p_ptr, dur, FALSE);
348348 set_tim_sh_fire(p_ptr, dur, FALSE);
349349 set_afraid(p_ptr, 0);
350350 break;
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -186,7 +186,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
186186
187187 if (cast)
188188 {
189- set_oppose_cold(randint1(base) + base, FALSE);
189+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
190190 set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
191191 }
192192 }
@@ -475,7 +475,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
475475 set_oppose_acid(p_ptr, v, FALSE);
476476 set_oppose_elec(p_ptr, v, FALSE);
477477 set_oppose_fire(p_ptr, v, FALSE);
478- set_oppose_cold(v, FALSE);
478+ set_oppose_cold(p_ptr, v, FALSE);
479479 set_oppose_pois(v, FALSE);
480480 set_ultimate_res(v, FALSE);
481481 }
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -161,7 +161,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
161161
162162 if (cast)
163163 {
164- set_oppose_cold(randint1(base) + base, FALSE);
164+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
165165 set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
166166 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
167167 }
@@ -364,7 +364,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
364364 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
365365 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
366366 set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
367- set_oppose_cold(randint1(base) + base, FALSE);
367+ set_oppose_cold(p_ptr, randint1(base) + base, FALSE);
368368 set_oppose_pois(randint1(base) + base, FALSE);
369369 }
370370 }
Show on old repository browser