#include "cmd-io/cmd-dump.h"
#include "cmd-io/cmd-save.h"
#include "core/disturbance.h"
-#include "dungeon/dungeon.h"
#include "dungeon/quest.h"
#include "effect/effect-characteristics.h"
#include "effect/effect-processor.h"
#include "status/bad-status-setter.h"
#include "status/base-status.h"
#include "status/element-resistance.h"
+#include "system/dungeon-info.h"
#include "system/floor-type-definition.h"
#include "system/grid-type-definition.h"
-#include "system/monster-type-definition.h"
+#include "system/monster-entity.h"
#include "system/player-type-definition.h"
+#include "system/terrain-type-definition.h"
#include "target/projection-path-calculator.h"
#include "timed-effect/player-cut.h"
#include "timed-effect/timed-effects.h"
* That is, it does not make sense to have spiked pits at 50 feet.\n
* Actually, it is not this routine, but the "trap instantiation"\n
* code, which should also check for "trap doors" on quest levels.\n
+ * @todo 引数はFloorType に差し替え可能
*/
FEAT_IDX choose_random_trap(PlayerType *player_ptr)
{
FEAT_IDX feat;
/* Pick a trap */
- auto *floor_ptr = player_ptr->current_floor_ptr;
+ const auto &floor = *player_ptr->current_floor_ptr;
while (true) {
- feat = normal_traps[randint0(normal_traps.size())];
+ feat = rand_choice(normal_traps);
/* Accept non-trapdoors */
- if (f_info[feat].flags.has_not(FloorFeatureType::MORE)) {
+ if (terrains_info[feat].flags.has_not(TerrainCharacteristics::MORE)) {
break;
}
/* Hack -- no trap doors on special levels */
- if (floor_ptr->inside_arena || inside_quest(quest_number(player_ptr, floor_ptr->dun_level))) {
+ if (floor.inside_arena || inside_quest(quest_number(floor, floor.dun_level))) {
continue;
}
/* Hack -- no trap doors on the deepest level */
- if (floor_ptr->dun_level >= d_info[floor_ptr->dungeon_idx].maxdepth) {
+ if (floor.dun_level >= floor.get_dungeon_definition().maxdepth) {
continue;
}
{
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
- if (g_ptr->cave_has_flag(FloorFeatureType::SECRET)) {
+ if (g_ptr->cave_has_flag(TerrainCharacteristics::SECRET)) {
/* No longer hidden */
- cave_alter_feat(player_ptr, y, x, FloorFeatureType::SECRET);
+ cave_alter_feat(player_ptr, y, x, TerrainCharacteristics::SECRET);
} else if (g_ptr->mimic) {
/* No longer hidden */
g_ptr->mimic = 0;
int i, num, dam;
POSITION x = player_ptr->x, y = player_ptr->y;
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
- auto *f_ptr = &f_info[g_ptr->feat];
- TrapType trap_feat_type = f_ptr->flags.has(FloorFeatureType::TRAP) ? i2enum<TrapType>(f_ptr->subtype) : TrapType::NOT_TRAP;
+ auto *f_ptr = &terrains_info[g_ptr->feat];
+ TrapType trap_feat_type = f_ptr->flags.has(TerrainCharacteristics::TRAP) ? i2enum<TrapType>(f_ptr->subtype) : TrapType::NOT_TRAP;
concptr name = _("トラップ", "a trap");
disturb(player_ptr, false, true);
- cave_alter_feat(player_ptr, y, x, FloorFeatureType::HIT_TRAP);
+ cave_alter_feat(player_ptr, y, x, TerrainCharacteristics::HIT_TRAP);
/* Analyze */
switch (trap_feat_type) {
do_cmd_save_game(player_ptr, true);
}
- exe_write_diary(player_ptr, DIARY_DESCRIPTION, 0, _("落とし戸に落ちた", "fell through a trap door!"));
+ exe_write_diary(player_ptr, DiaryKind::DESCRIPTION, 0, _("落とし戸に落ちた", "fell through a trap door!"));
prepare_change_floor_mode(player_ptr, CFM_SAVE_FLOORS | CFM_DOWN | CFM_RAND_PLACE | CFM_RAND_CONNECT);
player_ptr->leaving = true;
}
/* Let them fight each other */
if (evil_idx && good_idx) {
- monster_type *evil_ptr = &player_ptr->current_floor_ptr->m_list[evil_idx];
- monster_type *good_ptr = &player_ptr->current_floor_ptr->m_list[good_idx];
+ MonsterEntity *evil_ptr = &player_ptr->current_floor_ptr->m_list[evil_idx];
+ MonsterEntity *good_ptr = &player_ptr->current_floor_ptr->m_list[good_idx];
evil_ptr->target_y = good_ptr->fy;
evil_ptr->target_x = good_ptr->fx;
good_ptr->target_y = evil_ptr->fy;
}
if (break_trap && is_trap(player_ptr, g_ptr->feat)) {
- cave_alter_feat(player_ptr, y, x, FloorFeatureType::DISARM);
+ cave_alter_feat(player_ptr, y, x, TerrainCharacteristics::DISARM);
msg_print(_("トラップを粉砕した。", "You destroyed the trap."));
}
}