#include "angband.h"
+#include "world.h"
+#include "projection.h"
static byte display_autopick; /*!< 自動拾い状態の設定フラグ */
static int match_autopick;
* @param feat 地形情報のID
* @return 罠持ちの地形ならばTRUEを返す。
*/
-bool is_trap(IDX feat)
+bool is_trap(FEAT_IDX feat)
{
return have_flag(f_info[feat].flags, FF_TRAP);
}
* @param feat 地形情報のID
* @return 閉じたドアのある地形ならばTRUEを返す。
*/
-bool is_closed_door(IDX feat)
+bool is_closed_door(FEAT_IDX feat)
{
feature_type *f_ptr = &f_info[feat];
POSITION dx, dy;
/* Absolute */
- int ax, ay;
+ POSITION ax, ay;
/* Signs */
- int sx, sy;
+ POSITION sx, sy;
/* Fractions */
- int qx, qy;
+ POSITION qx, qy;
/* Scanners */
- int tx, ty;
+ POSITION tx, ty;
/* Scale factors */
- int f1, f2;
+ POSITION f1, f2;
/* Slope, or 1/Slope, of LOS */
- int m;
+ POSITION m;
/* Extract the offset */
/* Blind players see nothing */
if (p_ptr->blind) return FALSE;
- /* Access the cave grid */
c_ptr = &cave[y][x];
/* Note that "torch-lite" yields "illumination" */
* @param cp 本来のシンボル
* @return なし
*/
-static void image_monster(TERM_COLOR *ap, char *cp)
+static void image_monster(TERM_COLOR *ap, SYMBOL_CODE *cp)
{
/* Random symbol from set above */
if (use_graphics)
* @param cp 本来のシンボル
* @return なし
*/
-static void image_object(TERM_COLOR *ap, char *cp)
+static void image_object(TERM_COLOR *ap, SYMBOL_CODE *cp)
{
if (use_graphics)
{
* @param cp 本来のシンボル
* @return なし
*/
-static void image_random(TERM_COLOR *ap, char *cp)
+static void image_random(TERM_COLOR *ap, SYMBOL_CODE *cp)
{
/* Normally, assume monsters */
if (randint0(100) < 75)
* "x_ptr->xxx", is quicker than "x_info[x].xxx", if this is incorrect\n
* then a whole lot of code should be changed... XXX XXX\n
*/
-void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, char *tcp)
+void map_info(POSITION y, POSITION x, TERM_COLOR *ap, char *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
/* Get the cave */
cave_type *c_ptr = &cave[y][x];
feature_type *f_ptr = &f_info[feat];
TERM_COLOR a;
- byte c;
+ SYMBOL_CODE c;
/* Boring grids (floors, etc) */
if (!have_flag(f_ptr->flags, FF_REMEMBER))
if (player_bold(y, x))
{
monster_race *r_ptr = &r_info[0];
-
- /* Get the "player" attr */
*ap = r_ptr->x_attr;
-
- /* Get the "player" char */
*cp = r_ptr->x_char;
-
feat_priority = 31;
}
}
/*
* Place an attr/char pair at the given map coordinate, if legal.
*/
-void print_rel(char c, byte a, TERM_LEN y, TERM_LEN x)
+void print_rel(SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x)
{
/* Only do "legal" locations */
if (panel_contains(y, x))
if (view_torch_grids &&
((c_ptr->info & (CAVE_LITE | CAVE_MNLT)) || p_ptr->see_nocto))
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
/* Option -- memorize all perma-lit floors */
else if (view_perma_grids && ((c_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW))
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
}
/* Memorize normal grids */
else if (have_flag(f_ptr->flags, FF_LOS))
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
/* Memorize torch-lit walls */
else if (c_ptr->info & (CAVE_LITE | CAVE_MNLT))
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
/* Memorize walls seen by noctovision of Ninja */
else if (p_ptr->see_nocto)
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
/* Memorize certain non-torch-lit wall grids */
else if (check_local_illumination(y, x))
{
- /* Memorize */
c_ptr->info |= (CAVE_MARK);
}
}
{
TERM_LEN x, y;
TERM_COLOR a;
- char c;
+ SYMBOL_CODE c;
TERM_COLOR ta = 0;
- char tc = '\0';
+ SYMBOL_CODE tc = '\0';
for (x = p_ptr->x - Term->wid / 2 + 1; x <= p_ptr->x + Term->wid / 2; x++)
{
if (panel_contains(y, x) && in_bounds2(y, x))
{
TERM_COLOR a;
- char c;
+ SYMBOL_CODE c;
TERM_COLOR ta;
- char tc;
+ SYMBOL_CODE tc;
/* Examine the grid */
map_info(y, x, &a, &c, &ta, &tc);
*/
void prt_map(void)
{
- int x, y;
- int v;
+ POSITION x, y;
+ int v;
/* map bounds */
- s16b xmin, xmax, ymin, ymax;
+ POSITION xmin, xmax, ymin, ymax;
- int wid, hgt;
+ TERM_LEN wid, hgt;
Term_get_size(&wid, &hgt);
for (x = xmin; x <= xmax; x++)
{
TERM_COLOR a;
- char c;
+ SYMBOL_CODE c;
TERM_COLOR ta;
- char tc;
+ SYMBOL_CODE tc;
/* Determine what is there */
map_info(y, x, &a, &c, &ta, &tc);
}
-static cptr simplify_list[][2] =
+static concptr simplify_list[][2] =
{
#ifdef JP
{"の魔法書", ""},
int i;
for (i = 0; simplify_list[i][1]; i++)
{
- cptr org_w = simplify_list[i][0];
+ concptr org_w = simplify_list[i][0];
if (*org_w == '^')
{
if (!strncmp(c, org_w, strlen(org_w)))
{
char *s = c;
- cptr tmp = simplify_list[i][1];
+ concptr tmp = simplify_list[i][1];
while (*tmp)
*s++ = *tmp++;
tmp = c + strlen(org_w);
int i, j, x, y;
TERM_COLOR ta;
- char tc;
+ SYMBOL_CODE tc;
byte tp;
TERM_COLOR **bigma;
- char **bigmc;
+ SYMBOL_CODE **bigmc;
byte **bigmp;
TERM_COLOR **ma;
- char **mc;
+ SYMBOL_CODE **mc;
byte **mp;
/* Save lighting effects */
bool old_view_special_lite = view_special_lite;
bool old_view_granite_lite = view_granite_lite;
- int hgt, wid, yrat, xrat;
+ TERM_LEN hgt, wid, yrat, xrat;
int **match_autopick_yx;
object_type ***object_autopick_yx;
{
/* Free one row each array */
C_KILL(ma[y], (wid + 2), TERM_COLOR);
- C_KILL(mc[y], (wid + 2), char);
+ C_KILL(mc[y], (wid + 2), SYMBOL_CODE);
C_KILL(mp[y], (wid + 2), byte);
C_KILL(match_autopick_yx[y], (wid + 2), int);
C_KILL(object_autopick_yx[y], (wid + 2), object_type *);
{
/* Free one row each array */
C_KILL(bigma[y], (cur_wid + 2), TERM_COLOR);
- C_KILL(bigmc[y], (cur_wid + 2), char);
+ C_KILL(bigmc[y], (cur_wid + 2), SYMBOL_CODE);
C_KILL(bigmp[y], (cur_wid + 2), byte);
}
screen_save();
- /* Note */
prt(_("お待ち下さい...", "Please wait..."), 0, 0);
Term_fresh();
/* Get any key */
inkey();
}
-
- /* Restore the screen */
screen_load();
}
void cave_alter_feat(POSITION y, POSITION x, int action)
{
/* Set old feature */
- IDX oldfeat = cave[y][x].feat;
+ FEAT_IDX oldfeat = cave[y][x].feat;
/* Get the new feat */
- IDX newfeat = feat_state(oldfeat, action);
+ FEAT_IDX newfeat = feat_state(oldfeat, action);
/* No change */
if (newfeat == oldfeat) return;
return TRUE;
}
+
+/*!
+ * @brief 地形は開くものであって、かつ開かれているかを返す /
+ * Attempt to open the given chest at the given location
+ * @param feat 地形ID
+ * @return 開いた地形である場合TRUEを返す / Return TRUE if the given feature is an open door
+ */
+bool is_open(FEAT_IDX feat)
+{
+ return have_flag(f_info[feat].flags, FF_CLOSE) && (feat != feat_state(feat, FF_CLOSE));
+}