OSDN Git Service

Merge pull request #3814 from Slimebreath6078/feature/Add_Laffey_II
author火炎の飛竜 <87808091+Slimebreath6078@users.noreply.github.com>
Sun, 3 Mar 2024 13:40:54 +0000 (22:40 +0900)
committerGitHub <noreply@github.com>
Sun, 3 Mar 2024 13:40:54 +0000 (22:40 +0900)
モンスター「ラフィーII」実装

224 files changed:
Hengband/Hengband/Hengband.vcxproj
configure.ac
doxygen/Hengband.doxyfile
hengband.spec
lib/edit/MonsterRaceDefinitions.txt
src/Makefile.am
src/action/movement-execution.cpp
src/action/mutation-execution.cpp
src/action/run-execution.cpp
src/action/travel-execution.cpp
src/autopick/autopick-entry.cpp
src/autopick/autopick-matcher.cpp
src/avatar/avatar-changer.cpp
src/birth/game-play-initializer.cpp
src/blue-magic/blue-magic-caster.cpp
src/cmd-action/cmd-attack.cpp
src/cmd-action/cmd-mane.cpp
src/cmd-action/cmd-open-close.cpp
src/cmd-action/cmd-others.cpp
src/cmd-action/cmd-pet.cpp
src/cmd-action/cmd-tunnel.cpp
src/cmd-io/cmd-lore.cpp
src/combat/attack-criticality.cpp
src/combat/aura-counterattack.cpp
src/combat/shoot.cpp
src/combat/slaying.cpp
src/core/player-processor.cpp
src/dungeon/dungeon-processor.cpp
src/dungeon/quest-monster-placer.cpp
src/dungeon/quest.cpp
src/effect/effect-feature.cpp
src/effect/effect-feature.h
src/effect/effect-item.cpp
src/effect/effect-item.h
src/effect/effect-monster-charm.cpp
src/effect/effect-monster-curse.cpp
src/effect/effect-monster-evil.cpp
src/effect/effect-monster-lite-dark.cpp
src/effect/effect-monster-oldies.cpp
src/effect/effect-monster-psi.cpp
src/effect/effect-monster-resist-hurt.cpp
src/effect/effect-monster-spirit.cpp
src/effect/effect-monster-switcher.cpp
src/effect/effect-monster-util.cpp
src/effect/effect-monster-util.h
src/effect/effect-monster.cpp
src/effect/effect-monster.h
src/effect/effect-player-spirit.cpp
src/effect/effect-player.cpp
src/effect/effect-player.h
src/effect/effect-processor.cpp
src/effect/effect-processor.h
src/flavor/named-item-describer.cpp
src/flavor/object-flavor.cpp
src/flavor/tval-description-switcher.cpp
src/floor/fixed-map-generator.cpp
src/floor/floor-changer.cpp
src/floor/floor-events.cpp
src/floor/floor-streams.cpp
src/floor/object-allocator.cpp
src/floor/wild.cpp
src/grid/feature.cpp
src/grid/grid.cpp
src/hpmp/hp-mp-processor.cpp
src/hpmp/hp-mp-regenerator.cpp
src/info-reader/race-info-tokens-table.h
src/io-dump/character-dump.cpp
src/io/cursor.cpp
src/io/files-util.cpp
src/knowledge/knowledge-monsters.cpp
src/knowledge/knowledge-uniques.cpp
src/load/dungeon-loader.cpp
src/load/lore-loader.cpp
src/load/old/load-v1-5-0.cpp
src/load/old/load-v1-5-0.h
src/load/quest-loader.cpp
src/load/savedata-old-flag-types.h
src/lore/lore-calculator.cpp
src/lore/lore-store.cpp
src/lore/lore-util.cpp
src/lore/lore-util.h
src/lore/magic-types-setter.cpp
src/lore/monster-lore.cpp
src/main/angband-initializer.cpp
src/main/scene-table-monster.cpp
src/market/arena.cpp
src/market/bounty.cpp
src/market/building-monster.cpp
src/market/building-quest.cpp
src/melee/melee-postprocess.cpp
src/melee/melee-postprocess.h
src/melee/melee-spell-flags-checker.cpp
src/melee/monster-attack-monster.cpp
src/mind/mind-berserker.cpp
src/mind/mind-cavalry.cpp
src/mind/mind-elementalist.cpp
src/mind/mind-force-trainer.cpp
src/mind/mind-ninja.cpp
src/mind/mind-samurai.cpp
src/mind/mind-sniper.cpp
src/mind/mind-warrior.cpp
src/mind/monk-attack.cpp
src/monster-attack/monster-attack-player.cpp
src/monster-attack/monster-attack-processor.cpp
src/monster-floor/monster-death-util.cpp
src/monster-floor/monster-death.cpp
src/monster-floor/monster-direction.cpp
src/monster-floor/monster-generator.cpp
src/monster-floor/monster-generator.h
src/monster-floor/monster-lite.cpp
src/monster-floor/monster-move.cpp
src/monster-floor/monster-object.cpp
src/monster-floor/monster-remover.cpp
src/monster-floor/monster-runaway.cpp
src/monster-floor/monster-summon.cpp
src/monster-floor/monster-summon.h
src/monster-floor/monster-sweep-grid.cpp
src/monster-floor/one-monster-placer.cpp
src/monster-floor/one-monster-placer.h
src/monster-floor/quantum-effect.cpp
src/monster-race/monster-race-hook.cpp
src/monster-race/monster-race.cpp
src/monster-race/race-flags1.h [deleted file]
src/monster-race/race-flags2.h [deleted file]
src/monster-race/race-flags3.h [deleted file]
src/monster-race/race-flags7.h [deleted file]
src/monster-race/race-flags8.h [deleted file]
src/monster/monster-compaction.cpp
src/monster/monster-damage.cpp
src/monster/monster-describer.cpp
src/monster/monster-info.cpp
src/monster/monster-list.cpp
src/monster/monster-processor-util.cpp
src/monster/monster-processor-util.h
src/monster/monster-processor.cpp
src/monster/monster-status-setter.cpp
src/monster/monster-status.cpp
src/monster/monster-update.cpp
src/monster/monster-util.cpp
src/monster/monster-util.h
src/mspell/improper-mspell-remover.cpp
src/mspell/mspell-attack.cpp
src/mspell/mspell-checker.cpp
src/mspell/mspell-damage-calculator.cpp
src/mspell/mspell-floor.cpp
src/mspell/mspell-judgement.cpp
src/mspell/mspell-lite.cpp
src/mspell/mspell-selector.cpp
src/mspell/mspell-special.cpp
src/mspell/mspell-status.cpp
src/mspell/mspell-summon.cpp
src/mspell/smart-mspell-util.cpp
src/mspell/summon-checker.cpp
src/mutation/mutation-techniques.cpp
src/object-activation/activation-others.cpp
src/object-use/throw-execution.cpp
src/object/object-broken.cpp
src/object/object-broken.h
src/object/warning.cpp
src/perception/identification.cpp
src/pet/pet-fall-off.cpp
src/pet/pet-util.cpp
src/player-attack/attack-chaos-effect.cpp
src/player-attack/player-attack.cpp
src/player-info/alignment.cpp
src/player/eldritch-horror.cpp
src/player/player-damage.cpp
src/player/player-status-flags.cpp
src/player/player-status-resist.cpp
src/player/player-status.cpp
src/racial/racial-vampire.cpp
src/realm/realm-hex.cpp
src/realm/realm-hissatsu.cpp
src/room/rooms-pit-nest.cpp
src/room/vault-builder.cpp
src/save/monster-writer.cpp
src/spell-class/spells-mirror-master.cpp
src/spell-kind/earthquake.cpp
src/spell-kind/spells-detection.cpp
src/spell-kind/spells-fetcher.cpp
src/spell-kind/spells-floor.cpp
src/spell-kind/spells-genocide.cpp
src/spell-kind/spells-launcher.cpp
src/spell-kind/spells-launcher.h
src/spell-kind/spells-lite.cpp
src/spell-kind/spells-neighbor.cpp
src/spell-kind/spells-neighbor.h
src/spell-kind/spells-pet.cpp
src/spell-kind/spells-polymorph.cpp
src/spell-kind/spells-sight.cpp
src/spell-kind/spells-sight.h
src/spell-kind/spells-teleport.cpp
src/spell-kind/spells-world.cpp
src/spell-realm/spells-chaos.cpp
src/spell-realm/spells-craft.cpp
src/spell-realm/spells-crusade.cpp
src/spell/spells-diceroll.cpp
src/spell/spells-object.cpp
src/spell/spells-status.cpp
src/spell/spells-summon.cpp
src/spell/spells-summon.h
src/store/service-checker.cpp
src/system/angband-version.h
src/system/dungeon-info.h
src/system/grid-type-definition.cpp
src/system/grid-type-definition.h
src/system/monster-race-info.h
src/target/projection-path-calculator.cpp
src/target/target-describer.cpp
src/target/target-getter.cpp
src/target/target-preparation.cpp
src/util/sort.cpp
src/view/display-lore-attacks.cpp
src/view/display-lore-drops.cpp
src/view/display-lore-magics.cpp
src/view/display-lore-status.cpp
src/view/display-lore.cpp
src/view/display-map.cpp
src/window/display-sub-windows.cpp
src/wizard/monster-info-spoiler.cpp
src/wizard/wizard-game-modifier.cpp
src/wizard/wizard-spoiler.cpp
src/world/world-movement-processor.cpp
src/world/world-turn-processor.cpp

index ffbc892..651e388 100644 (file)
     <ClInclude Include="..\..\src\monster-floor\monster-death.h" />\r
     <ClInclude Include="..\..\src\lore\lore-store.h" />\r
     <ClInclude Include="..\..\src\lore\monster-lore.h" />\r
-    <ClInclude Include="..\..\src\monster-race\race-flags8.h" />\r
     <ClInclude Include="..\..\src\monster-race\race-flags-resistance.h" />\r
-    <ClInclude Include="..\..\src\monster-race\race-flags1.h" />\r
-    <ClInclude Include="..\..\src\monster-race\race-flags2.h" />\r
-    <ClInclude Include="..\..\src\monster-race\race-flags3.h" />\r
-    <ClInclude Include="..\..\src\monster-race\race-flags7.h" />\r
     <ClInclude Include="..\..\src\monster-race\race-indice-types.h" />\r
     <ClInclude Include="..\..\src\monster\monster-describer.h" />\r
     <ClInclude Include="..\..\src\monster\monster-description-types.h" />\r
     <Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.props'))" />\r
     <Error Condition="!Exists('..\packages\Microsoft.CodeAnalysis.NetAnalyzers.7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\Microsoft.CodeAnalysis.NetAnalyzers.7.0.4\build\Microsoft.CodeAnalysis.NetAnalyzers.targets'))" />\r
   </Target>\r
-</Project>\r
+</Project>
\ No newline at end of file
index 2ca5b23..1dac5ae 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(hengband, 3.0.1.6-Beta)
+AC_INIT(hengband, 3.0.1.7-Beta)
 
 AC_CONFIG_MACRO_DIRS([m4])
 AC_CONFIG_HEADERS(src/autoconf.h)
index 374b63f..58ae90d 100644 (file)
@@ -38,7 +38,7 @@ PROJECT_NAME           = Hengband
 # could be handy for archiving the generated documentation or if some version
 # control system is used.
 
-PROJECT_NUMBER         = 3.0.1.6-Beta
+PROJECT_NUMBER         = 3.0.1.7-Beta
 
 # Using the PROJECT_BRIEF tag one can provide an optional one line description
 # for a project that appears at the top of each page and should give viewer a
index 09aee20..fd056c9 100644 (file)
@@ -1,4 +1,4 @@
-%define version 3.0.1.6
+%define version 3.0.1.7
 %define release 1
 
 Summary: hengband %{version}
@@ -95,6 +95,9 @@ exit 0
 %license lib/help/jlicense.txt
 
 %changelog
+* Mon Feb 05 2024 Shiro Hara <white@vx-xv.com>
+- hengband RPM 3.0.1.7(Beta)
+
 * Mon Jan 22 2024 Shiro Hara <white@vx-xv.com>
 - hengband RPM 3.0.1.6(Beta)
 
index 9052dd0..10b7178 100644 (file)
@@ -26478,7 +26478,7 @@ D:とは言え普通は、巨大でしつこい死を呼ぶトカゲを投入す
 N:1322:溶岩の怪物『ヨガン』
 E:Magman,Lava monster
 G:~:R
-I:107:30d100:20:110:70:0
+I:107:30d100:20:110:70
 W:50:4:15000:0:0
 B:TOUCH:FIRE:12d8
 B:TOUCH:FIRE:12d8
@@ -27121,7 +27121,7 @@ N:1354:赤チォコヴォLv99
 E:Lv.99 Red Chiokovo
 G:B:R
 I:135:80d100:30:150:10
-W:99:6:80000:0:0:0
+W:99:6:80000:0:0
 B:CLAW:HURT:10d10
 B:CRUSH:HURT:8d13
 B:KICK:HURT:30d5
index b0e1efe..e6566dd 100644 (file)
@@ -519,9 +519,6 @@ hengband_SOURCES = \
        monster-race/race-drop-flags.h \
        monster-race/race-feature-flags.h \
        monster-race/race-flags-resistance.h \
-       monster-race/race-flags1.h monster-race/race-flags2.h \
-       monster-race/race-flags3.h \
-       monster-race/race-flags7.h monster-race/race-flags8.h \
        monster-race/race-indice-types.h \
        monster-race/race-kind-flags.h \
        monster-race/race-misc-flags.h \
index 3c735c3..d255c2c 100644 (file)
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-describer.h"
@@ -169,7 +165,7 @@ void exe_movement(PlayerType *player_ptr, DIRECTION dir, bool do_pickup, bool br
     std::string m_name;
     bool can_move = true;
     bool do_past = false;
-    if (grid.m_idx && (m_ptr->ml || p_can_enter || p_can_kill_walls)) {
+    if (grid.has_monster() && (m_ptr->ml || p_can_enter || p_can_kill_walls)) {
         auto *r_ptr = &m_ptr->get_monrace();
         auto effects = player_ptr->effects();
         auto is_stunned = effects->stun()->is_stunned();
index 2aef557..6041792 100644 (file)
@@ -19,8 +19,6 @@
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
@@ -249,7 +247,7 @@ bool exe_mutation_power(PlayerType *player_ptr, PlayerMutationType power)
         const auto y = player_ptr->y + ddy[dir];
         const auto x = player_ptr->x + ddx[dir];
         const auto &grid = floor.grid_array[y][x];
-        if (!grid.m_idx) {
+        if (!grid.has_monster()) {
             msg_print(_("邪悪な存在を感じとれません!", "You sense no evil there!"));
             return true;
         }
@@ -289,7 +287,7 @@ bool exe_mutation_power(PlayerType *player_ptr, PlayerMutationType power)
         const auto y = player_ptr->y + ddy[dir];
         const auto x = player_ptr->x + ddx[dir];
         auto &grid = floor.grid_array[y][x];
-        if (!grid.m_idx) {
+        if (!grid.has_monster()) {
             msg_print(_("あなたは何もない場所で手を振った。", "You wave your hands in the air."));
             return true;
         }
index ac8a6cc..dd9885d 100644 (file)
@@ -226,7 +226,7 @@ static bool run_test(PlayerType *player_ptr)
         int new_dir = cycle[chome[prev_dir] + i];
         const Pos2D pos(player_ptr->y + ddy[new_dir], player_ptr->x + ddx[new_dir]);
         const auto &grid = floor.get_grid(pos);
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             const auto &monster = floor.m_list[grid.m_idx];
             if (monster.ml) {
                 return true;
index c785ff6..cf4fe71 100644 (file)
@@ -61,7 +61,7 @@ static DIRECTION travel_test(PlayerType *player_ptr, DIRECTION prev_dir)
         POSITION row = player_ptr->y + ddy[dir];
         POSITION col = player_ptr->x + ddx[dir];
         g_ptr = &floor_ptr->grid_array[row][col];
-        if (g_ptr->m_idx) {
+        if (g_ptr->has_monster()) {
             auto *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
             if (m_ptr->ml) {
                 return 0;
index 6f1b38a..d586835 100644 (file)
@@ -9,7 +9,6 @@
 #include "flavor/object-flavor-types.h"
 #include "floor/floor-object.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/special-object-flags.h"
index 73a7521..7186152 100644 (file)
@@ -11,7 +11,6 @@
 #include "autopick/autopick-util.h"
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-hook/hook-armor.h"
index c462dd7..98173cc 100644 (file)
@@ -9,9 +9,6 @@
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "system/dungeon-info.h"
index 33ee8f7..78e795e 100644 (file)
@@ -7,8 +7,6 @@
 #include "inventory/inventory-slot-types.h"
 #include "market/arena.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "pet/pet-util.h"
 #include "player-base/player-class.h"
 #include "player-base/player-race.h"
index c13afda..ef5b203 100644 (file)
@@ -15,7 +15,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
@@ -100,7 +99,7 @@ static std::optional<std::string> exe_blue_teleport_back(PlayerType *player_ptr)
     const auto &floor = *player_ptr->current_floor_ptr;
     const Pos2D pos(target_row, target_col);
     const auto &grid = floor.get_grid(pos);
-    if ((grid.m_idx == 0) || !grid.has_los() || !projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
+    if (!grid.has_monster() || !grid.has_los() || !projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col)) {
         return std::nullopt;
     }
 
index 88d8c3d..d7e4f2d 100644 (file)
@@ -20,9 +20,6 @@
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-damage.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index d51ad6c..6a0b6ab 100644 (file)
@@ -30,7 +30,6 @@
 #include "monster-race/race-ability-flags.h"
 #include "monster-race/race-ability-mask.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-processor.h"
@@ -961,7 +960,7 @@ static bool use_mane(PlayerType *player_ptr, MonsterAbilityType spell)
         const auto &floor = *player_ptr->current_floor_ptr;
         const Pos2D pos(target_row, target_col);
         const auto &grid_target = floor.get_grid(pos);
-        auto should_teleport = grid_target.m_idx == 0;
+        auto should_teleport = grid_target.has_monster();
         should_teleport &= grid_target.has_los();
         should_teleport &= projectable(player_ptr, player_ptr->y, player_ptr->x, target_row, target_col);
         if (!should_teleport) {
index f359ec5..902dbb1 100644 (file)
@@ -130,7 +130,7 @@ void do_cmd_open(PlayerType *player_ptr)
         const auto o_idx = chest_check(player_ptr->current_floor_ptr, pos, false);
         if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::OPEN) && !o_idx) {
             msg_print(_("そこには開けるものが見当たらない。", "You see nothing there to open."));
-        } else if (grid.m_idx && player_ptr->riding != grid.m_idx) {
+        } else if (grid.has_monster() && player_ptr->riding != grid.m_idx) {
             PlayerEnergy(player_ptr).set_player_turn_energy(100);
             msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
             do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
@@ -179,7 +179,7 @@ void do_cmd_close(PlayerType *player_ptr)
         const auto &grid = player_ptr->current_floor_ptr->get_grid(pos);
         if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::CLOSE)) {
             msg_print(_("そこには閉じるものが見当たらない。", "You see nothing there to close."));
-        } else if (grid.m_idx) {
+        } else if (grid.has_monster()) {
             PlayerEnergy(player_ptr).set_player_turn_energy(100);
             msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
             do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
@@ -231,7 +231,7 @@ void do_cmd_disarm(PlayerType *player_ptr)
         const auto o_idx = chest_check(player_ptr->current_floor_ptr, pos, true);
         if (!is_trap(player_ptr, feat) && !o_idx) {
             msg_print(_("そこには解除するものが見当たらない。", "You see nothing there to disarm."));
-        } else if (grid.m_idx && player_ptr->riding != grid.m_idx) {
+        } else if (grid.has_monster() && player_ptr->riding != grid.m_idx) {
             msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
             do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
         } else if (o_idx) {
@@ -284,7 +284,7 @@ void do_cmd_bash(PlayerType *player_ptr)
         const Grid &grid = player_ptr->current_floor_ptr->get_grid(pos);
         if (grid.get_terrain_mimic().flags.has_not(TerrainCharacteristics::BASH)) {
             msg_print(_("そこには体当たりするものが見当たらない。", "You see nothing there to bash."));
-        } else if (grid.m_idx) {
+        } else if (grid.has_monster()) {
             PlayerEnergy(player_ptr).set_player_turn_energy(100);
             msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
             do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
@@ -355,7 +355,7 @@ void do_cmd_spike(PlayerType *player_ptr)
         msg_print(_("そこにはくさびを打てるものが見当たらない。", "You see nothing there to spike."));
     } else if (!get_spike(player_ptr, &i_idx)) {
         msg_print(_("くさびを持っていない!", "You have no spikes!"));
-    } else if (grid.m_idx) {
+    } else if (grid.has_monster()) {
         PlayerEnergy(player_ptr).set_player_turn_energy(100);
         msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
         do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
index b856e5b..3b4fb50 100644 (file)
@@ -71,7 +71,7 @@ static bool exe_alter(PlayerType *player_ptr)
     const auto &grid = player_ptr->current_floor_ptr->get_grid(pos);
     const auto &terrain = grid.get_terrain_mimic();
     PlayerEnergy(player_ptr).set_player_turn_energy(100);
-    if (grid.m_idx) {
+    if (grid.has_monster()) {
         do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
         return false;
     }
index 79a0350..6c1142f 100644 (file)
@@ -23,8 +23,6 @@
 #include "monster-floor/monster-object.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
@@ -220,7 +218,7 @@ bool do_cmd_riding(PlayerType *player_ptr, bool force)
             return false;
         }
 
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             PlayerEnergy(player_ptr).set_player_turn_energy(100);
 
             msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
@@ -239,7 +237,7 @@ bool do_cmd_riding(PlayerType *player_ptr, bool force)
 
         const auto *m_ptr = &player_ptr->current_floor_ptr->m_list[grid.m_idx];
 
-        if (!grid.m_idx || !m_ptr->ml) {
+        if (!grid.has_monster() || !m_ptr->ml) {
             msg_print(_("その場所にはモンスターはいません。", "There is no monster here."));
             return false;
         }
@@ -328,7 +326,7 @@ static void do_name_pet(PlayerType *player_ptr)
     target_pet = old_target_pet;
     auto &floor = *player_ptr->current_floor_ptr;
     const auto &grid = floor.grid_array[target_row][target_col];
-    if (grid.m_idx == 0) {
+    if (!grid.has_monster()) {
         return;
     }
 
@@ -705,7 +703,7 @@ void do_cmd_pet(PlayerType *player_ptr)
             player_ptr->pet_t_m_idx = 0;
         } else {
             auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[target_row][target_col];
-            if (g_ptr->m_idx && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
+            if (g_ptr->has_monster() && (player_ptr->current_floor_ptr->m_list[g_ptr->m_idx].ml)) {
                 player_ptr->pet_t_m_idx = player_ptr->current_floor_ptr->grid_array[target_row][target_col].m_idx;
                 player_ptr->pet_follow_distance = PET_DESTROY_DIST;
             } else {
index 98c0246..c260b7c 100644 (file)
@@ -56,7 +56,7 @@ void do_cmd_tunnel(PlayerType *player_ptr)
         msg_print(_("ドアは掘れない。", "You cannot tunnel through doors."));
     } else if (terrain_mimic.flags.has_not(TerrainCharacteristics::TUNNEL)) {
         msg_print(_("そこは掘れない。", "You can't tunnel through that."));
-    } else if (grid.m_idx) {
+    } else if (grid.has_monster()) {
         PlayerEnergy(player_ptr).set_player_turn_energy(100);
         msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
         do_cmd_attack(player_ptr, pos.y, pos.x, HISSATSU_NONE);
index 3d5ac7c..cdaa7b9 100644 (file)
@@ -6,8 +6,6 @@
 #include "io/input-key-acceptor.h"
 #include "lore/lore-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "term/gameterm.h"
index 3858236..5245102 100644 (file)
@@ -3,8 +3,6 @@
 #include "inventory/inventory-slot-types.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "object/tval-types.h"
 #include "player-attack/player-attack.h"
 #include "player-base/player-class.h"
index b515e47..ee19cb6 100644 (file)
@@ -13,7 +13,6 @@
 #include "monster-attack/monster-attack-player.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-damage.h"
 #include "monster/monster-info.h"
index 272222d..997396a 100644 (file)
 #include "monster-floor/monster-move.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-damage.h"
@@ -636,7 +632,7 @@ void exe_fire(PlayerType *player_ptr, INVENTORY_IDX i_idx, ItemEntity *j_ptr, SP
             if (snipe_type == SP_KILL_WALL) {
                 g_ptr = &floor_ptr->grid_array[ny][nx];
 
-                if (g_ptr->cave_has_flag(TerrainCharacteristics::HURT_ROCK) && !g_ptr->m_idx) {
+                if (g_ptr->cave_has_flag(TerrainCharacteristics::HURT_ROCK) && !g_ptr->has_monster()) {
                     if (any_bits(g_ptr->info, (CAVE_MARK))) {
                         msg_print(_("岩が砕け散った。", "Wall rocks were shattered."));
                     }
@@ -659,7 +655,7 @@ void exe_fire(PlayerType *player_ptr, INVENTORY_IDX i_idx, ItemEntity *j_ptr, SP
             }
 
             /* Stopped by walls/doors */
-            if (!cave_has_flag_bold(floor_ptr, ny, nx, TerrainCharacteristics::PROJECT) && !floor_ptr->grid_array[ny][nx].m_idx) {
+            if (!cave_has_flag_bold(floor_ptr, ny, nx, TerrainCharacteristics::PROJECT) && !floor_ptr->grid_array[ny][nx].has_monster()) {
                 break;
             }
 
@@ -718,7 +714,7 @@ void exe_fire(PlayerType *player_ptr, INVENTORY_IDX i_idx, ItemEntity *j_ptr, SP
             y = ny;
 
             /* Monster here, Try to hit it */
-            if (floor_ptr->grid_array[y][x].m_idx) {
+            if (floor_ptr->grid_array[y][x].has_monster()) {
                 sound(SOUND_SHOOT_HIT);
                 Grid *c_mon_ptr = &floor_ptr->grid_array[y][x];
 
index 36ae1f5..243cc49 100644 (file)
@@ -4,8 +4,6 @@
 #include "mind/mind-samurai.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-info.h"
index 933cd85..7782aa7 100644 (file)
@@ -25,7 +25,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-list.h"
index c09e348..7c65ba5 100644 (file)
@@ -21,7 +21,6 @@
 #include "market/arena.h"
 #include "mind/mind-ninja.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-compaction.h"
 #include "monster/monster-processor.h"
 #include "monster/monster-status.h"
index 21374a4..d302c46 100644 (file)
@@ -5,7 +5,6 @@
 #include "monster-floor/monster-generator.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-info.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
index 3f86ecf..1d366c4 100644 (file)
@@ -15,9 +15,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster/monster-info.h"
 #include "monster/monster-list.h"
 #include "monster/monster-util.h"
index 9a4333d..04734a0 100644 (file)
@@ -12,6 +12,7 @@
 #include "mind/mind-elementalist.h"
 #include "mind/mind-ninja.h"
 #include "monster/monster-update.h"
+#include "monster/monster-util.h"
 #include "player/special-defense-types.h"
 #include "room/door-definition.h"
 #include "spell-class/spells-mirror-master.h"
@@ -44,7 +45,7 @@ static bool cave_naked_bold(PlayerType *player_ptr, const Pos2D &pos)
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系による地形効果処理 / We are called from "project()" to "damage" terrain features
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
+ * @param src_idx 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標Y座標 / Target y location (or location to travel "towards")
  * @param x 目標X座標 / Target x location (or location to travel "towards")
@@ -67,7 +68,7 @@ static bool cave_naked_bold(PlayerType *player_ptr, const Pos2D &pos)
  * Perhaps we should affect doors?
  * </pre>
  */
-bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
+bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
 {
     const Pos2D pos(y, x);
     auto &floor = *player_ptr->current_floor_ptr;
@@ -77,7 +78,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITIO
     auto obvious = false;
     auto known = grid.has_los();
 
-    who = who ? who : 0;
+    src_idx = is_monster(src_idx) ? src_idx : 0;
     dam = (dam + r) / (r + 1);
 
     if (terrain.flags.has(TerrainCharacteristics::TREE)) {
@@ -354,7 +355,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITIO
         if (player_can_see_bold(player_ptr, y, x)) {
             obvious = true;
         }
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             update_monster(player_ptr, grid.m_idx, false);
         }
 
@@ -407,7 +408,7 @@ bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITIO
         if (player_can_see_bold(player_ptr, y, x)) {
             obvious = true;
         }
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             update_monster(player_ptr, grid.m_idx, false);
         }
 
index ccb8245..4fc8282 100644 (file)
@@ -4,4 +4,4 @@
 #include "system/angband.h"
 
 class PlayerType;
-bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
+bool affect_feature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
index 08ccd22..8a90d2c 100644 (file)
@@ -7,6 +7,7 @@
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster/monster-info.h"
+#include "monster/monster-util.h"
 #include "object-enchant/tr-types.h"
 #include "object-hook/hook-expendable.h"
 #include "object/object-broken.h"
@@ -26,7 +27,7 @@
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系によるアイテムオブジェクトへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
+ * @param src_idx 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標Y座標 / Target y location (or location to travel "towards")
  * @param x 目標X座標 / Target x location (or location to travel "towards")
@@ -34,7 +35,7 @@
  * @param typ 効果属性 / Type of damage to apply to monsters (and objects)
  * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
  */
-bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
+bool affect_item(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
 {
     const auto &floor = *player_ptr->current_floor_ptr;
     const Pos2D pos(y, x);
@@ -42,7 +43,7 @@ bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y
 
     auto is_item_affected = false;
     const auto known = grid.has_los();
-    who = who ? who : 0;
+    src_idx = is_monster(src_idx) ? src_idx : 0;
     dam = (dam + r) / (r + 1);
     std::set<OBJECT_IDX> processed_list;
     for (auto it = grid.o_idx_list.begin(); it != grid.o_idx_list.end();) {
@@ -227,7 +228,7 @@ bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y
             }
 
             BIT_FLAGS mode = 0L;
-            if (!who || player_ptr->current_floor_ptr->m_list[who].is_pet()) {
+            if (is_monster(src_idx) || player_ptr->current_floor_ptr->m_list[src_idx].is_pet()) {
                 mode |= PM_FORCE_PET;
             }
 
@@ -240,7 +241,7 @@ bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y
                     }
 
                     continue;
-                } else if (summon_named_creature(player_ptr, who, y, x, corpse_r_idx, mode)) {
+                } else if (summon_named_creature(player_ptr, src_idx, y, x, corpse_r_idx, mode)) {
                     note_kill = _("生き返った。", " revived.");
                 } else if (!note_kill) {
                     note_kill = _("灰になった。", (plural ? " become dust." : " becomes dust."));
@@ -281,7 +282,7 @@ bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y
         const auto is_potion = o_ptr->is_potion();
         delete_object_idx(player_ptr, this_o_idx);
         if (is_potion) {
-            (void)potion_smash_effect(player_ptr, who, y, x, bi_id);
+            (void)potion_smash_effect(player_ptr, src_idx, y, x, bi_id);
 
             // 薬の破壊効果によりリストの次のアイテムが破壊された可能性があるのでリストの最初から処理をやり直す
             // 処理済みのアイテムは processed_list に登録されており、スキップされる
index 9776f98..69d06d4 100644 (file)
@@ -4,4 +4,4 @@
 #include "system/angband.h"
 
 class PlayerType;
-bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
+bool affect_item(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
index 92770d2..cc7f261 100644 (file)
@@ -7,9 +7,6 @@
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
index a69cd78..dd0e275 100644 (file)
@@ -2,6 +2,7 @@
 #include "effect/effect-monster-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-indice-types.h"
+#include "monster/monster-util.h"
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
 #include "view/display-messages.h"
@@ -11,7 +12,7 @@ ProcessResult effect_monster_curse_1(EffectMonster *em_ptr)
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sを指差して呪いをかけた。", "You point at %s and curse."), em_ptr->m_name);
     }
     if (randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35)) {
@@ -27,7 +28,7 @@ ProcessResult effect_monster_curse_2(EffectMonster *em_ptr)
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sを指差して恐ろしげに呪いをかけた。", "You point at %s and curse horribly."), em_ptr->m_name);
     }
 
@@ -44,7 +45,7 @@ ProcessResult effect_monster_curse_3(EffectMonster *em_ptr)
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sを指差し、恐ろしげに呪文を唱えた!", "You point at %s, incanting terribly!"), em_ptr->m_name);
     }
 
@@ -61,13 +62,13 @@ ProcessResult effect_monster_curse_4(EffectMonster *em_ptr)
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sの秘孔を突いて、「お前は既に死んでいる」と叫んだ。",
                        "You point at %s, screaming the word, 'DIE!'."),
             em_ptr->m_name);
     }
 
-    if ((randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35)) && ((em_ptr->who <= 0) || (em_ptr->m_caster_ptr->r_idx != MonsterRaceId::KENSHIROU))) {
+    if ((randint0(100 + (em_ptr->caster_lev / 2)) < (em_ptr->r_ptr->level + 35)) && (!is_monster(em_ptr->src_idx) || (em_ptr->m_caster_ptr->r_idx != MonsterRaceId::KENSHIROU))) {
         em_ptr->note = _("には効果がなかった。", " is unaffected.");
         em_ptr->dam = 0;
     }
index f425478..1442501 100644 (file)
@@ -3,8 +3,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-info.h"
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
index 0955ae5..8362740 100644 (file)
@@ -2,7 +2,6 @@
 #include "effect/effect-monster-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-info.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
index d59f8d4..d3c33eb 100644 (file)
@@ -3,13 +3,11 @@
 #include "effect/effect-monster-util.h"
 #include "monster-floor/monster-generator.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-entity.h"
@@ -103,7 +101,7 @@ ProcessResult effect_monster_star_heal(PlayerType *player_ptr, EffectMonster *em
 // who == 0ならばプレイヤーなので、それの判定.
 static void effect_monster_old_heal_check_player(PlayerType *player_ptr, EffectMonster *em_ptr)
 {
-    if (em_ptr->who != 0) {
+    if (is_monster(em_ptr->src_idx)) {
         return;
     }
 
@@ -173,7 +171,7 @@ ProcessResult effect_monster_old_heal(PlayerType *player_ptr, EffectMonster *em_
     effect_monster_old_heal_check_player(player_ptr, em_ptr);
     if (em_ptr->m_ptr->r_idx == MonsterRaceId::LEPER) {
         em_ptr->heal_leper = true;
-        if (!em_ptr->who) {
+        if (is_player(em_ptr->src_idx)) {
             chg_virtue(player_ptr, Virtue::COMPASSION, 5);
         }
     }
@@ -202,7 +200,7 @@ ProcessResult effect_monster_old_speed(PlayerType *player_ptr, EffectMonster *em
         em_ptr->note = _("の動きが速くなった。", " starts moving faster.");
     }
 
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         if (em_ptr->r_ptr->kind_flags.has(MonsterKindType::UNIQUE)) {
             chg_virtue(player_ptr, Virtue::INDIVIDUALISM, 1);
         }
index 67be121..112bfae 100644 (file)
@@ -5,9 +5,6 @@
 #include "mind/mind-mirror-master.h"
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index 9630d20..c3c5eb0 100644 (file)
@@ -3,10 +3,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-flags.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
index 6e0cfe3..e56f372 100644 (file)
@@ -3,13 +3,11 @@
 #include "hpmp/hp-mp-processor.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "system/grid-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
@@ -35,7 +33,7 @@ ProcessResult effect_monster_drain_mana(PlayerType *player_ptr, EffectMonster *e
         return ProcessResult::PROCESS_CONTINUE;
     }
 
-    if (em_ptr->who <= 0) {
+    if (!is_monster(em_ptr->src_idx)) {
         msg_format(_("%sから精神エネルギーを吸いとった。", "You draw psychic energy from %s."), em_ptr->m_name);
         (void)hp_player(player_ptr, em_ptr->dam);
         em_ptr->dam = 0;
@@ -53,11 +51,11 @@ ProcessResult effect_monster_drain_mana(PlayerType *player_ptr, EffectMonster *e
     }
 
     auto &rfu = RedrawingFlagsUpdater::get_instance();
-    if (player_ptr->health_who == em_ptr->who) {
+    if (player_ptr->health_who == em_ptr->src_idx) {
         rfu.set_flag(MainWindowRedrawingFlag::HEALTH);
     }
 
-    if (player_ptr->riding == em_ptr->who) {
+    if (player_ptr->riding == em_ptr->src_idx) {
         rfu.set_flag(MainWindowRedrawingFlag::UHEALTH);
     }
 
@@ -75,7 +73,7 @@ ProcessResult effect_monster_mind_blast(PlayerType *player_ptr, EffectMonster *e
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
     }
 
@@ -108,7 +106,7 @@ ProcessResult effect_monster_mind_blast(PlayerType *player_ptr, EffectMonster *e
         em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
         em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
 
-        if (em_ptr->who > 0) {
+        if (is_monster(em_ptr->src_idx)) {
             em_ptr->do_conf = randint0(4) + 4;
         } else {
             em_ptr->do_conf = randint0(8) + 8;
@@ -123,7 +121,7 @@ ProcessResult effect_monster_brain_smash(PlayerType *player_ptr, EffectMonster *
     if (em_ptr->seen) {
         em_ptr->obvious = true;
     }
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sをじっと睨んだ。", "You gaze intently at %s."), em_ptr->m_name);
     }
 
@@ -157,7 +155,7 @@ ProcessResult effect_monster_brain_smash(PlayerType *player_ptr, EffectMonster *
     } else {
         em_ptr->note = _("は精神攻撃を食らった。", " is blasted by psionic energy.");
         em_ptr->note_dies = _("の精神は崩壊し、肉体は抜け殻となった。", " collapses, a mindless husk.");
-        if (em_ptr->who > 0) {
+        if (is_monster(em_ptr->src_idx)) {
             em_ptr->do_conf = randint0(4) + 4;
             em_ptr->do_stun = randint0(4) + 4;
         } else {
index 77748ee..0aa16a0 100644 (file)
 #include "monster-floor/monster-death.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "player/player-damage.h"
 #include "spell-kind/spells-genocide.h"
 #include "system/grid-type-definition.h"
@@ -139,8 +137,8 @@ ProcessResult effect_monster_hand_doom(EffectMonster *em_ptr)
         return ProcessResult::PROCESS_CONTINUE;
     }
 
-    if ((em_ptr->who > 0) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20)))
-                          : (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200)))) {
+    if (is_monster(em_ptr->src_idx) ? ((em_ptr->caster_lev + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + 10 + randint1(20)))
+                                    : (((em_ptr->caster_lev / 2) + randint1(em_ptr->dam)) > (em_ptr->r_ptr->level + randint1(200)))) {
         em_ptr->dam = ((40 + randint1(20)) * em_ptr->m_ptr->hp) / 100;
         if (em_ptr->m_ptr->hp < em_ptr->dam) {
             em_ptr->dam = em_ptr->m_ptr->hp - 1;
@@ -267,7 +265,7 @@ ProcessResult effect_monster_genocide(PlayerType *player_ptr, EffectMonster *em_
     }
 
     std::string_view spell_name(_("モンスター消滅", "Genocide One"));
-    if (genocide_aux(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, !em_ptr->who, (em_ptr->r_ptr->level + 1) / 2, spell_name.data())) {
+    if (genocide_aux(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, is_player(em_ptr->src_idx), (em_ptr->r_ptr->level + 1) / 2, spell_name.data())) {
         if (em_ptr->seen_msg) {
             msg_format(_("%sは消滅した!", "%s^ disappeared!"), em_ptr->m_name);
         }
@@ -281,7 +279,7 @@ ProcessResult effect_monster_genocide(PlayerType *player_ptr, EffectMonster *em_
 
 ProcessResult effect_monster_photo(PlayerType *player_ptr, EffectMonster *em_ptr)
 {
-    if (!em_ptr->who) {
+    if (is_player(em_ptr->src_idx)) {
         msg_format(_("%sを写真に撮った。", "You take a photograph of %s."), em_ptr->m_name);
     }
 
index ee518c7..6b8c8f3 100644 (file)
@@ -11,6 +11,7 @@
 #include "monster-race/monster-race.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "system/angband-system.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
@@ -22,7 +23,7 @@
  * @brief EffectMonster構造体のコンストラクタ
  * @param player_ptr プレイヤーへの参照ポインタ
  * @param em_ptr モンスター効果構造体への参照ポインタ
- * @param who 魔法を発動したモンスター (0ならばプレイヤー)
+ * @param src_idx 魔法を発動したモンスター (0ならばプレイヤー)
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標y座標 / Target y location (or location to travel "towards")
  * @param x 目標x座標 / Target x location (or location to travel "towards")
@@ -31,8 +32,8 @@
  * @param flag 効果フラグ
  * @param see_s_msg TRUEならばメッセージを表示する
  */
-EffectMonster::EffectMonster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
-    : who(who)
+EffectMonster::EffectMonster(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
+    : src_idx(src_idx)
     , r(r)
     , y(y)
     , x(x)
@@ -44,12 +45,12 @@ EffectMonster::EffectMonster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r
     auto *floor_ptr = player_ptr->current_floor_ptr;
     this->g_ptr = &floor_ptr->grid_array[this->y][this->x];
     this->m_ptr = &floor_ptr->m_list[this->g_ptr->m_idx];
-    this->m_caster_ptr = (this->who > 0) ? &floor_ptr->m_list[this->who] : nullptr;
+    this->m_caster_ptr = is_monster(this->src_idx) ? &floor_ptr->m_list[this->src_idx] : nullptr;
     this->r_ptr = &this->m_ptr->get_monrace();
     this->seen = this->m_ptr->ml;
     this->seen_msg = is_seen(player_ptr, this->m_ptr);
     this->slept = this->m_ptr->is_asleep();
     this->known = (this->m_ptr->cdis <= MAX_PLAYER_SIGHT) || AngbandSystem::get_instance().is_phase_out();
     this->note_dies = this->m_ptr->get_died_message();
-    this->caster_lev = (this->who > 0) ? this->m_caster_ptr->get_monrace().level : (player_ptr->lev * 2);
+    this->caster_lev = is_monster(this->src_idx) ? this->m_caster_ptr->get_monrace().level : (player_ptr->lev * 2);
 }
index 738f021..39fdd7e 100644 (file)
@@ -10,7 +10,7 @@ class MonsterRaceInfo;
 class PlayerType;
 class EffectMonster {
 public:
-    EffectMonster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg);
+    EffectMonster(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg);
 
     char killer[MAX_MONSTER_NAME]{};
     bool obvious = false;
@@ -29,7 +29,7 @@ public:
     short photo = 0;
     std::string note = "";
 
-    MONSTER_IDX who;
+    MONSTER_IDX src_idx;
     POSITION r;
     POSITION y;
     POSITION x;
index 0e3a514..8c75835 100644 (file)
@@ -25,9 +25,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-damage.h"
@@ -38,6 +35,7 @@
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
+#include "monster/monster-util.h"
 #include "object-enchant/special-object-flags.h"
 #include "object/object-kind-hook.h"
 #include "spell-kind/blood-curse.h"
  */
 static ProcessResult is_affective(PlayerType *player_ptr, EffectMonster *em_ptr)
 {
-    if (!em_ptr->g_ptr->m_idx) {
+    if (!em_ptr->g_ptr->has_monster()) {
         return ProcessResult::PROCESS_FALSE;
     }
-    if (em_ptr->who && (em_ptr->g_ptr->m_idx == em_ptr->who)) {
+    if (is_monster(em_ptr->src_idx) && (em_ptr->g_ptr->m_idx == em_ptr->src_idx)) {
         return ProcessResult::PROCESS_FALSE;
     }
     if (sukekaku && ((em_ptr->m_ptr->r_idx == MonsterRaceId::SUKE) || (em_ptr->m_ptr->r_idx == MonsterRaceId::KAKU))) {
@@ -78,7 +76,7 @@ static ProcessResult is_affective(PlayerType *player_ptr, EffectMonster *em_ptr)
     if (em_ptr->m_ptr->hp < 0) {
         return ProcessResult::PROCESS_FALSE;
     }
-    if (em_ptr->who || em_ptr->g_ptr->m_idx != player_ptr->riding) {
+    if (is_monster(em_ptr->src_idx) || em_ptr->g_ptr->m_idx != player_ptr->riding) {
         return ProcessResult::PROCESS_TRUE;
     }
 
@@ -191,8 +189,8 @@ static void effect_damage_killed_pet(PlayerType *player_ptr, EffectMonster *em_p
         }
     }
 
-    if (em_ptr->who > 0) {
-        monster_gain_exp(player_ptr, em_ptr->who, em_ptr->m_ptr->r_idx);
+    if (is_monster(em_ptr->src_idx)) {
+        monster_gain_exp(player_ptr, em_ptr->src_idx, em_ptr->m_ptr->r_idx);
     }
 
     monster_death(player_ptr, em_ptr->g_ptr->m_idx, false, em_ptr->attribute);
@@ -235,7 +233,7 @@ static void effect_damage_makes_sleep(PlayerType *player_ptr, EffectMonster *em_
  */
 static bool deal_effect_damage_from_monster(PlayerType *player_ptr, EffectMonster *em_ptr)
 {
-    if (em_ptr->who <= 0) {
+    if (!is_monster(em_ptr->src_idx)) {
         return false;
     }
 
@@ -367,7 +365,7 @@ static void deal_effect_damage_to_monster(PlayerType *player_ptr, EffectMonster
  */
 static void effect_makes_change_virtues(PlayerType *player_ptr, EffectMonster *em_ptr)
 {
-    if ((em_ptr->who > 0) || !em_ptr->slept) {
+    if (is_monster(em_ptr->src_idx) || !em_ptr->slept) {
         return;
     }
 
@@ -397,7 +395,7 @@ static void affected_monster_prevents_bad_status(PlayerType *player_ptr, EffectM
     auto should_alive = r_ptr->kind_flags.has(MonsterKindType::UNIQUE);
     should_alive |= r_ptr->misc_flags.has(MonsterMiscType::QUESTOR);
     should_alive |= r_ptr->population_flags.has(MonsterPopulationType::NAZGUL);
-    if (should_alive && !AngbandSystem::get_instance().is_phase_out() && (em_ptr->who > 0) && (em_ptr->dam > em_ptr->m_ptr->hp)) {
+    if (should_alive && !AngbandSystem::get_instance().is_phase_out() && is_monster(em_ptr->src_idx) && (em_ptr->dam > em_ptr->m_ptr->hp)) {
         em_ptr->dam = em_ptr->m_ptr->hp;
     }
 }
@@ -552,11 +550,11 @@ static void effect_damage_makes_teleport(PlayerType *player_ptr, EffectMonster *
 
     em_ptr->note = _("が消え去った!", " disappears!");
 
-    if (!em_ptr->who) {
+    if (is_monster(em_ptr->src_idx)) {
         chg_virtue(player_ptr, Virtue::VALOUR, -1);
     }
 
-    teleport_flags tflag = i2enum<teleport_flags>((!em_ptr->who ? TELEPORT_DEC_VALOUR : TELEPORT_SPONTANEOUS) | TELEPORT_PASSIVE);
+    teleport_flags tflag = i2enum<teleport_flags>((is_monster(em_ptr->src_idx) ? TELEPORT_DEC_VALOUR : TELEPORT_SPONTANEOUS) | TELEPORT_PASSIVE);
     teleport_away(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->do_dist, tflag);
 
     em_ptr->y = em_ptr->m_ptr->fy;
@@ -645,7 +643,7 @@ static void postprocess_by_effected_pet(PlayerType *player_ptr, EffectMonster *e
         return;
     }
 
-    if (em_ptr->who == 0) {
+    if (is_player(em_ptr->src_idx)) {
         if (!(em_ptr->flag & PROJECT_NO_HANGEKI)) {
             set_target(m_ptr, monster_target_y, monster_target_x);
         }
@@ -654,7 +652,7 @@ static void postprocess_by_effected_pet(PlayerType *player_ptr, EffectMonster *e
     }
 
     const auto &m_caster_ref = *em_ptr->m_caster_ptr;
-    if ((em_ptr->who > 0) && m_caster_ref.is_pet() && !player_ptr->is_located_at({ m_ptr->target_y, m_ptr->target_x })) {
+    if (is_monster(em_ptr->src_idx) && m_caster_ref.is_pet() && !player_ptr->is_located_at({ m_ptr->target_y, m_ptr->target_x })) {
         set_target(m_ptr, m_caster_ref.fy, m_caster_ref.fx);
     }
 }
@@ -716,7 +714,7 @@ static void exe_affect_monster_postprocess(PlayerType *player_ptr, EffectMonster
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系によるモンスターへの効果処理 / Handle a beam/bolt/ball causing damage to a monster.
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
+ * @param src_idx 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source" monster (zero for "player")
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標y座標 / Target y location (or location to travel "towards")
  * @param x 目標x座標 / Target x location (or location to travel "towards")
@@ -732,10 +730,10 @@ static void exe_affect_monster_postprocess(PlayerType *player_ptr, EffectMonster
  * 3.ペット及び撮影による事後効果
  */
 bool affect_monster(
-    PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg,
+    PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg,
     std::optional<CapturedMonsterType *> cap_mon_ptr)
 {
-    EffectMonster tmp_effect(player_ptr, who, r, y, x, dam, attribute, flag, see_s_msg);
+    EffectMonster tmp_effect(player_ptr, src_idx, r, y, x, dam, attribute, flag, see_s_msg);
     auto *em_ptr = &tmp_effect;
     auto target_m_idx = em_ptr->g_ptr->m_idx;
 
index dc295e2..28f8f6f 100644 (file)
@@ -6,4 +6,4 @@
 
 class CapturedMonsterType;
 class PlayerType;
-bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
+bool affect_monster(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
index b228866..9cd46ee 100644 (file)
@@ -3,6 +3,7 @@
 #include "core/window-redrawer.h"
 #include "effect/effect-player.h"
 #include "mind/mind-mirror-master.h"
+#include "monster/monster-util.h"
 #include "player/player-damage.h"
 #include "player/player-status-flags.h"
 #include "status/bad-status-setter.h"
@@ -26,7 +27,7 @@ void effect_player_drain_mana(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
         return;
     }
 
-    if (ep_ptr->who > 0) {
+    if (is_monster(ep_ptr->src_idx)) {
         msg_format(_("%s^に精神エネルギーを吸い取られてしまった!", "%s^ draws psychic energy from you!"), ep_ptr->m_name);
     } else {
         msg_print(_("精神エネルギーを吸い取られてしまった!", "Your psychic energy is drained!"));
@@ -48,7 +49,7 @@ void effect_player_drain_mana(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
     };
     rfu.set_flags(flags);
 
-    if ((ep_ptr->who <= 0) || (ep_ptr->m_ptr->hp >= ep_ptr->m_ptr->maxhp)) {
+    if (!is_monster(ep_ptr->src_idx) || (ep_ptr->m_ptr->hp >= ep_ptr->m_ptr->maxhp)) {
         ep_ptr->dam = 0;
         return;
     }
@@ -58,10 +59,10 @@ void effect_player_drain_mana(PlayerType *player_ptr, EffectPlayerType *ep_ptr)
         ep_ptr->m_ptr->hp = ep_ptr->m_ptr->maxhp;
     }
 
-    if (player_ptr->health_who == ep_ptr->who) {
+    if (player_ptr->health_who == ep_ptr->src_idx) {
         rfu.set_flag(MainWindowRedrawingFlag::HEALTH);
     }
-    if (player_ptr->riding == ep_ptr->who) {
+    if (player_ptr->riding == ep_ptr->src_idx) {
         rfu.set_flag(MainWindowRedrawingFlag::UHEALTH);
     }
 
index 45fae6b..62eb94e 100644 (file)
@@ -19,6 +19,7 @@
 #include "monster-race/monster-race.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
+#include "monster/monster-util.h"
 #include "player-base/player-class.h"
 #include "player-info/samurai-data-type.h"
 #include "player/player-status-flags.h"
 /*!
  * @brief EffectPlayerType構造体を初期化する
  * @param ep_ptr 初期化前の構造体
- * @param who 魔法を唱えたモンスター (0ならプレイヤー自身)
+ * @param src_idx 魔法を唱えたモンスター (0ならプレイヤー自身)
  * @param dam 基本威力
  * @param attribute 効果属性
  * @param flag 効果フラグ
  * @param monspell 効果元のモンスター魔法ID
  * @return 初期化後の構造体ポインタ
  */
-EffectPlayerType::EffectPlayerType(MONSTER_IDX who, int dam, AttributeType attribute, BIT_FLAGS flag)
+EffectPlayerType::EffectPlayerType(MONSTER_IDX src_idx, int dam, AttributeType attribute, BIT_FLAGS flag)
     : rlev(0)
     , m_ptr(nullptr)
     , killer("")
     , m_name("")
     , get_damage(0)
-    , who(who)
+    , src_idx(src_idx)
     , dam(dam)
     , attribute(attribute)
     , flag(flag)
@@ -92,9 +93,9 @@ static bool process_bolt_reflection(PlayerType *player_ptr, EffectPlayerType *ep
     msg_print(mes);
     POSITION t_y;
     POSITION t_x;
-    if (ep_ptr->who > 0) {
+    if (is_monster(ep_ptr->src_idx)) {
         auto *floor_ptr = player_ptr->current_floor_ptr;
-        auto *m_ptr = &floor_ptr->m_list[ep_ptr->who];
+        auto *m_ptr = &floor_ptr->m_list[ep_ptr->src_idx];
         do {
             t_y = m_ptr->fy - 1 + randint1(3);
             t_x = m_ptr->fx - 1 + randint1(3);
@@ -131,13 +132,13 @@ static ProcessResult check_continue_player_effect(PlayerType *player_ptr, Effect
 
     auto is_effective = ep_ptr->dam > 0;
     is_effective &= randint0(55) < (player_ptr->lev * 3 / 5 + 20);
-    is_effective &= ep_ptr->who > 0;
-    is_effective &= ep_ptr->who != player_ptr->riding;
+    is_effective &= is_monster(ep_ptr->src_idx);
+    is_effective &= ep_ptr->src_idx != player_ptr->riding;
     if (is_effective && kawarimi(player_ptr, true)) {
         return ProcessResult::PROCESS_FALSE;
     }
 
-    if ((ep_ptr->who == 0) || (ep_ptr->who == player_ptr->riding)) {
+    if (is_player(ep_ptr->src_idx) || (ep_ptr->src_idx == player_ptr->riding)) {
         return ProcessResult::PROCESS_FALSE;
     }
 
@@ -152,19 +153,19 @@ static ProcessResult check_continue_player_effect(PlayerType *player_ptr, Effect
  * @brief 魔法を発したモンスター名を記述する
  * @param player_ptr プレイヤーへの参照ポインタ
  * @param ep_ptr プレイヤー効果構造体への参照ポインタ
- * @param who_name モンスター名
+ * @param src_name モンスター名
  */
-static void describe_effect_source(PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr who_name)
+static void describe_effect_source(PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr src_name)
 {
-    if (ep_ptr->who > 0) {
-        ep_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[ep_ptr->who];
+    if (is_monster(ep_ptr->src_idx)) {
+        ep_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[ep_ptr->src_idx];
         ep_ptr->rlev = ep_ptr->m_ptr->get_monrace().level >= 1 ? ep_ptr->m_ptr->get_monrace().level : 1;
         angband_strcpy(ep_ptr->m_name, monster_desc(player_ptr, ep_ptr->m_ptr, 0), sizeof(ep_ptr->m_name));
-        angband_strcpy(ep_ptr->killer, who_name, sizeof(ep_ptr->killer));
+        angband_strcpy(ep_ptr->killer, src_name, sizeof(ep_ptr->killer));
         return;
     }
 
-    switch (ep_ptr->who) {
+    switch (ep_ptr->src_idx) {
     case PROJECT_WHO_UNCTRL_POWER:
         strcpy(ep_ptr->killer, _("制御できない力の氾流", "uncontrollable power storm"));
         break;
@@ -181,8 +182,8 @@ static void describe_effect_source(PlayerType *player_ptr, EffectPlayerType *ep_
 
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系によるプレイヤーへの効果処理 / Helper function for "project()" below.
- * @param who 魔法を発動したモンスター(0ならばプレイヤー、負値ならば自然発生) / Index of "source" monster (zero for "player")
- * @param who_name 効果を起こしたモンスターの名前
+ * @param src_idx 魔法を発動したモンスター(0ならばプレイヤー、負値ならば自然発生) / Index of "source" monster (zero for "player")
+ * @param src_name 効果を起こしたモンスターの名前
  * @param r 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion (0 = beam/bolt, 1 to 9 = ball)
  * @param y 目標Y座標 / Target y location (or location to travel "towards")
  * @param x 目標X座標 / Target x location (or location to travel "towards")
@@ -192,10 +193,10 @@ static void describe_effect_source(PlayerType *player_ptr, EffectPlayerType *ep_
  * @param monspell 効果元のモンスター魔法ID
  * @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
  */
-bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, int dam, AttributeType attribute,
+bool affect_player(MONSTER_IDX src_idx, PlayerType *player_ptr, concptr src_name, int r, POSITION y, POSITION x, int dam, AttributeType attribute,
     BIT_FLAGS flag, project_func project)
 {
-    EffectPlayerType tmp_effect(who, dam, attribute, flag);
+    EffectPlayerType tmp_effect(src_idx, dam, attribute, flag);
     auto *ep_ptr = &tmp_effect;
     auto check_result = check_continue_player_effect(player_ptr, ep_ptr, { y, x }, project);
     if (check_result != ProcessResult::PROCESS_CONTINUE) {
@@ -207,11 +208,11 @@ bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, in
     }
 
     ep_ptr->dam = (ep_ptr->dam + r) / (r + 1);
-    describe_effect_source(player_ptr, ep_ptr, who_name);
+    describe_effect_source(player_ptr, ep_ptr, src_name);
     switch_effects_player(player_ptr, ep_ptr);
 
     SpellHex(player_ptr).store_vengeful_damage(ep_ptr->get_damage);
-    if ((player_ptr->tim_eyeeye || SpellHex(player_ptr).is_spelling_specific(HEX_EYE_FOR_EYE)) && (ep_ptr->get_damage > 0) && !player_ptr->is_dead && (ep_ptr->who > 0)) {
+    if ((player_ptr->tim_eyeeye || SpellHex(player_ptr).is_spelling_specific(HEX_EYE_FOR_EYE)) && (ep_ptr->get_damage > 0) && !player_ptr->is_dead && is_monster(ep_ptr->src_idx)) {
         const auto m_name_self = monster_desc(player_ptr, ep_ptr->m_ptr, MD_PRON_VISIBLE | MD_POSSESSIVE | MD_OBJECTIVE);
         msg_print(_(format("攻撃が%s自身を傷つけた!", ep_ptr->m_name), format("The attack of %s has wounded %s!", ep_ptr->m_name, m_name_self.data())));
         (*project)(player_ptr, 0, 0, ep_ptr->m_ptr->fy, ep_ptr->m_ptr->fx, ep_ptr->get_damage, AttributeType::MISSILE, PROJECT_KILL, std::nullopt);
@@ -225,7 +226,7 @@ bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, in
     }
 
     disturb(player_ptr, true, true);
-    if (ep_ptr->dam && ep_ptr->who && (ep_ptr->who != player_ptr->riding)) {
+    if (ep_ptr->dam && ep_ptr->src_idx && (ep_ptr->src_idx != player_ptr->riding)) {
         (void)kawarimi(player_ptr, false);
     }
 
index 1fdaf42..be5b133 100644 (file)
@@ -13,18 +13,18 @@ public:
     GAME_TEXT m_name[MAX_NLEN];
     int get_damage;
 
-    MONSTER_IDX who;
+    MONSTER_IDX src_idx;
     int dam;
     AttributeType attribute;
     BIT_FLAGS flag;
-    EffectPlayerType(MONSTER_IDX who, int dam, AttributeType attribute, BIT_FLAGS flag);
+    EffectPlayerType(MONSTER_IDX src_idx, int dam, AttributeType attribute, BIT_FLAGS flag);
 };
 
 struct ProjectResult;
 class CapturedMonsterType;
 class PlayerType;
 using project_func = ProjectResult (*)(
-    PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr);
+    PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION rad, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr);
 
-bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag,
+bool affect_player(MONSTER_IDX src_idx, PlayerType *player_ptr, concptr src_name, int r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag,
     project_func project);
index 221e470..3e8acf6 100644 (file)
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
+#include "monster/monster-util.h"
 #include "pet/pet-fall-off.h"
 #include "player/player-status.h"
 #include "spell-class/spells-mirror-master.h"
@@ -44,7 +44,7 @@
 /*!
  * @brief 汎用的なビーム/ボルト/ボール系処理のルーチン Generic
  * "beam"/"bolt"/"ball" projection routine.
- * @param who 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source"
+ * @param src_idx 魔法を発動したモンスター(0ならばプレイヤー) / Index of "source"
  * monster (zero for "player")
  * @param rad 効果半径(ビーム/ボルト = 0 / ボール = 1以上) / Radius of explosion
  * (0 = beam/bolt, 1 to 9 = ball)
@@ -58,7 +58,7 @@
  * @todo 似たような処理が山ほど並んでいる、何とかならないものか
  * @todo 引数にそのまま再代入していてカオスすぎる。直すのは簡単ではない
  */
-ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, const POSITION target_y, const POSITION target_x, const int dam,
+ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX src_idx, POSITION rad, const POSITION target_y, const POSITION target_x, const int dam,
     const AttributeType typ, BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr)
 {
     POSITION y1;
@@ -82,12 +82,12 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
     if (any_bits(flag, PROJECT_JUMP)) {
         x1 = target_x;
         y1 = target_y;
-    } else if (who <= 0) {
+    } else if (!is_monster(src_idx)) {
         x1 = player_ptr->x;
         y1 = player_ptr->y;
-    } else if (who > 0) {
-        x1 = player_ptr->current_floor_ptr->m_list[who].fx;
-        y1 = player_ptr->current_floor_ptr->m_list[who].fy;
+    } else if (is_monster(src_idx)) {
+        x1 = player_ptr->current_floor_ptr->m_list[src_idx].fx;
+        y1 = player_ptr->current_floor_ptr->m_list[src_idx].fy;
     } else {
         x1 = target_x;
         y1 = target_y;
@@ -306,8 +306,8 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
     update_creature(player_ptr);
 
     if (flag & PROJECT_KILL) {
-        see_s_msg = (who > 0) ? is_seen(player_ptr, &player_ptr->current_floor_ptr->m_list[who])
-                              : (!who ? true : (player_can_see_bold(player_ptr, y1, x1) && projectable(player_ptr, player_ptr->y, player_ptr->x, y1, x1)));
+        see_s_msg = is_monster(src_idx) ? is_seen(player_ptr, &player_ptr->current_floor_ptr->m_list[src_idx])
+                                        : (is_player(src_idx) ? true : (player_can_see_bold(player_ptr, y1, x1) && projectable(player_ptr, player_ptr->y, player_ptr->x, y1, x1)));
     }
 
     if (flag & (PROJECT_GRID)) {
@@ -320,11 +320,11 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
             auto x = gx[i];
             if (breath) {
                 int d = dist_to_line(y, x, y1, x1, by, bx);
-                if (affect_feature(player_ptr, who, d, y, x, dam, typ)) {
+                if (affect_feature(player_ptr, src_idx, d, y, x, dam, typ)) {
                     res.notice = true;
                 }
             } else {
-                if (affect_feature(player_ptr, who, dist, y, x, dam, typ)) {
+                if (affect_feature(player_ptr, src_idx, dist, y, x, dam, typ)) {
                     res.notice = true;
                 }
             }
@@ -343,11 +343,11 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
             auto x = gx[i];
             if (breath) {
                 int d = dist_to_line(y, x, y1, x1, by, bx);
-                if (affect_item(player_ptr, who, d, y, x, dam, typ)) {
+                if (affect_item(player_ptr, src_idx, d, y, x, dam, typ)) {
                     res.notice = true;
                 }
             } else {
-                if (affect_item(player_ptr, who, dist, y, x, dam, typ)) {
+                if (affect_item(player_ptr, src_idx, dist, y, x, dam, typ)) {
                     res.notice = true;
                 }
             }
@@ -370,7 +370,8 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
             if (grids <= 1) {
                 auto *m_ptr = &floor.m_list[grid.m_idx];
                 MonsterRaceInfo *ref_ptr = &m_ptr->get_monrace();
-                if ((flag & PROJECT_REFLECTABLE) && grid.m_idx && ref_ptr->misc_flags.has(MonsterMiscType::REFLECTING) && ((grid.m_idx != player_ptr->riding) || !(flag & PROJECT_PLAYER)) && (!who || path_n > 1) && !one_in_(10)) {
+                if ((flag & PROJECT_REFLECTABLE) && grid.m_idx && ref_ptr->misc_flags.has(MonsterMiscType::REFLECTING) && ((grid.m_idx != player_ptr->riding) || !(flag & PROJECT_PLAYER)) && (!src_idx || path_n > 1) && !one_in_(10)) {
+
                     POSITION t_y, t_x;
                     int max_attempts = 10;
                     do {
@@ -393,7 +394,7 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
                         } else {
                             msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
                         }
-                    } else if (who <= 0) {
+                    } else if (!is_monster(src_idx)) {
                         sound(SOUND_REFLECT);
                     }
 
@@ -474,15 +475,15 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
                 }
             }
 
-            if (affect_monster(player_ptr, who, effective_dist, pos.y, pos.x, dam, typ, flag, see_s_msg, cap_mon_ptr)) {
+            if (affect_monster(player_ptr, src_idx, effective_dist, pos.y, pos.x, dam, typ, flag, see_s_msg, cap_mon_ptr)) {
                 res.notice = true;
             }
         }
         /* Player affected one monster (without "jumping") */
-        if (!who && (project_m_n == 1) && none_bits(flag, PROJECT_JUMP)) {
+        if (!src_idx && (project_m_n == 1) && none_bits(flag, PROJECT_JUMP)) {
             const Pos2D pos_project(project_m_y, project_m_x);
             const auto &grid = floor.get_grid(pos_project);
-            if (grid.m_idx > 0) {
+            if (grid.has_monster()) {
                 auto &monster = floor.m_list[grid.m_idx];
                 if (monster.ml) {
                     if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
@@ -548,11 +549,11 @@ ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION ra
             }
 
             std::string who_name;
-            if (who > 0) {
-                who_name = monster_desc(player_ptr, &floor.m_list[who], MD_WRONGDOER_NAME);
+            if (is_monster(src_idx)) {
+                who_name = monster_desc(player_ptr, &floor.m_list[src_idx], MD_WRONGDOER_NAME);
             }
 
-            if (affect_player(who, player_ptr, who_name.data(), effective_dist, pos.y, pos.x, dam, typ, flag, project)) {
+            if (affect_player(src_idx, player_ptr, who_name.data(), effective_dist, pos.y, pos.x, dam, typ, flag, project)) {
                 res.notice = true;
                 res.affected_player = true;
             }
index 259baea..039eec9 100644 (file)
@@ -15,5 +15,5 @@ class CapturedMonsterType;
 class EffectPlayerType;
 class PlayerType;
 ProjectResult project(
-    PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const int dam, const AttributeType typ,
+    PlayerType *player_ptr, const MONSTER_IDX src_idx, POSITION rad, POSITION y, POSITION x, const int dam, const AttributeType typ,
     BIT_FLAGS flag, std::optional<CapturedMonsterType *> cap_mon_ptr = std::nullopt);
index 2fc8b56..4079c99 100644 (file)
@@ -18,7 +18,6 @@
 #ifdef JP
 #else
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "object/tval-types.h"
 #include "system/monster-race-info.h"
 #endif
index 910d4a3..b05ff56 100644 (file)
@@ -23,7 +23,6 @@
 #include "mind/mind-sniper.h"
 #include "mind/mind-weaponsmith.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/special-object-flags.h"
 #include "object-enchant/tr-types.h"
index ab417d0..7bf96a2 100644 (file)
@@ -18,7 +18,6 @@
 #include "util/enum-converter.h"
 #ifdef JP
 #else
-#include "monster-race/race-flags1.h"
 #include "player-info/class-info.h"
 #endif
 
index ee57e0d..f6f1f36 100644 (file)
@@ -16,8 +16,6 @@
 #include "monster-floor/monster-generator.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-util.h"
 #include "monster/smart-learn-types.h"
 #include "object-enchant/item-apply-magic.h"
index 77414ad..1bcfc6c 100644 (file)
@@ -21,9 +21,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-floor/monster-summon.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
index e570d40..43bb0d2 100644 (file)
@@ -15,7 +15,6 @@
 #include "main/sound-of-music.h"
 #include "mind/mind-ninja.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-info.h"
 #include "monster/monster-list.h"
 #include "monster/monster-status.h"
index 5fe95d8..7c2c1b3 100644 (file)
@@ -343,7 +343,7 @@ void build_streamer(PlayerType *player_ptr, FEAT_IDX feat, int chance)
             }
 
             auto *r_ptr = &monraces_info[floor.m_list[grid.m_idx].r_idx];
-            if (grid.m_idx && !(streamer.flags.has(TerrainCharacteristics::PLACE) && monster_can_cross_terrain(player_ptr, feat, r_ptr, 0))) {
+            if (grid.has_monster() && !(streamer.flags.has(TerrainCharacteristics::PLACE) && monster_can_cross_terrain(player_ptr, feat, r_ptr, 0))) {
                 /* Delete the monster (if any) */
                 delete_monster(player_ptr, pos.y, pos.x);
             }
index 8748294..2839b07 100644 (file)
@@ -11,7 +11,6 @@
 #include "grid/object-placer.h"
 #include "grid/trap.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/dungeon-info.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
@@ -63,7 +62,7 @@ static bool alloc_stairs_aux(PlayerType *player_ptr, POSITION y, POSITION x, int
 {
     auto *floor_ptr = player_ptr->current_floor_ptr;
     auto *g_ptr = &floor_ptr->grid_array[y][x];
-    if (!g_ptr->is_floor() || pattern_tile(floor_ptr, y, x) || !g_ptr->o_idx_list.empty() || (g_ptr->m_idx != 0) || next_to_walls(floor_ptr, y, x) < walls) {
+    if (!g_ptr->is_floor() || pattern_tile(floor_ptr, y, x) || !g_ptr->o_idx_list.empty() || g_ptr->has_monster() || next_to_walls(floor_ptr, y, x) < walls) {
         return false;
     }
 
@@ -195,7 +194,7 @@ void alloc_object(PlayerType *player_ptr, dap_type set, dungeon_allocation_type
             x = randint0(floor_ptr->width);
             const Pos2D pos(y, x);
             const auto &grid = floor_ptr->get_grid(pos);
-            if (!grid.is_floor() || !grid.o_idx_list.empty() || grid.m_idx) {
+            if (!grid.is_floor() || !grid.o_idx_list.empty() || grid.has_monster()) {
                 continue;
             }
 
index fef6bb4..59924e5 100644 (file)
@@ -551,7 +551,7 @@ void wilderness_gen(PlayerType *player_ptr)
                     continue;
                 }
 
-                if (grid.m_idx != 0) {
+                if (grid.has_monster()) {
                     delete_monster_idx(player_ptr, grid.m_idx);
                 }
 
@@ -569,7 +569,7 @@ void wilderness_gen(PlayerType *player_ptr)
                     continue;
                 }
 
-                if (grid.m_idx != 0) {
+                if (grid.has_monster()) {
                     delete_monster_idx(player_ptr, grid.m_idx);
                 }
 
index 589efca..114c981 100644 (file)
@@ -234,7 +234,7 @@ void cave_set_feat(PlayerType *player_ptr, POSITION y, POSITION x, FEAT_IDX feat
         g_ptr->info &= ~(CAVE_MARK);
     }
 
-    if (g_ptr->m_idx) {
+    if (g_ptr->has_monster()) {
         update_monster(player_ptr, g_ptr->m_idx, false);
     }
 
@@ -264,7 +264,7 @@ void cave_set_feat(PlayerType *player_ptr, POSITION y, POSITION x, FEAT_IDX feat
         auto *cc_ptr = &floor_ptr->grid_array[yy][xx];
         cc_ptr->info |= CAVE_GLOW;
         if (cc_ptr->is_view()) {
-            if (cc_ptr->m_idx) {
+            if (cc_ptr->has_monster()) {
                 update_monster(player_ptr, cc_ptr->m_idx, false);
             }
 
index e863b8f..7ee06ef 100644 (file)
@@ -34,8 +34,6 @@
 #include "io/screen-util.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
@@ -86,7 +84,7 @@ bool new_player_spot(PlayerType *player_ptr)
         const auto &grid = player_ptr->current_floor_ptr->get_grid({ y, x });
 
         /* Must be a "naked" floor grid */
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             continue;
         }
         if (floor.is_in_dungeon()) {
@@ -186,7 +184,7 @@ static void update_local_illumination_aux(PlayerType *player_ptr, int y, int x)
         return;
     }
 
-    if (grid.m_idx > 0) {
+    if (grid.has_monster()) {
         update_monster(player_ptr, grid.m_idx, false);
     }
 
@@ -851,7 +849,7 @@ bool cave_monster_teleportable_bold(PlayerType *player_ptr, MONSTER_IDX m_idx, P
         return false;
     }
 
-    if (grid.m_idx && (grid.m_idx != m_idx)) {
+    if (grid.has_monster() && (grid.m_idx != m_idx)) {
         return false;
     }
     if (player_ptr->is_located_at(pos)) {
@@ -898,7 +896,7 @@ bool cave_player_teleportable_bold(PlayerType *player_ptr, POSITION y, POSITION
         return false;
     }
 
-    if (grid.m_idx && (grid.m_idx != player_ptr->riding)) {
+    if (grid.has_monster() && (grid.m_idx != player_ptr->riding)) {
         return false;
     }
 
@@ -1062,7 +1060,7 @@ void place_grid(PlayerType *player_ptr, Grid *g_ptr, grid_bold_type gb_type)
         return;
     }
 
-    if (g_ptr->m_idx > 0) {
+    if (g_ptr->has_monster()) {
         delete_monster_idx(player_ptr, g_ptr->m_idx);
     }
 }
index fc465d0..d9fbd5e 100644 (file)
@@ -11,8 +11,6 @@
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/trc-types.h"
index e7f9cd2..df479fd 100644 (file)
@@ -3,7 +3,6 @@
 #include "core/window-redrawer.h"
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-status.h"
 #include "player-base/player-class.h"
 #include "player-info/magic-eater-data-type.h"
index c3c18ea..b1e0d7c 100644 (file)
@@ -9,11 +9,6 @@
 #include "monster-race/race-drop-flags.h"
 #include "monster-race/race-feature-flags.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-kind-flags.h"
 #include "monster-race/race-misc-flags.h"
 #include "monster-race/race-population-flags.h"
index c26a5b5..9446a64 100644 (file)
@@ -16,7 +16,6 @@
 #include "main/angband-headers.h"
 #include "market/arena-info-table.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index 01aaba3..80ba10c 100644 (file)
@@ -57,7 +57,7 @@ void print_path(PlayerType *player_ptr, POSITION y, POSITION x)
             TERM_COLOR ta = default_color;
             auto tc = '*';
 
-            if (g_ptr->m_idx && floor_ptr->m_list[g_ptr->m_idx].ml) {
+            if (g_ptr->has_monster() && floor_ptr->m_list[g_ptr->m_idx].ml) {
                 map_info(player_ptr, ny, nx, &a, &c, &ta, &tc);
 
                 if (!is_ascii_graphics(a)) {
index 6531e4e..8498e99 100644 (file)
@@ -17,7 +17,6 @@
 #include "io/input-key-acceptor.h"
 #include "io/uid-checker.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/angband-exceptions.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
index 9aea320..59b61a2 100644 (file)
@@ -17,9 +17,6 @@
 #include "locale/english.h"
 #include "lore/lore-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index 04b0973..6308c7f 100644 (file)
@@ -9,7 +9,6 @@
 #include "game-option/cheat-options.h"
 #include "io-dump/dump-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
 #include "term/z-form.h"
index cd34fe9..172af54 100644 (file)
@@ -8,7 +8,6 @@
 #include "load/load-util.h"
 #include "load/old/load-v1-5-0.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "save/floor-writer.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-race-info.h"
index 06528e9..7096d50 100644 (file)
@@ -5,10 +5,6 @@
 #include "load/old/load-v1-5-0.h"
 #include "load/savedata-old-flag-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "system/angband.h"
 #include "system/monster-race-info.h"
 #include "system/system-variables.h"
 
 static void migrate_old_misc_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1, BIT_FLAGS old_flags2)
 {
+    if (!loading_savefile_version_is_older_than(20)) {
+        rd_FlagGroup(r_ptr->r_misc_flags, rd_byte);
+        return;
+    }
+
     constexpr auto SIZE_OF_RF1 = 6;
     struct flag_list_ver20 {
         SavedataLoreOlderThan20FlagType old_flag;
@@ -60,6 +61,11 @@ static void migrate_old_misc_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1,
 
 static void migrate_old_feature_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags)
 {
+    if (!loading_savefile_version_is_older_than(19)) {
+        rd_FlagGroup(r_ptr->feature_flags, rd_byte);
+        return;
+    }
+
     if (any_bits(old_flags, enum2i(SavedataLoreOlderThan19FlagType::RF2_PASS_WALL))) {
         r_ptr->r_feature_flags.set(MonsterFeatureType::PASS_WALL);
     }
@@ -68,23 +74,32 @@ static void migrate_old_feature_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flag
     }
 }
 
-static void migrate_old_aura_flags(MonsterRaceInfo *r_ptr)
+static void migrate_old_aura_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags2, BIT_FLAGS old_flags3)
 {
-    if (any_bits(r_ptr->r_flags2, SavedataLoreOlderThan10FlagType::AURA_FIRE_OLD)) {
+    if (!loading_savefile_version_is_older_than(10)) {
+        rd_FlagGroup(r_ptr->r_aura_flags, rd_byte);
+        return;
+    }
+
+    if (any_bits(old_flags2, SavedataLoreOlderThan10FlagType::AURA_FIRE_OLD)) {
         r_ptr->r_aura_flags.set(MonsterAuraType::FIRE);
     }
 
-    if (any_bits(r_ptr->r_flags3, SavedataLoreOlderThan10FlagType::AURA_COLD_OLD)) {
+    if (any_bits(old_flags3, SavedataLoreOlderThan10FlagType::AURA_COLD_OLD)) {
         r_ptr->r_aura_flags.set(MonsterAuraType::COLD);
     }
 
-    if (any_bits(r_ptr->r_flags2, SavedataLoreOlderThan10FlagType::AURA_ELEC_OLD)) {
+    if (any_bits(old_flags2, SavedataLoreOlderThan10FlagType::AURA_ELEC_OLD)) {
         r_ptr->r_aura_flags.set(MonsterAuraType::ELEC);
     }
 }
 
 static void migrate_old_resistance_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags)
 {
+    if (!loading_savefile_version_is_older_than(14)) {
+        return;
+    }
+
     struct flag_list_ver14 {
         SavedataLoreOlderThan14FlagType old_flag;
         MonsterResistanceType flag;
@@ -126,6 +141,11 @@ static void migrate_old_resistance_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_f
 
 static void migrate_old_drop_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1)
 {
+    if (!loading_savefile_version_is_older_than(18)) {
+        rd_FlagGroup(r_ptr->r_drop_flags, rd_byte);
+        return;
+    }
+
     struct flag_list_ver18 {
         SavedataLoreOlderThan18FlagType old_flag;
         MonsterDropType flag;
@@ -151,8 +171,12 @@ static void migrate_old_drop_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1)
     }
 }
 
-static void migrate_old_no_debuff_flags(MonsterRaceInfo *r_ptr)
+static void migrate_old_no_debuff_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags3)
 {
+    if (!loading_savefile_version_is_older_than(19)) {
+        return;
+    }
+
     struct flag_list_ver19 {
         SavedataLoreOlderThan19FlagType_No_Debuff old_flag;
         MonsterResistanceType flag;
@@ -166,23 +190,13 @@ static void migrate_old_no_debuff_flags(MonsterRaceInfo *r_ptr)
     };
 
     for (const auto &l : flag_list) {
-        if (any_bits(r_ptr->r_flags3, l.old_flag)) {
+        if (any_bits(old_flags3, l.old_flag)) {
             r_ptr->r_resistance_flags.set(l.flag);
         }
     }
 }
 
-static void rd_r_drop_flags(MonsterRaceInfo *r_ptr)
-{
-    if (loading_savefile_version_is_older_than(18)) {
-        migrate_old_drop_flags(r_ptr, r_ptr->r_flags1);
-        return;
-    }
-
-    rd_FlagGroup(r_ptr->r_drop_flags, rd_byte);
-}
-
-static void rd_r_ability_flags(MonsterRaceInfo *r_ptr, const MonsterRaceId r_idx)
+static void migrate_old_resistance_and_ability_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS f3, const MonsterRaceId r_idx)
 {
     if (loading_savefile_version_is_older_than(3)) {
         BIT_FLAGS r_flagsr = 0;
@@ -190,7 +204,7 @@ static void rd_r_ability_flags(MonsterRaceInfo *r_ptr, const MonsterRaceId r_idx
         uint32_t f5 = rd_u32b();
         uint32_t f6 = rd_u32b();
         if (h_older_than(1, 5, 0, 3)) {
-            set_old_lore(r_ptr, f4, r_idx);
+            set_old_lore(r_ptr, f3, f4, r_idx);
         } else {
             r_flagsr = rd_u32b();
         }
@@ -211,132 +225,103 @@ static void rd_r_ability_flags(MonsterRaceInfo *r_ptr, const MonsterRaceId r_idx
     }
 }
 
-static void rd_r_aura_flags(MonsterRaceInfo *r_ptr)
+static void migrate_old_kind_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1, BIT_FLAGS old_flags2, BIT_FLAGS old_flags3)
 {
-    if (loading_savefile_version_is_older_than(10)) {
+    if (!loading_savefile_version_is_older_than(12)) {
+        rd_FlagGroup(r_ptr->r_kind_flags, rd_byte);
         return;
     }
 
-    rd_FlagGroup(r_ptr->r_aura_flags, rd_byte);
-}
-
-static void rd_r_kind_flags(MonsterRaceInfo *r_ptr)
-{
-    if (loading_savefile_version_is_older_than(12)) {
-        struct flag_list_ver12 {
-            BIT_FLAGS check_flag;
-            MonsterKindType flag;
-        };
-
-        const std::vector<flag_list_ver12> flag1 = {
-            { RF1_UNIQUE, MonsterKindType::UNIQUE },
-        };
-
-        const std::vector<flag_list_ver12> flag2 = {
-            { static_cast<BIT_FLAGS>(RF2_HUMAN), MonsterKindType::HUMAN },
-            { static_cast<BIT_FLAGS>(RF2_QUANTUM), MonsterKindType::QUANTUM },
-        };
-
-        const std::vector<flag_list_ver12> flag3 = {
-            { RF3_ORC, MonsterKindType::ORC },
-            { RF3_TROLL, MonsterKindType::TROLL },
-            { RF3_GIANT, MonsterKindType::GIANT },
-            { RF3_DRAGON, MonsterKindType::DRAGON },
-            { RF3_DEMON, MonsterKindType::DEMON },
-            { RF3_AMBERITE, MonsterKindType::AMBERITE },
-            { RF3_ANGEL, MonsterKindType::ANGEL },
-            { RF3_DRAGON, MonsterKindType::DRAGON },
-            { RF3_EVIL, MonsterKindType::EVIL },
-            { RF3_GOOD, MonsterKindType::GOOD },
-            { RF3_ANIMAL, MonsterKindType::ANIMAL },
-            { RF3_UNDEAD, MonsterKindType::UNDEAD },
-
-        };
-
-        for (const auto &f : flag1) {
-            if (any_bits(r_ptr->r_flags1, f.check_flag)) {
-                r_ptr->r_kind_flags.set(f.flag);
-            }
-        }
+    struct flag_list_ver12 {
+        SavedataLoreOlderThan12FlagType check_flag;
+        MonsterKindType flag;
+    };
 
-        for (const auto &f : flag2) {
-            if (any_bits(r_ptr->r_flags2, f.check_flag)) {
-                r_ptr->r_kind_flags.set(f.flag);
-            }
-        }
+    const std::vector<flag_list_ver12> flag1 = {
+        { SavedataLoreOlderThan12FlagType::RF1_UNIQUE, MonsterKindType::UNIQUE },
+    };
 
-        for (const auto &f : flag3) {
-            if (any_bits(r_ptr->r_flags3, f.check_flag)) {
-                r_ptr->r_kind_flags.set(f.flag);
-            }
-        }
+    const std::vector<flag_list_ver12> flag2 = {
+        { SavedataLoreOlderThan12FlagType::RF2_HUMAN, MonsterKindType::HUMAN },
+        { SavedataLoreOlderThan12FlagType::RF2_QUANTUM, MonsterKindType::QUANTUM },
+    };
 
-        return;
-    }
+    const std::vector<flag_list_ver12> flag3 = {
+        { SavedataLoreOlderThan12FlagType::RF3_ORC, MonsterKindType::ORC },
+        { SavedataLoreOlderThan12FlagType::RF3_TROLL, MonsterKindType::TROLL },
+        { SavedataLoreOlderThan12FlagType::RF3_GIANT, MonsterKindType::GIANT },
+        { SavedataLoreOlderThan12FlagType::RF3_DRAGON, MonsterKindType::DRAGON },
+        { SavedataLoreOlderThan12FlagType::RF3_DEMON, MonsterKindType::DEMON },
+        { SavedataLoreOlderThan12FlagType::RF3_AMBERITE, MonsterKindType::AMBERITE },
+        { SavedataLoreOlderThan12FlagType::RF3_ANGEL, MonsterKindType::ANGEL },
+        { SavedataLoreOlderThan12FlagType::RF3_DRAGON, MonsterKindType::DRAGON },
+        { SavedataLoreOlderThan12FlagType::RF3_EVIL, MonsterKindType::EVIL },
+        { SavedataLoreOlderThan12FlagType::RF3_GOOD, MonsterKindType::GOOD },
+        { SavedataLoreOlderThan12FlagType::RF3_ANIMAL, MonsterKindType::ANIMAL },
+        { SavedataLoreOlderThan12FlagType::RF3_UNDEAD, MonsterKindType::UNDEAD },
 
-    rd_FlagGroup(r_ptr->r_kind_flags, rd_byte);
-}
+    };
 
-static void rd_r_behavior_flags(MonsterRaceInfo *r_ptr)
-{
-    if (loading_savefile_version_is_older_than(11)) {
-        struct flag_list_ver11 {
-            BIT_FLAGS check_flag;
-            MonsterBehaviorType flag;
-        };
-
-        const std::vector<flag_list_ver11> flag1 = {
-            { RF1_NEVER_BLOW, MonsterBehaviorType::NEVER_BLOW },
-            { RF1_NEVER_MOVE, MonsterBehaviorType::NEVER_MOVE },
-            { RF1_RAND_25, MonsterBehaviorType::RAND_MOVE_25 },
-            { RF1_RAND_50, MonsterBehaviorType::RAND_MOVE_50 },
-        };
-
-        const std::vector<flag_list_ver11> flag2 = {
-            { RF2_OPEN_DOOR, MonsterBehaviorType::OPEN_DOOR },
-            { RF2_BASH_DOOR, MonsterBehaviorType::BASH_DOOR },
-            { RF2_MOVE_BODY, MonsterBehaviorType::MOVE_BODY },
-            { RF2_KILL_BODY, MonsterBehaviorType::KILL_BODY },
-            { RF2_TAKE_ITEM, MonsterBehaviorType::TAKE_ITEM },
-            { RF2_KILL_ITEM, MonsterBehaviorType::KILL_ITEM },
-            { RF2_STUPID, MonsterBehaviorType::STUPID },
-            { RF2_SMART, MonsterBehaviorType::SMART },
-        };
-
-        for (const auto &f : flag1) {
-            if (any_bits(r_ptr->r_flags1, f.check_flag)) {
-                r_ptr->r_behavior_flags.set(f.flag);
-            }
+    for (const auto &f : flag1) {
+        if (any_bits(old_flags1, f.check_flag)) {
+            r_ptr->r_kind_flags.set(f.flag);
         }
+    }
 
-        for (const auto &f : flag2) {
-            if (any_bits(r_ptr->r_flags2, f.check_flag)) {
-                r_ptr->r_behavior_flags.set(f.flag);
-            }
+    for (const auto &f : flag2) {
+        if (any_bits(old_flags2, f.check_flag)) {
+            r_ptr->r_kind_flags.set(f.flag);
         }
-
-        return;
     }
 
-    rd_FlagGroup(r_ptr->r_behavior_flags, rd_byte);
+    for (const auto &f : flag3) {
+        if (any_bits(old_flags3, f.check_flag)) {
+            r_ptr->r_kind_flags.set(f.flag);
+        }
+    }
 }
 
-static void rd_r_feature_flags(MonsterRaceInfo *r_ptr)
+static void migrate_old_behavior_flags(MonsterRaceInfo *r_ptr, BIT_FLAGS old_flags1, BIT_FLAGS old_flags2)
 {
-    if (loading_savefile_version_is_older_than(19)) {
-        migrate_old_feature_flags(r_ptr, r_ptr->r_flags2);
+    if (!loading_savefile_version_is_older_than(11)) {
+        rd_FlagGroup(r_ptr->r_behavior_flags, rd_byte);
         return;
     }
-    rd_FlagGroup(r_ptr->r_feature_flags, rd_byte);
-}
 
-static void rd_r_misc_flags(MonsterRaceInfo *r_ptr)
-{
-    if (loading_savefile_version_is_older_than(20)) {
-        migrate_old_misc_flags(r_ptr, r_ptr->r_flags1, r_ptr->r_flags2);
-        return;
+    struct flag_list_ver11 {
+        SavedataLoreOlderThan11FlagType check_flag;
+        MonsterBehaviorType flag;
+    };
+
+    const std::vector<flag_list_ver11> flag1 = {
+        { SavedataLoreOlderThan11FlagType::RF1_NEVER_BLOW, MonsterBehaviorType::NEVER_BLOW },
+        { SavedataLoreOlderThan11FlagType::RF1_NEVER_MOVE, MonsterBehaviorType::NEVER_MOVE },
+        { SavedataLoreOlderThan11FlagType::RF1_RAND_25, MonsterBehaviorType::RAND_MOVE_25 },
+        { SavedataLoreOlderThan11FlagType::RF1_RAND_50, MonsterBehaviorType::RAND_MOVE_50 },
+    };
+
+    const std::vector<flag_list_ver11> flag2 = {
+        { SavedataLoreOlderThan11FlagType::RF2_OPEN_DOOR, MonsterBehaviorType::OPEN_DOOR },
+        { SavedataLoreOlderThan11FlagType::RF2_BASH_DOOR, MonsterBehaviorType::BASH_DOOR },
+        { SavedataLoreOlderThan11FlagType::RF2_MOVE_BODY, MonsterBehaviorType::MOVE_BODY },
+        { SavedataLoreOlderThan11FlagType::RF2_KILL_BODY, MonsterBehaviorType::KILL_BODY },
+        { SavedataLoreOlderThan11FlagType::RF2_TAKE_ITEM, MonsterBehaviorType::TAKE_ITEM },
+        { SavedataLoreOlderThan11FlagType::RF2_KILL_ITEM, MonsterBehaviorType::KILL_ITEM },
+        { SavedataLoreOlderThan11FlagType::RF2_STUPID, MonsterBehaviorType::STUPID },
+        { SavedataLoreOlderThan11FlagType::RF2_SMART, MonsterBehaviorType::SMART },
+    };
+
+    for (const auto &f : flag1) {
+        if (any_bits(old_flags1, f.check_flag)) {
+            r_ptr->r_behavior_flags.set(f.flag);
+        }
+    }
+
+    for (const auto &f : flag2) {
+        if (any_bits(old_flags2, f.check_flag)) {
+            r_ptr->r_behavior_flags.set(f.flag);
+        }
     }
-    rd_FlagGroup(r_ptr->r_misc_flags, rd_byte);
 }
 
 /*!
@@ -378,21 +363,34 @@ static void rd_lore(MonsterRaceInfo *r_ptr, const MonsterRaceId r_idx)
     r_ptr->r_blows[2] = rd_byte();
     r_ptr->r_blows[3] = rd_byte();
 
-    r_ptr->r_flags1 = rd_u32b();
-    r_ptr->r_flags2 = rd_u32b();
-    r_ptr->r_flags3 = rd_u32b();
-    migrate_old_no_debuff_flags(r_ptr);
-    migrate_old_aura_flags(r_ptr);
-    rd_r_ability_flags(r_ptr, r_idx);
-    rd_r_aura_flags(r_ptr);
-    rd_r_behavior_flags(r_ptr);
-    rd_r_kind_flags(r_ptr);
-    rd_r_drop_flags(r_ptr);
-    rd_r_feature_flags(r_ptr);
-    if (!loading_savefile_version_is_older_than(20)) {
-        rd_FlagGroup(r_ptr->special_flags, rd_byte);
+    if (loading_savefile_version_is_older_than(21)) {
+        auto r_flags1 = rd_u32b();
+        auto r_flags2 = rd_u32b();
+        auto r_flags3 = rd_u32b();
+
+        migrate_old_no_debuff_flags(r_ptr, r_flags3);
+        migrate_old_resistance_and_ability_flags(r_ptr, r_flags3, r_idx);
+        migrate_old_aura_flags(r_ptr, r_flags2, r_flags3);
+        migrate_old_behavior_flags(r_ptr, r_flags1, r_flags2);
+        migrate_old_kind_flags(r_ptr, r_flags1, r_flags2, r_flags3);
+        migrate_old_drop_flags(r_ptr, r_flags1);
+        migrate_old_feature_flags(r_ptr, r_flags2);
+        if (!loading_savefile_version_is_older_than(20)) {
+            rd_FlagGroup(r_ptr->r_special_flags, rd_byte);
+        }
+        migrate_old_misc_flags(r_ptr, r_flags1, r_flags2);
+    } else {
+        rd_FlagGroup(r_ptr->r_resistance_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_ability_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_aura_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_behavior_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_kind_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_drop_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_feature_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_special_flags, rd_byte);
+        rd_FlagGroup(r_ptr->r_misc_flags, rd_byte);
     }
-    rd_r_misc_flags(r_ptr);
+
     r_ptr->max_num = rd_byte();
     r_ptr->floor_id = rd_s16b();
 
@@ -403,9 +401,6 @@ static void rd_lore(MonsterRaceInfo *r_ptr, const MonsterRaceId r_idx)
 
     strip_bytes(1);
 
-    r_ptr->r_flags1 &= r_ptr->flags1;
-    r_ptr->r_flags2 &= r_ptr->flags2;
-    r_ptr->r_flags3 &= r_ptr->flags3;
     r_ptr->r_resistance_flags &= r_ptr->resistance_flags;
     r_ptr->r_ability_flags &= r_ptr->ability_flags;
     r_ptr->r_aura_flags &= r_ptr->aura_flags;
index 013a008..1eda0d8 100644 (file)
@@ -24,8 +24,7 @@
 #include "monster-floor/monster-move.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
+
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
@@ -484,10 +483,9 @@ void rd_monster_old(PlayerType *player_ptr, MonsterEntity *m_ptr)
     strip_bytes(1);
 }
 
-static void move_RF3_to_RFR(MonsterRaceInfo *r_ptr, const BIT_FLAGS rf3, const MonsterResistanceType rfr)
+static void move_RF3_to_RFR(MonsterRaceInfo *r_ptr, BIT_FLAGS f3, const BIT_FLAGS rf3, const MonsterResistanceType rfr)
 {
-    if (r_ptr->r_flags3 & rf3) {
-        r_ptr->r_flags3 &= ~rf3;
+    if (f3 & rf3) {
         r_ptr->resistance_flags.set(rfr);
     }
 }
@@ -505,21 +503,21 @@ static void move_RF4_BR_to_RFR(MonsterRaceInfo *r_ptr, BIT_FLAGS f4, const BIT_F
  * @param r_idx モンスター種族ID
  * @details 本来はr_idxからr_ptrを決定可能だが、互換性を優先するため元コードのままとする
  */
-void set_old_lore(MonsterRaceInfo *r_ptr, BIT_FLAGS f4, const MonsterRaceId r_idx)
+void set_old_lore(MonsterRaceInfo *r_ptr, BIT_FLAGS f3, BIT_FLAGS f4, const MonsterRaceId r_idx)
 {
     r_ptr->r_resistance_flags.clear();
-    move_RF3_to_RFR(r_ptr, RF3_IM_ACID, MonsterResistanceType::IMMUNE_ACID);
-    move_RF3_to_RFR(r_ptr, RF3_IM_ELEC, MonsterResistanceType::IMMUNE_ELEC);
-    move_RF3_to_RFR(r_ptr, RF3_IM_FIRE, MonsterResistanceType::IMMUNE_FIRE);
-    move_RF3_to_RFR(r_ptr, RF3_IM_COLD, MonsterResistanceType::IMMUNE_COLD);
-    move_RF3_to_RFR(r_ptr, RF3_IM_POIS, MonsterResistanceType::IMMUNE_POISON);
-    move_RF3_to_RFR(r_ptr, RF3_RES_TELE, MonsterResistanceType::RESIST_TELEPORT);
-    move_RF3_to_RFR(r_ptr, RF3_RES_NETH, MonsterResistanceType::RESIST_NETHER);
-    move_RF3_to_RFR(r_ptr, RF3_RES_WATE, MonsterResistanceType::RESIST_WATER);
-    move_RF3_to_RFR(r_ptr, RF3_RES_PLAS, MonsterResistanceType::RESIST_PLASMA);
-    move_RF3_to_RFR(r_ptr, RF3_RES_NEXU, MonsterResistanceType::RESIST_NEXUS);
-    move_RF3_to_RFR(r_ptr, RF3_RES_DISE, MonsterResistanceType::RESIST_DISENCHANT);
-    move_RF3_to_RFR(r_ptr, RF3_RES_ALL, MonsterResistanceType::RESIST_ALL);
+    move_RF3_to_RFR(r_ptr, f3, RF3_IM_ACID, MonsterResistanceType::IMMUNE_ACID);
+    move_RF3_to_RFR(r_ptr, f3, RF3_IM_ELEC, MonsterResistanceType::IMMUNE_ELEC);
+    move_RF3_to_RFR(r_ptr, f3, RF3_IM_FIRE, MonsterResistanceType::IMMUNE_FIRE);
+    move_RF3_to_RFR(r_ptr, f3, RF3_IM_COLD, MonsterResistanceType::IMMUNE_COLD);
+    move_RF3_to_RFR(r_ptr, f3, RF3_IM_POIS, MonsterResistanceType::IMMUNE_POISON);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_TELE, MonsterResistanceType::RESIST_TELEPORT);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_NETH, MonsterResistanceType::RESIST_NETHER);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_WATE, MonsterResistanceType::RESIST_WATER);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_PLAS, MonsterResistanceType::RESIST_PLASMA);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_NEXU, MonsterResistanceType::RESIST_NEXUS);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_DISE, MonsterResistanceType::RESIST_DISENCHANT);
+    move_RF3_to_RFR(r_ptr, f3, RF3_RES_ALL, MonsterResistanceType::RESIST_ALL);
 
     move_RF4_BR_to_RFR(r_ptr, f4, RF4_BR_LITE, MonsterResistanceType::RESIST_LITE);
     move_RF4_BR_to_RFR(r_ptr, f4, RF4_BR_DARK, MonsterResistanceType::RESIST_DARK);
index 29b55d4..3da59d3 100644 (file)
@@ -40,5 +40,5 @@ class ItemEntity;
 class PlayerType;
 void rd_item_old(ItemEntity *o_ptr);
 void rd_monster_old(PlayerType *player_ptr, MonsterEntity *m_ptr);
-void set_old_lore(MonsterRaceInfo *r_ptr, BIT_FLAGS f4, const MonsterRaceId r_idx);
+void set_old_lore(MonsterRaceInfo *r_ptr, BIT_FLAGS f3, BIT_FLAGS f4, const MonsterRaceId r_idx);
 errr rd_dungeon_old(PlayerType *player_ptr);
index 566b1f6..cb1b8b9 100644 (file)
@@ -7,8 +7,6 @@
 #include "load/load-zangband.h"
 #include "load/savedata-old-flag-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "object-enchant/trg-types.h"
 #include "system/angband-exceptions.h"
 #include "system/artifact-type-definition.h"
index 9725d90..993667f 100644 (file)
@@ -29,6 +29,41 @@ enum class SavedataLoreOlderThan10FlagType {
     AURA_ELEC_OLD = 0x00008000,
 };
 
+enum class SavedataLoreOlderThan11FlagType : uint32_t {
+    RF1_NEVER_BLOW = 0x00010000, /*!< モンスター特性: 打撃を一切行わない / Never make physical blow */
+    RF1_NEVER_MOVE = 0x00020000, /*!< モンスター特性: 移動を一切行わない / Never make physical move */
+    RF1_RAND_25 = 0x00040000, /*!< モンスター特性: ランダムに移動する確率+25%/ Moves randomly (25%) */
+    RF1_RAND_50 = 0x00080000, /*!< モンスター特性: ランダムに移動する確率+50%/ Moves randomly (50%) */
+    RF2_STUPID = 0x00000001, /*!< モンスター特性: 愚かな行動を取る / Monster is stupid */
+    RF2_SMART = 0x00000002, /*!< モンスター特性: 賢い行動を取る / Monster is smart */
+    RF2_OPEN_DOOR = 0x00010000, /*!< モンスター特性: ドアを開けることができる / Monster can open doors */
+    RF2_BASH_DOOR = 0x00020000, /*!< モンスター特性: ドアを破壊することができる / Monster can bash doors */
+    RF2_PASS_WALL = 0x00040000, /*!< モンスター特性: 壁を抜けることができる / Monster can pass walls */
+    RF2_KILL_WALL = 0x00080000, /*!< モンスター特性: 壁を破壊して進む / Monster can destroy walls */
+    RF2_MOVE_BODY = 0x00100000, /*!< モンスター特性: 道中の弱いモンスターを押しのけることができる / Monster can move monsters */
+    RF2_KILL_BODY = 0x00200000, /*!< モンスター特性: 道中の弱いモンスターを殺して進む / Monster can kill monsters */
+    RF2_TAKE_ITEM = 0x00400000, /*!< モンスター特性: 道中のアイテムを拾う / Monster can pick up items */
+    RF2_KILL_ITEM = 0x00800000, /*!< モンスター特性: 道中のアイテムを破壊する / Monster can crush items */
+};
+
+enum class SavedataLoreOlderThan12FlagType : uint32_t {
+    RF1_UNIQUE = 0x00000001, /*!< モンスター特性: ユニーク / Unique Monster */
+    RF1_QUESTOR = 0x00000002, /*!< モンスター特性: クエストモンスター / Quest Monster */
+    RF2_HUMAN = 0x40000000, /*!< モンスター特性: 人間 / Human */
+    RF2_QUANTUM = 0x80000000, /*!< モンスター特性: 量子的な振る舞いをする / Monster has quantum behavior */
+    RF3_ORC = 0x00000001, /*!< モンスター特性: オーク / Orc */
+    RF3_TROLL = 0x00000002, /*!< モンスター特性: トロル / Troll */
+    RF3_GIANT = 0x00000004, /*!< モンスター特性: 巨人 / Giant */
+    RF3_DRAGON = 0x00000008, /*!< モンスター特性: ドラゴン / Dragon */
+    RF3_DEMON = 0x00000010, /*!< モンスター特性: 悪魔 / Demon */
+    RF3_UNDEAD = 0x00000020, /*!< モンスター特性: アンデッド / Undead */
+    RF3_EVIL = 0x00000040, /*!< モンスター特性: 邪悪 / Evil */
+    RF3_ANIMAL = 0x00000080, /*!< モンスター特性: 動物 / Animal */
+    RF3_AMBERITE = 0x00000100, /*!< モンスター特性: アンバーの血族 / TY: Amberite */
+    RF3_GOOD = 0x00000200, /*!< モンスター特性: 善良 / Good */
+    RF3_ANGEL = 0x00010000, /*!< モンスター特性: 天使 / ANGEL */
+};
+
 enum class SavedataLoreOlderThan14FlagType {
     RFR_IM_ACID = 0x00000001, /* Immunity acid */
     RFR_IM_ELEC = 0x00000002, /* Immunity elec */
index 2a12099..4d33fa1 100644 (file)
@@ -3,7 +3,6 @@
 #include "lore/lore-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags1.h"
 #include "mspell/mspell-damage-calculator.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
@@ -159,9 +158,6 @@ void set_flags_for_full_knowledge(lore_type *lore_ptr)
         lore_ptr->drop_gold = 0;
     }
 
-    lore_ptr->flags1 = lore_ptr->r_ptr->flags1;
-    lore_ptr->flags2 = lore_ptr->r_ptr->flags2;
-    lore_ptr->flags3 = lore_ptr->r_ptr->flags3;
     lore_ptr->ability_flags = lore_ptr->r_ptr->ability_flags;
     lore_ptr->aura_flags = lore_ptr->r_ptr->aura_flags;
     lore_ptr->behavior_flags = lore_ptr->r_ptr->behavior_flags;
index d4421a6..df1008b 100644 (file)
@@ -7,7 +7,6 @@
 #include "lore/lore-store.h"
 #include "core/window-redrawer.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-info.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h" //!< @todo 違和感、m_ptr は外から与えることとしたい.
@@ -78,18 +77,6 @@ int lore_do_probe(PlayerType *player_ptr, MonsterRaceId r_idx)
     }
     r_ptr->r_cast_spell = MAX_UCHAR;
 
-    for (int i = 0; i < 32; i++) {
-        if (!(r_ptr->r_flags1 & (1UL << i)) && (r_ptr->flags1 & (1UL << i))) {
-            n++;
-        }
-        if (!(r_ptr->r_flags2 & (1UL << i)) && (r_ptr->flags2 & (1UL << i))) {
-            n++;
-        }
-        if (!(r_ptr->r_flags3 & (1UL << i)) && (r_ptr->flags3 & (1UL << i))) {
-            n++;
-        }
-    }
-
     n += count_lore_mflag_group(r_ptr->resistance_flags, r_ptr->r_resistance_flags);
     n += count_lore_mflag_group(r_ptr->ability_flags, r_ptr->r_ability_flags);
     n += count_lore_mflag_group(r_ptr->behavior_flags, r_ptr->r_behavior_flags);
@@ -98,9 +85,6 @@ int lore_do_probe(PlayerType *player_ptr, MonsterRaceId r_idx)
     n += count_lore_mflag_group(r_ptr->special_flags, r_ptr->r_special_flags);
     n += count_lore_mflag_group(r_ptr->misc_flags, r_ptr->r_misc_flags);
 
-    r_ptr->r_flags1 = r_ptr->flags1;
-    r_ptr->r_flags2 = r_ptr->flags2;
-    r_ptr->r_flags3 = r_ptr->flags3;
     r_ptr->r_resistance_flags = r_ptr->resistance_flags;
     r_ptr->r_ability_flags = r_ptr->ability_flags;
     r_ptr->r_behavior_flags = r_ptr->behavior_flags;
index 2605b56..20e47ba 100644 (file)
@@ -40,14 +40,10 @@ lore_type::lore_type(MonsterRaceId r_idx, monster_lore_mode mode)
     this->speed = this->nightmare ? this->r_ptr->speed + 5 : this->r_ptr->speed;
     this->drop_gold = this->r_ptr->r_drop_gold;
     this->drop_item = this->r_ptr->r_drop_item;
-    this->flags1 = (this->r_ptr->flags1 & this->r_ptr->r_flags1);
-    this->flags2 = (this->r_ptr->flags2 & this->r_ptr->r_flags2);
-    this->flags3 = (this->r_ptr->flags3 & this->r_ptr->r_flags3);
     this->ability_flags = (this->r_ptr->ability_flags & this->r_ptr->r_ability_flags);
     this->aura_flags = (this->r_ptr->aura_flags & this->r_ptr->r_aura_flags);
     this->behavior_flags = (this->r_ptr->behavior_flags & this->r_ptr->r_behavior_flags);
     this->drop_flags = (this->r_ptr->drop_flags & this->r_ptr->r_drop_flags);
-    this->flags7 = (this->r_ptr->flags7 & this->r_ptr->flags7);
     this->resistance_flags = (this->r_ptr->resistance_flags & this->r_ptr->r_resistance_flags);
     this->feature_flags = (this->r_ptr->feature_flags & this->r_ptr->r_feature_flags);
     this->brightness_flags = this->r_ptr->brightness_flags;
index 01a1688..a437182 100644 (file)
@@ -70,10 +70,6 @@ struct lore_type {
     byte speed;
     ITEM_NUMBER drop_gold;
     ITEM_NUMBER drop_item;
-    BIT_FLAGS flags1;
-    BIT_FLAGS flags2;
-    BIT_FLAGS flags3;
-    BIT_FLAGS flags7;
     EnumClassFlagGroup<MonsterAbilityType> ability_flags;
     EnumClassFlagGroup<MonsterAuraType> aura_flags;
     EnumClassFlagGroup<MonsterBehaviorType> behavior_flags;
index e453c5e..90ee776 100644 (file)
@@ -2,8 +2,6 @@
 #include "lore/lore-calculator.h"
 #include "lore/lore-util.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "player-base/player-class.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
index 78309f6..13e2bac 100644 (file)
@@ -10,9 +10,6 @@
 #include "lore/lore-util.h"
 #include "lore/magic-types-setter.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-misc-flags.h"
 #include "monster-race/race-sex-const.h"
index f86af54..cbbb916 100644 (file)
@@ -23,7 +23,6 @@
 #include "main/info-initializer.h"
 #include "market/building-initializer.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags7.h"
 #include "system/angband-version.h"
 #include "system/dungeon-info.h"
 #include "system/monster-race-info.h"
index da9b70f..46db83b 100644 (file)
@@ -7,7 +7,6 @@
 #include "dungeon/quest.h"
 #include "main/music-definitions-table.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
index c1b3d6a..b72958c 100644 (file)
@@ -14,8 +14,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-list.h"
 #include "monster/monster-util.h"
 #include "player-base/player-class.h"
index 58d3bb0..426d7f7 100644 (file)
@@ -14,9 +14,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-list.h"
 #include "monster/monster-util.h"
index af7c84e..dfed3e8 100644 (file)
@@ -6,7 +6,6 @@
 #include "lore/lore-store.h"
 #include "lore/lore-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/monster-race-info.h"
 #include "term/gameterm.h"
 #include "term/screen-processor.h"
index 6f02fb2..65ae728 100644 (file)
@@ -5,7 +5,6 @@
 #include "info-reader/fixed-map-parser.h"
 #include "market/building-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-list.h"
 #include "system/floor-type-definition.h"
 #include "system/grid-type-definition.h"
index 10e79c9..d28e2b8 100644 (file)
@@ -25,9 +25,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
 
 // Melee-post-process-type
 struct mam_pp_type {
-    mam_pp_type(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX who);
+    mam_pp_type(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX src_idx);
     MONSTER_IDX m_idx;
     MonsterEntity *m_ptr;
     int dam;
     bool *dead;
     bool *fear;
     std::string note;
-    MONSTER_IDX who;
+    MONSTER_IDX src_idx;
     bool seen;
     bool known; /* Can the player be aware of this attack? */
     std::string m_name;
 };
 
-mam_pp_type::mam_pp_type(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX who)
+mam_pp_type::mam_pp_type(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX src_idx)
     : m_idx(m_idx)
     , m_ptr(&player_ptr->current_floor_ptr->m_list[m_idx])
     , dam(dam)
     , dead(dead)
     , fear(fear)
     , note(note)
-    , who(who)
+    , src_idx(src_idx)
 {
     this->seen = is_seen(player_ptr, this->m_ptr);
     this->known = this->m_ptr->cdis <= MAX_PLAYER_SIGHT;
@@ -201,7 +198,7 @@ static bool check_monster_hp(PlayerType *player_ptr, mam_pp_type *mam_pp_ptr)
 
     *(mam_pp_ptr->dead) = true;
     print_monster_dead_by_monster(player_ptr, mam_pp_ptr);
-    monster_gain_exp(player_ptr, mam_pp_ptr->who, mam_pp_ptr->m_ptr->r_idx);
+    monster_gain_exp(player_ptr, mam_pp_ptr->src_idx, mam_pp_ptr->m_ptr->r_idx);
     monster_death(player_ptr, mam_pp_ptr->m_idx, false, AttributeType::NONE);
     delete_monster_idx(player_ptr, mam_pp_ptr->m_idx);
     *(mam_pp_ptr->fear) = false;
@@ -276,14 +273,14 @@ static void fall_off_horse_by_melee(PlayerType *player_ptr, mam_pp_type *mam_pp_
  * @param dead 目標となったモンスターの死亡状態を返す参照ポインタ
  * @param fear 目標となったモンスターの恐慌状態を返す参照ポインタ
  * @param note 目標モンスターが死亡した場合の特別メッセージ(nullptrならば標準表示を行う)
- * @param who 打撃を行ったモンスターの参照ID
+ * @param src_idx 打撃を行ったモンスターの参照ID
  * @todo 打撃が当たった時の後処理 (爆発持ちのモンスターを爆発させる等)なので、関数名を変更する必要あり
  */
-void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX who)
+void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX src_idx)
 {
     auto *floor_ptr = player_ptr->current_floor_ptr;
     auto *m_ptr = &floor_ptr->m_list[m_idx];
-    mam_pp_type tmp_mam_pp(player_ptr, m_idx, dam, dead, fear, note, who);
+    mam_pp_type tmp_mam_pp(player_ptr, m_idx, dam, dead, fear, note, src_idx);
     mam_pp_type *mam_pp_ptr = &tmp_mam_pp;
     prepare_redraw(player_ptr, mam_pp_ptr);
     (void)set_monster_csleep(player_ptr, m_idx, 0);
@@ -304,8 +301,8 @@ void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *
     *dead = false;
     cancel_fear_by_pain(player_ptr, mam_pp_ptr);
     make_monster_fear(player_ptr, mam_pp_ptr);
-    if ((dam > 0) && !m_ptr->is_pet() && !m_ptr->is_friendly() && (mam_pp_ptr->who != m_idx)) {
-        const auto &m_ref = floor_ptr->m_list[who];
+    if ((dam > 0) && !m_ptr->is_pet() && !m_ptr->is_friendly() && (mam_pp_ptr->src_idx != m_idx)) {
+        const auto &m_ref = floor_ptr->m_list[src_idx];
         if (m_ref.is_pet() && !player_ptr->is_located_at({ m_ptr->target_y, m_ptr->target_x })) {
             set_target(m_ptr, m_ref.fy, m_ref.fx);
         }
index b033b43..4f25bf2 100644 (file)
@@ -5,4 +5,4 @@
 #include <string_view>
 
 class PlayerType;
-void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX who);
+void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, std::string_view note, MONSTER_IDX src_idx);
index 52ad75e..aa399ab 100644 (file)
@@ -8,9 +8,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-status.h"
 #include "mspell/mspell-checker.h"
index e638350..7b6a55b 100644 (file)
@@ -21,9 +21,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
index 3a78390..a44eedd 100644 (file)
@@ -42,7 +42,7 @@ bool cast_berserk_spell(PlayerType *player_ptr, MindBerserkerType spell)
 
         y = player_ptr->y + ddy[dir];
         x = player_ptr->x + ddx[dir];
-        if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+        if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
             msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
             return false;
         }
@@ -54,7 +54,7 @@ bool cast_berserk_spell(PlayerType *player_ptr, MindBerserkerType spell)
 
         y += ddy[dir];
         x += ddx[dir];
-        if (player_can_enter(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat) && !player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+        if (player_can_enter(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat, 0) && !is_trap(player_ptr, player_ptr->current_floor_ptr->grid_array[y][x].feat) && !player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
             msg_print(nullptr);
             (void)move_player_effect(player_ptr, y, x, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
         }
index 99a87ce..dd999be 100644 (file)
@@ -7,8 +7,6 @@
 #include "mind/mind-cavalry.h"
 #include "cmd-action/cmd-pet.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
index e8388dd..88f5be0 100644 (file)
@@ -34,9 +34,8 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-flags.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
+#include "monster/monster-util.h"
 #include "player-base/player-class.h"
 #include "player-info/equipment-info.h"
 #include "player-status/player-energy.h"
@@ -1065,7 +1064,7 @@ ProcessResult effect_monster_elemental_genocide(PlayerType *player_ptr, EffectMo
         return ProcessResult::PROCESS_TRUE;
     }
 
-    if (genocide_aux(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, !em_ptr->who, (em_ptr->r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One"))) {
+    if (genocide_aux(player_ptr, em_ptr->g_ptr->m_idx, em_ptr->dam, is_player(em_ptr->src_idx), (em_ptr->r_ptr->level + 1) / 2, _("モンスター消滅", "Genocide One"))) {
         if (em_ptr->seen_msg) {
             msg_format(_("%sは消滅した!", "%s^ disappeared!"), em_ptr->m_name);
         }
index 9748830..85ccbf4 100644 (file)
@@ -14,7 +14,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-status.h"
 #include "monster/monster-update.h"
@@ -212,7 +211,7 @@ bool shock_power(PlayerType *player_ptr)
     PLAYER_LEVEL plev = player_ptr->lev;
     int dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
     fire_beam(player_ptr, AttributeType::MISSILE, dir, dam);
-    if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+    if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         return true;
     }
 
index 8a8944b..3ef33ec 100644 (file)
@@ -179,7 +179,7 @@ bool rush_attack(PlayerType *player_ptr, bool *mdeath)
             continue;
         }
 
-        if (!grid_new.m_idx) {
+        if (!grid_new.has_monster()) {
             if (tm_idx) {
                 msg_print(_("失敗!", "Failed!"));
             } else {
index 4ecc04c..0a89649 100644 (file)
@@ -15,7 +15,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index d956272..3f247ab 100644 (file)
@@ -22,7 +22,6 @@
 #include "mind/snipe-types.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags3.h"
 #include "object/tval-types.h"
 #include "player-base/player-class.h"
 #include "player-info/sniper-data-type.h"
index a8ef612..a7e54ac 100644 (file)
@@ -21,7 +21,7 @@ bool hit_and_away(PlayerType *player_ptr)
     }
     POSITION y = player_ptr->y + ddy[dir];
     POSITION x = player_ptr->x + ddx[dir];
-    if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+    if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
         if (randint0(player_ptr->skill_dis) < 7) {
             msg_print(_("うまく逃げられなかった。", "You failed to run away."));
@@ -53,7 +53,7 @@ bool sword_dancing(PlayerType *player_ptr)
         g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
 
         /* Hack -- attack monsters */
-        if (g_ptr->m_idx) {
+        if (g_ptr->has_monster()) {
             do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
         } else {
             msg_print(_("攻撃が空をきった。", "You attack the empty air."));
index 264f9b5..def04ea 100644 (file)
@@ -16,8 +16,6 @@
 #include "main/sound-of-music.h"
 #include "mind/mind-force-trainer.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
 #include "player-attack/player-attack.h"
@@ -274,7 +272,7 @@ bool double_attack(PlayerType *player_ptr)
     }
     POSITION y = player_ptr->y + ddy[dir];
     POSITION x = player_ptr->x + ddx[dir];
-    if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+    if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
         msg_print(nullptr);
         return true;
@@ -289,7 +287,7 @@ bool double_attack(PlayerType *player_ptr)
     }
 
     do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
-    if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+    if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         handle_stuff(player_ptr);
         do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
     }
index c72ec67..38b8a4a 100644 (file)
@@ -25,8 +25,6 @@
 #include "monster-attack/monster-attack-switcher.h"
 #include "monster-attack/monster-attack-table.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-damage.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index d5ddf1b..8a3ee14 100644 (file)
@@ -10,8 +10,6 @@
 #include "melee/monster-attack-monster.h"
 #include "monster-attack/monster-attack-player.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-info.h"
 #include "monster/monster-processor-util.h"
 #include "monster/monster-status-setter.h"
@@ -124,7 +122,7 @@ static bool exe_monster_attack_to_monster(PlayerType *player_ptr, MONSTER_IDX m_
  */
 bool process_monster_attack_to_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, MONSTER_IDX m_idx, Grid *g_ptr, bool can_cross)
 {
-    if (!turn_flags_ptr->do_move || (g_ptr->m_idx == 0)) {
+    if (!turn_flags_ptr->do_move || !g_ptr->has_monster()) {
         return false;
     }
 
index cd13cd1..ae754cc 100644 (file)
@@ -1,6 +1,5 @@
 #include "monster-floor/monster-death-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/smart-learn-types.h"
index f8291a0..326a7e9 100644 (file)
@@ -19,9 +19,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index 3d3b01c..e64628b 100644 (file)
@@ -8,8 +8,6 @@
 #include "floor/cave.h"
 #include "monster-floor/monster-sweep-grid.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-info.h"
 #include "monster/monster-processor-util.h"
 #include "monster/monster-status.h"
index be99b53..4280562 100644 (file)
@@ -16,9 +16,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
@@ -168,14 +165,14 @@ bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT
 
 /*!
  * @brief モンスターを目標地点に集団生成する / Attempt to place a "group" of monsters around the given location
- * @param who 召喚主のモンスター情報ID
+ * @param src_idx 召喚主のモンスター情報ID
  * @param y 中心生成位置y座標
  * @param x 中心生成位置x座標
  * @param r_idx 生成モンスター種族
  * @param mode 生成オプション
  * @return 成功したらtrue
  */
-static bool place_monster_group(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
+static bool place_monster_group(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
 {
     auto *r_ptr = &monraces_info[r_idx];
     auto total = randint1(10);
@@ -221,7 +218,7 @@ static bool place_monster_group(PlayerType *player_ptr, MONSTER_IDX who, POSITIO
                 continue;
             }
 
-            if (place_monster_one(player_ptr, who, my, mx, r_idx, mode)) {
+            if (place_monster_one(player_ptr, src_idx, my, mx, r_idx, mode)) {
                 hack_y[hack_n] = my;
                 hack_x[hack_n] = mx;
                 hack_n++;
@@ -283,7 +280,7 @@ static bool place_monster_can_escort(PlayerType *player_ptr, MonsterRaceId r_idx
 /*!
  * @brief 特定モンスターを生成する
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスター情報ID
+ * @param src_idx 召喚主のモンスター情報ID
  * @param y 生成地点y座標
  * @param x 生成地点x座標
  * @param r_idx 生成するモンスターの種族ID
@@ -291,7 +288,7 @@ static bool place_monster_can_escort(PlayerType *player_ptr, MonsterRaceId r_idx
  * @return 生成に成功したらtrue
  * @details 護衛も一緒に生成する
  */
-bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
+bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
 {
     auto *r_ptr = &monraces_info[r_idx];
 
@@ -299,7 +296,7 @@ bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y,
         mode |= PM_KAGE;
     }
 
-    if (!place_monster_one(player_ptr, who, y, x, r_idx, mode)) {
+    if (!place_monster_one(player_ptr, src_idx, y, x, r_idx, mode)) {
         return false;
     }
     if (!(mode & PM_ALLOW_GROUP)) {
@@ -331,7 +328,7 @@ bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y,
     }
 
     if (r_ptr->misc_flags.has(MonsterMiscType::HAS_FRIENDS)) {
-        (void)place_monster_group(player_ptr, who, y, x, r_idx, mode);
+        (void)place_monster_group(player_ptr, src_idx, y, x, r_idx, mode);
     }
 
     if (r_ptr->misc_flags.has_not(MonsterMiscType::ESCORT)) {
index ed06deb..240adce 100644 (file)
@@ -9,7 +9,7 @@ typedef bool (*summon_specific_pf)(PlayerType *, MONSTER_IDX, POSITION, POSITION
 
 bool mon_scatter(PlayerType *player_ptr, MonsterRaceId r_idx, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION max_dist);
 bool multiply_monster(PlayerType *player_ptr, MONSTER_IDX m_idx, bool clone, BIT_FLAGS mode);
-bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
+bool place_specific_monster(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
 bool place_random_monster(PlayerType *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
 bool alloc_horde(PlayerType *player_ptr, POSITION y, POSITION x, summon_specific_pf summon_specific);
 bool alloc_guardian(PlayerType *player_ptr, bool def_val);
index e5b40c7..61f991a 100644 (file)
@@ -6,7 +6,6 @@
 #include "monster-floor/monster-lite-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-flags.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-status.h"
 #include "player-base/player-class.h"
 #include "player-info/ninja-data-type.h"
index 3260a11..c486fed 100644 (file)
 #include "monster-attack/monster-attack-processor.h"
 #include "monster-floor/monster-object.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-flag-types.h"
@@ -70,7 +66,7 @@ static bool process_wall(PlayerType *player_ptr, turn_flags *turn_flags_ptr, con
         return true;
     }
 
-    if (grid.m_idx > 0) {
+    if (grid.has_monster()) {
         turn_flags_ptr->do_move = true;
         return true;
     }
index c3f5d7e..43f7362 100644 (file)
@@ -11,8 +11,6 @@
 #include "floor/geometry.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index c311853..33e29f4 100644 (file)
@@ -5,8 +5,6 @@
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
@@ -160,7 +158,7 @@ void delete_monster(PlayerType *player_ptr, POSITION y, POSITION x)
     }
 
     g_ptr = &floor_ptr->grid_array[y][x];
-    if (g_ptr->m_idx) {
+    if (g_ptr->has_monster()) {
         delete_monster_idx(player_ptr, g_ptr->m_idx);
     }
 }
index 35332cd..a7dd3d4 100644 (file)
@@ -10,9 +10,6 @@
 #include "grid/grid.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index ec17bf2..c33bd1c 100644 (file)
@@ -8,8 +8,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-list.h"
@@ -119,7 +117,7 @@ DEPTH get_dungeon_or_wilderness_level(PlayerType *player_ptr)
 /*!
  * @brief モンスターを召喚により配置する / Place a monster (of the specified "type") near the given location. Return TRUE if a monster was actually summoned.
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスター情報ID
+ * @param src_idx 召喚主のモンスター情報ID
  * @param y1 目標地点y座標
  * @param x1 目標地点x座標
  * @param lev 相当生成階
@@ -127,7 +125,7 @@ DEPTH get_dungeon_or_wilderness_level(PlayerType *player_ptr)
  * @param mode 生成オプション
  * @return 召喚できたらtrueを返す
  */
-bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode)
+bool summon_specific(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode)
 {
     auto *floor_ptr = player_ptr->current_floor_ptr;
     if (floor_ptr->inside_arena) {
@@ -139,7 +137,7 @@ bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSIT
         return false;
     }
 
-    summon_specific_who = who;
+    summon_specific_who = src_idx;
     summon_specific_type = type;
     summon_unique_okay = (mode & PM_ALLOW_UNIQUE) != 0;
     get_mon_num_prep(player_ptr, summon_specific_okay, get_monster_hook2(player_ptr, y, x));
@@ -155,7 +153,7 @@ bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSIT
         mode |= PM_NO_KAGE;
     }
 
-    if (!place_specific_monster(player_ptr, who, y, x, r_idx, mode)) {
+    if (!place_specific_monster(player_ptr, src_idx, y, x, r_idx, mode)) {
         summon_specific_type = SUMMON_NONE;
         return false;
     }
@@ -163,10 +161,10 @@ bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSIT
     summon_specific_type = SUMMON_NONE;
 
     bool notice = false;
-    if (who <= 0) {
+    if (!is_monster(src_idx)) {
         notice = true;
     } else {
-        auto *m_ptr = &player_ptr->current_floor_ptr->m_list[who];
+        auto *m_ptr = &player_ptr->current_floor_ptr->m_list[src_idx];
         if (m_ptr->is_pet()) {
             notice = true;
         } else if (is_seen(player_ptr, m_ptr)) {
@@ -186,14 +184,14 @@ bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSIT
 /*!
  * @brief 特定モンスター種族を召喚により生成する / A "dangerous" function, creates a pet of the specified type
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスター情報ID
+ * @param src_idx 召喚主のモンスター情報ID
  * @param oy 目標地点y座標
  * @param ox 目標地点x座標
  * @param r_idx 生成するモンスター種族ID
  * @param mode 生成オプション
  * @return 召喚できたらtrueを返す
  */
-bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MonsterRaceId r_idx, BIT_FLAGS mode)
+bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION oy, POSITION ox, MonsterRaceId r_idx, BIT_FLAGS mode)
 {
     if (!MonsterRace(r_idx).is_valid() || (r_idx >= static_cast<MonsterRaceId>(monraces_info.size()))) {
         return false;
@@ -204,5 +202,5 @@ bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX who, POSITION oy,
         return false;
     }
 
-    return place_specific_monster(player_ptr, who, y, x, r_idx, (mode | PM_NO_KAGE));
+    return place_specific_monster(player_ptr, src_idx, y, x, r_idx, (mode | PM_NO_KAGE));
 }
index 8577ef9..9039dcb 100644 (file)
@@ -8,5 +8,5 @@ extern bool summon_unique_okay;
 enum summon_type : int;
 enum class MonsterRaceId : int16_t;
 class PlayerType;
-bool summon_specific(PlayerType *player_ptr, MONSTER_IDX who, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode);
-bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX who, POSITION oy, POSITION ox, MonsterRaceId r_idx, BIT_FLAGS mode);
+bool summon_specific(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y1, POSITION x1, DEPTH lev, summon_type type, BIT_FLAGS mode);
+bool summon_named_creature(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION oy, POSITION ox, MonsterRaceId r_idx, BIT_FLAGS mode);
index 5d136e3..12665eb 100644 (file)
@@ -13,9 +13,6 @@
 #include "monster-floor/monster-safety-hiding.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-processor-util.h"
index 7696fb9..dffaffa 100644 (file)
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-misc-flags.h"
 #include "monster/monster-flag-types.h"
@@ -173,7 +169,7 @@ static bool check_quest_placeable(const FloorType &floor, MonsterRaceId r_idx)
     int number_mon = 0;
     for (int i2 = 0; i2 < floor.width; ++i2) {
         for (int j2 = 0; j2 < floor.height; j2++) {
-            auto quest_monster = (floor.grid_array[j2][i2].m_idx > 0);
+            auto quest_monster = floor.grid_array[j2][i2].has_monster();
             quest_monster &= (floor.m_list[floor.grid_array[j2][i2].m_idx].r_idx == q_ptr->r_idx);
             if (quest_monster) {
                 number_mon++;
@@ -256,14 +252,14 @@ static void warn_unique_generation(PlayerType *player_ptr, MonsterRaceId r_idx)
 /*!
  * @brief モンスターを一体生成する / Attempt to place a monster of the given race at the given location.
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚を行ったモンスターID
+ * @param src_idx 召喚を行ったモンスターID
  * @param y 生成位置y座標
  * @param x 生成位置x座標
  * @param r_idx 生成モンスター種族
  * @param mode 生成オプション
  * @return 成功したらtrue
  */
-bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
+bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode)
 {
     auto &floor = *player_ptr->current_floor_ptr;
     auto *g_ptr = &floor.grid_array[y][x];
@@ -289,7 +285,7 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
 
     g_ptr->m_idx = m_pop(&floor);
     hack_m_idx_ii = g_ptr->m_idx;
-    if (!g_ptr->m_idx) {
+    if (!g_ptr->has_monster()) {
         return false;
     }
 
@@ -300,15 +296,15 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
 
     m_ptr->mflag.clear();
     m_ptr->mflag2.clear();
-    if (any_bits(mode, PM_MULTIPLY) && (who > 0) && !floor.m_list[who].is_original_ap()) {
-        m_ptr->ap_r_idx = floor.m_list[who].ap_r_idx;
-        if (floor.m_list[who].mflag2.has(MonsterConstantFlagType::KAGE)) {
+    if (any_bits(mode, PM_MULTIPLY) && is_monster(src_idx) && !floor.m_list[src_idx].is_original_ap()) {
+        m_ptr->ap_r_idx = floor.m_list[src_idx].ap_r_idx;
+        if (floor.m_list[src_idx].mflag2.has(MonsterConstantFlagType::KAGE)) {
             m_ptr->mflag2.set(MonsterConstantFlagType::KAGE);
         }
     }
 
-    if ((who > 0) && r_ptr->kind_flags.has_none_of(alignment_mask)) {
-        m_ptr->sub_align = floor.m_list[who].sub_align;
+    if (is_monster(src_idx) && r_ptr->kind_flags.has_none_of(alignment_mask)) {
+        m_ptr->sub_align = floor.m_list[src_idx].sub_align;
     } else {
         m_ptr->sub_align = SUB_ALIGN_NEUTRAL;
         if (r_ptr->kind_flags.has(MonsterKindType::EVIL)) {
@@ -332,9 +328,9 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
     m_ptr->nickname.clear();
     m_ptr->exp = 0;
 
-    if (who > 0 && floor.m_list[who].is_pet()) {
+    if (is_monster(src_idx) && floor.m_list[src_idx].is_pet()) {
         set_bits(mode, PM_FORCE_PET);
-        m_ptr->parent_m_idx = who;
+        m_ptr->parent_m_idx = src_idx;
     } else {
         m_ptr->parent_m_idx = 0;
     }
@@ -343,7 +339,7 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
         choose_new_monster(player_ptr, g_ptr->m_idx, true, MonsterRace::empty_id());
         r_ptr = &m_ptr->get_monrace();
         m_ptr->mflag2.set(MonsterConstantFlagType::CHAMELEON);
-        if (r_ptr->kind_flags.has(MonsterKindType::UNIQUE) && (who <= 0)) {
+        if (r_ptr->kind_flags.has(MonsterKindType::UNIQUE) && (!is_monster(src_idx))) {
             m_ptr->sub_align = SUB_ALIGN_NEUTRAL;
         }
     } else if (any_bits(mode, PM_KAGE) && none_bits(mode, PM_FORCE_PET)) {
@@ -362,7 +358,7 @@ bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSI
     m_ptr->ml = false;
     if (any_bits(mode, PM_FORCE_PET)) {
         set_pet(player_ptr, m_ptr);
-    } else if (((who == 0) && r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY)) || is_friendly_idx(player_ptr, who) || any_bits(mode, PM_FORCE_FRIENDLY)) {
+    } else if ((is_player(src_idx) && r_ptr->behavior_flags.has(MonsterBehaviorType::FRIENDLY)) || is_friendly_idx(player_ptr, src_idx) || any_bits(mode, PM_FORCE_FRIENDLY)) {
         if (!monster_has_hostile_align(player_ptr, nullptr, 0, -1, r_ptr) && !player_ptr->current_floor_ptr->inside_arena) {
             set_friendly(m_ptr);
         }
index 2293dcc..b7f68d7 100644 (file)
@@ -4,4 +4,4 @@
 
 enum class MonsterRaceId : int16_t;
 class PlayerType;
-bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
+bool place_monster_one(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, MonsterRaceId r_idx, BIT_FLAGS mode);
index 2894eef..394f647 100644 (file)
@@ -4,8 +4,6 @@
 #include "monster-floor/monster-death.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index d904bd4..6c90f9d 100644 (file)
@@ -6,11 +6,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-misc-flags.h"
 #include "monster/monster-list.h"
index a32a154..fadd072 100644 (file)
@@ -1,6 +1,5 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "system/monster-race-info.h"
diff --git a/src/monster-race/race-flags1.h b/src/monster-race/race-flags1.h
deleted file mode 100644 (file)
index fb8ae0d..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-enum race_flags1 {
-    RF1_UNIQUE = 0x00000001, /*!< モンスター特性: ユニーク / Unique Monster */
-    RF1_QUESTOR = 0x00000002, /*!< モンスター特性: クエストモンスター / Quest Monster */
-    RF1_MALE = 0x00000004, /*!< モンスター特性: 男性 / Male gender */
-    RF1_FEMALE = 0x00000008, /*!< モンスター特性: 女性 / Female gender */
-    RF1_CHAR_CLEAR = 0x00000010, /*!< モンスター特性: シンボルが完全に透明 / Absorbs symbol */
-    RF1_SHAPECHANGER = 0x00000020, /*!< モンスター特性: シンボルアルファベットがランダムになる / TY: shapechanger */
-    RF1_ATTR_CLEAR = 0x00000040, /*!< モンスター特性: シンボルカラーが透明色になる(地形と同じ色になる) / Absorbs color */
-    RF1_ATTR_MULTI = 0x00000080, /*!< モンスター特性: シンボルカラーがランダムに変化する(基本7色) / Changes color */
-    RF1_FORCE_DEPTH = 0x00000100, /*!< モンスター特性: 指定階未満では生成されない / Start at "correct" depth */
-    RF1_FORCE_MAXHP = 0x00000200, /*!< モンスター特性: 通常生成時必ずHPがダイス最大値になる / Start with max hitpoints */
-    RF1_PREVENT_SUDDEN_MAGIC = 0x00000400, /*!< モンスター特性: 生成直後に魔法を使用しない / Start with no-magic */
-    RF1_FORCE_EXTRA = 0x00000800, /*!< モンスター特性: (未使用) / Start out something */
-    RF1_ATTR_SEMIRAND = 0x00001000, /*!< モンスター特性: シンボルカラーがランダムに変化する(15色) / Color is determined semi-randomly */
-    RF1_FRIENDS = 0x00002000, /*!< モンスター特性: 同種の友軍を用意している / Arrive with some friends */
-    RF1_ESCORT = 0x00004000, /*!< モンスター特性: 護衛を用意している/ Arrive with an escort */
-    RF1_ESCORTS = 0x00008000, /*!< モンスター特性: さらに大量の護衛を用意している / Arrive with some escorts */
-    RF1_NEVER_BLOW = 0x00010000, /*!< モンスター特性: 打撃を一切行わない / Never make physical blow */
-    RF1_NEVER_MOVE = 0x00020000, /*!< モンスター特性: 移動を一切行わない / Never make physical move */
-    RF1_RAND_25 = 0x00040000, /*!< モンスター特性: ランダムに移動する確率+25%/ Moves randomly (25%) */
-    RF1_RAND_50 = 0x00080000, /*!< モンスター特性: ランダムに移動する確率+50%/ Moves randomly (50%) */
-    RF1_ONLY_GOLD = 0x00100000, /*!< モンスター特性: 財宝しか落とさない / Drop only gold */
-    RF1_ONLY_ITEM = 0x00200000, /*!< モンスター特性: アイテムしか落とさない / Drop only items */
-    RF1_DROP_60 = 0x00400000, /*!< モンスター特性: 落とすアイテム数60%で+1/ Drop an item/gold (60%) */
-    RF1_DROP_90 = 0x00800000, /*!< モンスター特性: 落とすアイテム数90%で+1 / Drop an item/gold (90%) */
-    RF1_DROP_1D2 = 0x01000000, /*!< モンスター特性: 落とすアイテム数+1d2 / Drop 1d2 items/gold */
-    RF1_DROP_2D2 = 0x02000000, /*!< モンスター特性: 落とすアイテム数+2d2 / Drop 2d2 items/gold */
-    RF1_DROP_3D2 = 0x04000000, /*!< モンスター特性: 落とすアイテム数+3d2 / Drop 3d2 items/gold */
-    RF1_DROP_4D2 = 0x08000000, /*!< モンスター特性: 落とすアイテム数+4d2 / Drop 4d2 items/gold */
-    RF1_DROP_GOOD = 0x10000000, /*!< モンスター特性: 必ず上質品をドロップする / Drop good items */
-    RF1_DROP_GREAT = 0x20000000, /*!< モンスター特性: 必ず高級品をドロップする / Drop great items */
-    RF1_XXX2 = 0x40000000, /*!< モンスター特性: 未使用 / XXX */
-    RF1_XXX3 = 0x80000000, /*!< モンスター特性: 未使用 / XXX */
-};
diff --git a/src/monster-race/race-flags2.h b/src/monster-race/race-flags2.h
deleted file mode 100644 (file)
index 08d0ac7..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-enum race_flags2 {
-    RF2_STUPID = 0x00000001, /*!< モンスター特性: 愚かな行動を取る / Monster is stupid */
-    RF2_SMART = 0x00000002, /*!< モンスター特性: 賢い行動を取る / Monster is smart */
-    RF2_CAN_SPEAK = 0x00000004, /*!< モンスター特性: 台詞をしゃべる / TY: can speak */
-    RF2_REFLECTING = 0x00000008, /*!< モンスター特性: 矢やボルト魔法を反射する / Reflects bolts */
-    RF2_INVISIBLE = 0x00000010, /*!< モンスター特性: 透明視力がないと見えない / Monster avoids vision */
-    RF2_COLD_BLOOD = 0x00000020, /*!< モンスター特性: 冷血動物である / Monster avoids infra */
-    RF2_EMPTY_MIND = 0x00000040, /*!< モンスター特性: 知性を持たない(テレパシー回避) / Monster avoids telepathy */
-    RF2_WEIRD_MIND = 0x00000080, /*!< モンスター特性: 異質な知性(テレパシーで感知づらい) / Monster avoids telepathy? */
-    RF2_MULTIPLY = 0x00000100, /*!< モンスター特性: 増殖する / Monster reproduces */
-    RF2_REGENERATE = 0x00000200, /*!< モンスター特性: 急激に回復する / Monster regenerates */
-    RF2_CHAR_MULTI = 0x00000400, /*!< モンスター特性: 未使用 / (Not implemented) */
-    RF2_ATTR_ANY = 0x00000800, /*!< モンスター特性: ATTR_MULTIの色数が増える / TY: Attr_any */
-    RF2_POWERFUL = 0x00001000, /*!< モンスター特性: 強力に魔法をあやつる / Monster has strong breath */
-    RF2_ELDRITCH_HORROR = 0x00002000, /*!< モンスター特性: 狂気を呼び起こす / Sanity-blasting horror    */
-    RF2_XX14 = 0x00004000, /*!< 予約領域。元火炎オーラ */
-    RF2_XX15 = 0x00008000, /*!< 予約領域。元電撃オーラ */
-    RF2_OPEN_DOOR = 0x00010000, /*!< モンスター特性: ドアを開けることができる / Monster can open doors */
-    RF2_BASH_DOOR = 0x00020000, /*!< モンスター特性: ドアを破壊することができる / Monster can bash doors */
-    RF2_PASS_WALL = 0x00040000, /*!< モンスター特性: 壁を抜けることができる / Monster can pass walls */
-    RF2_KILL_WALL = 0x00080000, /*!< モンスター特性: 壁を破壊して進む / Monster can destroy walls */
-    RF2_MOVE_BODY = 0x00100000, /*!< モンスター特性: 道中の弱いモンスターを押しのけることができる / Monster can move monsters */
-    RF2_KILL_BODY = 0x00200000, /*!< モンスター特性: 道中の弱いモンスターを殺して進む / Monster can kill monsters */
-    RF2_TAKE_ITEM = 0x00400000, /*!< モンスター特性: 道中のアイテムを拾う / Monster can pick up items */
-    RF2_KILL_ITEM = 0x00800000, /*!< モンスター特性: 道中のアイテムを破壊する / Monster can crush items */
-    RF2_XXX1 = 0x01000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_XXX2 = 0x02000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_XXX3 = 0x04000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_XXX4 = 0x08000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_XXX5 = 0x10000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_XXX6 = 0x20000000, /*!< モンスター特性: 未使用 / XXX */
-    RF2_HUMAN = 0x40000000, /*!< モンスター特性: 人間 / Human */
-    RF2_QUANTUM = 0x80000000, /*!< モンスター特性: 量子的な振る舞いをする / Monster has quantum behavior */
-};
diff --git a/src/monster-race/race-flags3.h b/src/monster-race/race-flags3.h
deleted file mode 100644 (file)
index bb46891..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-#pragma once
-
-enum race_flags3 {
-    RF3_ORC = 0x00000001, /*!< モンスター特性: オーク / Orc */
-    RF3_TROLL = 0x00000002, /*!< モンスター特性: トロル / Troll */
-    RF3_GIANT = 0x00000004, /*!< モンスター特性: 巨人 / Giant */
-    RF3_DRAGON = 0x00000008, /*!< モンスター特性: ドラゴン / Dragon */
-    RF3_DEMON = 0x00000010, /*!< モンスター特性: 悪魔 / Demon */
-    RF3_UNDEAD = 0x00000020, /*!< モンスター特性: アンデッド / Undead */
-    RF3_EVIL = 0x00000040, /*!< モンスター特性: 邪悪 / Evil */
-    RF3_ANIMAL = 0x00000080, /*!< モンスター特性: 動物 / Animal */
-    RF3_AMBERITE = 0x00000100, /*!< モンスター特性: アンバーの血族 / TY: Amberite */
-    RF3_GOOD = 0x00000200, /*!< モンスター特性: 善良 / Good */
-    RF3_XX10 = 0x00000400, /*!< 予約領域。元冷気オーラ */
-    RF3_NONLIVING = 0x00000800, /*!< モンスター特性: 無生物 / TY: Non-Living (?) */
-    RF3_HURT_LITE = 0x00001000, /*!< モンスター特性: 通常の光(GF_WEAK_LITE)でダメージを受ける / Hurt by lite */
-    RF3_HURT_ROCK = 0x00002000, /*!< モンスター特性: 岩石溶解(KILL_WALL)でダメージを受ける / Hurt by rock remover */
-    RF3_HURT_FIRE = 0x00004000, /*!< モンスター特性: 火炎が弱点 / Hurt badly by fire */
-    RF3_HURT_COLD = 0x00008000, /*!< モンスター特性: 冷気が弱点 / Hurt badly by cold */
-    RF3_ANGEL = 0x00010000, /*!< モンスター特性: 天使 / ANGEL */
-    RF3_XXX17 = 0x00020000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX18 = 0x00040000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX19 = 0x00080000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX20 = 0x00100000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX21 = 0x00200000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX22 = 0x00400000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX23 = 0x00800000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX24 = 0x01000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX25 = 0x02000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX26 = 0x04000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX27 = 0x08000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX28 = 0x10000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX29 = 0x20000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX30 = 0x40000000, /*!< モンスター特性: 未使用 / XXX */
-    RF3_XXX31 = 0x80000000, /*!< モンスター特性: 未使用 / XXX */
-};
diff --git a/src/monster-race/race-flags7.h b/src/monster-race/race-flags7.h
deleted file mode 100644 (file)
index 795af3b..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-#pragma once
-
-enum race_flags7 {
-    RF7_AQUATIC = 0x00000001, /* Aquatic monster */
-    RF7_CAN_SWIM = 0x00000002, /* Monster can swim */
-    RF7_CAN_FLY = 0x00000004, /* Monster can fly */
-    RF7_FRIENDLY = 0x00000008, /* Monster is friendly */
-    RF7_NAZGUL = 0x00000010, /* Is a "Nazgul" unique */
-    RF7_UNIQUE2 = 0x00000020, /* Fake unique */
-    RF7_RIDING = 0x00000040, /* Good for riding */
-    RF7_KAGE = 0x00000080, /* Is kage */
-    RF7_HAS_LITE_1 = 0x00000100, /* Monster carries light */
-    RF7_SELF_LITE_1 = 0x00000200, /* Monster lights itself */
-    RF7_HAS_LITE_2 = 0x00000400, /* Monster carries light */
-    RF7_SELF_LITE_2 = 0x00000800, /* Monster lights itself */
-    RF7_GUARDIAN = 0x00001000, /* Guardian of a dungeon */
-    RF7_CHAMELEON = 0x00002000, /* Chameleon can change */
-    RF7_XXXX4XXX = 0x00004000, /* Now Empty */
-    RF7_TANUKI = 0x00008000, /* Tanuki disguise */
-    RF7_HAS_DARK_1 = 0x00010000, /* Monster carries darkness */
-    RF7_SELF_DARK_1 = 0x00020000, /* Monster darkens itself */
-    RF7_HAS_DARK_2 = 0x00040000, /* Monster carries darkness */
-    RF7_SELF_DARK_2 = 0x00080000, /* Monster darkens itself */
-};
-
-#define RF7_LITE_MASK (RF7_HAS_LITE_1 | RF7_SELF_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_2)
-#define RF7_DARK_MASK (RF7_HAS_DARK_1 | RF7_SELF_DARK_1 | RF7_HAS_DARK_2 | RF7_SELF_DARK_2)
-#define RF7_HAS_LD_MASK (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_HAS_DARK_1 | RF7_HAS_DARK_2)
-#define RF7_SELF_LD_MASK (RF7_SELF_LITE_1 | RF7_SELF_LITE_2 | RF7_SELF_DARK_1 | RF7_SELF_DARK_2)
diff --git a/src/monster-race/race-flags8.h b/src/monster-race/race-flags8.h
deleted file mode 100644 (file)
index 6cf37f1..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-#pragma once
-
-enum race_flags8 : uint32_t {
-    RF8_WILD_ONLY = 0x00000001,
-    RF8_WILD_TOWN = 0x00000002,
-    RF8_NO_QUEST = 0x00000004,
-    RF8_WILD_SHORE = 0x00000008,
-    RF8_WILD_OCEAN = 0x00000010,
-    RF8_WILD_WASTE = 0x00000020,
-    RF8_WILD_WOOD = 0x00000040,
-    RF8_WILD_VOLCANO = 0x00000080,
-    RF8_XXX8X08 = 0x00000100,
-    RF8_WILD_MOUNTAIN = 0x00000200,
-    RF8_WILD_GRASS = 0x00000400,
-    RF8_WILD_SWAMP = 0x00000800, //!< 沼地に生息(未使用)
-    RF8_WILD_ALL = 0x80000000,
-};
index 7a53dd2..9a30a9c 100644 (file)
@@ -4,7 +4,6 @@
 #include "io/write-diary.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index a6f4ad2..b181a85 100644 (file)
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index 0ecfbe0..0c56e59 100644 (file)
@@ -2,7 +2,6 @@
 #include "io/files-util.h"
 #include "locale/english.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-sex-const.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
index e882f7d..17b69a2 100644 (file)
 #include "floor/wild.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-describer.h"
@@ -152,7 +147,7 @@ bool monster_can_enter(PlayerType *player_ptr, POSITION y, POSITION x, MonsterRa
     if (player_ptr->is_located_at(pos)) {
         return false;
     }
-    if (grid.m_idx) {
+    if (grid.has_monster()) {
         return false;
     }
 
index 7f1563b..052a4da 100644 (file)
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
@@ -453,7 +449,7 @@ int get_monster_crowd_number(FloorType *floor_ptr, MONSTER_IDX m_idx)
         if (!in_bounds(floor_ptr, ay, ax)) {
             continue;
         }
-        if (floor_ptr->grid_array[ay][ax].m_idx > 0) {
+        if (floor_ptr->grid_array[ay][ax].has_monster()) {
             count++;
         }
     }
index 47cbdc5..3aacda9 100644 (file)
@@ -266,9 +266,6 @@ old_race_flags::old_race_flags(MonsterRaceId monrace_id)
 
     const auto &monrace = monraces_info[monrace_id];
 
-    this->old_r_flags1 = monrace.r_flags1;
-    this->old_r_flags2 = monrace.r_flags2;
-    this->old_r_flags3 = monrace.r_flags3;
     this->old_r_ability_flags = monrace.r_ability_flags;
     this->old_r_behavior_flags = monrace.r_behavior_flags;
     this->old_r_kind_flags = monrace.r_kind_flags;
index 8ef8c0e..b31d41a 100644 (file)
@@ -41,10 +41,6 @@ struct turn_flags {
 struct old_race_flags {
     old_race_flags(MonsterRaceId monrace_id);
 
-    BIT_FLAGS old_r_flags1 = 0;
-    BIT_FLAGS old_r_flags2 = 0;
-    BIT_FLAGS old_r_flags3 = 0;
-    BIT_FLAGS old_r_flagsr = 0;
     EnumClassFlagGroup<MonsterAbilityType> old_r_ability_flags{};
     EnumClassFlagGroup<MonsterBehaviorType> old_r_behavior_flags{};
     EnumClassFlagGroup<MonsterKindType> old_r_kind_flags{};
index 8da9e15..4af97be 100644 (file)
@@ -33,9 +33,6 @@
 #include "monster-floor/quantum-effect.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
@@ -455,7 +452,7 @@ bool decide_monster_multiplication(PlayerType *player_ptr, MONSTER_IDX m_idx, PO
                 continue;
             }
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 k++;
             }
         }
index d698ac5..a39fe64 100644 (file)
@@ -9,8 +9,6 @@
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-processor.h"
@@ -362,12 +360,12 @@ bool set_monster_invulner(PlayerType *player_ptr, MONSTER_IDX m_idx, int v, bool
  * @brief モンスターの時間停止処理
  * @param player_ptr プレイヤーへの参照ポインタ
  * @param num 時間停止を行った敵が行動できる回数
- * @param who 時間停止を行う敵の種族番号
+ * @param src_idx 時間停止を行う敵の種族番号
  * @param vs_player TRUEならば時間停止開始処理を行う
  * @return 時間停止が行われている状態ならばTRUEを返す
  * @details monster_desc() は視認外のモンスターについて「何か」と返してくるので、この関数ではLOSや透明視等を判定する必要はない
  */
-bool set_monster_timewalk(PlayerType *player_ptr, int num, MonsterRaceId who, bool vs_player)
+bool set_monster_timewalk(PlayerType *player_ptr, int num, MonsterRaceId src_idx, bool vs_player)
 {
     auto &floor = *player_ptr->current_floor_ptr;
     auto *m_ptr = &floor.m_list[hack_m_idx];
@@ -378,7 +376,7 @@ bool set_monster_timewalk(PlayerType *player_ptr, int num, MonsterRaceId who, bo
     if (vs_player) {
         const auto m_name = monster_desc(player_ptr, m_ptr, 0);
         std::string mes;
-        switch (who) {
+        switch (src_idx) {
         case MonsterRaceId::DIO:
             mes = _("「『ザ・ワールド』! 時は止まった!」", format("%s yells 'The World! Time has stopped!'", m_name.data()));
             break;
@@ -428,7 +426,7 @@ bool set_monster_timewalk(PlayerType *player_ptr, int num, MonsterRaceId who, bo
     should_output_message &= projectable(player_ptr, player_ptr->y, player_ptr->x, m_ptr->fy, m_ptr->fx);
     if (vs_player || should_output_message) {
         std::string mes;
-        switch (who) {
+        switch (src_idx) {
         case MonsterRaceId::DIAVOLO:
             mes = _("これが我が『キング・クリムゾン』の能力! 『時間を消し去って』飛び越えさせた…!!",
                 "This is the ability of my 'King Crimson'! 'Erase the time' and let it jump over... !!");
index a283621..d28f353 100644 (file)
@@ -8,9 +8,6 @@
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-special-flags.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index bea13c2..0831bbc 100644 (file)
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-flags.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
@@ -81,7 +77,7 @@ bool update_riding_monster(PlayerType *player_ptr, turn_flags *turn_flags_ptr, M
     }
 
     player_ptr->current_floor_ptr->grid_array[oy][ox].m_idx = g_ptr->m_idx;
-    if (g_ptr->m_idx) {
+    if (g_ptr->has_monster()) {
         y_ptr->fy = oy;
         y_ptr->fx = ox;
         update_monster(player_ptr, g_ptr->m_idx, true);
@@ -183,8 +179,7 @@ void update_player_window(PlayerType *player_ptr, old_race_flags *old_race_flags
 {
     MonsterRaceInfo *r_ptr;
     r_ptr = &monraces_info[player_ptr->monster_race_idx];
-    if ((old_race_flags_ptr->old_r_flags1 != r_ptr->r_flags1) || (old_race_flags_ptr->old_r_flags2 != r_ptr->r_flags2) ||
-        (old_race_flags_ptr->old_r_flags3 != r_ptr->r_flags3) || (old_race_flags_ptr->old_r_ability_flags != r_ptr->r_ability_flags) ||
+    if ((old_race_flags_ptr->old_r_ability_flags != r_ptr->r_ability_flags) ||
         (old_race_flags_ptr->old_r_resistance_flags != r_ptr->r_resistance_flags) || (old_race_flags_ptr->old_r_blows0 != r_ptr->r_blows[0]) ||
         (old_race_flags_ptr->old_r_blows1 != r_ptr->r_blows[1]) || (old_race_flags_ptr->old_r_blows2 != r_ptr->r_blows[2]) ||
         (old_race_flags_ptr->old_r_blows3 != r_ptr->r_blows[3]) || (old_race_flags_ptr->old_r_cast_spell != r_ptr->r_cast_spell) ||
index 26906c4..7e1bb9f 100644 (file)
@@ -7,8 +7,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-misc-flags.h"
 #include "spell/summon-types.h"
@@ -124,11 +122,6 @@ static bool restrict_monster_to_dungeon(const FloorType *floor_ptr, MonsterRaceI
     case DUNGEON_MODE_AND:
     case DUNGEON_MODE_NAND: {
         std::vector<bool> is_possible = {
-            all_bits(r_ptr->flags1, d_ptr->mflags1),
-            all_bits(r_ptr->flags2, d_ptr->mflags2),
-            all_bits(r_ptr->flags3, d_ptr->mflags3),
-            all_bits(r_ptr->flags7, d_ptr->mflags7),
-            all_bits(r_ptr->flags8, d_ptr->mflags8),
             is_possible_monster_and(r_ptr->ability_flags, d_ptr->mon_ability_flags),
             is_possible_monster_and(r_ptr->behavior_flags, d_ptr->mon_behavior_flags),
             is_possible_monster_and(r_ptr->resistance_flags, d_ptr->mon_resistance_flags),
@@ -151,11 +144,6 @@ static bool restrict_monster_to_dungeon(const FloorType *floor_ptr, MonsterRaceI
     case DUNGEON_MODE_OR:
     case DUNGEON_MODE_NOR: {
         std::vector<bool> is_possible = {
-            any_bits(r_ptr->flags1, d_ptr->mflags1),
-            any_bits(r_ptr->flags2, d_ptr->mflags2),
-            any_bits(r_ptr->flags3, d_ptr->mflags3),
-            any_bits(r_ptr->flags7, d_ptr->mflags7),
-            any_bits(r_ptr->flags8, d_ptr->mflags8),
             is_possible_monster_or(r_ptr->ability_flags, d_ptr->mon_ability_flags),
             is_possible_monster_or(r_ptr->behavior_flags, d_ptr->mon_behavior_flags),
             is_possible_monster_or(r_ptr->resistance_flags, d_ptr->mon_resistance_flags),
@@ -373,3 +361,13 @@ errr get_mon_num_prep_bounty(PlayerType *player_ptr)
 {
     return do_get_mon_num_prep(player_ptr, nullptr, nullptr, false);
 }
+
+bool is_player(MONSTER_IDX m_idx)
+{
+    return m_idx == 0;
+}
+
+bool is_monster(MONSTER_IDX m_idx)
+{
+    return m_idx > 0;
+}
index e2459a2..ccb7a2e 100644 (file)
@@ -16,3 +16,5 @@ monsterrace_hook_type get_monster_hook(PlayerType *player_ptr);
 monsterrace_hook_type get_monster_hook2(PlayerType *player_ptr, POSITION y, POSITION x);
 errr get_mon_num_prep(PlayerType *player_ptr, monsterrace_hook_type hook1, monsterrace_hook_type hook2);
 errr get_mon_num_prep_bounty(PlayerType *player_ptr);
+bool is_player(MONSTER_IDX m_idx);
+bool is_monster(MONSTER_IDX m_idx);
index dad14dc..b882e28 100644 (file)
@@ -1,7 +1,6 @@
 #include "mspell/improper-mspell-remover.h"
 #include "game-option/birth-options.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
 #include "monster/smart-learn-types.h"
 #include "mspell/element-resistance-checker.h"
 #include "mspell/high-resistance-checker.h"
index 489887c..d6157ed 100644 (file)
@@ -7,7 +7,6 @@
 #include "monster-floor/monster-move.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags2.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-flag-types.h"
index d79a64c..de3f728 100644 (file)
 #include "monster-floor/monster-move.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "mspell/assign-monster-spell.h"
 #include "mspell/improper-mspell-remover.h"
 #include "mspell/mspell-judgement.h"
@@ -169,7 +167,7 @@ bool clean_shot(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2, P
     for (const auto &[y, x] : grid_g) {
         const Pos2D pos(y, x);
         const auto &grid = floor_ptr->get_grid(pos);
-        if ((grid.m_idx > 0) && (y != y2 || x != x2)) {
+        if (grid.has_monster() && (y != y2 || x != x2)) {
             auto *m_ptr = &floor_ptr->m_list[grid.m_idx];
             if (is_friend == m_ptr->is_pet()) {
                 return false;
index 7f848e3..5886067 100644 (file)
@@ -3,7 +3,6 @@
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-status.h"
 #include "player-info/equipment-info.h"
 #include "system/floor-type-definition.h"
index 2abb58f..d18b210 100644 (file)
@@ -15,9 +15,6 @@
 #include "monster-race/race-ability-flags.h"
 #include "monster-race/race-brightness-mask.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-info.h"
index 623c91a..71ba860 100644 (file)
@@ -65,7 +65,7 @@ bool direct_beam(PlayerType *player_ptr, POSITION y1, POSITION x1, POSITION y2,
         const auto &grid = floor.get_grid(pos);
         if (y == y2 && x == x2) {
             hit2 = true;
-        } else if (is_friend && grid.m_idx > 0 && !m_ptr->is_hostile_to_melee(floor.m_list[grid.m_idx])) {
+        } else if (is_friend && grid.has_monster() && !m_ptr->is_hostile_to_melee(floor.m_list[grid.m_idx])) {
             return false;
         }
 
index 264406c..d548ac0 100644 (file)
@@ -12,9 +12,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "mspell/mspell-attack-util.h"
 #include "mspell/mspell-judgement.h"
 #include "player-base/player-class.h"
index ffce4d2..ba7808a 100644 (file)
@@ -9,7 +9,6 @@
 #include "floor/geometry.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-mask.h"
-#include "monster-race/race-flags2.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-status.h"
 #include "mspell/mspell-attack-util.h"
@@ -243,7 +242,7 @@ MonsterAbilityType choose_attack_spell(PlayerType *player_ptr, msa_type *msa_ptr
 
     auto *m_ptr = &player_ptr->current_floor_ptr->m_list[msa_ptr->m_idx];
     auto *r_ptr = &m_ptr->get_monrace();
-    if (r_ptr->flags2 & RF2_STUPID) {
+    if (r_ptr->behavior_flags.has(MonsterBehaviorType::STUPID)) {
         return rand_choice(msa_ptr->mspells);
     }
 
index a7c40ec..11b0cad 100644 (file)
@@ -17,7 +17,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-floor/monster-summon.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index 51da8c7..b9ebd19 100644 (file)
@@ -13,8 +13,6 @@
 #include "mind/drs-types.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index 0ec5aa4..1f40dc3 100644 (file)
@@ -8,7 +8,6 @@
 #include "monster-floor/monster-summon.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
index 7d7f46c..e5fa509 100644 (file)
@@ -1,7 +1,6 @@
 #include "mspell/smart-mspell-util.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags2.h"
 #include "monster/smart-learn-types.h"
 #include "system/floor-type-definition.h"
 #include "system/monster-entity.h"
index df3f425..53ac271 100644 (file)
@@ -2,11 +2,6 @@
 #include "monster-attack/monster-attack-table.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-util.h"
 #include "player-base/player-race.h"
index b3f916b..2064b80 100644 (file)
@@ -43,7 +43,7 @@ bool eat_rock(PlayerType *player_ptr)
         msg_print(_("この地形は食べられない。", "You cannot eat this feature."));
     } else if (terrain.flags.has(TerrainCharacteristics::PERMANENT)) {
         msg_format(_("いてっ!この%sはあなたの歯より硬い!", "Ouch!  This %s is harder than your teeth!"), terrain_mimic.name.data());
-    } else if (grid.m_idx) {
+    } else if (grid.has_monster()) {
         const auto &monster = player_ptr->current_floor_ptr->m_list[grid.m_idx];
         msg_print(_("何かが邪魔しています!", "There's something in the way!"));
         if (!monster.ml || !monster.is_pet()) {
index 98ab5d0..0d3aa3c 100644 (file)
@@ -16,7 +16,6 @@
 #include "hpmp/hp-mp-processor.h"
 #include "mind/mind-archer.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-status.h"
 #include "player-attack/player-attack.h"
index f813ef2..1b1a0bc 100644 (file)
@@ -263,7 +263,7 @@ void ObjectThrowEntity::display_potion_throw()
 
     auto *floor_ptr = this->player_ptr->current_floor_ptr;
     auto *angry_m_ptr = &floor_ptr->m_list[floor_ptr->grid_array[this->y][this->x].m_idx];
-    if ((floor_ptr->grid_array[this->y][this->x].m_idx == 0) || !angry_m_ptr->is_friendly() || angry_m_ptr->is_invulnerable()) {
+    if (!floor_ptr->grid_array[this->y][this->x].has_monster() || !angry_m_ptr->is_friendly() || angry_m_ptr->is_invulnerable()) {
         this->do_drop = false;
         return;
     }
index 7a27087..b4b5609 100644 (file)
@@ -201,7 +201,7 @@ bool ObjectBreaker::can_destroy(ItemEntity *o_ptr) const
  *    o_ptr --- pointer to the potion object.
  * </pre>
  */
-bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, short bi_id)
+bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, short bi_id)
 {
     int radius = 2;
     AttributeType dt = AttributeType::NONE;
@@ -335,7 +335,7 @@ bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, PO
         break;
     }
 
-    (void)project(player_ptr, who, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL));
+    (void)project(player_ptr, src_idx, radius, y, x, dam, dt, (PROJECT_JUMP | PROJECT_ITEM | PROJECT_KILL));
     return angry;
 }
 
index 3e5a7d0..360bcb7 100644 (file)
@@ -6,7 +6,7 @@
 class ItemEntity;
 class PlayerType;
 
-bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x, short bi_id);
+bool potion_smash_effect(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x, short bi_id);
 PERCENTAGE breakage_chance(PlayerType *player_ptr, ItemEntity *o_ptr, bool has_archer_bonus, SPELL_IDX snipe_type);
 
 class ObjectBreaker {
index 78dba08..3f61805 100644 (file)
@@ -14,7 +14,6 @@
 #include "monster-attack/monster-attack-table.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags1.h"
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
@@ -367,7 +366,7 @@ bool process_warning(PlayerType *player_ptr, POSITION xx, POSITION yy)
 
             const auto *g_ptr = &floor.grid_array[my][mx];
 
-            if (!g_ptr->m_idx) {
+            if (!g_ptr->has_monster()) {
                 continue;
             }
 
index b57eae2..ad6b1f4 100644 (file)
@@ -5,7 +5,6 @@
 #include "game-option/special-options.h"
 #include "io/input-key-acceptor.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
 #include "monster-race/race-indice-types.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/tr-types.h"
index ce0be87..e3486ae 100644 (file)
@@ -111,7 +111,7 @@ bool process_fall_off_horse(PlayerType *player_ptr, int dam, bool force)
             Grid *g_ptr;
             g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
 
-            if (g_ptr->m_idx) {
+            if (g_ptr->has_monster()) {
                 continue;
             }
 
index 8e331cc..5fba061 100644 (file)
@@ -2,8 +2,6 @@
 #include "core/stuff-handler.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "player-info/class-info.h"
index d1109f6..5a825d7 100644 (file)
@@ -16,8 +16,6 @@
 #include "monster-race//race-ability-mask.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
 #include "monster-race/race-resistance-mask.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index 7b6338b..3a5b448 100644 (file)
 #include "mind/monk-attack.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-damage.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "object-enchant/tr-types.h"
 #include "object-enchant/vorpal-weapon.h"
 #include "object-hook/hook-weapon.h"
@@ -520,7 +520,7 @@ static void cause_earthquake(PlayerType *player_ptr, player_attack_type *pa_ptr,
     }
 
     earthquake(player_ptr, player_ptr->y, player_ptr->x, 10, 0);
-    if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx == 0) {
+    if (!player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         *(pa_ptr->mdeath) = true;
     }
 }
@@ -613,7 +613,7 @@ void massacre(PlayerType *player_ptr)
         POSITION x = player_ptr->x + ddx_ddd[dir];
         g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
         m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
-        if (g_ptr->m_idx && (m_ptr->ml || cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
+        if (g_ptr->has_monster() && (m_ptr->ml || cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
             do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
         }
     }
index 4511d45..4e27667 100644 (file)
@@ -4,7 +4,6 @@
 #include "game-option/text-display-options.h"
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
 #include "player-info/equipment-info.h"
index 6b33b5e..d49d5fb 100644 (file)
@@ -10,9 +10,6 @@
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/horror-descriptions.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
index 13cab81..fd8b371 100644 (file)
@@ -29,8 +29,6 @@
 #include "market/arena-info-table.h"
 #include "mind/mind-mirror-master.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index 1ae2b98..f37988a 100644 (file)
@@ -3,8 +3,6 @@
 #include "inventory/inventory-slot-types.h"
 #include "mind/mind-elementalist.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "mutation/mutation-flag-types.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/tr-types.h"
index 30d5099..8261ae5 100644 (file)
@@ -3,8 +3,6 @@
 #include "grid/grid.h"
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "mutation/mutation-flag-types.h"
 #include "object-enchant/object-ego.h"
 #include "object-enchant/tr-types.h"
index 0d45a15..7e760d0 100644 (file)
@@ -33,9 +33,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-update.h"
 #include "monster/smart-learn-types.h"
 #include "mutation/mutation-calculator.h"
@@ -176,7 +173,7 @@ static void delayed_visual_update(PlayerType *player_ptr)
         }
 
         lite_spot(player_ptr, y, x);
-        if (g_ptr->m_idx) {
+        if (g_ptr->has_monster()) {
             update_monster(player_ptr, g_ptr->m_idx, false);
         }
 
@@ -2819,7 +2816,7 @@ bool player_has_no_spellbooks(PlayerType *player_ptr)
  */
 bool player_place(PlayerType *player_ptr, POSITION y, POSITION x)
 {
-    if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx != 0) {
+    if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
         return false;
     }
 
index 9c1974a..b5d5a4a 100644 (file)
@@ -29,7 +29,7 @@ bool vampirism(PlayerType *player_ptr)
     POSITION x = player_ptr->x + ddx[dir];
     const auto *g_ptr = &floor.grid_array[y][x];
     stop_mouth(player_ptr);
-    if (!(g_ptr->m_idx)) {
+    if (!g_ptr->has_monster()) {
         msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
         return false;
     }
index 18a3351..7fa992a 100644 (file)
@@ -841,7 +841,7 @@ std::optional<std::string> do_hex_spell(PlayerType *player_ptr, spell_hex_type s
                     if (dir == 5) {
                         continue;
                     }
-                    if (floor_ptr->grid_array[dy][dx].m_idx) {
+                    if (floor_ptr->grid_array[dy][dx].has_monster()) {
                         flag = true;
                     }
                 }
index f8860b4..753503a 100644 (file)
@@ -23,7 +23,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-info.h"
 #include "monster/monster-update.h"
@@ -123,7 +122,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
 
             y = player_ptr->y + ddy_cdd[cdir];
             x = player_ptr->x + ddx_cdd[cdir];
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
             } else {
                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
@@ -131,7 +130,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
 
             y = player_ptr->y + ddy_cdd[(cdir + 7) % 8];
             x = player_ptr->x + ddx_cdd[(cdir + 7) % 8];
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
             } else {
                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
@@ -139,7 +138,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
 
             y = player_ptr->y + ddy_cdd[(cdir + 1) % 8];
             x = player_ptr->x + ddx_cdd[(cdir + 1) % 8];
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
             } else {
                 msg_print(_("攻撃は空を切った。", "You attack the empty air."));
@@ -184,7 +183,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_FIRE);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -227,7 +226,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_MINEUCHI);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -284,7 +283,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
 
             const auto *floor_ptr = player_ptr->current_floor_ptr;
             const auto &grid = floor_ptr->grid_array[y][x];
-            if (!grid.m_idx) {
+            if (!grid.has_monster()) {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
                 return std::nullopt;
             }
@@ -325,7 +324,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_POISON);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -356,7 +355,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_ZANMA);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -387,7 +386,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             x = player_ptr->x + ddx[dir];
 
             const auto &floor = *player_ptr->current_floor_ptr;
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -396,7 +395,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             if (floor.get_dungeon_definition().flags.has(DungeonFeatureType::NO_MELEE)) {
                 return "";
             }
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 int i;
                 POSITION ty = y, tx = x;
                 POSITION oy = y, ox = x;
@@ -476,7 +475,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_HAGAN);
             }
 
@@ -512,7 +511,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_COLD);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -543,7 +542,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_KYUSHO);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -573,7 +572,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_MAJIN);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -604,7 +603,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_SUTEMI);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -635,7 +634,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_ELEC);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -679,7 +678,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
                 x = player_ptr->x + ddx_ddd[dir];
                 auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
                 auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
-                if ((g_ptr->m_idx == 0) || (!m_ptr->ml && !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
+                if (!g_ptr->has_monster() || (!m_ptr->ml && !cave_has_flag_bold(player_ptr->current_floor_ptr, y, x, TerrainCharacteristics::PROJECT))) {
                     continue;
                 }
 
@@ -715,7 +714,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_QUAKE);
             } else {
                 earthquake(player_ptr, player_ptr->y, player_ptr->x, 10, 0);
@@ -815,7 +814,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
                 x = player_ptr->x + ddx[dir];
                 g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
 
-                if (g_ptr->m_idx) {
+                if (g_ptr->has_monster()) {
                     do_cmd_attack(player_ptr, y, x, HISSATSU_3DAN);
                 } else {
                     msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -827,7 +826,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
                 }
 
                 /* Monster is dead? */
-                if (!g_ptr->m_idx) {
+                if (!g_ptr->has_monster()) {
                     break;
                 }
 
@@ -897,7 +896,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_DRAIN);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
@@ -1013,9 +1012,9 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
-                if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+                if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                     handle_stuff(player_ptr);
                     do_cmd_attack(player_ptr, y, x, HISSATSU_NONE);
                 }
@@ -1108,7 +1107,7 @@ std::optional<std::string> do_hissatsu_spell(PlayerType *player_ptr, SPELL_IDX s
             y = player_ptr->y + ddy[dir];
             x = player_ptr->x + ddx[dir];
 
-            if (player_ptr->current_floor_ptr->grid_array[y][x].m_idx) {
+            if (player_ptr->current_floor_ptr->grid_array[y][x].has_monster()) {
                 do_cmd_attack(player_ptr, y, x, HISSATSU_UNDEAD);
             } else {
                 msg_print(_("その方向にはモンスターはいません。", "There is no monster."));
index 9c0c4ff..dbf8460 100644 (file)
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-info.h"
 #include "monster/monster-list.h"
 #include "monster/monster-util.h"
index 546b081..0b4c256 100644 (file)
@@ -27,7 +27,7 @@ static bool player_grid(PlayerType *player_ptr, Grid *g_ptr)
 static bool is_cave_empty_grid(PlayerType *player_ptr, Grid *g_ptr)
 {
     bool is_empty_grid = g_ptr->cave_has_flag(TerrainCharacteristics::PLACE);
-    is_empty_grid &= g_ptr->m_idx == 0;
+    is_empty_grid &= !g_ptr->has_monster();
     is_empty_grid &= !player_grid(player_ptr, g_ptr);
     return is_empty_grid;
 }
@@ -139,7 +139,7 @@ static void vault_trap_aux(FloorType *floor_ptr, POSITION y, POSITION x, POSITIO
         }
 
         g_ptr = &floor_ptr->grid_array[y1][x1];
-        if (!g_ptr->is_floor() || !g_ptr->o_idx_list.empty() || g_ptr->m_idx) {
+        if (!g_ptr->is_floor() || !g_ptr->o_idx_list.empty() || g_ptr->has_monster()) {
             continue;
         }
 
index 38f1372..9445486 100644 (file)
@@ -204,9 +204,6 @@ void wr_lore(MonsterRaceId r_idx)
     wr_byte(r_ptr->r_blows[2]);
     wr_byte(r_ptr->r_blows[3]);
 
-    wr_u32b(r_ptr->r_flags1);
-    wr_u32b(r_ptr->r_flags2);
-    wr_u32b(r_ptr->r_flags3);
     wr_FlagGroup(r_ptr->r_resistance_flags, wr_byte);
     wr_FlagGroup(r_ptr->r_ability_flags, wr_byte);
     wr_FlagGroup(r_ptr->r_aura_flags, wr_byte);
index cfd3920..dd13908 100644 (file)
@@ -62,7 +62,7 @@ void SpellsMirrorMaster::remove_mirror(int y, int x)
             reset_bits(g_ptr->info, CAVE_MARK);
         }
 
-        if (g_ptr->m_idx) {
+        if (g_ptr->has_monster()) {
             update_monster(this->player_ptr, g_ptr->m_idx, false);
         }
 
@@ -196,7 +196,7 @@ void SpellsMirrorMaster::seal_of_mirror(const int dam)
                 continue;
             }
 
-            if (g_ref.m_idx == 0) {
+            if (!g_ref.has_monster()) {
                 this->remove_mirror(y, x);
             }
         }
@@ -334,7 +334,7 @@ void SpellsMirrorMaster::project_seeker_ray(int target_x, int target_y, int dam)
             }
             const auto &grid = floor.grid_array[project_m_y][project_m_x];
             const auto &monster = floor.m_list[grid.m_idx];
-            if (project_m_n == 1 && grid.m_idx > 0 && monster.ml) {
+            if (project_m_n == 1 && grid.has_monster() && monster.ml) {
                 if (!this->player_ptr->effects()->hallucination()->is_hallucinated()) {
                     monster_race_track(this->player_ptr, monster.ap_r_idx);
                 }
@@ -431,7 +431,7 @@ static bool activate_super_ray_effect(PlayerType *player_ptr, int y, int x, int
     const auto *floor_ptr = player_ptr->current_floor_ptr;
     const auto *g_ptr = &floor_ptr->grid_array[project_m_y][project_m_x];
     const auto *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
-    if (project_m_n == 1 && g_ptr->m_idx > 0 && m_ptr->ml) {
+    if (project_m_n == 1 && g_ptr->has_monster() && m_ptr->ml) {
         if (!player_ptr->effects()->hallucination()->is_hallucinated()) {
             monster_race_track(player_ptr, m_ptr->ap_r_idx);
         }
index 2c8ebdd..e9ec609 100644 (file)
@@ -15,8 +15,6 @@
 #include "mind/mind-ninja.h"
 #include "monster-floor/monster-lite.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
@@ -112,7 +110,7 @@ bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MO
                 continue;
             }
 
-            if (floor_ptr->grid_array[y][x].m_idx) {
+            if (floor_ptr->grid_array[y][x].has_monster()) {
                 continue;
             }
 
@@ -180,7 +178,7 @@ bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MO
                 continue;
             }
 
-            if (!grid.m_idx) {
+            if (!grid.has_monster()) {
                 continue;
             }
 
@@ -220,7 +218,7 @@ bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MO
                         continue;
                     }
 
-                    if (grid_neighbor.m_idx) {
+                    if (grid_neighbor.has_monster()) {
                         continue;
                     }
 
@@ -251,7 +249,7 @@ bool earthquake(PlayerType *player_ptr, POSITION cy, POSITION cx, POSITION r, MO
                     msg_format(_("%s^は岩石に埋もれてしまった!", "%s^ is embedded in the rock!"), m_name.data());
                 }
 
-                if (grid.m_idx) {
+                if (grid.has_monster()) {
                     const auto &m_ref = floor_ptr->m_list[grid.m_idx];
                     if (record_named_pet && m_ref.is_named_pet()) {
                         const auto m2_name = monster_desc(player_ptr, m_ptr, MD_INDEF_VISIBLE);
index 49db38b..e907700 100644 (file)
@@ -8,8 +8,6 @@
 #include "grid/trap.h"
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
index 0164686..b642e9f 100644 (file)
@@ -8,7 +8,6 @@
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-update.h"
index 2185826..e49f19f 100644 (file)
@@ -29,7 +29,6 @@
 #include "mind/mind-ninja.h"
 #include "monster-floor/monster-lite.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
@@ -336,7 +335,7 @@ bool destroy_area(PlayerType *player_ptr, const POSITION y1, const POSITION x1,
                 continue;
             }
 
-            if (grid.m_idx) {
+            if (grid.has_monster()) {
                 auto &monster = floor.m_list[grid.m_idx];
                 auto &monrace = monster.get_monrace();
 
index db35f37..82febca 100644 (file)
@@ -14,9 +14,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
index 7905359..fe4d1fa 100644 (file)
@@ -131,7 +131,7 @@ bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, in
 /*!
  * @brief メテオ系スペルの発動 / Cast a meteor spell
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who スぺル詠唱者のモンスターID(0=プレイヤー)
+ * @param src_idx スぺル詠唱者のモンスターID(0=プレイヤー)
  * @param typ 効果属性
  * @param dam 威力
  * @param rad 半径
@@ -147,10 +147,10 @@ bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, in
  * Option to hurt the player.
  * </pre>
  */
-bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, int dam, POSITION rad)
+bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX src_idx, AttributeType typ, POSITION y, POSITION x, int dam, POSITION rad)
 {
     BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
-    return project(player_ptr, who, rad, y, x, dam, typ, flg).notice;
+    return project(player_ptr, src_idx, rad, y, x, dam, typ, flg).notice;
 }
 
 /*!
index 11c8b32..61ccf6e 100644 (file)
@@ -10,7 +10,7 @@ bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam
 bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
 bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
 bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
-bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, int dam, POSITION rad);
+bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX src_idx, AttributeType typ, POSITION x, POSITION y, int dam, POSITION rad);
 bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam);
 bool fire_blast(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev);
 bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam);
index b4a7c90..66ce8a9 100644 (file)
@@ -10,7 +10,6 @@
 #include "grid/grid.h"
 #include "mind/mind-ninja.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags2.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
@@ -63,7 +62,7 @@ static void cave_temp_room_lite(PlayerType *player_ptr, const std::vector<Pos2D>
         auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
         g_ptr->info &= ~(CAVE_TEMP);
         g_ptr->info |= (CAVE_GLOW);
-        if (g_ptr->m_idx) {
+        if (g_ptr->has_monster()) {
             PERCENTAGE chance = 25;
             auto *m_ptr = &player_ptr->current_floor_ptr->m_list[g_ptr->m_idx];
             auto *r_ptr = &m_ptr->get_monrace();
@@ -133,7 +132,7 @@ static void cave_temp_room_unlite(PlayerType *player_ptr, const std::vector<Pos2
             note_spot(player_ptr, point.y, point.x);
         }
 
-        if (grid.m_idx) {
+        if (grid.has_monster()) {
             update_monster(player_ptr, grid.m_idx, false);
         }
 
index 95bc56b..b2c99e1 100644 (file)
@@ -108,15 +108,15 @@ bool sleep_monsters_touch(PlayerType *player_ptr)
 /*!
  * @brief 死者復活処理(起点より周囲5マス)
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 術者モンスターID(0ならばプレイヤー)
+ * @param src_idx 術者モンスターID(0ならばプレイヤー)
  * @param y 起点Y座標
  * @param x 起点X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-bool animate_dead(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x)
+bool animate_dead(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x)
 {
     BIT_FLAGS flg = PROJECT_ITEM | PROJECT_HIDE;
-    return project(player_ptr, who, 5, y, x, 0, AttributeType::ANIM_DEAD, flg).notice;
+    return project(player_ptr, src_idx, 5, y, x, 0, AttributeType::ANIM_DEAD, flg).notice;
 }
 
 /*!
index 11a0c1a..4607a70 100644 (file)
@@ -11,5 +11,5 @@ bool wall_stone(PlayerType *player_ptr);
 bool destroy_doors_touch(PlayerType *player_ptr);
 bool disarm_traps_touch(PlayerType *player_ptr);
 bool sleep_monsters_touch(PlayerType *player_ptr);
-bool animate_dead(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x);
+bool animate_dead(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x);
 void wall_breaker(PlayerType *player_ptr);
index 038f204..da73c0d 100644 (file)
@@ -7,7 +7,6 @@
 #include "io/write-diary.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-info.h"
index fe3e4ad..af6ea20 100644 (file)
@@ -5,7 +5,6 @@
 #include "monster-floor/monster-remover.h"
 #include "monster-floor/place-monster-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-list.h"
index 9bb7fd1..fc336a2 100644 (file)
@@ -14,7 +14,6 @@
 #include "lore/lore-store.h"
 #include "monster-race/monster-kind-mask.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags3.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
@@ -212,9 +211,9 @@ bool crusade(PlayerType *player_ptr)
 /*!
  * @brief 視界内モンスターを怒らせる処理 / Wake up all monsters, and speed up "los" monsters.
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 怒らせる原因を起こしたモンスター(0ならばプレイヤー)
+ * @param src_idx 怒らせる原因を起こしたモンスター(0ならばプレイヤー)
  */
-void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who)
+void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX src_idx)
 {
     auto sleep = false;
     auto speed = false;
@@ -224,7 +223,7 @@ void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who)
         if (!monster.is_valid()) {
             continue;
         }
-        if (i == who) {
+        if (i == src_idx) {
             continue;
         }
 
index 7d051fe..5867956 100644 (file)
@@ -11,7 +11,7 @@ bool project_all_los(PlayerType *player_ptr, AttributeType typ, int dam);
 bool speed_monsters(PlayerType *player_ptr);
 bool slow_monsters(PlayerType *player_ptr, int power);
 bool sleep_monsters(PlayerType *player_ptr, int power);
-void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who);
+void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX src_idx);
 bool banish_evil(PlayerType *player_ptr, int dist);
 bool turn_undead(PlayerType *player_ptr);
 bool dispel_evil(PlayerType *player_ptr, int dam);
index a2e290c..64ae90f 100644 (file)
@@ -22,7 +22,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-mask.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status-setter.h"
 #include "monster/monster-status.h"
@@ -72,7 +71,7 @@ bool teleport_swap(PlayerType *player_ptr, DIRECTION dir)
 
     Grid *g_ptr;
     g_ptr = &player_ptr->current_floor_ptr->grid_array[ty][tx];
-    if (!g_ptr->m_idx || (g_ptr->m_idx == player_ptr->riding)) {
+    if (!g_ptr->has_monster() || (g_ptr->m_idx == player_ptr->riding)) {
         msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
         return false;
     }
@@ -515,7 +514,7 @@ void teleport_player_to(PlayerType *player_ptr, POSITION ny, POSITION nx, telepo
 
         bool is_anywhere = w_ptr->wizard;
         is_anywhere &= (mode & TELEPORT_PASSIVE) == 0;
-        is_anywhere &= (player_ptr->current_floor_ptr->grid_array[y][x].m_idx > 0) || player_ptr->current_floor_ptr->grid_array[y][x].m_idx == player_ptr->riding;
+        is_anywhere &= player_ptr->current_floor_ptr->grid_array[y][x].has_monster() || player_ptr->current_floor_ptr->grid_array[y][x].m_idx == player_ptr->riding;
         if (is_anywhere) {
             break;
         }
index b86e919..2577f3a 100644 (file)
@@ -22,7 +22,6 @@
 #include "market/building-util.h"
 #include "monster-floor/monster-remover.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "system/angband-system.h"
index 72984ac..aa49094 100644 (file)
@@ -162,7 +162,7 @@ bool vanish_dungeon(PlayerType *player_ptr)
             const auto &terrrain = grid.get_terrain();
             grid.info &= ~(CAVE_ROOM | CAVE_ICKY);
             const auto &monster = floor.m_list[grid.m_idx];
-            if (grid.m_idx && monster.is_asleep()) {
+            if (grid.has_monster() && monster.is_asleep()) {
                 (void)set_monster_csleep(player_ptr, grid.m_idx, 0);
                 if (monster.ml) {
                     const auto m_name = monster_desc(player_ptr, &monster, 0);
index 9cf7e9e..e4d5a79 100644 (file)
@@ -141,19 +141,19 @@ bool set_ele_immune(PlayerType *player_ptr, uint32_t immune_type, TIME_EFFECT v)
         player_ptr->ele_immune = v;
         std::string element;
         switch (immune_type) {
-        case ATTACK_ACID:
+        case DEFENSE_ACID:
             element = _("酸", "acid!");
             break;
-        case ATTACK_ELEC:
+        case DEFENSE_ELEC:
             element = _("電撃", "electricity!");
             break;
-        case ATTACK_FIRE:
+        case DEFENSE_FIRE:
             element = _("火炎", "fire!");
             break;
-        case ATTACK_COLD:
+        case DEFENSE_COLD:
             element = _("冷気", "cold!");
             break;
-        case ATTACK_POIS:
+        case DEFENSE_POIS:
             element = _("毒", "poison!");
             break;
         default: // @todo 本来はruntime_error を飛ばすべきだが、既存コードと同じように動くことを優先した.
index b91a5ff..9ac9f11 100644 (file)
@@ -61,7 +61,7 @@ bool cast_wrath_of_the_god(PlayerType *player_ptr, int dam, POSITION rad)
         if (!cave_has_flag_bold(&floor, pos_to.y, pos_to.x, TerrainCharacteristics::PROJECT)) {
             break;
         }
-        if ((dir != 5) && floor.get_grid(pos_to).m_idx != 0) {
+        if ((dir != 5) && floor.get_grid(pos_to).has_monster()) {
             break;
         }
 
index f6ac993..65c3079 100644 (file)
@@ -2,9 +2,6 @@
 #include "monster-race/monster-race-hook.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "player-base/player-class.h"
index 15d068c..e9fe217 100644 (file)
@@ -14,7 +14,6 @@
 #include "game-option/disturbance-options.h"
 #include "inventory/inventory-slot-types.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "object-enchant/item-apply-magic.h"
 #include "object-enchant/item-feeling.h"
 #include "object-enchant/item-magic-applier.h"
index 5a5c84f..2d5341e 100644 (file)
@@ -546,7 +546,7 @@ bool fishing(PlayerType *player_ptr)
         return false;
     }
 
-    if (floor_ptr->grid_array[y][x].m_idx) {
+    if (floor_ptr->grid_array[y][x].has_monster()) {
         const auto m_name = monster_desc(player_ptr, &floor_ptr->m_list[floor_ptr->grid_array[y][x].m_idx], 0);
         msg_format(_("%sが邪魔だ!", "%s^ is standing in your way."), m_name.data());
         PlayerEnergy(player_ptr).reset_player_turn();
index 33e1317..121ea9c 100644 (file)
@@ -12,6 +12,7 @@
 #include "monster-race/race-indice-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
+#include "monster/monster-util.h"
 #include "monster/smart-learn-types.h"
 #include "object/item-tester-hooker.h"
 #include "object/item-use-flags.h"
@@ -55,7 +56,7 @@ bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSI
         lev = plev * 2 / 3 + randint1(plev / 2);
     }
 
-    MONSTER_IDX who;
+    MONSTER_IDX src_idx;
     if (pet) {
         /* Become pet */
         mode |= PM_FORCE_PET;
@@ -69,18 +70,18 @@ bool trump_summoning(PlayerType *player_ptr, int num, bool pet, POSITION y, POSI
         }
 
         /* Player is who summons */
-        who = -1;
+        src_idx = -1;
     } else {
         /* Prevent taming, allow unique monster */
         mode |= PM_NO_PET;
 
         /* Behave as if they appear by themselfs */
-        who = 0;
+        src_idx = 0;
     }
 
     bool success = false;
     for (int i = 0; i < num; i++) {
-        if (summon_specific(player_ptr, who, y, x, lev, type, mode)) {
+        if (summon_specific(player_ptr, src_idx, y, x, lev, type, mode)) {
             success = true;
         }
     }
@@ -260,18 +261,18 @@ bool summon_kin_player(PlayerType *player_ptr, DEPTH level, POSITION y, POSITION
 /*!
  * @brief サイバーデーモンの召喚
  * @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスターID(0ならばプレイヤー)
+ * @param src_idx 召喚主のモンスターID(0ならばプレイヤー)
  * @param y 召喚位置Y座標
  * @param x 召喚位置X座標
  * @return 作用が実際にあった場合TRUEを返す
  */
-int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x)
+int summon_cyber(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x)
 {
     /* Summoned by a monster */
     BIT_FLAGS mode = PM_ALLOW_GROUP;
     auto *floor_ptr = player_ptr->current_floor_ptr;
-    if (who > 0) {
-        auto *m_ptr = &floor_ptr->m_list[who];
+    if (is_monster(src_idx)) {
+        auto *m_ptr = &floor_ptr->m_list[src_idx];
         if (m_ptr->is_pet()) {
             mode |= PM_FORCE_PET;
         }
@@ -284,7 +285,7 @@ int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x
 
     int count = 0;
     for (int i = 0; i < max_cyber; i++) {
-        count += summon_specific(player_ptr, who, y, x, 100, SUMMON_CYBER, mode);
+        count += summon_specific(player_ptr, src_idx, y, x, 100, SUMMON_CYBER, mode);
     }
 
     return count;
index c5ac9fc..971560a 100644 (file)
@@ -15,6 +15,6 @@ bool cast_summon_octopus(PlayerType *player_ptr);
 bool cast_summon_greater_demon(PlayerType *player_ptr);
 bool summon_kin_player(PlayerType *player_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode);
 void mitokohmon(PlayerType *player_ptr);
-int summon_cyber(PlayerType *player_ptr, MONSTER_IDX who, POSITION y, POSITION x);
+int summon_cyber(PlayerType *player_ptr, MONSTER_IDX src_idx, POSITION y, POSITION x);
 int activate_hi_summon(PlayerType *player_ptr, POSITION y, POSITION x, bool can_pet);
 void cast_invoke_spirits(PlayerType *player_ptr, DIRECTION dir);
index 3d771e3..e3d52f6 100644 (file)
@@ -1,6 +1,5 @@
 #include "store/service-checker.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags3.h"
 #include "object-enchant/tr-types.h"
 #include "object/object-value.h"
 #include "object/tval-types.h"
index 9cbcccc..2c763d1 100644 (file)
@@ -23,12 +23,12 @@ constexpr std::string_view ROOT_VARIANT_NAME("Hengband");
 #define H_VER_MAJOR 3 //!< ゲームのバージョン定義(メジャー番号)
 #define H_VER_MINOR 0 //!< ゲームのバージョン定義(マイナー番号)
 #define H_VER_PATCH 1 //!< ゲームのバージョン定義(パッチ番号)
-#define H_VER_EXTRA 6 //!< ゲームのバージョン定義(エクストラ番号)
+#define H_VER_EXTRA 7 //!< ゲームのバージョン定義(エクストラ番号)
 
 /*!
  * @brief セーブファイルのバージョン(3.0.0から導入)
  */
-constexpr uint32_t SAVEFILE_VERSION = 20;
+constexpr uint32_t SAVEFILE_VERSION = 21;
 
 /*!
  * @brief バージョンが開発版が安定版かを返す(廃止予定)
index b090617..375ff7b 100644 (file)
@@ -83,12 +83,6 @@ struct dungeon_type {
 
     EnumClassFlagGroup<DungeonFeatureType> flags{}; /* Dungeon Flags */
 
-    BIT_FLAGS mflags1{}; /* The monster flags that are allowed */
-    BIT_FLAGS mflags2{};
-    BIT_FLAGS mflags3{};
-    BIT_FLAGS mflags7{};
-    BIT_FLAGS mflags8{};
-
     EnumClassFlagGroup<MonsterAbilityType> mon_ability_flags;
     EnumClassFlagGroup<MonsterBehaviorType> mon_behavior_flags;
     EnumClassFlagGroup<MonsterVisualType> mon_visual_flags;
index 1a6e960..78753a2 100644 (file)
@@ -1,5 +1,5 @@
 #include "system/grid-type-definition.h"
-#include "monster-race/race-flags7.h"
+#include "monster/monster-util.h"
 #include "system/angband-system.h"
 #include "system/monster-race-info.h"
 #include "system/terrain-type-definition.h"
@@ -92,6 +92,11 @@ bool Grid::is_rune_explosion() const
     return this->is_object() && TerrainList::get_instance()[this->mimic].flags.has(TerrainCharacteristics::RUNE_EXPLOSION);
 }
 
+bool Grid::has_monster() const
+{
+    return is_monster(this->m_idx);
+}
+
 byte Grid::get_cost(const MonsterRaceInfo *r_ptr) const
 {
     return this->costs[get_grid_flow_type(r_ptr)];
index ed45104..d716cb8 100644 (file)
@@ -83,6 +83,7 @@ public:
     bool is_mirror() const;
     bool is_rune_protection() const;
     bool is_rune_explosion() const;
+    bool has_monster() const;
     byte get_cost(const MonsterRaceInfo *r_ptr) const;
     byte get_distance(const MonsterRaceInfo *r_ptr) const;
     FEAT_IDX get_feat_mimic() const;
index 8b3ecbd..2b5cb15 100644 (file)
@@ -79,11 +79,6 @@ public:
     EXP mexp{}; //!< 殺害時基本経験値 / Exp value for kill
     RARITY freq_spell{}; //!< 魔法&特殊能力仕様頻度(1/n) /  Spell frequency
     MonsterSex sex{}; //!< 性別 / Sex
-    BIT_FLAGS flags1{}; //!< Flags 1 (general)
-    BIT_FLAGS flags2{}; //!< Flags 2 (abilities)
-    BIT_FLAGS flags3{}; //!< Flags 3 (race/resist)
-    BIT_FLAGS flags7{}; //!< Flags 7 (movement related abilities)
-    BIT_FLAGS flags8{}; //!< Flags 8 (wilderness info)
     EnumClassFlagGroup<MonsterAbilityType> ability_flags; //!< 能力フラグ(魔法/ブレス) / Ability Flags
     EnumClassFlagGroup<MonsterAuraType> aura_flags; //!< オーラフラグ / Aura Flags
     EnumClassFlagGroup<MonsterBehaviorType> behavior_flags; //!< 能力フラグ(習性)
@@ -130,9 +125,6 @@ public:
     ITEM_NUMBER r_drop_item{}; //!< これまでに撃破時に落としたアイテムの数 / Max number of item dropped at once
     byte r_cast_spell{}; //!< 使った魔法/ブレスの種類数 /  Max unique number of spells seen
     byte r_blows[MAX_NUM_BLOWS]{}; //!< 受けた打撃 /  Number of times each blow type was seen
-    uint32_t r_flags1{}; //!< Observed racial flags
-    uint32_t r_flags2{}; //!< Observed racial flags
-    uint32_t r_flags3{}; //!< Observed racial flags
     EnumClassFlagGroup<MonsterAbilityType> r_ability_flags; //!< 見た能力フラグ(魔法/ブレス) / Observed racial ability flags
     EnumClassFlagGroup<MonsterAuraType> r_aura_flags; //!< 見た能力フラグ(オーラ) / Observed aura flags
     EnumClassFlagGroup<MonsterBehaviorType> r_behavior_flags; //!< 見た能力フラグ(習性) / Observed racial attr flags
index b406800..0a0ac94 100644 (file)
@@ -123,7 +123,7 @@ static bool project_stop(PlayerType *player_ptr, projection_path_type *pp_ptr)
         }
     }
 
-    if (any_bits(pp_ptr->flag, PROJECT_STOP) && !pp_ptr->position->empty() && (player_ptr->is_located_at(pos) || grid.m_idx != 0)) {
+    if (any_bits(pp_ptr->flag, PROJECT_STOP) && !pp_ptr->position->empty() && (player_ptr->is_located_at(pos) || grid.has_monster())) {
         return true;
     }
 
index bb3bd28..61323a4 100644 (file)
@@ -17,7 +17,6 @@
 #include "locale/english.h"
 #include "lore/lore-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-description-types.h"
 #include "monster/monster-flag-types.h"
@@ -271,7 +270,7 @@ static bool within_char_util(const short input)
 
 static short describe_grid(PlayerType *player_ptr, GridExamination *ge_ptr)
 {
-    if ((ge_ptr->g_ptr->m_idx == 0) || !player_ptr->current_floor_ptr->m_list[ge_ptr->g_ptr->m_idx].ml) {
+    if (!ge_ptr->g_ptr->has_monster() || !player_ptr->current_floor_ptr->m_list[ge_ptr->g_ptr->m_idx].ml) {
         return CONTINUOUS_DESCRIPTION;
     }
 
index fd3e1c3..ded6014 100644 (file)
@@ -7,7 +7,6 @@
 #include "io/input-key-requester.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-describer.h"
 #include "monster/monster-status.h"
 #include "system/floor-type-definition.h"
index 467c23e..f1bf38c 100644 (file)
@@ -3,7 +3,6 @@
 #include "game-option/input-options.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-flag-types.h"
 #include "monster/monster-info.h"
 #include "monster/monster-status.h"
@@ -87,7 +86,7 @@ static bool target_set_accept(PlayerType *player_ptr, const Pos2D &pos)
     }
 
     const auto &grid = floor.get_grid(pos);
-    if (grid.m_idx) {
+    if (grid.has_monster()) {
         auto &monster = floor.m_list[grid.m_idx];
         if (monster.ml) {
             return true;
index c1d3668..0b39b02 100644 (file)
@@ -3,7 +3,6 @@
 #include "dungeon/quest.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "monster/monster-flag-types.h"
 #include "system/artifact-type-definition.h"
 #include "system/floor-type-definition.h"
@@ -138,14 +137,14 @@ bool ang_sort_comp_importance(PlayerType *player_ptr, vptr u, vptr v, int a, int
 
     /* Extract monster race */
     MonsterRaceInfo *ap_r_ptr_a;
-    if (grid_a.m_idx && monster_a.ml) {
+    if (grid_a.has_monster() && monster_a.ml) {
         ap_r_ptr_a = &monster_a.get_appearance_monrace();
     } else {
         ap_r_ptr_a = nullptr;
     }
 
     MonsterRaceInfo *ap_r_ptr_b;
-    if (grid_b.m_idx && monster_b.ml) {
+    if (grid_b.has_monster() && monster_b.ml) {
         ap_r_ptr_b = &monster_b.get_appearance_monrace();
     } else {
         ap_r_ptr_b = nullptr;
index 2cefd41..473fbfc 100644 (file)
@@ -4,7 +4,6 @@
 #include "lore/lore-calculator.h"
 #include "lore/lore-util.h"
 #include "monster-attack/monster-attack-table.h"
-#include "monster-race/race-flags1.h"
 #include "system/monster-race-info.h"
 #include "term/term-color-types.h"
 
index f381124..54c2caa 100644 (file)
@@ -1,6 +1,5 @@
 #include "view/display-lore-drops.h"
 #include "lore/lore-util.h"
-#include "monster-race/race-flags1.h"
 #include "util/bit-flags-calculator.h"
 
 void display_monster_drop_quantity(lore_type *lore_ptr)
index d4bc6c9..a76c7ab 100644 (file)
@@ -1,6 +1,5 @@
 #include "view/display-lore-magics.h"
 #include "lore/lore-util.h"
-#include "monster-race/race-flags2.h"
 #include "system/monster-race-info.h"
 #include "term/term-color-types.h"
 
index 05597fb..c9a3c8f 100644 (file)
@@ -5,10 +5,6 @@
 #include "monster-race/monster-race.h"
 #include "monster-race/race-brightness-flags.h"
 #include "monster-race/race-flags-resistance.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "system/monster-entity.h"
 #include "system/monster-race-info.h"
 #include "term/term-color-types.h"
index 7c3ebbd..8763a5a 100644 (file)
 #include "monster-attack/monster-attack-table.h"
 #include "monster-race/monster-race.h"
 #include "monster-race/race-ability-flags.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
-#include "monster-race/race-flags3.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "system/monster-race-info.h"
 #include "system/player-type-definition.h"
index 79ced0c..da76b16 100644 (file)
@@ -9,8 +9,6 @@
 #include "grid/feature.h"
 #include "grid/grid.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags2.h"
 #include "object/object-info.h"
 #include "object/object-mark-types.h"
 #include "system/baseitem-info.h"
@@ -303,7 +301,7 @@ void map_info(PlayerType *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, ch
         break;
     }
 
-    if (grid.m_idx && display_autopick != 0) {
+    if (grid.has_monster() && display_autopick != 0) {
         set_term_color(player_ptr, y, x, ap, cp);
         return;
     }
index 5d544a0..b0c301c 100644 (file)
@@ -527,7 +527,7 @@ void fix_object(PlayerType *player_ptr)
  */
 static const MonsterEntity *monster_on_floor_items(FloorType *floor_ptr, const Grid *g_ptr)
 {
-    if (g_ptr->m_idx == 0) {
+    if (!g_ptr->has_monster()) {
         return nullptr;
     }
 
index 76739b8..d57b91e 100644 (file)
@@ -1,9 +1,6 @@
 #include "wizard/monster-info-spoiler.h"
 #include "io/files-util.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "system/angband-version.h"
 #include "system/monster-race-info.h"
 #include "term/term-color-types.h"
index 47feb6a..a737c79 100644 (file)
@@ -10,8 +10,6 @@
 #include "io/input-key-requester.h"
 #include "market/arena.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
-#include "monster-race/race-flags7.h"
 #include "monster-race/race-indice-types.h"
 #include "player-info/self-info.h"
 #include "system/floor-type-definition.h"
index 2af7ae1..8275274 100644 (file)
@@ -17,8 +17,6 @@
 #include "io/input-key-acceptor.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags7.h"
-#include "monster-race/race-flags8.h"
 #include "object/object-kind-hook.h"
 #include "player-info/class-info.h"
 #include "realm/realm-names-table.h"
index 0c511fd..7c432bc 100644 (file)
@@ -10,7 +10,6 @@
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
 #include "monster-race/monster-race.h"
-#include "monster-race/race-flags1.h"
 #include "system/angband-system.h"
 #include "system/dungeon-info.h"
 #include "system/floor-type-definition.h"
index 3ea111d..21ad9c8 100644 (file)
@@ -146,7 +146,7 @@ void WorldTurnProcessor::process_monster_arena()
     for (auto x = 0; x < floor_ptr->width; ++x) {
         for (auto y = 0; y < floor_ptr->height; y++) {
             auto *g_ptr = &floor_ptr->grid_array[y][x];
-            if ((g_ptr->m_idx > 0) && (g_ptr->m_idx != this->player_ptr->riding)) {
+            if (g_ptr->has_monster() && (g_ptr->m_idx != this->player_ptr->riding)) {
                 number_mon++;
                 win_m_idx = g_ptr->m_idx;
             }