• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisionf178945d31ea6ae9393ad843edebad64bb7039a9 (tree)
Time2019-06-25 23:44:43
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1040,7 +1040,7 @@ bool activate_artifact(object_type *o_ptr)
10401040 (void)set_blessed(p_ptr, randint1(50) + 50, FALSE);
10411041 (void)set_oppose_acid(p_ptr, randint1(50) + 50, FALSE);
10421042 (void)set_oppose_elec(p_ptr, randint1(50) + 50, FALSE);
1043- (void)set_oppose_fire(randint1(50) + 50, FALSE);
1043+ (void)set_oppose_fire(p_ptr, randint1(50) + 50, FALSE);
10441044 (void)set_oppose_cold(randint1(50) + 50, FALSE);
10451045 (void)set_oppose_pois(randint1(50) + 50, FALSE);
10461046 break;
@@ -1052,7 +1052,7 @@ bool activate_artifact(object_type *o_ptr)
10521052 fire_breath(GF_FIRE, dir, 200, 2);
10531053 if ((o_ptr->tval == TV_RING) && (o_ptr->sval == SV_RING_FLAMES))
10541054 {
1055- (void)set_oppose_fire(randint1(20) + 20, FALSE);
1055+ (void)set_oppose_fire(p_ptr, randint1(20) + 20, FALSE);
10561056 }
10571057 break;
10581058 }
@@ -1337,7 +1337,7 @@ bool activate_artifact(object_type *o_ptr)
13371337 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
13381338 (void)set_oppose_acid(p_ptr, randint1(40) + 40, FALSE);
13391339 (void)set_oppose_elec(p_ptr, randint1(40) + 40, FALSE);
1340- (void)set_oppose_fire(randint1(40) + 40, FALSE);
1340+ (void)set_oppose_fire(p_ptr, randint1(40) + 40, FALSE);
13411341 (void)set_oppose_cold(randint1(40) + 40, FALSE);
13421342 (void)set_oppose_pois(randint1(40) + 40, FALSE);
13431343 break;
@@ -1402,7 +1402,7 @@ bool activate_artifact(object_type *o_ptr)
14021402 if (!get_aim_dir(&dir)) return FALSE;
14031403 fire_ball(GF_FIRE, dir, 100, 2);
14041404 }
1405- (void)set_oppose_fire(randint1(20) + 20, FALSE);
1405+ (void)set_oppose_fire(p_ptr, randint1(20) + 20, FALSE);
14061406 break;
14071407 }
14081408
@@ -1690,7 +1690,7 @@ bool activate_artifact(object_type *o_ptr)
16901690 (void)set_blessed(p_ptr, v, FALSE);
16911691 (void)set_oppose_acid(p_ptr, v, FALSE);
16921692 (void)set_oppose_elec(p_ptr, v, FALSE);
1693- (void)set_oppose_fire(v, FALSE);
1693+ (void)set_oppose_fire(p_ptr, v, FALSE);
16941694 (void)set_oppose_cold(v, FALSE);
16951695 (void)set_oppose_pois(v, FALSE);
16961696 (void)set_ultimate_res(v, FALSE);
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -291,7 +291,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
291291 break;
292292
293293 case SV_POTION_RESIST_HEAT:
294- if (set_oppose_fire(p_ptr->oppose_fire + randint1(10) + 10, FALSE))
294+ if (set_oppose_fire(p_ptr, p_ptr->oppose_fire + randint1(10) + 10, FALSE))
295295 {
296296 ident = TRUE;
297297 }
@@ -451,7 +451,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
451451 case SV_POTION_RESISTANCE:
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);
454- (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
454+ (void)set_oppose_fire(p_ptr, p_ptr->oppose_fire + randint1(20) + 20, FALSE);
455455 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
456456 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
457457 ident = TRUE;
--- a/src/core.c
+++ b/src/core.c
@@ -2055,7 +2055,7 @@ static void process_world_aux_timeout(void)
20552055 /* Oppose Fire */
20562056 if (p_ptr->oppose_fire)
20572057 {
2058- (void)set_oppose_fire(p_ptr->oppose_fire - 1, TRUE);
2058+ (void)set_oppose_fire(p_ptr, p_ptr->oppose_fire - 1, TRUE);
20592059 }
20602060
20612061 /* Oppose Cold */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1108,7 +1108,7 @@ static bool cast_mindcrafter_spell(int spell)
11081108 /* Character Armour */
11091109 set_shield(p_ptr, (TIME_EFFECT)plev, FALSE);
11101110 if (plev > 14) set_oppose_acid(p_ptr, (TIME_EFFECT)plev, FALSE);
1111- if (plev > 19) set_oppose_fire((TIME_EFFECT)plev, FALSE);
1111+ if (plev > 19) set_oppose_fire(p_ptr, (TIME_EFFECT)plev, FALSE);
11121112 if (plev > 24) set_oppose_cold((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);
@@ -1606,7 +1606,7 @@ static bool cast_ninja_spell(int spell)
16061606 case 9:
16071607 fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
16081608 teleport_player(30, 0L);
1609- set_oppose_fire((TIME_EFFECT)plev, FALSE);
1609+ set_oppose_fire(p_ptr, (TIME_EFFECT)plev, FALSE);
16101610 break;
16111611 case 10:
16121612 return rush_attack(NULL);
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2239,7 +2239,7 @@ bool mutation_power_aux(int power)
22392239 }
22402240 if (randint0(3) < num)
22412241 {
2242- (void)set_oppose_fire(dur, FALSE);
2242+ (void)set_oppose_fire(p_ptr, dur, FALSE);
22432243 num--;
22442244 }
22452245 if (randint0(2) < num)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -323,7 +323,7 @@ void dispel_player(void)
323323 (void)set_resist_magic(p_ptr, 0, TRUE);
324324 (void)set_oppose_acid(p_ptr, 0, TRUE);
325325 (void)set_oppose_elec(p_ptr, 0, TRUE);
326- (void)set_oppose_fire(0, TRUE);
326+ (void)set_oppose_fire(p_ptr, 0, TRUE);
327327 (void)set_oppose_cold(0, TRUE);
328328 (void)set_oppose_pois(0, TRUE);
329329 (void)set_ultimate_res(0, TRUE);
@@ -389,7 +389,7 @@ bool set_mimic(player_type *creature_ptr, TIME_EFFECT v, IDX p, bool do_dec)
389389 if (creature_ptr->tim_mimic)
390390 {
391391 msg_print(_("変身が解けた。", "You are no longer transformed."));
392- if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(0, TRUE);
392+ if (creature_ptr->mimic_form == MIMIC_DEMON) set_oppose_fire(p_ptr, 0, TRUE);
393393 creature_ptr->mimic_form=0;
394394 notice = TRUE;
395395 p = 0;
@@ -2528,20 +2528,20 @@ bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
25282528 * @param do_dec 現在の継続時間より長い値のみ上書きする
25292529 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
25302530 */
2531-bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
2531+bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
25322532 {
25332533 bool notice = FALSE;
25342534 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
25352535
2536- if (p_ptr->is_dead) return FALSE;
2536+ if (creature_ptr->is_dead) return FALSE;
25372537
2538- if ((PRACE_IS_(p_ptr, RACE_DEMON) && (p_ptr->lev > 44)) || (p_ptr->mimic_form == MIMIC_DEMON)) v = 1;
2538+ if ((PRACE_IS_(creature_ptr, RACE_DEMON) && (creature_ptr->lev > 44)) || (creature_ptr->mimic_form == MIMIC_DEMON)) v = 1;
25392539 /* Open */
25402540 if (v)
25412541 {
2542- if (p_ptr->oppose_fire && !do_dec)
2542+ if (creature_ptr->oppose_fire && !do_dec)
25432543 {
2544- if (p_ptr->oppose_fire > v) return FALSE;
2544+ if (creature_ptr->oppose_fire > v) return FALSE;
25452545 }
25462546 else if (!IS_OPPOSE_FIRE())
25472547 {
@@ -2553,7 +2553,7 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
25532553 /* Shut */
25542554 else
25552555 {
2556- if (p_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2556+ if (creature_ptr->oppose_fire && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
25572557 {
25582558 msg_print(_("火への耐性が薄れた気がする。", "You feel less resistant to fire."));
25592559 notice = TRUE;
@@ -2561,11 +2561,11 @@ bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
25612561 }
25622562
25632563 /* Use the value */
2564- p_ptr->oppose_fire = v;
2564+ creature_ptr->oppose_fire = v;
25652565
25662566 /* Nothing to notice */
25672567 if (!notice) return (FALSE);
2568- p_ptr->redraw |= (PR_STATUS);
2568+ creature_ptr->redraw |= (PR_STATUS);
25692569
25702570 if (disturb_state) disturb(FALSE, FALSE);
25712571 handle_stuff();
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -51,7 +51,7 @@ extern bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFF
5151 extern bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v);
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);
54-extern bool set_oppose_fire(TIME_EFFECT v, bool do_dec);
54+extern bool set_oppose_fire(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5555 extern bool set_oppose_cold(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);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -276,7 +276,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
276276
277277 if (cast)
278278 {
279- set_oppose_fire(randint1(base) + base, FALSE);
279+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
280280 }
281281 }
282282 break;
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -103,7 +103,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
103103
104104 if (cast)
105105 {
106- set_oppose_fire(randint1(base) + base, FALSE);
106+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
107107 }
108108 }
109109 break;
@@ -323,7 +323,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
323323 {
324324 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
325325 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
326- set_oppose_fire(randint1(base) + base, FALSE);
326+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
327327 set_oppose_cold(randint1(base) + base, FALSE);
328328 set_oppose_pois(randint1(base) + base, FALSE);
329329 }
--- a/src/realm-daemon.c
+++ b/src/realm-daemon.c
@@ -95,7 +95,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
9595
9696 if (cast)
9797 {
98- set_oppose_fire(randint1(base) + base, FALSE);
98+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
9999 }
100100 }
101101 break;
@@ -343,7 +343,7 @@ concptr do_daemon_spell(SPELL_IDX spell, BIT_FLAGS mode)
343343 {
344344 TIME_EFFECT dur = randint1(base) + base;
345345
346- set_oppose_fire(dur, FALSE);
346+ set_oppose_fire(p_ptr, dur, FALSE);
347347 set_oppose_cold(dur, FALSE);
348348 set_tim_sh_fire(p_ptr, dur, FALSE);
349349 set_afraid(p_ptr, 0);
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -187,7 +187,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
187187 if (cast)
188188 {
189189 set_oppose_cold(randint1(base) + base, FALSE);
190- set_oppose_fire(randint1(base) + base, FALSE);
190+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
191191 }
192192 }
193193 break;
@@ -474,7 +474,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
474474 set_fast(p_ptr, v, FALSE);
475475 set_oppose_acid(p_ptr, v, FALSE);
476476 set_oppose_elec(p_ptr, v, FALSE);
477- set_oppose_fire(v, FALSE);
477+ set_oppose_fire(p_ptr, v, FALSE);
478478 set_oppose_cold(v, FALSE);
479479 set_oppose_pois(v, FALSE);
480480 set_ultimate_res(v, FALSE);
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -162,7 +162,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
162162 if (cast)
163163 {
164164 set_oppose_cold(randint1(base) + base, FALSE);
165- set_oppose_fire(randint1(base) + base, FALSE);
165+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
166166 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
167167 }
168168 }
@@ -363,7 +363,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
363363 {
364364 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
365365 set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
366- set_oppose_fire(randint1(base) + base, FALSE);
366+ set_oppose_fire(p_ptr, randint1(base) + base, FALSE);
367367 set_oppose_cold(randint1(base) + base, FALSE);
368368 set_oppose_pois(randint1(base) + base, FALSE);
369369 }
Show on old repository browser