OSDN Git Service

[Refactor] ステータス修正以外のチャージマン判定を is_chargeman() に集約.
authordeskull <deskull@users.sourceforge.jp>
Mon, 28 Jun 2021 11:57:22 +0000 (20:57 +0900)
committerDeskull <61610939+sikabane-works@users.noreply.github.com>
Tue, 29 Jun 2021 11:39:24 +0000 (20:39 +0900)
src/dungeon/quest.cpp
src/grid/trap.cpp
src/inventory/inventory-damage.cpp
src/monster-floor/one-monster-placer.cpp
src/mspell/mspell-dispel.cpp
src/mspell/mspell-floor.cpp
src/player/player-status.cpp
src/player/player-status.h
src/status/bad-status-setter.cpp

index 623e9d6..7acc3a7 100644 (file)
@@ -330,7 +330,7 @@ void do_cmd_quest(player_type *player_ptr)
         return;
     if (is_echizen(player_ptr))
         msg_print(_("『とにかく入ってみようぜぇ。』", "\"Let's go in anyway.\""));
-    else if (player_ptr->pseikaku == PERSONALITY_CHARGEMAN)
+    else if (is_chargeman(player_ptr))
         msg_print(_("『全滅してやるぞ!』", "\"I'll annihilate THEM!\""));
 
     /* Player enters a new quest */
index 42ca2c6..0ee0087 100644 (file)
@@ -420,7 +420,7 @@ void hit_trap(player_type *trapped_ptr, bool break_trap)
             msg_print(_("落とし戸に落ちた!", "You have fallen through a trap door!"));
             if (is_echizen(trapped_ptr))
                 msg_print(_("くっそ~!", ""));
-            else if (trapped_ptr->pseikaku == PERSONALITY_CHARGEMAN)
+            else if (is_chargeman(trapped_ptr))
                 msg_print(_("ジュラル星人の仕業に違いない!", ""));
 
             sound(SOUND_FALL);
index a444e05..e9c4bed 100644 (file)
@@ -73,7 +73,7 @@ void inventory_damage(player_type *player_ptr, inven_func typ, int perc)
 #ifdef JP
         if (is_echizen(player_ptr))
             msg_print("やりやがったな!");
-        else if (player_ptr->pseikaku == PERSONALITY_CHARGEMAN) {
+        else if (is_chargeman(player_ptr)) {
             if (randint0(2) == 0)
                 msg_print(_("ジュラル星人め!", ""));
             else
index 19a2c89..f260670 100644 (file)
@@ -34,6 +34,7 @@
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
 #include "monster/monster-util.h"
+#include "player/player-status.h"
 #include "object/warning.h"
 #include "spell/spell-types.h"
 #include "system/floor-type-definition.h"
@@ -77,7 +78,7 @@ static bool monster_hook_tanuki(player_type *player_ptr, MONRACE_IDX r_idx)
 static MONRACE_IDX initial_r_appearance(player_type *player_ptr, MONRACE_IDX r_idx, BIT_FLAGS generate_mode)
 {
     floor_type *floor_ptr = player_ptr->current_floor_ptr;
-    if (player_ptr->pseikaku == PERSONALITY_CHARGEMAN && (generate_mode & PM_JURAL) && !(generate_mode & (PM_MULTIPLY | PM_KAGE)))
+    if (is_chargeman(player_ptr) && (generate_mode & PM_JURAL) && !(generate_mode & (PM_MULTIPLY | PM_KAGE)))
         return MON_ALIEN_JURAL;
 
     if (!(r_info[r_idx].flags7 & RF7_TANUKI))
index ecd978f..1d46d6d 100644 (file)
@@ -124,7 +124,7 @@ MonsterSpellResult spell_RF4_DISPEL(MONSTER_IDX m_idx, player_type *target_ptr,
 
         if (is_echizen(target_ptr))
             msg_print(_("やりやがったな!", ""));
-        else if (target_ptr->pseikaku == PERSONALITY_CHARGEMAN) {
+        else if (is_chargeman(target_ptr)) {
             if (randint0(2) == 0)
                 msg_print(_("ジュラル星人め!", ""));
             else
index 255fd40..81f9a6d 100644 (file)
@@ -239,7 +239,7 @@ MonsterSpellResult spell_RF6_TELE_AWAY(player_type *target_ptr, MONSTER_IDX m_id
     if (TARGET_TYPE == MONSTER_TO_PLAYER) {
         if (is_echizen(target_ptr))
             msg_print(_("くっそ~", ""));
-        else if (target_ptr->pseikaku == PERSONALITY_CHARGEMAN) {
+        else if (is_chargeman(target_ptr)) {
             if (randint0(2) == 0)
                 msg_print(_("ジュラル星人め!", ""));
             else
index c7d26e1..f67ad45 100644 (file)
@@ -3026,6 +3026,11 @@ bool is_echizen(player_type *creature_ptr)
     return (creature_ptr->pseikaku == PERSONALITY_COMBAT) || (creature_ptr->inventory_list[INVEN_BOW].name1 == ART_CRIMSON);
 }
 
+bool is_chargeman(player_type *creature_ptr)
+{
+    return creature_ptr->pseikaku == PERSONALITY_CHARGEMAN;
+}
+
 WEIGHT calc_weapon_weight_limit(player_type *creature_ptr)
 {
     WEIGHT weight = adj_str_hold[creature_ptr->stat_index[A_STR]];
index 3ded9ce..8f6855c 100644 (file)
@@ -38,5 +38,6 @@ bool is_invuln(player_type *creature_ptr);
 bool is_hero(player_type *creature_ptr);
 bool is_shero(player_type *creature_ptr);
 bool is_echizen(player_type *creature_ptr);
+bool is_chargeman(player_type *creature_ptr);
 
 void stop_mouth(player_type *caster_ptr);
index 36b2d37..4fb4c92 100644 (file)
@@ -9,6 +9,7 @@
 #include "player/attack-defense-types.h"
 #include "player-info/avatar.h"
 #include "player/player-race.h"
+#include "player/player-status.h"
 #include "player/player-status-flags.h"
 #include "player/special-defense-types.h"
 #include "spell-realm/spells-hex.h"
@@ -289,7 +290,7 @@ bool set_image(player_type *creature_ptr, TIME_EFFECT v)
 
     if (creature_ptr->is_dead)
         return false;
-    if (creature_ptr->pseikaku == PERSONALITY_CHARGEMAN)
+    if (is_chargeman(creature_ptr))
         v = 0;
 
     if (v) {