• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

Revision313e69353b4c989c26397b56190ae75e2dc8b33c (tree)
Time2019-06-24 23:29:30
Authordeskull <deskull@user...>
Commiterdeskull

Log Message

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

Change Summary

Incremental Difference

--- a/src/cmd-activate.c
+++ b/src/cmd-activate.c
@@ -1039,7 +1039,7 @@ bool activate_artifact(object_type *o_ptr)
10391039 (void)hp_player(p_ptr, 10);
10401040 (void)set_blessed(p_ptr, randint1(50) + 50, FALSE);
10411041 (void)set_oppose_acid(p_ptr, randint1(50) + 50, FALSE);
1042- (void)set_oppose_elec(randint1(50) + 50, FALSE);
1042+ (void)set_oppose_elec(p_ptr, randint1(50) + 50, FALSE);
10431043 (void)set_oppose_fire(randint1(50) + 50, FALSE);
10441044 (void)set_oppose_cold(randint1(50) + 50, FALSE);
10451045 (void)set_oppose_pois(randint1(50) + 50, FALSE);
@@ -1336,7 +1336,7 @@ bool activate_artifact(object_type *o_ptr)
13361336 {
13371337 msg_print(_("様々な色に輝いている...", "It glows many colours..."));
13381338 (void)set_oppose_acid(p_ptr, randint1(40) + 40, FALSE);
1339- (void)set_oppose_elec(randint1(40) + 40, FALSE);
1339+ (void)set_oppose_elec(p_ptr, randint1(40) + 40, FALSE);
13401340 (void)set_oppose_fire(randint1(40) + 40, FALSE);
13411341 (void)set_oppose_cold(randint1(40) + 40, FALSE);
13421342 (void)set_oppose_pois(randint1(40) + 40, FALSE);
@@ -1426,7 +1426,7 @@ bool activate_artifact(object_type *o_ptr)
14261426 if (!get_aim_dir(&dir)) return FALSE;
14271427 fire_ball(GF_ELEC, dir, 100, 2);
14281428 }
1429- (void)set_oppose_elec(randint1(20) + 20, FALSE);
1429+ (void)set_oppose_elec(p_ptr, randint1(20) + 20, FALSE);
14301430 break;
14311431 }
14321432
@@ -1689,7 +1689,7 @@ bool activate_artifact(object_type *o_ptr)
16891689 (void)hp_player(p_ptr, 10);
16901690 (void)set_blessed(p_ptr, v, FALSE);
16911691 (void)set_oppose_acid(p_ptr, v, FALSE);
1692- (void)set_oppose_elec(v, FALSE);
1692+ (void)set_oppose_elec(p_ptr, v, FALSE);
16931693 (void)set_oppose_fire(v, FALSE);
16941694 (void)set_oppose_cold(v, FALSE);
16951695 (void)set_oppose_pois(v, FALSE);
--- a/src/cmd-quaff.c
+++ b/src/cmd-quaff.c
@@ -450,7 +450,7 @@ void exe_quaff_potion(INVENTORY_IDX item)
450450
451451 case SV_POTION_RESISTANCE:
452452 (void)set_oppose_acid(p_ptr, p_ptr->oppose_acid + randint1(20) + 20, FALSE);
453- (void)set_oppose_elec(p_ptr->oppose_elec + randint1(20) + 20, FALSE);
453+ (void)set_oppose_elec(p_ptr, 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);
456456 (void)set_oppose_pois(p_ptr->oppose_pois + randint1(20) + 20, FALSE);
--- a/src/core.c
+++ b/src/core.c
@@ -2049,7 +2049,7 @@ static void process_world_aux_timeout(void)
20492049 /* Oppose Lightning */
20502050 if (p_ptr->oppose_elec)
20512051 {
2052- (void)set_oppose_elec(p_ptr->oppose_elec - 1, TRUE);
2052+ (void)set_oppose_elec(p_ptr, p_ptr->oppose_elec - 1, TRUE);
20532053 }
20542054
20552055 /* Oppose Fire */
--- a/src/mind.c
+++ b/src/mind.c
@@ -1110,7 +1110,7 @@ static bool cast_mindcrafter_spell(int spell)
11101110 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);
1113- if (plev > 29) set_oppose_elec((TIME_EFFECT)plev, FALSE);
1113+ 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;
11161116 case 7:
--- a/src/mutation.c
+++ b/src/mutation.c
@@ -2234,7 +2234,7 @@ bool mutation_power_aux(int power)
22342234 }
22352235 if (randint0(4) < num)
22362236 {
2237- (void)set_oppose_elec(dur, FALSE);
2237+ (void)set_oppose_elec(p_ptr, dur, FALSE);
22382238 num--;
22392239 }
22402240 if (randint0(3) < num)
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -322,7 +322,7 @@ void dispel_player(void)
322322 (void)set_magicdef(p_ptr, 0, TRUE);
323323 (void)set_resist_magic(p_ptr, 0, TRUE);
324324 (void)set_oppose_acid(p_ptr, 0, TRUE);
325- (void)set_oppose_elec(0, TRUE);
325+ (void)set_oppose_elec(p_ptr, 0, TRUE);
326326 (void)set_oppose_fire(0, TRUE);
327327 (void)set_oppose_cold(0, TRUE);
328328 (void)set_oppose_pois(0, TRUE);
@@ -2479,19 +2479,19 @@ bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
24792479 * @param do_dec 現在の継続時間より長い値のみ上書きする
24802480 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
24812481 */
2482-bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
2482+bool set_oppose_elec(player_type *creature_ptr, TIME_EFFECT v, bool do_dec)
24832483 {
24842484 bool notice = FALSE;
24852485 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
24862486
2487- if (p_ptr->is_dead) return FALSE;
2487+ if (creature_ptr->is_dead) return FALSE;
24882488
24892489 /* Open */
24902490 if (v)
24912491 {
2492- if (p_ptr->oppose_elec && !do_dec)
2492+ if (creature_ptr->oppose_elec && !do_dec)
24932493 {
2494- if (p_ptr->oppose_elec > v) return FALSE;
2494+ if (creature_ptr->oppose_elec > v) return FALSE;
24952495 }
24962496 else if (!IS_OPPOSE_ELEC())
24972497 {
@@ -2503,7 +2503,7 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
25032503 /* Shut */
25042504 else
25052505 {
2506- if (p_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(p_ptr->special_defense & KATA_MUSOU))
2506+ if (creature_ptr->oppose_elec && !music_singing(MUSIC_RESIST) && !(creature_ptr->special_defense & KATA_MUSOU))
25072507 {
25082508 msg_print(_("電撃への耐性が薄れた気がする。", "You feel less resistant to electricity."));
25092509 notice = TRUE;
@@ -2511,11 +2511,11 @@ bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
25112511 }
25122512
25132513 /* Use the value */
2514- p_ptr->oppose_elec = v;
2514+ creature_ptr->oppose_elec = v;
25152515
25162516 /* Nothing to notice */
25172517 if (!notice) return (FALSE);
2518- p_ptr->redraw |= (PR_STATUS);
2518+ creature_ptr->redraw |= (PR_STATUS);
25192519
25202520 if (disturb_state) disturb(FALSE, FALSE);
25212521 handle_stuff();
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -50,7 +50,7 @@ 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);
5252 extern bool set_oppose_acid(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
53-extern bool set_oppose_elec(TIME_EFFECT v, bool do_dec);
53+extern bool set_oppose_elec(player_type *creature_ptr, 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);
5656 extern bool set_oppose_pois(TIME_EFFECT v, bool do_dec);
--- a/src/realm-arcane.c
+++ b/src/realm-arcane.c
@@ -293,7 +293,7 @@ concptr do_arcane_spell(SPELL_IDX spell, BIT_FLAGS mode)
293293
294294 if (cast)
295295 {
296- set_oppose_elec(randint1(base) + base, FALSE);
296+ set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
297297 }
298298 }
299299 break;
--- a/src/realm-craft.c
+++ b/src/realm-craft.c
@@ -136,7 +136,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
136136
137137 if (cast)
138138 {
139- set_oppose_elec(randint1(base) + base, FALSE);
139+ set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
140140 }
141141 }
142142 break;
@@ -322,7 +322,7 @@ concptr do_craft_spell(SPELL_IDX spell, BIT_FLAGS mode)
322322 if (cast)
323323 {
324324 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
325- set_oppose_elec(randint1(base) + base, FALSE);
325+ set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
326326 set_oppose_fire(randint1(base) + base, FALSE);
327327 set_oppose_cold(randint1(base) + base, FALSE);
328328 set_oppose_pois(randint1(base) + base, FALSE);
--- a/src/realm-life.c
+++ b/src/realm-life.c
@@ -473,7 +473,7 @@ concptr do_life_spell(SPELL_IDX spell, BIT_FLAGS mode)
473473 TIME_EFFECT v = randint1(base) + base;
474474 set_fast(p_ptr, v, FALSE);
475475 set_oppose_acid(p_ptr, v, FALSE);
476- set_oppose_elec(v, FALSE);
476+ set_oppose_elec(p_ptr, v, FALSE);
477477 set_oppose_fire(v, FALSE);
478478 set_oppose_cold(v, FALSE);
479479 set_oppose_pois(v, FALSE);
--- a/src/realm-nature.c
+++ b/src/realm-nature.c
@@ -163,7 +163,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
163163 {
164164 set_oppose_cold(randint1(base) + base, FALSE);
165165 set_oppose_fire(randint1(base) + base, FALSE);
166- set_oppose_elec(randint1(base) + base, FALSE);
166+ set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
167167 }
168168 }
169169 break;
@@ -362,7 +362,7 @@ concptr do_nature_spell(SPELL_IDX spell, BIT_FLAGS mode)
362362 if (cast)
363363 {
364364 set_oppose_acid(p_ptr, randint1(base) + base, FALSE);
365- set_oppose_elec(randint1(base) + base, FALSE);
365+ set_oppose_elec(p_ptr, randint1(base) + base, FALSE);
366366 set_oppose_fire(randint1(base) + base, FALSE);
367367 set_oppose_cold(randint1(base) + base, FALSE);
368368 set_oppose_pois(randint1(base) + base, FALSE);
Show on old repository browser