-
- /*!
- * @file grid.c
- * @brief グリッドの実装 / low level dungeon routines -BEN-
- * @date 2013/12/30
- * @author
- * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
- *\n
- * This software may be copied and distributed for educational, research,\n
- * and not for profit purposes provided that this copyright and statement\n
- * are included in all such copies. Other copyrights may also apply.\n
- * \n
- * Support for Adam Bolt's tileset, lighting and transparency effects\n
- * by Robert Ruehlmann (rr9@angband.org)\n
- * \n
- * 2013 Deskull Doxygen向けのコメント整理\n
- */
-
+/*!
+ * @file grid.c
+ * @brief グリッドの実装 / low level dungeon routines -BEN-
+ * @date 2013/12/30
+ * @author
+ * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke\n
+ *\n
+ * This software may be copied and distributed for educational, research,\n
+ * and not for profit purposes provided that this copyright and statement\n
+ * are included in all such copies. Other copyrights may also apply.\n
+ * \n
+ * Support for Adam Bolt's tileset, lighting and transparency effects\n
+ * by Robert Ruehlmann (rr9@angband.org)\n
+ * \n
+ * 2013 Deskull Doxygen向けのコメント整理\n
+ */
#include "angband.h"
#include "util.h"
/*
+ * todo ここにplayer_type を追加した時のコンパイルエラーに対処できなかったので保留
* Memorize interesting viewable object/features in the given grid
*
* This function should only be called on "legal" grids.
TERM_COLOR ta;
SYMBOL_CODE tc;
- map_info(y, x, &a, &c, &ta, &tc);
+ map_info(p_ptr, y, x, &a, &c, &ta, &tc);
/* Hack -- fake monochrome */
if (!use_graphics)
if (newfeat == oldfeat) return;
/* Set the new feature */
- cave_set_feat(floor_ptr, y, x, newfeat);
+ cave_set_feat(player_ptr, y, x, newfeat);
if (!(feature_action_flags[action] & FAF_NO_DROP))
{
return TRUE;
}
+
+void place_solid_perm_grid(grid_type *g_ptr)
+{
+ g_ptr->feat = feat_permanent;
+ g_ptr->info &= ~(CAVE_MASK);
+ g_ptr->info |= CAVE_SOLID;
+ if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
+}
+
+
+void place_grid(grid_type *g_ptr, place_grid_type pg_type)
+{
+ switch (pg_type)
+ {
+ case floor:
+ {
+ g_ptr->feat = feat_ground_type[randint0(100)];
+ g_ptr->info |= CAVE_FLOOR;
+ break;
+ }
+ case extra:
+ {
+ g_ptr->feat = feat_wall_type[randint0(100)];
+ g_ptr->info |= CAVE_EXTRA;
+ break;
+ }
+ case inner:
+ {
+ g_ptr->feat = feat_wall_inner;
+ g_ptr->info |= CAVE_INNER;
+ break;
+ }
+ case inner_perm:
+ {
+ g_ptr->feat = feat_permanent;
+ g_ptr->info |= CAVE_INNER;
+ break;
+ }
+ case outer:
+ {
+ g_ptr->feat = feat_wall_outer;
+ g_ptr->info |= CAVE_OUTER;
+ break;
+ }
+ case outer_noperm:
+ {
+ feature_type *f_ptr = &f_info[feat_wall_outer];
+ if (permanent_wall(f_ptr))
+ {
+ g_ptr->feat = (s16b)feat_state(feat_wall_outer, FF_UNPERM);
+ }
+ else
+ {
+ g_ptr->feat = feat_wall_outer;
+ }
+
+ g_ptr->info |= (CAVE_OUTER | CAVE_VAULT);
+ break;
+ }
+ case solid_perm:
+ {
+ g_ptr->feat = feat_permanent;
+ g_ptr->info |= CAVE_SOLID;
+ break;
+ }
+ default:
+ return;
+ }
+
+ g_ptr->info &= ~(CAVE_MASK);
+ if (g_ptr->m_idx) delete_monster_idx(g_ptr->m_idx);
+}
+
+
+/*!
+ * モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster?
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param g_ptr グリッドへの参照ポインタ
+ * @return 照明が消されている地形ならばTRUE
+ */
+bool darkened_grid(player_type *player_ptr, grid_type *g_ptr)
+{
+ return ((g_ptr->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) &&
+ !player_ptr->see_nocto;
+}