• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revisione16abeace9e4eeadc1960444026991578bda2897 (tree)
Time2019-06-24 23:26:06
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1038,7 +1038,7 @@ bool activate_artifact(object_type *o_ptr)
10381038 (void)set_hero(p_ptr, randint1(50) + 50, FALSE);
10391039 (void)hp_player(p_ptr, 10);
10401040 (void)set_blessed(p_ptr, randint1(50) + 50, FALSE);
1041- (void)set_oppose_acid(randint1(50) + 50, FALSE);
1041+ (void)set_oppose_acid(p_ptr, randint1(50) + 50, FALSE);
10421042 (void)set_oppose_elec(randint1(50) + 50, FALSE);
10431043 (void)set_oppose_fire(randint1(50) + 50, FALSE);
10441044 (void)set_oppose_cold(randint1(50) + 50, FALSE);
@@ -1335,7 +1335,7 @@ bool activate_artifact(object_type *o_ptr)
13351335 case ACT_RESIST_ALL:
13361336 {
13371337 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
1338- (void)set_oppose_acid(randint1(40) + 40, FALSE);
1338+ (void)set_oppose_acid(p_ptr, randint1(40) + 40, FALSE);
13391339 (void)set_oppose_elec(randint1(40) + 40, FALSE);
13401340 (void)set_oppose_fire(randint1(40) + 40, FALSE);
13411341 (void)set_oppose_cold(randint1(40) + 40, FALSE);
@@ -1390,7 +1390,7 @@ bool activate_artifact(object_type *o_ptr)
13901390 if (!get_aim_dir(&dir)) return FALSE;
13911391 fire_ball(GF_ACID, dir, 100, 2);
13921392 }
1393- (void)set_oppose_acid(randint1(20) + 20, FALSE);
1393+ (void)set_oppose_acid(p_ptr, randint1(20) + 20, FALSE);
13941394 break;
13951395 }
13961396
@@ -1688,7 +1688,7 @@ bool activate_artifact(object_type *o_ptr)
16881688 (void)set_hero(p_ptr, v, FALSE);
16891689 (void)hp_player(p_ptr, 10);
16901690 (void)set_blessed(p_ptr, v, FALSE);
1691- (void)set_oppose_acid(v, FALSE);
1691+ (void)set_oppose_acid(p_ptr, v, FALSE);
16921692 (void)set_oppose_elec(v, FALSE);
16931693 (void)set_oppose_fire(v, FALSE);
16941694 (void)set_oppose_cold(v, FALSE);
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -449,7 +449,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
449449 break;
450450
451451 case SV_POTION_RESISTANCE:
452- (void)set_oppose_acid(p_ptr->oppose_acid + randint1(20) + 20, FALSE);
452+ (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid + randint1(20) + 20, FALSE);
453453 (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
454454 (void)set_oppose_fire(p_ptr->oppose_fire + randint1(20) + 20, FALSE);
455455 (void)set_oppose_cold(p_ptr->oppose_cold + randint1(20) + 20, FALSE);
--- a/src/core.c
+++ b/src/core.c
@@ -2043,7 +2043,7 @@ static void process_world_aux_timeout(void)
20432043 /* Oppose Acid */
20442044 if (p_ptr->oppose_acid)
20452045 {
2046- (void)set_oppose_acid(p_ptr->oppose_acid - 1, TRUE);
2046+ (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid - 1, TRUE);
20472047 }
20482048
20492049 /* Oppose Lightning */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1107,7 +1107,7 @@ static bool cast_mindcrafter_spell(int spell)
11071107 case 6:
11081108 /* Character Armour */
11091109 set_shield(p_ptr, (TIME_EFFECT)plev, FALSE);
1110- if (plev > 14) set_oppose_acid((TIME_EFFECT)plev, FALSE);
1110+ if (plev > 14) set_oppose_acid(p_ptr, (TIME_EFFECT)plev, FALSE);
11111111 if (plev > 19) set_oppose_fire((TIME_EFFECT)plev, FALSE);
11121112 if (plev > 24) set_oppose_cold((TIME_EFFECT)plev, FALSE);
11131113 if (plev > 29) set_oppose_elec((TIME_EFFECT)plev, FALSE);
@@ -1719,7 +1719,7 @@ static bool cast_ninja_spell(int spell)
17191719 break;
17201720 case 16:
17211721 (void)set_kabenuke(p_ptr, randint1(plev/2) + plev/2, FALSE);
1722- set_oppose_acid((TIME_EFFECT)plev, FALSE);
1722+ set_oppose_acid(p_ptr, (TIME_EFFECT)plev, FALSE);
17231723 break;
17241724 case 17:
17251725 fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2229,7 +2229,7 @@ bool mutation_power_aux(int power)
22292229
22302230 if (randint0(5) < num)
22312231 {
2232- (void)set_oppose_acid(dur, FALSE);
2232+ (void)set_oppose_acid(p_ptr, dur, FALSE);
22332233 num--;
22342234 }
22352235 if (randint0(4) < num)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -321,7 +321,7 @@ void dispel_player(void)
321321 (void)set_tim_eyeeye(p_ptr, 0, TRUE);
322322 (void)set_magicdef(p_ptr, 0, TRUE);
323323 (void)set_resist_magic(p_ptr, 0, TRUE);
324- (void)set_oppose_acid(0, TRUE);
324+ (void)set_oppose_acid(p_ptr, 0, TRUE);
325325 (void)set_oppose_elec(0, TRUE);
326326 (void)set_oppose_fire(0, TRUE);
327327 (void)set_oppose_cold(0, TRUE);
@@ -2430,19 +2430,19 @@ bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
24302430 * @param do_dec 現在の継続時間より長い値のみ上書きする
24312431 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
24322432 */
2433-bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
2433+bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
24342434 {
24352435 bool notice = FALSE;
24362436 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
24372437
2438- if (p_ptr->is_dead) return FALSE;
2438+ if (creature_ptr->is_dead) return FALSE;
24392439
24402440 /* Open */
24412441 if (v)
24422442 {
2443- if (p_ptr->oppose_acid && !do_dec)
2443+ if (creature_ptr->oppose_acid && !do_dec)
24442444 {
2445- if (p_ptr->oppose_acid > v) return FALSE;
2445+ if (creature_ptr->oppose_acid > v) return FALSE;
24462446 }
24472447 else if (!IS_OPPOSE_ACID())
24482448 {
@@ -2454,7 +2454,7 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
24542454 /* Shut */
24552455 else
24562456 {
2457- if (p_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2457+ if (creature_ptr->oppose_acid && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
24582458 {
24592459 msg_print(_("酸への耐性が薄れた気がする。", "You feel less resistant to acid."));
24602460 notice = TRUE;
@@ -2462,11 +2462,11 @@ bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
24622462 }
24632463
24642464 /* Use the value */
2465- p_ptr->oppose_acid = v;
2465+ creature_ptr->oppose_acid = v;
24662466
24672467 /* Nothing to notice */
24682468 if (!notice) return (FALSE);
2469- p_ptr->redraw |= (PR_STATUS);
2469+ creature_ptr->redraw |= (PR_STATUS);
24702470
24712471 if (disturb_state) disturb(FALSE, FALSE);
24722472 handle_stuff();
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -49,7 +49,7 @@ extern bool set_kabenuke(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4949 extern bool set_tsuyoshi(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5050 extern bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v);
5151 extern bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v);
52-extern bool set_oppose_acid(TIME_EFFECT v, bool do_dec);
52+extern bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
5353 extern bool set_oppose_elec(TIME_EFFECT v, bool do_dec);
5454 extern bool set_oppose_fire(TIME_EFFECT v, bool do_dec);
5555 extern bool set_oppose_cold(TIME_EFFECT v, bool do_dec);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -310,7 +310,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
310310
311311 if (cast)
312312 {
313- set_oppose_acid(randint1(base) + base, FALSE);
313+ set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
314314 }
315315 }
316316 break;
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -153,7 +153,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
153153
154154 if (cast)
155155 {
156- set_oppose_acid(randint1(base) + base, FALSE);
156+ set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
157157 }
158158 }
159159 break;
@@ -321,7 +321,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
321321
322322 if (cast)
323323 {
324- set_oppose_acid(randint1(base) + base, FALSE);
324+ set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
325325 set_oppose_elec(randint1(base) + base, FALSE);
326326 set_oppose_fire(randint1(base) + base, FALSE);
327327 set_oppose_cold(randint1(base) + base, FALSE);
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -472,7 +472,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
472472 {
473473 TIME_EFFECT v = randint1(base) + base;
474474 set_fast(p_ptr, v, FALSE);
475- set_oppose_acid(v, FALSE);
475+ set_oppose_acid(p_ptr, v, FALSE);
476476 set_oppose_elec(v, FALSE);
477477 set_oppose_fire(v, FALSE);
478478 set_oppose_cold(v, FALSE);
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -361,7 +361,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
361361
362362 if (cast)
363363 {
364- set_oppose_acid(randint1(base) + base, FALSE);
364+ set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
365365 set_oppose_elec(randint1(base) + base, FALSE);
366366 set_oppose_fire(randint1(base) + base, FALSE);
367367 set_oppose_cold(randint1(base) + base, FALSE);
Show on old repository browser