OSDN Git Service

[Refactor] #40514 player_type の resist_water 変数を廃止. / Abolished resist_water variable...
authordeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:59:55 +0000 (13:59 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Mon, 11 Jan 2021 04:59:55 +0000 (13:59 +0900)
src/core/hp-mp-processor.c
src/effect/effect-player-resist-hurt.c
src/player/player-status.c
src/player/player-status.h

index bdc37e2..a4e8972 100644 (file)
@@ -279,7 +279,7 @@ void process_player_hp_mp(player_type *creature_ptr)
     }
 
     if (has_flag(f_ptr->flags, FF_WATER) && has_flag(f_ptr->flags, FF_DEEP) && !creature_ptr->levitation && !creature_ptr->can_swim
-        && !creature_ptr->resist_water) {
+        && !has_resist_water(creature_ptr)) {
         if (calc_inventory_weight(creature_ptr) > calc_weight_limit(creature_ptr)) {
             msg_print(_("溺れている!", "You are drowning!"));
             take_hit(creature_ptr, DAMAGE_NOESCAPE, randint1(creature_ptr->lev), _("溺れ", "drowning"), -1);
index 5c57fdc..e738f90 100644 (file)
@@ -172,18 +172,18 @@ void effect_player_water(player_type *target_ptr, effect_player_type *ep_ptr)
         return;
     }
 
-    if (!has_resist_sound(target_ptr) && !target_ptr->resist_water) {
+    if (!has_resist_sound(target_ptr) && !has_resist_water(target_ptr)) {
         set_stun(target_ptr, target_ptr->stun + randint1(40));
     }
-    if (!has_resist_conf(target_ptr) && !target_ptr->resist_water) {
+    if (!has_resist_conf(target_ptr) && !has_resist_water(target_ptr)) {
         set_confused(target_ptr, target_ptr->confused + randint1(5) + 5);
     }
 
-    if (one_in_(5) && !target_ptr->resist_water) {
+    if (one_in_(5) && !has_resist_water(target_ptr)) {
         inventory_damage(target_ptr, set_cold_destroy, 3);
     }
 
-    if (target_ptr->resist_water)
+    if (has_resist_water(target_ptr))
         ep_ptr->get_damage /= 4;
 
     ep_ptr->get_damage = take_hit(target_ptr, DAMAGE_ATTACK, ep_ptr->dam, ep_ptr->killer, ep_ptr->monspell);
index f557f20..ed0dafd 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_water = has_resist_water(creature_ptr);
 
     creature_ptr->lite = has_lite(creature_ptr);
 
index 697b147..50f4c05 100644 (file)
@@ -366,8 +366,6 @@ typedef struct player_type {
     bool is_fired;
     bool level_up_message;
 
-    BIT_FLAGS resist_water; /* Resist water */
-
     BIT_FLAGS reflect; /* Reflect 'bolt' attacks */
     BIT_FLAGS sh_fire; /* Fiery 'immolation' effect */
     BIT_FLAGS sh_elec; /* Electric 'immolation' effect */