From e7ee87126cb89688852196500cb9d73b8538f3d8 Mon Sep 17 00:00:00 2001 From: deskull Date: Mon, 28 Jun 2021 20:57:22 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20=E3=82=B9=E3=83=86=E3=83=BC?= =?utf8?q?=E3=82=BF=E3=82=B9=E4=BF=AE=E6=AD=A3=E4=BB=A5=E5=A4=96=E3=81=AE?= =?utf8?q?=E3=83=81=E3=83=A3=E3=83=BC=E3=82=B8=E3=83=9E=E3=83=B3=E5=88=A4?= =?utf8?q?=E5=AE=9A=E3=82=92=20is=5Fchargeman()=20=E3=81=AB=E9=9B=86?= =?utf8?q?=E7=B4=84.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/dungeon/quest.cpp | 2 +- src/grid/trap.cpp | 2 +- src/inventory/inventory-damage.cpp | 2 +- src/monster-floor/one-monster-placer.cpp | 3 ++- src/mspell/mspell-dispel.cpp | 2 +- src/mspell/mspell-floor.cpp | 2 +- src/player/player-status.cpp | 5 +++++ src/player/player-status.h | 1 + src/status/bad-status-setter.cpp | 3 ++- 9 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/dungeon/quest.cpp b/src/dungeon/quest.cpp index 623e9d63d..7acc3a76c 100644 --- a/src/dungeon/quest.cpp +++ b/src/dungeon/quest.cpp @@ -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 */ diff --git a/src/grid/trap.cpp b/src/grid/trap.cpp index 42ca2c6cd..0ee0087c7 100644 --- a/src/grid/trap.cpp +++ b/src/grid/trap.cpp @@ -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); diff --git a/src/inventory/inventory-damage.cpp b/src/inventory/inventory-damage.cpp index a444e05e3..e9c4bed86 100644 --- a/src/inventory/inventory-damage.cpp +++ b/src/inventory/inventory-damage.cpp @@ -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 diff --git a/src/monster-floor/one-monster-placer.cpp b/src/monster-floor/one-monster-placer.cpp index 19a2c895b..f260670da 100644 --- a/src/monster-floor/one-monster-placer.cpp +++ b/src/monster-floor/one-monster-placer.cpp @@ -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)) diff --git a/src/mspell/mspell-dispel.cpp b/src/mspell/mspell-dispel.cpp index ecd978f18..1d46d6d1b 100644 --- a/src/mspell/mspell-dispel.cpp +++ b/src/mspell/mspell-dispel.cpp @@ -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 diff --git a/src/mspell/mspell-floor.cpp b/src/mspell/mspell-floor.cpp index 255fd40ab..81f9a6dca 100644 --- a/src/mspell/mspell-floor.cpp +++ b/src/mspell/mspell-floor.cpp @@ -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 diff --git a/src/player/player-status.cpp b/src/player/player-status.cpp index c7d26e196..f67ad452c 100644 --- a/src/player/player-status.cpp +++ b/src/player/player-status.cpp @@ -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]]; diff --git a/src/player/player-status.h b/src/player/player-status.h index 3ded9cef6..8f6855c8c 100644 --- a/src/player/player-status.h +++ b/src/player/player-status.h @@ -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); diff --git a/src/status/bad-status-setter.cpp b/src/status/bad-status-setter.cpp index 36b2d37f3..4fb4c9288 100644 --- a/src/status/bad-status-setter.cpp +++ b/src/status/bad-status-setter.cpp @@ -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) { -- 2.11.0