• R/O
  • HTTP
  • SSH
  • HTTPS

hengband: Commit

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


Commit MetaInfo

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

Log Message

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

Change Summary

Incremental Difference

--- a/src/core.c
+++ b/src/core.c
@@ -1857,7 +1857,7 @@ static void process_world_aux_timeout(void)
18571857 p_ptr->ele_immune--;
18581858
18591859 /* Clear all temporary elemental brands. */
1860- if (!p_ptr->ele_immune) set_ele_immune(0, 0);
1860+ if (!p_ptr->ele_immune) set_ele_immune(p_ptr, 0, 0);
18611861 }
18621862
18631863 /* Timed infra-vision */
--- a/src/player-effects.c
+++ b/src/player-effects.c
@@ -329,7 +329,7 @@ void dispel_player(void)
329329 (void)set_ultimate_res(0, TRUE);
330330 (void)set_mimic(p_ptr, 0, 0, TRUE);
331331 (void)set_ele_attack(p_ptr, 0, 0);
332- (void)set_ele_immune(0, 0);
332+ (void)set_ele_immune(p_ptr, 0, 0);
333333
334334 /* Cancel glowing hands */
335335 if (p_ptr->special_attack & ATTACK_CONFUSE)
@@ -2368,44 +2368,44 @@ bool set_ele_attack(player_type *creature_ptr, u32b attack_type, TIME_EFFECT v)
23682368 * @param v 継続時間
23692369 * @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
23702370 */
2371-bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
2371+bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v)
23722372 {
23732373 v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
23742374
23752375 /* Clear all elemental attacks (only one is allowed at a time). */
2376- if ((p_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
2376+ if ((creature_ptr->special_defense & (DEFENSE_ACID)) && (immune_type != DEFENSE_ACID))
23772377 {
2378- p_ptr->special_defense &= ~(DEFENSE_ACID);
2378+ creature_ptr->special_defense &= ~(DEFENSE_ACID);
23792379 msg_print(_("酸の攻撃で傷つけられるようになった。。", "You are no longer immune to acid."));
23802380 }
2381- if ((p_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
2381+ if ((creature_ptr->special_defense & (DEFENSE_ELEC)) && (immune_type != DEFENSE_ELEC))
23822382 {
2383- p_ptr->special_defense &= ~(DEFENSE_ELEC);
2383+ creature_ptr->special_defense &= ~(DEFENSE_ELEC);
23842384 msg_print(_("電撃の攻撃で傷つけられるようになった。。", "You are no longer immune to electricity."));
23852385 }
2386- if ((p_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
2386+ if ((creature_ptr->special_defense & (DEFENSE_FIRE)) && (immune_type != DEFENSE_FIRE))
23872387 {
2388- p_ptr->special_defense &= ~(DEFENSE_FIRE);
2388+ creature_ptr->special_defense &= ~(DEFENSE_FIRE);
23892389 msg_print(_("火炎の攻撃で傷つけられるようになった。。", "You are no longer immune to fire."));
23902390 }
2391- if ((p_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
2391+ if ((creature_ptr->special_defense & (DEFENSE_COLD)) && (immune_type != DEFENSE_COLD))
23922392 {
2393- p_ptr->special_defense &= ~(DEFENSE_COLD);
2393+ creature_ptr->special_defense &= ~(DEFENSE_COLD);
23942394 msg_print(_("冷気の攻撃で傷つけられるようになった。。", "You are no longer immune to cold."));
23952395 }
2396- if ((p_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
2396+ if ((creature_ptr->special_defense & (DEFENSE_POIS)) && (immune_type != DEFENSE_POIS))
23972397 {
2398- p_ptr->special_defense &= ~(DEFENSE_POIS);
2398+ creature_ptr->special_defense &= ~(DEFENSE_POIS);
23992399 msg_print(_("毒の攻撃で傷つけられるようになった。。", "You are no longer immune to poison."));
24002400 }
24012401
24022402 if ((v) && (immune_type))
24032403 {
24042404 /* Set attack type. */
2405- p_ptr->special_defense |= (immune_type);
2405+ creature_ptr->special_defense |= (immune_type);
24062406
24072407 /* Set duration. */
2408- p_ptr->ele_immune = v;
2408+ creature_ptr->ele_immune = v;
24092409
24102410 msg_format(_("%sの攻撃を受けつけなくなった!", "For a while, You are immune to %s"),
24112411 ((immune_type == DEFENSE_ACID) ? _("酸", "acid!") :
@@ -2417,8 +2417,8 @@ bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
24172417 }
24182418
24192419 if (disturb_state) disturb(FALSE, FALSE);
2420- p_ptr->redraw |= (PR_STATUS);
2421- p_ptr->update |= (PU_BONUS);
2420+ creature_ptr->redraw |= (PR_STATUS);
2421+ creature_ptr->update |= (PU_BONUS);
24222422 handle_stuff();
24232423
24242424 return (TRUE);
@@ -4307,13 +4307,13 @@ bool choose_ele_immune(TIME_EFFECT immune_turn)
43074307 choice = inkey();
43084308
43094309 if ((choice == 'a') || (choice == 'A'))
4310- set_ele_immune(DEFENSE_FIRE, immune_turn);
4310+ set_ele_immune(p_ptr, DEFENSE_FIRE, immune_turn);
43114311 else if ((choice == 'b') || (choice == 'B'))
4312- set_ele_immune(DEFENSE_COLD, immune_turn);
4312+ set_ele_immune(p_ptr, DEFENSE_COLD, immune_turn);
43134313 else if ((choice == 'c') || (choice == 'C'))
4314- set_ele_immune(DEFENSE_ACID, immune_turn);
4314+ set_ele_immune(p_ptr, DEFENSE_ACID, immune_turn);
43154315 else if ((choice == 'd') || (choice == 'D'))
4316- set_ele_immune(DEFENSE_ELEC, immune_turn);
4316+ set_ele_immune(p_ptr, DEFENSE_ELEC, immune_turn);
43174317 else
43184318 {
43194319 msg_print(_("免疫を付けるのをやめた。", "You cancel the temporary immune."));
--- a/src/player-effects.h
+++ b/src/player-effects.h
@@ -48,7 +48,7 @@ extern bool set_dustrobe(player_type *creature_ptr, TIME_EFFECT v, bool do_dec);
4848 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);
51-extern bool set_ele_immune(u32b immune_type, TIME_EFFECT v);
51+extern bool set_ele_immune(player_type *creature_ptr, u32b immune_type, TIME_EFFECT v);
5252 extern bool set_oppose_acid(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);
Show on old repository browser