<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
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)
# 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
-%define version 3.0.1.6
+%define version 3.0.1.7
%define release 1
Summary: hengband %{version}
%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)
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
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
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 \
#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"
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();
#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"
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;
}
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;
}
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;
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;
#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"
#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"
#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"
#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"
#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"
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;
}
#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"
#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"
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) {
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);
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);
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) {
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);
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);
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;
}
#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"
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!"));
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;
}
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;
}
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 {
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);
#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"
#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"
#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"
#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"
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."));
}
}
/* 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;
}
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];
#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"
#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"
#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"
#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"
#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"
#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"
/*!
* @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")
* 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;
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)) {
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);
}
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);
}
#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);
#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"
/*!
* @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")
* @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);
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();) {
}
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;
}
}
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."));
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 に登録されており、スキップされる
#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);
#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"
#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"
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)) {
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);
}
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);
}
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;
}
#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"
#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"
#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"
// 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;
}
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);
}
}
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);
}
#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"
#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"
#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"
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;
}
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);
}
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);
}
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;
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);
}
} 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 {
#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"
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;
}
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);
}
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);
}
#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"
* @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")
* @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)
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);
}
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;
short photo = 0;
std::string note = "";
- MONSTER_IDX who;
+ MONSTER_IDX src_idx;
POSITION r;
POSITION y;
POSITION x;
#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"
#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))) {
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;
}
}
}
- 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);
*/
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;
}
*/
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;
}
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;
}
}
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;
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);
}
}
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);
}
}
/*!
* @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")
* 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;
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);
#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"
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!"));
};
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;
}
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);
}
#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)
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);
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;
}
* @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;
/*!
* @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")
* @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) {
}
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);
}
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);
}
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);
#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"
/*!
* @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)
* @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;
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;
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)) {
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;
}
}
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;
}
}
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 {
} else {
msg_print(_("攻撃は跳ね返った!", "The attack bounces!"));
}
- } else if (who <= 0) {
+ } else if (!is_monster(src_idx)) {
sound(SOUND_REFLECT);
}
}
}
- 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()) {
}
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;
}
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);
#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
#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"
#include "util/enum-converter.h"
#ifdef JP
#else
-#include "monster-race/race-flags1.h"
#include "player-info/class-info.h"
#endif
#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"
#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"
#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"
}
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);
}
#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"
{
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;
}
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;
}
continue;
}
- if (grid.m_idx != 0) {
+ if (grid.has_monster()) {
delete_monster_idx(player_ptr, grid.m_idx);
}
continue;
}
- if (grid.m_idx != 0) {
+ if (grid.has_monster()) {
delete_monster_idx(player_ptr, grid.m_idx);
}
g_ptr->info &= ~(CAVE_MARK);
}
- if (g_ptr->m_idx) {
+ if (g_ptr->has_monster()) {
update_monster(player_ptr, g_ptr->m_idx, false);
}
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);
}
#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"
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()) {
return;
}
- if (grid.m_idx > 0) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
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)) {
return false;
}
- if (grid.m_idx && (grid.m_idx != player_ptr->riding)) {
+ if (grid.has_monster() && (grid.m_idx != player_ptr->riding)) {
return false;
}
return;
}
- if (g_ptr->m_idx > 0) {
+ if (g_ptr->has_monster()) {
delete_monster_idx(player_ptr, g_ptr->m_idx);
}
}
#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"
#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"
#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"
#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"
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)) {
#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"
#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"
#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"
#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"
#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;
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);
}
}
}
-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;
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;
}
}
-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;
};
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;
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();
}
}
}
-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);
}
/*!
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();
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;
#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"
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);
}
}
* @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);
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);
#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"
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 */
#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"
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;
#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 は外から与えることとしたい.
}
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);
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;
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;
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;
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#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"
#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;
*(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;
* @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);
*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);
}
#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);
#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"
#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"
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;
}
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);
}
#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"
#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"
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);
}
#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"
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;
}
continue;
}
- if (!grid_new.m_idx) {
+ if (!grid_new.has_monster()) {
if (tm_idx) {
msg_print(_("失敗!", "Failed!"));
} else {
#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"
#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"
}
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."));
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."));
#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"
}
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;
}
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);
}
#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"
#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"
*/
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;
}
#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"
#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"
#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"
#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"
/*!
* @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);
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++;
/*!
* @brief 特定モンスターを生成する
* @param player_ptr プレイヤーへの参照ポインタ
- * @param who 召喚主のモンスター情報ID
+ * @param src_idx 召喚主のモンスター情報ID
* @param y 生成地点y座標
* @param x 生成地点x座標
* @param r_idx 生成するモンスターの種族ID
* @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];
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)) {
}
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)) {
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);
#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"
#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"
return true;
}
- if (grid.m_idx > 0) {
+ if (grid.has_monster()) {
turn_flags_ptr->do_move = true;
return true;
}
#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"
#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"
}
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);
}
}
#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"
#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"
/*!
* @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 相当生成階
* @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) {
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));
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;
}
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)) {
/*!
* @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;
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));
}
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);
#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"
#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"
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++;
/*!
* @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];
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;
}
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)) {
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;
}
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)) {
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);
}
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);
#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"
#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"
#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"
+++ /dev/null
-#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 */
-};
+++ /dev/null
-#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 */
-};
+++ /dev/null
-#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 */
-};
+++ /dev/null
-#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)
+++ /dev/null
-#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,
-};
#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"
#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"
#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"
#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"
if (player_ptr->is_located_at(pos)) {
return false;
}
- if (grid.m_idx) {
+ if (grid.has_monster()) {
return false;
}
#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"
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++;
}
}
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;
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{};
#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"
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++;
}
}
#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"
* @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];
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;
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... !!");
#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"
#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"
}
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);
{
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) ||
#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"
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),
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),
{
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;
+}
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);
#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"
#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"
#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"
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;
#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"
#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"
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;
}
#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"
#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"
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);
}
#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"
#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"
#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"
#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"
#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"
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()) {
#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"
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;
}
* 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;
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;
}
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 {
#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"
const auto *g_ptr = &floor.grid_array[my][mx];
- if (!g_ptr->m_idx) {
+ if (!g_ptr->has_monster()) {
continue;
}
#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"
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;
}
#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"
#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"
#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"
}
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;
}
}
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);
}
}
#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"
#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"
#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"
#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"
#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"
#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"
}
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);
}
*/
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;
}
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;
}
if (dir == 5) {
continue;
}
- if (floor_ptr->grid_array[dy][dx].m_idx) {
+ if (floor_ptr->grid_array[dy][dx].has_monster()) {
flag = true;
}
}
#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"
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."));
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."));
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."));
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."));
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."));
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;
}
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."));
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."));
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."));
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;
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);
}
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."));
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."));
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."));
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."));
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."));
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;
}
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);
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."));
}
/* Monster is dead? */
- if (!g_ptr->m_idx) {
+ if (!g_ptr->has_monster()) {
break;
}
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."));
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);
}
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."));
#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"
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;
}
}
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;
}
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);
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);
}
continue;
}
- if (g_ref.m_idx == 0) {
+ if (!g_ref.has_monster()) {
this->remove_mirror(y, x);
}
}
}
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);
}
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);
}
#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"
continue;
}
- if (floor_ptr->grid_array[y][x].m_idx) {
+ if (floor_ptr->grid_array[y][x].has_monster()) {
continue;
}
continue;
}
- if (!grid.m_idx) {
+ if (!grid.has_monster()) {
continue;
}
continue;
}
- if (grid_neighbor.m_idx) {
+ if (grid_neighbor.has_monster()) {
continue;
}
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);
#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"
#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"
#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"
continue;
}
- if (grid.m_idx) {
+ if (grid.has_monster()) {
auto &monster = floor.m_list[grid.m_idx];
auto &monrace = monster.get_monrace();
#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"
/*!
* @brief メテオ系スペルの発動 / Cast a meteor spell
* @param player_ptr プレイヤーへの参照ポインタ
- * @param who スぺル詠唱者のモンスターID(0=プレイヤー)
+ * @param src_idx スぺル詠唱者のモンスターID(0=プレイヤー)
* @param typ 効果属性
* @param dam 威力
* @param rad 半径
* 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;
}
/*!
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);
#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"
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();
note_spot(player_ptr, point.y, point.x);
}
- if (grid.m_idx) {
+ if (grid.has_monster()) {
update_monster(player_ptr, grid.m_idx, false);
}
/*!
* @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;
}
/*!
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);
#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"
#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"
#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"
/*!
* @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;
if (!monster.is_valid()) {
continue;
}
- if (i == who) {
+ if (i == src_idx) {
continue;
}
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);
#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"
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;
}
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;
}
#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"
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);
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 を飛ばすべきだが、既存コードと同じように動くことを優先した.
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;
}
#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"
#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"
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();
#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"
lev = plev * 2 / 3 + randint1(plev / 2);
}
- MONSTER_IDX who;
+ MONSTER_IDX src_idx;
if (pet) {
/* Become pet */
mode |= PM_FORCE_PET;
}
/* 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;
}
}
/*!
* @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;
}
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;
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);
#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"
#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 バージョンが開発版が安定版かを返す(廃止予定)
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;
#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"
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)];
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;
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; //!< 能力フラグ(習性)
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
}
}
- 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;
}
#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"
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;
}
#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"
#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"
}
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;
#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"
/* 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;
#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"
#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)
#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"
#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"
#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"
#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"
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;
}
*/
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;
}
#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"
#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"
#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"
#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"
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;
}