OSDN Git Service

[Refactor] #40514 player_type の resist_sound 変数を廃止. / Abolished the resist_sound...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 01:31:45 +0000 (10:31 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 01:44:10 +0000 (10:44 +0900)
src/effect/effect-player-resist-hurt.c
src/monster-attack/monster-attack-status.c
src/monster/monster-update.c
src/mspell/high-resistance-checker.c
src/player-info/resistance-info.c
src/player/player-status-resist.c
src/player/player-status.c
src/player/player-status.h

index de56155..5b54a40 100644 (file)
@@ -134,7 +134,7 @@ void effect_player_plasma(player_type *target_ptr, effect_player_type *ep_ptr)
 
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell);
 
-    if (!target_ptr->resist_sound && !check_multishadow(target_ptr)) {
+    if (!has_resist_sound(target_ptr) && !check_multishadow(target_ptr)) {
         int plus_stun = (randint1((ep_ptr->dam > 40) ? 35 : (ep_ptr->dam * 3 / 4 + 5)));
         (void)set_stun(target_ptr, target_ptr->stun + plus_stun);
     }
@@ -172,7 +172,7 @@ void effect_player_water(player_type *target_ptr, effect_player_type *ep_ptr)
         return;
     }
 
-    if (!target_ptr->resist_sound && !target_ptr->resist_water) {
+    if (!has_resist_sound(target_ptr) && !target_ptr->resist_water) {
         set_stun(target_ptr, target_ptr->stun + randint1(40));
     }
     if (!has_resist_conf(target_ptr) && !target_ptr->resist_water) {
@@ -247,12 +247,12 @@ void effect_player_sound(player_type *target_ptr, effect_player_type *ep_ptr)
 
     ep_ptr->dam = ep_ptr->dam * calc_sound_damage_rate(target_ptr, CALC_RAND) / 100;
 
-    if (!target_ptr->resist_sound && !check_multishadow(target_ptr)) {
+    if (!has_resist_sound(target_ptr) && !check_multishadow(target_ptr)) {
         int plus_stun = (randint1((ep_ptr->dam > 90) ? 35 : (ep_ptr->dam / 3 + 5)));
         (void)set_stun(target_ptr, target_ptr->stun + plus_stun);
     }
 
-    if (!target_ptr->resist_sound || one_in_(13))
+    if (!has_resist_sound(target_ptr) || one_in_(13))
         inventory_damage(target_ptr, set_cold_destroy, 2);
 
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell);
@@ -304,7 +304,7 @@ void effect_player_force(player_type *target_ptr, effect_player_type *ep_ptr)
 {
     if (target_ptr->blind)
         msg_print(_("運動エネルギーで攻撃された!", "You are hit by kinetic force!"));
-    if (!target_ptr->resist_sound && !check_multishadow(target_ptr)) {
+    if (!has_resist_sound(target_ptr) && !check_multishadow(target_ptr)) {
         (void)set_stun(target_ptr, target_ptr->stun + randint1(20));
     }
 
@@ -315,7 +315,7 @@ void effect_player_rocket(player_type *target_ptr, effect_player_type *ep_ptr)
 {
     if (target_ptr->blind)
         msg_print(_("爆発があった!", "There is an explosion!"));
-    if (!target_ptr->resist_sound && !check_multishadow(target_ptr)) {
+    if (!has_resist_sound(target_ptr) && !check_multishadow(target_ptr)) {
         (void)set_stun(target_ptr, target_ptr->stun + randint1(20));
     }
 
@@ -489,7 +489,7 @@ void effect_player_gravity(player_type *target_ptr, effect_player_type *ep_ptr)
         teleport_player(target_ptr, 5, TELEPORT_PASSIVE);
         if (!target_ptr->levitation)
             (void)set_slow(target_ptr, target_ptr->slow + randint0(4) + 4, FALSE);
-        if (!(target_ptr->resist_sound || target_ptr->levitation)) {
+        if (!(has_resist_sound(target_ptr) || target_ptr->levitation)) {
             int plus_stun = (randint1((ep_ptr->dam > 90) ? 35 : (ep_ptr->dam / 3 + 5)));
             (void)set_stun(target_ptr, target_ptr->stun + plus_stun);
         }
@@ -563,7 +563,7 @@ void effect_player_icee(player_type *target_ptr, effect_player_type *ep_ptr)
         (void)set_cut(target_ptr, target_ptr->cut + damroll(5, 8));
     }
 
-    if (!target_ptr->resist_sound) {
+    if (!has_resist_sound(target_ptr)) {
         (void)set_stun(target_ptr, target_ptr->stun + randint1(15));
     }
 
index 049bba3..f0f9a69 100644 (file)
@@ -12,6 +12,7 @@
 #include "status/bad-status-setter.h"
 #include "status/base-status.h"
 #include "status/experience.h"
+#include "player/player-status-flags.h"
 #include "view/display-messages.h"
 
 void process_blind_attack(player_type *target_ptr, monap_type *monap_ptr)
@@ -95,7 +96,7 @@ void process_lose_all_attack(player_type *target_ptr, monap_type *monap_ptr)
 
 void process_stun_attack(player_type *target_ptr, monap_type *monap_ptr)
 {
-    if (target_ptr->resist_sound || check_multishadow(target_ptr))
+    if (has_resist_sound(target_ptr) || check_multishadow(target_ptr))
         return;
 
     monster_race *r_ptr = &r_info[monap_ptr->m_ptr->r_idx];
index f2b6056..37be3f4 100644 (file)
@@ -636,7 +636,7 @@ void update_smart_learn(player_type *player_ptr, MONSTER_IDX m_idx, int what)
 
         break;
     case DRS_SOUND:
-        if (player_ptr->resist_sound)
+        if (has_resist_sound(player_ptr))
             m_ptr->smart |= SM_RES_SOUND;
 
         break;
index 73da34f..b6e362f 100644 (file)
@@ -36,7 +36,7 @@ void add_cheat_remove_flags_others(player_type *target_ptr, msr_type *msr_ptr)
     if (target_ptr->resist_nexus)
         msr_ptr->smart |= SM_RES_NEXUS;
 
-    if (target_ptr->resist_sound)
+    if (has_resist_sound(target_ptr))
         msr_ptr->smart |= SM_RES_SOUND;
 
     if (target_ptr->resist_shard)
index 1735134..f3836b6 100644 (file)
@@ -69,7 +69,7 @@ void set_high_resistance_info(player_type *creature_ptr, self_info_type *self_pt
     if (has_resist_conf(creature_ptr))
         self_ptr->info[self_ptr->line++] = _("あなたは混乱への耐性を持っている。", "You are resistant to confusion.");
     
-    if (creature_ptr->resist_sound)
+    if (has_resist_sound(creature_ptr))
         self_ptr->info[self_ptr->line++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks.");
     
     if (creature_ptr->resist_disen)
index a7bbcab..18bff55 100644 (file)
@@ -287,7 +287,7 @@ PERCENTAGE calc_sound_damage_rate(player_type *creature_ptr, rate_calc_type_mode
 {
     PERCENTAGE per = 100;
 
-    if (creature_ptr->resist_sound) {
+    if (has_resist_sound(creature_ptr)) {
         per *= 500;
         per /= randrate(4, 7, mode);
     }
index fa979ef..5e784ef 100644 (file)
@@ -394,7 +394,6 @@ void calc_bonuses(player_type *creature_ptr)
     has_curses(creature_ptr);
     creature_ptr->impact = has_impact(creature_ptr);
     has_extra_blow(creature_ptr);
-    creature_ptr->resist_sound = has_resist_sound(creature_ptr);
     creature_ptr->resist_lite = has_resist_lite(creature_ptr);
     creature_ptr->resist_dark = has_resist_dark(creature_ptr);
     creature_ptr->resist_chaos = has_resist_chaos(creature_ptr);
index 3943c7b..1c46350 100644 (file)
@@ -366,7 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS resist_sound; /* Resist sound */
     BIT_FLAGS resist_lite; /* Resist light */
     BIT_FLAGS resist_dark; /* Resist darkness */
     BIT_FLAGS resist_chaos; /* Resist chaos */