#include "view/object-describer.h"
#include "world/world.h"
- /*
- * Not using graphical tiles for this feature?
- */
+/*
+ * Not using graphical tiles for this feature?
+ */
#define IS_ASCII_GRAPHICS(A) (!((A) & 0x80))
static int feat_priority; /*!< マップ縮小表示時に表示すべき地形の優先度を保管する */
#define ROW_RACE 1
#define COL_RACE 0 /* <race name> */
- /*#define ROW_CLASS 2 */
- /*#define COL_CLASS 0 */ /* <class name> */
-
#define ROW_TITLE 2
#define COL_TITLE 0 /* <title> or <mode> */
-/*#define ROW_SEIKAKU 4 */
-/*#define COL_SEIKAKU 0*/ /* <seikaku> */
-
#define ROW_DAY 21
#define COL_DAY 0 /* day */
*/
static void print_field(concptr info, TERM_LEN row, TERM_LEN col)
{
- /* Dump 13 spaces to clear */
c_put_str(TERM_WHITE, " ", row, col);
-
- /* Dump the info itself */
c_put_str(TERM_L_BLUE, info, row, col);
}
void print_time(player_type *player_ptr)
{
int day, hour, min;
-
- /* Dump 13 spaces to clear */
c_put_str(TERM_WHITE, " ", ROW_DAY, COL_DAY);
-
extract_day_hour_min(player_ptr, &day, &hour, &min);
-
- /* Dump the info itself */
if (day < 1000) c_put_str(TERM_WHITE, format(_("%2d日目", "Day%3d"), day), ROW_DAY, COL_DAY);
else c_put_str(TERM_WHITE, _("***日目", "Day***"), ROW_DAY, COL_DAY);
*/
static void print_dungeon(player_type *creature_ptr)
{
- /* Dump 13 spaces to clear */
c_put_str(TERM_WHITE, " ", ROW_DUNGEON, COL_DUNGEON);
-
concptr dungeon_name = map_name(creature_ptr);
-
TERM_LEN col = COL_DUNGEON + 6 - strlen(dungeon_name) / 2;
if (col < 0) col = 0;
- /* Dump the info itself */
c_put_str(TERM_L_UMBER, format("%s", dungeon_name),
ROW_DUNGEON, col);
}
static void print_stat(player_type *creature_ptr, int stat)
{
GAME_TEXT tmp[32];
-
- /* Display "injured" stat */
if (creature_ptr->stat_cur[stat] < creature_ptr->stat_max[stat])
{
put_str(stat_names_reduced[stat], ROW_STAT + stat, 0);
cnv_stat(creature_ptr->stat_use[stat], tmp);
c_put_str(TERM_YELLOW, tmp, ROW_STAT + stat, COL_STAT + 6);
}
-
- /* Display "healthy" stat */
else
{
put_str(stat_names[stat], ROW_STAT + stat, 0);
c_put_str(TERM_L_GREEN, tmp, ROW_STAT + stat, COL_STAT + 6);
}
- /* Indicate natural maximum */
if (creature_ptr->stat_max[stat] != creature_ptr->stat_max_max[stat])
return;
*/
#define ADD_FLG(FLG) (bar_flags[FLG / 32] |= (1L << (FLG % 32)))
- /*!
- * @brief 32ビット変数配列の指定位置のビットフラグが1かどうかを返す。
- * @param FLG フラグ位置(ビット)
- * @return 1ならば0以外を返す
- */
+/*!
+ * @brief 32ビット変数配列の指定位置のビットフラグが1かどうかを返す。
+ * @param FLG フラグ位置(ビット)
+ * @return 1ならば0以外を返す
+ */
#define IS_FLG(FLG) (bar_flags[FLG / 32] & (1L << (FLG % 32)))
- /*!
- * @brief 下部に状態表示を行う / Show status bar
- * @return なし
- */
+/*!
+ * @brief 下部に状態表示を行う / Show status bar
+ * @return なし
+ */
static void print_status(player_type *creature_ptr)
{
TERM_LEN wid, hgt;
BIT_FLAGS bar_flags[3];
bar_flags[0] = bar_flags[1] = bar_flags[2] = 0L;
- /* Tsuyoshi */
if (creature_ptr->tsuyoshi) ADD_FLG(BAR_TSUYOSHI);
- /* Hallucinating */
if (creature_ptr->image) ADD_FLG(BAR_HALLUCINATION);
- /* Blindness */
if (creature_ptr->blind) ADD_FLG(BAR_BLINDNESS);
- /* Paralysis */
if (creature_ptr->paralyzed) ADD_FLG(BAR_PARALYZE);
- /* Confusion */
if (creature_ptr->confused) ADD_FLG(BAR_CONFUSE);
- /* Posioned */
if (creature_ptr->poisoned) ADD_FLG(BAR_POISONED);
- /* Times see-invisible */
if (creature_ptr->tim_invis) ADD_FLG(BAR_SENSEUNSEEN);
- /* Timed esp */
if (is_time_limit_esp(creature_ptr)) ADD_FLG(BAR_TELEPATHY);
- /* Timed regenerate */
if (creature_ptr->tim_regen) ADD_FLG(BAR_REGENERATION);
- /* Timed infra-vision */
if (creature_ptr->tim_infra) ADD_FLG(BAR_INFRAVISION);
- /* Protection from evil */
if (creature_ptr->protevil) ADD_FLG(BAR_PROTEVIL);
- /* Invulnerability */
if (IS_INVULN(creature_ptr)) ADD_FLG(BAR_INVULN);
- /* Wraith form */
if (creature_ptr->wraith_form) ADD_FLG(BAR_WRAITH);
- /* Kabenuke */
if (creature_ptr->kabenuke) ADD_FLG(BAR_PASSWALL);
if (creature_ptr->tim_reflect) ADD_FLG(BAR_REFLECTION);
- /* Heroism */
if (IS_HERO(creature_ptr)) ADD_FLG(BAR_HEROISM);
- /* Super Heroism / berserk */
if (creature_ptr->shero) ADD_FLG(BAR_BERSERK);
- /* Blessed */
if (is_blessed(creature_ptr)) ADD_FLG(BAR_BLESSED);
- /* Shield */
if (creature_ptr->magicdef) ADD_FLG(BAR_MAGICDEFENSE);
if (creature_ptr->tsubureru) ADD_FLG(BAR_EXPAND);
if (creature_ptr->special_defense & NINJA_KAWARIMI) ADD_FLG(BAR_KAWARIMI);
- /* Oppose Acid */
if (creature_ptr->special_defense & DEFENSE_ACID) ADD_FLG(BAR_IMMACID);
if (is_oppose_acid(creature_ptr)) ADD_FLG(BAR_RESACID);
- /* Oppose Lightning */
if (creature_ptr->special_defense & DEFENSE_ELEC) ADD_FLG(BAR_IMMELEC);
if (is_oppose_elec(creature_ptr)) ADD_FLG(BAR_RESELEC);
- /* Oppose Fire */
if (creature_ptr->special_defense & DEFENSE_FIRE) ADD_FLG(BAR_IMMFIRE);
if (is_oppose_fire(creature_ptr)) ADD_FLG(BAR_RESFIRE);
- /* Oppose Cold */
if (creature_ptr->special_defense & DEFENSE_COLD) ADD_FLG(BAR_IMMCOLD);
if (is_oppose_cold(creature_ptr)) ADD_FLG(BAR_RESCOLD);
- /* Oppose Poison */
if (is_oppose_pois(creature_ptr)) ADD_FLG(BAR_RESPOIS);
- /* Word of Recall */
if (creature_ptr->word_recall) ADD_FLG(BAR_RECALL);
- /* Alter realiry */
if (creature_ptr->alter_reality) ADD_FLG(BAR_ALTER);
- /* Afraid */
if (creature_ptr->afraid) ADD_FLG(BAR_AFRAID);
- /* Resist time */
if (creature_ptr->tim_res_time) ADD_FLG(BAR_RESTIME);
if (creature_ptr->multishadow) ADD_FLG(BAR_MULTISHADOW);
- /* Confusing Hands */
if (creature_ptr->special_attack & ATTACK_CONFUSE) ADD_FLG(BAR_ATTKCONF);
if (creature_ptr->resist_magic) ADD_FLG(BAR_REGMAGIC);
- /* Ultimate-resistance */
if (creature_ptr->ult_res) ADD_FLG(BAR_ULTIMATE);
- /* tim levitation */
if (creature_ptr->tim_levitation) ADD_FLG(BAR_LEVITATE);
if (creature_ptr->tim_res_nether) ADD_FLG(BAR_RESNETH);
if (creature_ptr->dustrobe) ADD_FLG(BAR_DUSTROBE);
- /* Mahouken */
if (creature_ptr->special_attack & ATTACK_FIRE) ADD_FLG(BAR_ATTKFIRE);
if (creature_ptr->special_attack & ATTACK_COLD) ADD_FLG(BAR_ATTKCOLD);
if (creature_ptr->special_attack & ATTACK_ELEC) ADD_FLG(BAR_ATTKELEC);
if (creature_ptr->tim_sh_fire) ADD_FLG(BAR_SHFIRE);
- /* tim stealth */
if (is_time_limit_stealth(creature_ptr)) ADD_FLG(BAR_STEALTH);
if (creature_ptr->tim_sh_touki) ADD_FLG(BAR_TOUKI);
- /* Holy aura */
if (creature_ptr->tim_sh_holy) ADD_FLG(BAR_SHHOLY);
- /* An Eye for an Eye */
if (creature_ptr->tim_eyeeye) ADD_FLG(BAR_EYEEYE);
- /* Hex spells */
if (creature_ptr->realm1 == REALM_HEX)
{
if (hex_spelling(creature_ptr, HEX_BLESS)) ADD_FLG(BAR_BLESSED);
}
}
- /* Calcurate length */
TERM_LEN col = 0, num = 0;
for (int i = 0; bar[i].sstr; i++)
{
}
}
- /* If there are not excess spaces for long strings, use short one */
int space = 2;
if (col - 1 > max_col_statbar)
{
}
}
- /* If there are excess spaces for short string, use more */
if (col - 1 <= max_col_statbar - (num - 1))
{
space = 1;
}
}
- /* Centering display column */
col = (max_col_statbar - col) / 2;
-
- /* Display status bar */
for (int i = 0; bar[i].sstr; i++)
{
if (!IS_FLG(i)) continue;
static void print_title(player_type *creature_ptr)
{
GAME_TEXT str[14];
-
concptr p = "";
if (current_world_ptr->wizard)
{
*/
static void print_hp(player_type *creature_ptr)
{
- /* ヒットポイントの表示方法を変更 */
char tmp[32];
-
- /* タイトル */
put_str("HP", ROW_CURHP, COL_CURHP);
-
- /* 現在のヒットポイント */
sprintf(tmp, "%4ld", (long int)creature_ptr->chp);
-
TERM_COLOR color;
if (creature_ptr->chp >= creature_ptr->mhp)
{
}
c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 3);
-
- /* 区切り */
put_str("/", ROW_CURHP, COL_CURHP + 7);
-
- /* 最大ヒットポイント */
sprintf(tmp, "%4ld", (long int)creature_ptr->mhp);
color = TERM_L_GREEN;
-
c_put_str(color, tmp, ROW_CURHP, COL_CURHP + 8);
}
*/
static void print_sp(player_type *creature_ptr)
{
- /* マジックポイントの表示方法を変更している */
char tmp[32];
byte color;
-
- /* Do not show mana unless it matters */
if (!mp_ptr->spell_book) return;
- /* タイトル */
put_str(_("MP", "SP"), ROW_CURSP, COL_CURSP);
-
- /* 現在のマジックポイント */
sprintf(tmp, "%4ld", (long int)creature_ptr->csp);
-
if (creature_ptr->csp >= creature_ptr->msp)
{
color = TERM_L_GREEN;
}
c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 3);
-
- /* 区切り */
put_str("/", ROW_CURSP, COL_CURSP + 7);
-
- /* 最大マジックポイント */
sprintf(tmp, "%4ld", (long int)creature_ptr->msp);
color = TERM_L_GREEN;
-
c_put_str(color, tmp, ROW_CURSP, COL_CURSP + 8);
}
if (depth_in_feet) (void)sprintf(depths, _("%d ft", "%d ft"), (int)floor_ptr->dun_level * 50);
else (void)sprintf(depths, _("%d 階", "Lev %d"), (int)floor_ptr->dun_level);
- /* Get color of level based on feeling -JSV- */
switch (creature_ptr->feeling)
{
case 0: attr = TERM_SLATE; break; /* Unknown */
{
TERM_COLOR attr = TERM_WHITE;
GAME_TEXT text[16];
-
- /* Repeating */
if (command_rep)
{
if (command_rep > 999)
return;
}
- /* Action */
switch (player_ptr->action)
{
case ACTION_SEARCH:
break;
}
case ACTION_REST:
- /* Start with "Rest" */
strcpy(text, _(" ", " "));
-
if (player_ptr->resting > 0)
{
sprintf(text, "%4d", player_ptr->resting);
{
text[0] = text[1] = text[2] = text[3] = '&';
}
+
break;
case ACTION_LEARN:
case 2: attr = TERM_L_BLUE; break;
case 3: attr = TERM_L_RED; break;
}
+
strcpy(text, kamae_shurui[i].desc);
break;
}
int i;
for (i = 0; i < MAX_KATA; i++)
if (player_ptr->special_defense & (KATA_IAI << i)) break;
+
strcpy(text, kata_shurui[i].desc);
break;
}
TERM_LEN col_speed = wid + COL_SPEED;
TERM_LEN row_speed = hgt + ROW_SPEED;
- /* Hack -- Visually "undo" the Search Mode Slowdown */
int i = player_ptr->pspeed;
if (player_ptr->action == ACTION_SEARCH && !player_ptr->lightspeed) i += 10;
- /* Fast */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
bool is_fast = IS_FAST(player_ptr);
char buf[32] = "";
else attr = TERM_L_GREEN;
sprintf(buf, "%s(+%d)", (player_ptr->riding ? _("乗馬", "Ride") : _("加速", "Fast")), (i - 110));
}
-
- /* Slow */
else if (i < 110)
{
if (player_ptr->riding)
return;
}
- /* Not tracking */
if (!health_who)
{
- /* Erase the health bar */
Term_erase(col, row, 12);
return;
}
- /* Tracking an unseen monster */
if (!m_ptr->ml)
{
- /* Indicate that the monster health is "unknown" */
Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
return;
}
- /* Tracking a hallucinatory monster */
if (creature_ptr->image)
{
- /* Indicate that the monster health is "unknown" */
Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
return;
}
- /* Tracking a dead monster (???) */
if (m_ptr->hp < 0)
{
- /* Indicate that the monster health is "unknown" */
Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
return;
}
- /* Tracking a visible monster */
- /* Extract the "percent" of health */
int pct = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->maxhp : 0;
int pct2 = m_ptr->maxhp > 0 ? 100L * m_ptr->hp / m_ptr->max_maxhp : 0;
-
- /* Convert percent into "health" */
int len = (pct2 < 10) ? 1 : (pct2 < 90) ? (pct2 / 10 + 1) : 10;
-
- /* Default to almost dead */
TERM_COLOR attr = TERM_RED;
-
- /* Invulnerable */
if (monster_invulner_remaining(m_ptr)) attr = TERM_WHITE;
-
- /* Asleep */
else if (monster_csleep_remaining(m_ptr)) attr = TERM_BLUE;
-
- /* Afraid */
else if (monster_fear_remaining(m_ptr)) attr = TERM_VIOLET;
-
- /* Healthy */
else if (pct >= 100) attr = TERM_L_GREEN;
-
- /* Somewhat Wounded */
else if (pct >= 60) attr = TERM_YELLOW;
-
- /* Wounded */
else if (pct >= 25) attr = TERM_ORANGE;
-
- /* Badly wounded */
else if (pct >= 10) attr = TERM_L_RED;
- /* Default to "unknown" */
Term_putstr(col, row, 12, TERM_WHITE, "[----------]");
-
- /* Dump the current "health" (use '*' symbols) */
Term_putstr(col + 1, row, len, attr, "**********");
}
-
-
/*!
* @brief プレイヤーのステータスを一括表示する(左側部分) / Display basic info (mostly left of map)
* @param creature_ptr プレーヤーへの参照ポインタ
print_exp(creature_ptr);
for (int i = 0; i < A_MAX; i++)
print_stat(creature_ptr, i);
+
print_ac(creature_ptr);
print_hp(creature_ptr);
print_sp(creature_ptr);
*/
static void fix_inventory(player_type *player_ptr, tval_type item_tester_tval)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_INVEN))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
display_inventory(player_ptr, item_tester_tval);
Term_fresh();
Term_activate(old);
Term_gotoxy(x, y);
if (!r_ptr)return;
- //Number of 'U'nique
- //unique
if (r_ptr->flags1 & RF1_UNIQUE)
{
bool is_bounty = FALSE;
Term_addstr(-1, TERM_WHITE, buf);
}
- //symbol
Term_addstr(-1, TERM_WHITE, " ");
Term_add_bigch(r_ptr->x_attr, r_ptr->x_char);
- //LV
if (r_ptr->r_tkills && !(m_ptr->mflag2 & MFLAG2_KAGE))
{
sprintf(buf, " %2d", (int)r_ptr->level);
Term_addstr(-1, TERM_WHITE, buf);
- //name
sprintf(buf, " %s ", r_name + r_ptr->name);
Term_addstr(-1, TERM_WHITE, buf);
}
{
grid_type* g_ptr = &floor_ptr->grid_array[tmp_pos.y[i]][tmp_pos.x[i]];
if (!g_ptr->m_idx || !floor_ptr->m_list[g_ptr->m_idx].ml)
- continue;//no mons or cannot look
+ continue;
m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
if (is_pet(m_ptr)) continue;//pet
if (!m_ptr->r_idx) continue;//dead?
//ソート済みなので同じモンスターは連続する.これを利用して同じモンスターをカウント,まとめて表示する.
-
//先頭モンスター
if (!last_mons)
{
*/
static void fix_monster_list(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
-
- /* No relevant flags */
if (!(window_flag[j] & (PW_MONSTER_LIST))) continue;
- /* Activate */
Term_activate(angband_term[j]);
int w, h;
Term_get_size(&w, &h);
-
Term_clear();
-
- target_set_prepare_look(player_ptr);//モンスター一覧を生成,ソート
+ target_set_prepare_look(player_ptr);
print_monster_list(player_ptr->current_floor_ptr, 0, 0, h);
Term_fresh();
Term_activate(old);
*/
static void fix_equip(player_type *player_ptr, tval_type item_tester_tval)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
-
- /* No relevant flags */
if (!(window_flag[j] & (PW_EQUIP))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Display equipment */
display_equipment(player_ptr, item_tester_tval);
Term_fresh();
Term_activate(old);
*/
static void fix_spell(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_SPELL))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Display spell list */
display_spell_list(player_ptr);
Term_fresh();
Term_activate(old);
*/
static void fix_player(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_PLAYER))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
update_playtime();
display_player(player_ptr, 0, map_name);
Term_fresh();
*/
static void fix_message(void)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_MESSAGE))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
TERM_LEN w, h;
Term_get_size(&w, &h);
-
- /* Dump messages */
for (int i = 0; i < h; i++)
{
- /* Dump the message on the appropriate line */
Term_putstr(0, (h - 1) - i, -1, (byte)((i < now_message) ? TERM_WHITE : TERM_SLATE), message_str((s16b)i));
-
- /* Cursor */
TERM_LEN x, y;
Term_locate(&x, &y);
-
- /* Clear to end of line */
Term_erase(x, y, 255);
}
*/
static void fix_overhead(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
TERM_LEN wid, hgt;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_OVERHEAD))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Full map in too small window is useless */
Term_get_size(&wid, &hgt);
if (wid > COL_MAP + 2 && hgt > ROW_MAP + 2)
{
*/
static void fix_dungeon(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_DUNGEON))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Redraw dungeon view */
display_dungeon(player_ptr);
Term_fresh();
Term_activate(old);
*/
static void fix_monster(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_MONSTER))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Display monster race info */
if (player_ptr->monster_race_idx) display_roff(player_ptr);
+
Term_fresh();
Term_activate(old);
}
*/
static void fix_object(player_type *player_ptr)
{
- /* Scan windows */
for (int j = 0; j < 8; j++)
{
term *old = Term;
-
- /* No window */
if (!angband_term[j]) continue;
- /* No relevant flags */
if (!(window_flag[j] & (PW_OBJECT))) continue;
- /* Activate */
Term_activate(angband_term[j]);
-
- /* Display monster race info */
if (player_ptr->object_kind_idx) display_koff(player_ptr, player_ptr->object_kind_idx);
+
Term_fresh();
Term_activate(old);
}
bool is_heavy_shoot(player_type *creature_ptr, object_type *o_ptr)
{
int hold = adj_str_hold[creature_ptr->stat_ind[A_STR]];
- /* It is hard to carholdry a heavy bow */
return (hold < o_ptr->weight / 10);
}
{
if (!creature_ptr->redraw) return;
- /* Character is not ready yet, no screen updates */
if (!current_world_ptr->character_generated) return;
- /* Character is in "icky" mode, no screen updates */
if (current_world_ptr->character_icky) return;
- /* Hack -- clear the screen */
if (creature_ptr->redraw & (PR_WIPE))
{
creature_ptr->redraw &= ~(PR_WIPE);
if (creature_ptr->redraw & (PR_EQUIPPY))
{
creature_ptr->redraw &= ~(PR_EQUIPPY);
- print_equippy(creature_ptr); /* To draw / delete equippy chars */
+ print_equippy(creature_ptr);
}
if (creature_ptr->redraw & (PR_MISC))
{
if (!player_ptr->window) return;
- /* Scan windows */
BIT_FLAGS mask = 0L;
for (int j = 0; j < 8; j++)
{
- /* Save usable flags */
if (angband_term[j]) mask |= window_flag[j];
}
- /* Apply usable flags */
player_ptr->window &= mask;
- /* Nothing to do */
if (!player_ptr->window) return;
if (player_ptr->window & (PW_INVEN))
fix_inventory(player_ptr, 0); // TODO:2.2.2 まともなtval参照手段を確保
}
- /* Display equipment */
if (player_ptr->window & (PW_EQUIP))
{
player_ptr->window &= ~(PW_EQUIP);
fix_equip(player_ptr, 0); // TODO:2.2.2 まともなtval参照手段を確保
}
- /* Display spell list */
if (player_ptr->window & (PW_SPELL))
{
player_ptr->window &= ~(PW_SPELL);
fix_spell(player_ptr);
}
- /* Display player */
if (player_ptr->window & (PW_PLAYER))
{
player_ptr->window &= ~(PW_PLAYER);
fix_player(player_ptr);
}
- /* Display monster list */
if (player_ptr->window & (PW_MONSTER_LIST))
{
player_ptr->window &= ~(PW_MONSTER_LIST);
fix_monster_list(player_ptr);
}
- /* Display overhead view */
if (player_ptr->window & (PW_MESSAGE))
{
player_ptr->window &= ~(PW_MESSAGE);
fix_message();
}
- /* Display overhead view */
if (player_ptr->window & (PW_OVERHEAD))
{
player_ptr->window &= ~(PW_OVERHEAD);
fix_overhead(player_ptr);
}
- /* Display overhead view */
if (player_ptr->window & (PW_DUNGEON))
{
player_ptr->window &= ~(PW_DUNGEON);
fix_dungeon(player_ptr);
}
- /* Display monster recall */
if (player_ptr->window & (PW_MONSTER))
{
player_ptr->window &= ~(PW_MONSTER);
fix_monster(player_ptr);
}
- /* Display object recall */
if (player_ptr->window & (PW_OBJECT))
{
player_ptr->window &= ~(PW_OBJECT);
*/
void resize_map()
{
- /* Only if the dungeon exists */
if (!current_world_ptr->character_dungeon) return;
- /* Mega-Hack -- no panel yet */
panel_row_max = 0;
panel_col_max = 0;
-
- /* Reset the panels */
panel_row_min = p_ptr->current_floor_ptr->height;
panel_col_min = p_ptr->current_floor_ptr->width;
-
verify_panel(p_ptr);
p_ptr->update |= (PU_TORCH | PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
handle_stuff(p_ptr);
Term_redraw();
- /*
- * Waiting command;
- * Place the cursor on the player
- */
if (can_save) move_cursor_relative(p_ptr->y, p_ptr->x);
Term_fresh();
*/
void redraw_window(void)
{
- /* Only if the dungeon exists */
if (!current_world_ptr->character_dungeon) return;
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
TERM_LEN wid, hgt;
get_screen_size(&wid, &hgt);
- /* Apply the motion */
POSITION y = panel_row_min + dy * hgt / 2;
POSITION x = panel_col_min + dx * wid / 2;
- /* Verify the row */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
if (y > floor_ptr->height - hgt) y = floor_ptr->height - hgt;
if (y < 0) y = 0;
- /* Verify the col */
if (x > floor_ptr->width - wid) x = floor_ptr->width - wid;
if (x < 0) x = 0;
TERM_LEN wid, hgt;
Term_get_size(&wid, &hgt);
- /* Remove map offset */
wid -= COL_MAP + 2;
hgt -= ROW_MAP + 2;
- /* Access the cursor state */
int v;
(void)Term_get_cursor(&v);
- /* Hide the cursor */
(void)Term_set_cursor(0);
- /* Get bounds */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
POSITION xmin = (0 < panel_col_min) ? panel_col_min : 0;
POSITION xmax = (floor_ptr->width - 1 > panel_col_max) ? panel_col_max : floor_ptr->width - 1;
POSITION ymin = (0 < panel_row_min) ? panel_row_min : 0;
POSITION ymax = (floor_ptr->height - 1 > panel_row_max) ? panel_row_max : floor_ptr->height - 1;
- /* Bottom section of screen */
for (POSITION y = 1; y <= ymin - panel_row_prt; y++)
{
- /* Erase the section */
Term_erase(COL_MAP, y, wid);
}
- /* Top section of screen */
for (POSITION y = ymax - panel_row_prt; y <= hgt; y++)
{
- /* Erase the section */
Term_erase(COL_MAP, y, wid);
}
- /* Dump the map */
for (POSITION y = ymin; y <= ymax; y++)
{
- /* Scan the columns of row "y" */
for (POSITION x = xmin; x <= xmax; x++)
{
TERM_COLOR a;
SYMBOL_CODE c;
-
TERM_COLOR ta;
SYMBOL_CODE tc;
-
- /* Determine what is there */
map_info(player_ptr, y, x, &a, &c, &ta, &tc);
-
- /* Hack -- fake monochrome */
if (!use_graphics)
{
if (current_world_ptr->timewalk_m_idx) a = TERM_DARK;
else if (player_ptr->wraith_form) a = TERM_L_DARK;
}
- /* Efficiency -- Redraw that grid of the map */
Term_queue_bigchar(panel_col_of(x), y - panel_row_prt, a, c, ta, tc);
}
}
- /* Display player */
lite_spot(player_ptr, player_ptr->y, player_ptr->x);
-
- /* Restore the cursor */
(void)Term_set_cursor(v);
}
-/*!
- * 一般的にモンスターシンボルとして扱われる記号を定義する(幻覚処理向け) / Hack -- Legal monster codes
- */
+/* 一般的にモンスターシンボルとして扱われる記号を定義する(幻覚処理向け) / Hack -- Legal monster codes */
static char image_monster_hack[] = \
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
-/*!
- * 一般的にオブジェクトシンボルとして扱われる記号を定義する(幻覚処理向け) / Hack -- Legal object codes
- */
+/* 一般的にオブジェクトシンボルとして扱われる記号を定義する(幻覚処理向け) / Hack -- Legal object codes */
static char image_object_hack[] = "?/|\\\"!$()_-=[]{},~";
*/
static void image_random(TERM_COLOR *ap, SYMBOL_CODE *cp)
{
- /* Normally, assume monsters */
if (randint0(100) < 75)
{
image_monster(ap, cp);
}
-
- /* Otherwise, assume objects */
else
{
image_object(ap, cp);
/*!
* @brief Mコマンドによる縮小マップの表示を行う / Extract the attr/char to display at the given (legal) map location
- * @details
- * Basically, we "paint" the chosen attr/char in several passes, starting\n
- * with any known "terrain features" (defaulting to darkness), then adding\n
- * any known "objects", and finally, adding any known "monsters". This\n
- * is not the fastest method but since most of the calls to this function\n
- * are made for grids with no monsters or objects, it is fast enough.\n
- *\n
- * Note that this function, if used on the grid containing the "player",\n
- * will return the attr/char of the grid underneath the player, and not\n
- * the actual player attr/char itself, allowing a lot of optimization\n
- * in various "display" functions.\n
- *\n
- * Note that the "zero" entry in the feature/object/monster arrays are\n
- * used to provide "special" attr/char codes, with "monster zero" being\n
- * used for the player attr/char, "object zero" being used for the "stack"\n
- * attr/char, and "feature zero" being used for the "nothing" attr/char,\n
- * though this function makes use of only "feature zero".\n
- *\n
- * Note that monsters can have some "special" flags, including "ATTR_MULTI",\n
- * which means their color changes, and "ATTR_CLEAR", which means they take\n
- * the color of whatever is under them, and "CHAR_CLEAR", which means that\n
- * they take the symbol of whatever is under them. Technically, the flag\n
- * "CHAR_MULTI" is supposed to indicate that a monster looks strange when\n
- * examined, but this flag is currently ignored.\n
- *\n
- * Currently, we do nothing with multi-hued objects, because there are\n
- * not any. If there were, they would have to set "shimmer_objects"\n
- * when they were created, and then new "shimmer" code in "dungeon.c"\n
- * would have to be created handle the "shimmer" effect, and the code\n
- * in floor would have to be updated to create the shimmer effect.\n
- *\n
- * Note the effects of hallucination. Objects always appear as random\n
- * "objects", monsters as random "monsters", and normal grids occasionally\n
- * appear as random "monsters" or "objects", but note that these random\n
- * "monsters" and "objects" are really just "colored ascii symbols".\n
- *\n
- * Note that "floors" and "invisible traps" (and "zero" features) are\n
- * drawn as "floors" using a special check for optimization purposes,\n
- * and these are the only features which get drawn using the special\n
- * lighting effects activated by "view_special_lite".\n
- *\n
- * Note the use of the "mimic" field in the "terrain feature" processing,\n
- * which allows any feature to "pretend" to be another feature. This is\n
- * used to "hide" secret doors, and to make all "doors" appear the same,\n
- * and all "walls" appear the same, and "hidden" treasure stay hidden.\n
- * It is possible to use this field to make a feature "look" like a floor,\n
- * but the "special lighting effects" for floors will not be used.\n
- *\n
- * Note the use of the new "terrain feature" information. Note that the\n
- * assumption that all interesting "objects" and "terrain features" are\n
- * memorized allows extremely optimized processing below. Note the use\n
- * of separate flags on objects to mark them as memorized allows a grid\n
- * to have memorized "terrain" without granting knowledge of any object\n
- * which may appear in that grid.\n
- *\n
- * Note the efficient code used to determine if a "floor" grid is\n
- * "memorized" or "viewable" by the player, where the test for the\n
- * grid being "viewable" is based on the facts that (1) the grid\n
- * must be "lit" (torch-lit or perma-lit), (2) the grid must be in\n
- * line of sight, and (3) the player must not be blind, and uses the\n
- * assumption that all torch-lit grids are in line of sight.\n
- *\n
- * Note that floors (and invisible traps) are the only grids which are\n
- * not memorized when seen, so only these grids need to check to see if\n
- * the grid is "viewable" to the player (if it is not memorized). Since\n
- * most non-memorized grids are in fact walls, this induces *massive*\n
- * efficiency, at the cost of *forcing* the memorization of non-floor\n
- * grids when they are first seen. Note that "invisible traps" are\n
- * always treated exactly like "floors", which prevents "cheating".\n
- *\n
- * Note the "special lighting effects" which can be activated for floor\n
- * grids using the "view_special_lite" option (for "white" floor grids),\n
- * causing certain grids to be displayed using special colors. If the\n
- * player is "blind", we will use "dark gray", else if the grid is lit\n
- * by the torch, and the "view_yellow_lite" option is set, we will use\n
- * "yellow", else if the grid is "dark", we will use "dark gray", else\n
- * if the grid is not "viewable", and the "view_bright_lite" option is\n
- * set, and the we will use "slate" (gray). We will use "white" for all\n
- * other cases, in particular, for illuminated viewable floor grids.\n
- *\n
- * Note the "special lighting effects" which can be activated for wall\n
- * grids using the "view_granite_lite" option (for "white" wall grids),\n
- * causing certain grids to be displayed using special colors. If the\n
- * player is "blind", we will use "dark gray", else if the grid is lit\n
- * by the torch, and the "view_yellow_lite" option is set, we will use\n
- * "yellow", else if the "view_bright_lite" option is set, and the grid\n
- * is not "viewable", or is "dark", or is glowing, but not when viewed\n
- * from the player's current location, we will use "slate" (gray). We\n
- * will use "white" for all other cases, in particular, for correctly\n
- * illuminated viewable wall grids.\n
- *\n
- * Note that, when "view_granite_lite" is set, we use an inline version\n
- * of the "player_can_see_bold()" function to check the "viewability" of\n
- * grids when the "view_bright_lite" option is set, and we do NOT use\n
- * any special colors for "dark" wall grids, since this would allow the\n
- * player to notice the walls of illuminated rooms from a hallway that\n
- * happened to run beside the room. The alternative, by the way, would\n
- * be to prevent the generation of hallways next to rooms, but this\n
- * would still allow problems when digging towards a room.\n
- *\n
- * Note that bizarre things must be done when the "attr" and/or "char"\n
- * codes have the "high-bit" set, since these values are used to encode\n
- * various "special" pictures in some versions, and certain situations,\n
- * such as "multi-hued" or "clear" monsters, cause the attr/char codes\n
- * to be "scrambled" in various ways.\n
- *\n
- * Note that eventually we may use the "&" symbol for embedded treasure,\n
- * and use the "*" symbol to indicate multiple objects, though this will\n
- * have to wait for Angband 2.8.0 or later. Note that currently, this\n
- * is not important, since only one object or terrain feature is allowed\n
- * in each grid. If needed, "k_info[0]" will hold the "stack" attr/char.\n
- *\n
- * Note the assumption that doing "x_ptr = &x_info[x]" plus a few of\n
- * "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(player_type *player_ptr, POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp)
{
floor_type *floor_ptr = player_ptr->current_floor_ptr;
grid_type *g_ptr = &floor_ptr->grid_array[y][x];
-
OBJECT_IDX this_o_idx, next_o_idx = 0;
-
- /* Feature code (applying "mimic" field) */
FEAT_IDX feat = get_feat_mimic(g_ptr);
-
- /* Access floor */
feature_type *f_ptr = &f_info[feat];
-
TERM_COLOR a;
SYMBOL_CODE c;
-
- /* Boring grids (floors, etc) */
if (!have_flag(f_ptr->flags, FF_REMEMBER))
{
- /*
- * Handle Memorized or visible floor
- *
- * No visual when blinded.
- * (to prevent strange effects on darkness breath)
- * otherwise,
- * - Can see grids with CAVE_MARK.
- * - Can see grids with CAVE_LITE or CAVE_MNLT.
- * (Such grids also have CAVE_VIEW)
- * - Can see grids with CAVE_VIEW unless darkened by monsters.
- */
if (!player_ptr->blind &&
((g_ptr->info & (CAVE_MARK | CAVE_LITE | CAVE_MNLT)) ||
((g_ptr->info & CAVE_VIEW) && (((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) == CAVE_GLOW) || player_ptr->see_nocto))))
{
- /* Normal attr/char */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
-
if (player_ptr->wild_mode)
{
- /* Special lighting effects */
- /* Handle "night" */
if (view_special_lite && !is_daytime())
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
}
-
- /* Mega-Hack -- Handle "in-sight" and "darkened" grids */
else if (darkened_grid(player_ptr, g_ptr))
{
- /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
-
- /* Access darkness */
f_ptr = &f_info[feat];
-
- /* Char and attr of darkness */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
}
-
- /* Special lighting effects */
else if (view_special_lite)
{
- /* Handle "torch-lit" grids */
if (g_ptr->info & (CAVE_LITE | CAVE_MNLT))
{
- /* Torch lite */
if (view_yellow_lite)
{
- /* Use a brightly lit colour/tile */
a = f_ptr->x_attr[F_LIT_LITE];
c = f_ptr->x_char[F_LIT_LITE];
}
}
-
- /* Handle "dark" grids */
else if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
-
- /* Handle "out-of-sight" grids */
else if (!(g_ptr->info & CAVE_VIEW))
{
- /* Special flag */
if (view_bright_lite)
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
}
}
}
-
- /* Unknown */
else
{
- /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
-
- /* Access darkness */
f_ptr = &f_info[feat];
-
- /* Normal attr/char */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
}
}
-
- /* Interesting grids (non-floors) */
else
{
- /* Memorized grids */
if (g_ptr->info & CAVE_MARK)
{
- /* Normal attr/char */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
-
if (player_ptr->wild_mode)
{
- /* Special lighting effects */
- /* Handle "blind" or "night" */
if (view_granite_lite && (player_ptr->blind || !is_daytime()))
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
}
-
- /* Mega-Hack -- Handle "in-sight" and "darkened" grids */
else if (darkened_grid(player_ptr, g_ptr) && !player_ptr->blind)
{
if (have_flag(f_ptr->flags, FF_LOS) && have_flag(f_ptr->flags, FF_PROJECT))
{
- /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
-
- /* Access darkness */
f_ptr = &f_info[feat];
-
- /* Char and attr of darkness */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
}
else if (view_granite_lite && view_bright_lite)
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
}
-
- /* Special lighting effects */
else if (view_granite_lite)
{
- /* Handle "blind" */
if (player_ptr->blind)
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
-
- /* Handle "torch-lit" grids */
else if (g_ptr->info & (CAVE_LITE | CAVE_MNLT))
{
- /* Torch lite */
if (view_yellow_lite)
{
- /* Use a brightly lit colour/tile */
a = f_ptr->x_attr[F_LIT_LITE];
c = f_ptr->x_char[F_LIT_LITE];
}
}
-
- /* Handle "view_bright_lite" */
else if (view_bright_lite)
{
- /* Not viewable */
if (!(g_ptr->info & CAVE_VIEW))
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
-
- /* Not glowing */
else if ((g_ptr->info & (CAVE_GLOW | CAVE_MNDK)) != CAVE_GLOW)
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
-
- /* Not glowing correctly */
else if (!have_flag(f_ptr->flags, FF_LOS) && !check_local_illumination(player_ptr, y, x))
{
- /* Use a darkened colour/tile */
a = f_ptr->x_attr[F_LIT_DARK];
c = f_ptr->x_char[F_LIT_DARK];
}
}
}
}
-
- /* Unknown */
else
{
- /* Unsafe grid -- idea borrowed from Unangband */
feat = (view_unsafe_grids && (g_ptr->info & CAVE_UNSAFE)) ? feat_undetected : feat_none;
-
- /* Access feature */
f_ptr = &f_info[feat];
-
- /* Normal attr/char */
a = f_ptr->x_attr[F_LIT_STANDARD];
c = f_ptr->x_char[F_LIT_STANDARD];
}
if (feat_priority == -1) feat_priority = f_ptr->priority;
- /* Save the terrain info for the transparency effects */
(*tap) = a;
(*tcp) = c;
-
- /* Save the info */
(*ap) = a;
(*cp) = c;
- /* Hack -- rare random hallucination, except on outer dungeon walls */
if (player_ptr->image && one_in_(256))
image_random(ap, cp);
- /* Objects */
for (this_o_idx = g_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
o_ptr = &floor_ptr->o_list[this_o_idx];
next_o_idx = o_ptr->next_o_idx;
-
- /* Memorized objects */
if (!(o_ptr->marked & OM_FOUND)) continue;
if (display_autopick)
}
}
- /* Normal char */
(*cp) = object_char(o_ptr);
-
- /* Normal attr */
(*ap) = object_attr(o_ptr);
-
feat_priority = 20;
-
- /* Hack -- hallucination */
if (player_ptr->image) image_object(ap, cp);
break;
}
- /* Handle monsters */
if (g_ptr->m_idx && display_autopick != 0)
{
set_term_color(player_ptr, y, x, ap, cp);
}
monster_type *m_ptr = &floor_ptr->m_list[g_ptr->m_idx];
-
- /* Visible monster */
if (!m_ptr->ml)
{
set_term_color(player_ptr, y, x, ap, cp);
return;
}
-
monster_race *r_ptr = &r_info[m_ptr->ap_r_idx];
-
feat_priority = 30;
-
- /* Hallucination */
if (player_ptr->image)
{
- /*
- * Monsters with both CHAR_CLEAR and ATTR_CLEAR
- * flags are always unseen.
- */
if ((r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR)) == (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR))
{
/* Do nothing */
return;
}
- /* Monster attr/char */
a = r_ptr->x_attr;
c = r_ptr->x_char;
-
if (!(r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_SHAPECHANGER | RF1_ATTR_CLEAR
| RF1_ATTR_MULTI | RF1_ATTR_SEMIRAND)))
{
- /* Desired monster attr/char */
*ap = a;
*cp = c;
set_term_color(player_ptr, y, x, ap, cp);
return;
}
- /*
- * Monsters with both CHAR_CLEAR and ATTR_CLEAR
- * flags are always unseen.
- */
if ((r_ptr->flags1 & (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR)) == (RF1_CHAR_CLEAR | RF1_ATTR_CLEAR))
{
set_term_color(player_ptr, y, x, ap, cp);
return;
}
- /*** Monster's attr ***/
if ((r_ptr->flags1 & RF1_ATTR_CLEAR) && (*ap != TERM_DARK) && !use_graphics)
{
- /* Clear-attr */
/* Do nothing */
}
else if ((r_ptr->flags1 & RF1_ATTR_MULTI) && !use_graphics)
{
- /* Multi-hued attr */
if (r_ptr->flags2 & RF2_ATTR_ANY) *ap = randint1(15);
else switch (randint1(7))
{
}
else if ((r_ptr->flags1 & RF1_ATTR_SEMIRAND) && !use_graphics)
{
- /* Use semi-random attr (usually mimics' colors vary) */
*ap = g_ptr->m_idx % 15 + 1;
}
else
{
- /* Normal case */
*ap = a;
}
- /*** Monster's char ***/
if ((r_ptr->flags1 & RF1_CHAR_CLEAR) && (*cp != ' ') && !use_graphics)
{
set_term_color(player_ptr, y, x, ap, cp);
SYMBOL_CODE **mc;
byte **mp;
- /* Save lighting effects */
bool old_view_special_lite = view_special_lite;
bool old_view_granite_lite = view_granite_lite;
-
TERM_LEN hgt, wid, yrat, xrat;
-
int **match_autopick_yx;
object_type ***object_autopick_yx;
-
Term_get_size(&wid, &hgt);
hgt -= 2;
wid -= 14;
floor_type *floor_ptr = player_ptr->current_floor_ptr;
yrat = (floor_ptr->height + hgt - 1) / hgt;
xrat = (floor_ptr->width + wid - 1) / wid;
-
- /* Disable lighting effects */
view_special_lite = FALSE;
view_granite_lite = FALSE;
- /* Allocate the maps */
C_MAKE(ma, (hgt + 2), TERM_COLOR *);
C_MAKE(mc, (hgt + 2), char_ptr);
C_MAKE(mp, (hgt + 2), byte_ptr);
C_MAKE(match_autopick_yx, (hgt + 2), int*);
C_MAKE(object_autopick_yx, (hgt + 2), object_type **);
-
- /* Allocate and wipe each line map */
for (y = 0; y < (hgt + 2); y++)
{
- /* Allocate one row each array */
C_MAKE(ma[y], (wid + 2), TERM_COLOR);
C_MAKE(mc[y], (wid + 2), char);
C_MAKE(mp[y], (wid + 2), byte);
C_MAKE(match_autopick_yx[y], (wid + 2), int);
C_MAKE(object_autopick_yx[y], (wid + 2), object_type *);
-
for (x = 0; x < wid + 2; ++x)
{
match_autopick_yx[y][x] = -1;
object_autopick_yx[y][x] = NULL;
-
- /* Nothing here */
ma[y][x] = TERM_WHITE;
mc[y][x] = ' ';
-
- /* No priority */
mp[y][x] = 0;
}
}
- /* Allocate the maps */
C_MAKE(bigma, (floor_ptr->height + 2), TERM_COLOR *);
C_MAKE(bigmc, (floor_ptr->height + 2), char_ptr);
C_MAKE(bigmp, (floor_ptr->height + 2), byte_ptr);
-
- /* Allocate and wipe each line map */
for (y = 0; y < (floor_ptr->height + 2); y++)
{
- /* Allocate one row each array */
C_MAKE(bigma[y], (floor_ptr->width + 2), TERM_COLOR);
C_MAKE(bigmc[y], (floor_ptr->width + 2), char);
C_MAKE(bigmp[y], (floor_ptr->width + 2), byte);
-
for (x = 0; x < floor_ptr->width + 2; ++x)
{
- /* Nothing here */
bigma[y][x] = TERM_WHITE;
bigmc[y][x] = ' ';
-
- /* No priority */
bigmp[y][x] = 0;
}
}
- /* Fill in the map */
for (i = 0; i < floor_ptr->width; ++i)
{
for (j = 0; j < floor_ptr->height; ++j)
match_autopick = -1;
autopick_obj = NULL;
feat_priority = -1;
-
- /* Extract the current attr/char at that map location */
map_info(player_ptr, j, i, &ta, &tc, &ta, &tc);
-
- /* Extract the priority */
tp = (byte)feat_priority;
-
if (match_autopick != -1
&& (match_autopick_yx[y][x] == -1
|| match_autopick_yx[y][x] > match_autopick))
tp = 0x7f;
}
- /* Save the char, attr and priority */
bigmc[j + 1][i + 1] = tc;
bigma[j + 1][i + 1] = ta;
bigmp[j + 1][i + 1] = tp;
tc = bigmc[j + 1][i + 1];
ta = bigma[j + 1][i + 1];
tp = bigmp[j + 1][i + 1];
-
- /* rare feature has more priority */
if (mp[y][x] == tp)
{
int t;
tp++;
}
- /* Save "best" */
if (mp[y][x] < tp)
{
- /* Save the char, attr and priority */
mc[y][x] = tc;
ma[y][x] = ta;
mp[y][x] = tp;
}
}
- /* Corners */
x = wid + 1;
y = hgt + 1;
- /* Draw the corners */
mc[0][0] = mc[0][x] = mc[y][0] = mc[y][x] = '+';
-
- /* Draw the horizontal edges */
for (x = 1; x <= wid; x++) mc[0][x] = mc[y][x] = '-';
- /* Draw the vertical edges */
for (y = 1; y <= hgt; y++) mc[y][0] = mc[y][x] = '|';
- /* Display each map line in order */
for (y = 0; y < hgt + 2; ++y)
{
- /* Start a new line */
Term_gotoxy(COL_MAP, y);
-
- /* Display the line */
for (x = 0; x < wid + 2; ++x)
{
ta = ma[y][x];
tc = mc[y][x];
-
- /* Hack -- fake monochrome */
if (!use_graphics)
{
if (current_world_ptr->timewalk_m_idx) ta = TERM_DARK;
else if (player_ptr->wraith_form) ta = TERM_L_DARK;
}
- /* Add the character */
Term_add_bigch(ta, tc);
}
}
}
}
- /* Clear old display */
Term_putstr(0, y, 12, 0, " ");
-
if (match_autopick != -1)
display_shortened_item_name(player_ptr, autopick_obj, y);
}
- /* Player location */
(*cy) = player_ptr->y / yrat + 1 + ROW_MAP;
if (!use_bigtile)
(*cx) = player_ptr->x / xrat + 1 + COL_MAP;
else
(*cx) = (player_ptr->x / xrat + 1) * 2 + COL_MAP;
- /* Restore lighting effects */
view_special_lite = old_view_special_lite;
view_granite_lite = old_view_granite_lite;
- /* Free each line map */
for (y = 0; y < (hgt + 2); y++)
{
- /* Free one row each array */
C_KILL(ma[y], (wid + 2), TERM_COLOR);
C_KILL(mc[y], (wid + 2), SYMBOL_CODE);
C_KILL(mp[y], (wid + 2), byte);
C_KILL(object_autopick_yx[y], (wid + 2), object_type *);
}
- /* Free each line map */
C_KILL(ma, (hgt + 2), TERM_COLOR *);
C_KILL(mc, (hgt + 2), char_ptr);
C_KILL(mp, (hgt + 2), byte_ptr);
C_KILL(match_autopick_yx, (hgt + 2), int*);
C_KILL(object_autopick_yx, (hgt + 2), object_type **);
-
- /* Free each line map */
for (y = 0; y < (floor_ptr->height + 2); y++)
{
- /* Free one row each array */
C_KILL(bigma[y], (floor_ptr->width + 2), TERM_COLOR);
C_KILL(bigmc[y], (floor_ptr->width + 2), SYMBOL_CODE);
C_KILL(bigmp[y], (floor_ptr->width + 2), byte);
}
- /* Free each line map */
C_KILL(bigma, (floor_ptr->height + 2), TERM_COLOR *);
C_KILL(bigmc, (floor_ptr->height + 2), char_ptr);
C_KILL(bigmp, (floor_ptr->height + 2), byte_ptr);
{
screen_save();
prt(_("お待ち下さい...", "Please wait..."), 0, 0);
-
Term_fresh();
Term_clear();
-
display_autopick = 0;
- /* Display the map */
int cy, cx;
display_map(player_ptr, &cy, &cx);
-
if ((max_autopick == 0) || player_ptr->wild_mode)
{
put_str(_("何かキーを押すとゲームに戻ります", "Hit any key to continue"), 23, 30);
- /* Hilite the player */
move_cursor(cy, cx);
- /* Get any key */
inkey();
screen_load();
return;
}
display_autopick = ITEM_DISPLAY;
-
while (TRUE)
{
int wid, hgt;
Term_get_size(&wid, &hgt);
int row_message = hgt - 1;
-
put_str(_("何かキーを押してください('M':拾う 'N':放置 'D':M+N 'K':壊すアイテムを表示)",
" Hit M, N(for ~), K(for !), or D(same as M+N) to display auto-picker items."), row_message, 1);
-
move_cursor(cy, cx);
-
int i = inkey();
-
byte flag;
if ('M' == i)
flag = (DO_AUTOPICK | DO_QUERY_AUTOPICK);
break;
Term_fresh();
-
if (~display_autopick & flag)
display_autopick |= flag;
else
display_autopick &= ~flag;
+
display_map(player_ptr, &cy, &cx);
}
*/
void health_track(player_type *player_ptr, MONSTER_IDX m_idx)
{
- /* Mount monster is already tracked */
if (m_idx && m_idx == player_ptr->riding) return;
- /* Track a new guy */
player_ptr->health_who = m_idx;
-
- /* Redraw (later) */
player_ptr->redraw |= (PR_HEALTH);
}
*/
void move_cursor_relative(int row, int col)
{
- /* Real co-ords convert to screen positions */
row -= panel_row_prt;
-
- /* Go there */
Term_gotoxy(panel_col_of(col), row);
}
if (!display_path) return;
if (project_length == -1) return;
- /* Get projection path */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
path_n = project_path(player_ptr, path_g, (project_length ? project_length : MAX_RANGE), player_ptr->y, player_ptr->x, y, x, PROJECT_PATH | PROJECT_THRU);
-
player_ptr->redraw |= (PR_MAP);
handle_stuff(player_ptr);
-
- /* Draw path */
for (int i = 0; i < path_n; i++)
{
POSITION ny = GRID_Y(path_g[i]);
POSITION nx = GRID_X(path_g[i]);
grid_type *g_ptr = &floor_ptr->grid_array[ny][nx];
-
if (panel_contains(ny, nx))
{
TERM_COLOR a = default_color;
if (g_ptr->m_idx && floor_ptr->m_list[g_ptr->m_idx].ml)
{
- /* Determine what is there */
map_info(player_ptr, ny, nx, &a, &c, &ta, &tc);
if (!IS_ASCII_GRAPHICS(a))
}
c = '*';
-
- /* Hack -- Queue it */
Term_queue_bigchar(panel_col_of(nx), ny - panel_row_prt, a, c, ta, tc);
}
- /* Known Wall */
if ((g_ptr->info & CAVE_MARK) && !cave_have_flag_grid(g_ptr, FF_PROJECT)) break;
- /* Change color */
if (nx == x && ny == y) default_color = TERM_L_DARK;
}
}
/*
- * Hack -- track the given monster race
+ * Track the given monster race
*/
void monster_race_track(player_type *player_ptr, MONRACE_IDX r_idx)
{
/*
- * Hack -- track the given object kind
+ * Track the given object kind
*/
void object_kind_track(player_type *player_ptr, KIND_OBJECT_IDX k_idx)
{
*/
void update_playtime(void)
{
- /* Check if the game has started */
if (current_world_ptr->start_time != 0)
{
u32b tmp = (u32b)time(NULL);
/*
- * Mega-Hack -- Delayed visual update
+ * Delayed visual update
* Only used if update_view(), update_lite() or update_mon_lite() was called
*/
void delayed_visual_update(player_type *player_ptr)
{
- /* Update needed grids */
floor_type *floor_ptr = player_ptr->current_floor_ptr;
for (int i = 0; i < floor_ptr->redraw_n; i++)
{
POSITION x = floor_ptr->redraw_x[i];
grid_type *g_ptr;
g_ptr = &floor_ptr->grid_array[y][x];
-
- /* Update only needed grids (prevent multiple updating) */
if (!(g_ptr->info & CAVE_REDRAW)) continue;
- /* If required, note */
if (g_ptr->info & CAVE_NOTE) note_spot(player_ptr, y, x);
lite_spot(player_ptr, y, x);
-
- /* Hack -- Visual update of monster on this grid */
if (g_ptr->m_idx) update_monster(player_ptr, g_ptr->m_idx, FALSE);
- /* No longer in the array */
g_ptr->info &= ~(CAVE_NOTE | CAVE_REDRAW);
}
- /* None left */
floor_ptr->redraw_n = 0;
}