/* Hack -- lower limit */
if (p_ptr->exp < 0) p_ptr->exp = 0;
-
- /* Hack -- lower limit */
if (p_ptr->max_exp < 0) p_ptr->max_exp = 0;
+ if (p_ptr->max_max_exp < 0) p_ptr->max_max_exp = 0;
/* Hack -- upper limit */
if (p_ptr->exp > PY_MAX_EXP) p_ptr->exp = PY_MAX_EXP;
-
- /* Hack -- upper limit */
if (p_ptr->max_exp > PY_MAX_EXP) p_ptr->max_exp = PY_MAX_EXP;
+ if (p_ptr->max_max_exp > PY_MAX_EXP) p_ptr->max_max_exp = PY_MAX_EXP;
/* Hack -- maintain "max" experience */
if (p_ptr->exp > p_ptr->max_exp) p_ptr->max_exp = p_ptr->exp;
+ /* Hack -- maintain "max max" experience */
+ if (p_ptr->max_exp > p_ptr->max_max_exp) p_ptr->max_max_exp = p_ptr->max_exp;
+
/* Redraw experience */
p_ptr->redraw |= (PR_EXP);
msg_format("¥ì¥Ù¥ë %d ¤Ë¤è¤¦¤³¤½¡£", p_ptr->lev);
#else
msg_format("Welcome to level %d.", p_ptr->lev);
+
#endif
/* Update some stuff */
p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
/* Redraw some stuff */
- p_ptr->redraw |= (PR_LEV | PR_TITLE);
+ p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP);
/* Window stuff */
- p_ptr->window |= (PW_PLAYER | PW_SPELL);
+ p_ptr->window |= (PW_PLAYER | PW_SPELL | PW_INVEN);
/* HP¤ÈMP¤Î¾å¾ºÎ̤òɽ¼¨ */
level_up = 1;
*/
static int get_coin_type(int r_idx)
{
- monster_race *r_ptr = &r_info[r_idx];
-
- /* Analyze "coin" monsters */
- if (r_ptr->d_char == '$')
+ /* Analyze monsters */
+ switch (r_idx)
{
- /* Look for textual clues */
- switch (r_idx)
- {
- case MON_COPPER_COINS: return (2);
- case MON_SILVER_COINS: return (5);
- case MON_GOLD_COINS: return (10);
- case MON_MITHRIL_COINS: return (16);
- case MON_ADAMANT_COINS: return (17);
- }
+ case MON_COPPER_COINS: return 2;
+ case MON_SILVER_COINS: return 5;
+ case MON_GOLD_COINS: return 10;
+ case MON_MITHRIL_COINS:
+ case MON_MITHRIL_GOLEM: return 16;
+ case MON_ADAMANT_COINS: return 17;
}
/* Assume nothing */
- return (0);
+ return 0;
}
/*
+ * Hack -- determine if a template is hafted weapon
+ */
+static bool kind_is_hafted(int k_idx)
+{
+ object_kind *k_ptr = &k_info[k_idx];
+
+ /* Analyze the item type */
+ if (k_ptr->tval == TV_HAFTED)
+ {
+ return (TRUE);
+ }
+
+ /* Assume not good */
+ return (FALSE);
+}
+
+
+/*
* Check for "Quest" completion when a quest monster is killed or charmed.
*/
void check_quest_completion(monster_type *m_ptr)
cave_set_feat(y, x, FEAT_MORE);
/* Remember to update everything */
- p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS);
+ p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MONSTERS | PU_MON_LITE);
}
/*
}
}
+
+/*
+ * Return monster death string
+ */
+cptr extract_note_dies(monster_race *r_ptr)
+{
+ /* Some monsters get "destroyed" */
+ if (!monster_living(r_ptr))
+ {
+ int i;
+
+ for (i = 0; i < 4; i++)
+ {
+ if (r_ptr->blow[i].method == RBM_EXPLODE)
+ {
+#ifdef JP
+ return "¤ÏÇúȯ¤·¤ÆÊ´¡¹¤Ë¤Ê¤Ã¤¿¡£";
+#else
+ return " explodes into tiny shreds.";
+#endif
+ }
+ }
+
+#ifdef JP
+ return "¤òÅݤ·¤¿¡£";
+#else
+ return " is destroyed.";
+#endif
+ }
+
+ /* Assume a default death */
+#ifdef JP
+ return "¤Ï»à¤ó¤À¡£";
+#else
+ return " dies.";
+#endif
+}
+
+
/*
* Handle the "death" of a monster.
*
bool do_gold = (!(r_ptr->flags1 & RF1_ONLY_ITEM));
bool do_item = (!(r_ptr->flags1 & RF1_ONLY_GOLD));
- bool cloned = FALSE;
+ bool cloned = (m_ptr->smart & SM_CLONED) ? TRUE : FALSE;
int force_coin = get_coin_type(m_ptr->r_idx);
object_type forge;
bool drop_chosen_item = drop_item && !cloned && !p_ptr->inside_arena
&& !p_ptr->inside_battle && !is_pet(m_ptr);
-
- if (world_monster) world_monster = FALSE;
+ /* The caster is dead? */
+ if (world_monster && world_monster == m_idx) world_monster = 0;
/* Notice changes in view */
- if (r_ptr->flags7 & (RF7_HAS_LITE_1 | RF7_HAS_LITE_2 | RF7_SELF_LITE_1 | RF7_SELF_LITE_2))
+ if (r_ptr->flags7 & (RF7_LITE_MASK | RF7_DARK_MASK))
{
/* Update some things */
p_ptr->update |= (PU_MON_LITE);
y = m_ptr->fy;
x = m_ptr->fx;
- if (m_ptr->smart & SM_CLONED)
- cloned = TRUE;
-
if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
{
char m_name[80];
- monster_desc(m_name, m_ptr, 0x08);
+ monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
do_cmd_write_nikki(NIKKI_NAMED_PET, 3, m_name);
}
/* Handle the possibility of player vanquishing arena combatant -KMW- */
if (p_ptr->inside_arena && !is_pet(m_ptr))
{
- char m_name[80];
-
- /* Extract monster name */
- monster_desc(m_name, m_ptr, 0);
-
p_ptr->exit_bldg = TRUE;
if (p_ptr->arena_number > MAX_ARENA_MONS)
if (p_ptr->arena_number > MAX_ARENA_MONS) p_ptr->arena_number++;
p_ptr->arena_number++;
- if (record_arena) do_cmd_write_nikki(NIKKI_ARENA, p_ptr->arena_number, m_name);
+ if (record_arena)
+ {
+ char m_name[80];
+
+ /* Extract monster name */
+ monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
+
+ do_cmd_write_nikki(NIKKI_ARENA, p_ptr->arena_number, m_name);
+ }
}
if (m_idx == p_ptr->riding)
if (one_in_(r_ptr->flags1 & RF1_UNIQUE ? 1 : 4) &&
((r_ptr->flags9 & RF9_DROP_CORPSE) ||
(r_ptr->flags9 & RF9_DROP_SKELETON)) &&
- !(p_ptr->inside_arena || p_ptr->inside_battle || (m_ptr->smart & SM_CLONED) || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
+ !(p_ptr->inside_arena || p_ptr->inside_battle || cloned || ((m_ptr->r_idx == today_mon) && is_pet(m_ptr))))
{
/* Assume skeleton */
bool corpse = FALSE;
/* Drop objects being carried */
monster_drop_carried_objects(m_ptr);
+ if (r_ptr->flags1 & RF1_DROP_GOOD) mo_mode |= AM_GOOD;
+ if (r_ptr->flags1 & RF1_DROP_GREAT) mo_mode |= AM_GREAT;
+
switch (m_ptr->r_idx)
{
case MON_PINK_HORROR:
/* Prepare to make a Blade of Chaos */
object_prep(q_ptr, lookup_kind(TV_SWORD, SV_BLADE_OF_CHAOS));
- apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
+ apply_magic(q_ptr, object_level, AM_NO_FIXED_ART | mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
else
get_obj_num_hook = kind_is_book;
- /* Prepare allocation table */
- get_obj_num_prep();
-
/* Make a book */
- make_object(q_ptr, 0L);
+ make_object(q_ptr, mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
{
if (!one_in_(7))
{
- int wy = py, wx = px;
+ int wy = y, wx = x;
int attempts = 100;
bool pet = is_pet(m_ptr);
do
{
- scatter(&wy, &wx, py, px, 20, 0);
+ scatter(&wy, &wx, y, x, 20, 0);
}
- while (!(in_bounds(wy, wx) && cave_floor_bold(wy, wx)) && --attempts);
+ while (!(in_bounds(wy, wx) && cave_empty_bold2(wy, wx)) && --attempts);
if (attempts > 0)
{
/* Reward for "lazy" player */
if (p_ptr->pseikaku == SEIKAKU_NAMAKE)
{
- int a_idx;
+ int a_idx = 0;
if (!drop_chosen_item) break;
+
do
{
switch (randint0(3))
case MON_A_GOLD:
case MON_A_SILVER:
if (drop_chosen_item && ((m_ptr->r_idx == MON_A_GOLD) ||
- ((m_ptr->r_idx == MON_A_SILVER) && !((r_ptr->r_pkills + 1) % 5))))
+ ((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_pkills % 5 == 0))))
{
/* Get local object */
q_ptr = &forge;
/* Activate restriction */
get_obj_num_hook = kind_is_cloak;
- /* Prepare allocation table */
- get_obj_num_prep();
-
/* Make a cloak */
- make_object(q_ptr, 0L);
+ make_object(q_ptr, mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
/* Activate restriction */
get_obj_num_hook = kind_is_polearm;
- /* Prepare allocation table */
- get_obj_num_prep();
-
/* Make a poleweapon */
- make_object(q_ptr, 0L);
+ make_object(q_ptr, mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
/* Activate restriction */
get_obj_num_hook = kind_is_armor;
- /* Prepare allocation table */
- get_obj_num_prep();
-
/* Make a hard armor */
- make_object(q_ptr, 0L);
+ make_object(q_ptr, mo_mode);
+
+ /* Drop it in the dungeon */
+ (void)drop_near(q_ptr, -1, y, x);
+ }
+ break;
+
+ case '\\':
+ if (dun_level > 4)
+ {
+ /* Get local object */
+ q_ptr = &forge;
+
+ /* Wipe the object */
+ object_wipe(q_ptr);
+
+ /* Activate restriction */
+ get_obj_num_hook = kind_is_hafted;
+
+ /* Make a poleweapon */
+ make_object(q_ptr, mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
/* Activate restriction */
get_obj_num_hook = kind_is_sword;
- /* Prepare allocation table */
- get_obj_num_prep();
-
/* Make a sword */
- make_object(q_ptr, 0L);
+ make_object(q_ptr, mo_mode);
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
break;
}
- /* Mega-Hack -- drop fixed artifacts */
+ /* Mega-Hack -- drop fixed items */
if (drop_chosen_item)
{
int a_idx = 0;
if ((r_ptr->flags7 & RF7_GUARDIAN) && (d_info[dungeon_type].final_guardian == m_ptr->r_idx))
{
- int k_idx = lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT); /* Acquirement */;
-
- if (d_info[dungeon_type].final_object)
- k_idx = d_info[dungeon_type].final_object;
+ int k_idx = d_info[dungeon_type].final_object ? d_info[dungeon_type].final_object
+ : lookup_kind(TV_SCROLL, SV_SCROLL_ACQUIREMENT);
if (d_info[dungeon_type].final_artifact)
{
int a_idx = d_info[dungeon_type].final_artifact;
- if (a_info[a_idx].cur_num == 0)
+ if (!a_info[a_idx].cur_num)
{
/* Create the artifact */
create_named_art(a_idx, y, x);
-
a_info[a_idx].cur_num = 1;
- k_idx = 0;
+
+ /* Prevent rewarding both artifact and "default" object */
+ if (!d_info[dungeon_type].final_object) k_idx = 0;
}
}
/* Average dungeon and monster levels */
object_level = (dun_level + r_ptr->level) / 2;
- if (r_ptr->flags1 & RF1_DROP_GOOD) mo_mode |= AM_GOOD;
- if (r_ptr->flags1 & RF1_DROP_GREAT) mo_mode |= AM_GREAT;
-
/* Drop some objects */
for (j = 0; j < number; j++)
{
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];
- if ((r_ptr->flags3 & RF3_RES_ALL) && dam > 0)
+ if ((r_ptr->flagsr & RFR_RES_ALL) && dam > 0)
{
dam /= 100;
if((dam == 0) && one_in_(3)) dam = 1;
/* Wake it up */
m_ptr->csleep = 0;
+ if (r_ptr->flags7 & RF7_HAS_LD_MASK) p_ptr->update |= (PU_MON_LITE);
+
/* Hack - Cancel any special player stealth magics. -LM- */
if (p_ptr->special_defense & NINJA_S_STEALTH)
{
if (r_ptr->r_sights < MAX_SHORT) r_ptr->r_sights++;
}
- /* When the player kills a Unique, it stays dead */
- if (r_ptr->flags1 & RF1_UNIQUE && !(m_ptr->smart & SM_CLONED))
- r_ptr->max_num = 0;
+ if (!(m_ptr->smart & SM_CLONED))
+ {
+ /* When the player kills a Unique, it stays dead */
+ if (r_ptr->flags1 & RF1_UNIQUE)
+ {
+ r_ptr->max_num = 0;
- /* When the player kills a Nazgul, it stays dead */
- if (r_ptr->flags7 & RF7_UNIQUE_7) r_ptr->max_num--;
+ /* Mega-Hack -- Banor & Lupart */
+ if ((m_ptr->r_idx == MON_BANOR) || (m_ptr->r_idx == MON_LUPART))
+ {
+ r_info[MON_BANORLUPART].max_num = 0;
+ r_info[MON_BANORLUPART].r_pkills++;
+ if (r_info[MON_BANORLUPART].r_tkills < MAX_SHORT) r_info[MON_BANORLUPART].r_tkills++;
+ }
+ else if (m_ptr->r_idx == MON_BANORLUPART)
+ {
+ r_info[MON_BANOR].max_num = 0;
+ r_info[MON_BANOR].r_pkills++;
+ if (r_info[MON_BANOR].r_tkills < MAX_SHORT) r_info[MON_BANOR].r_tkills++;
+ r_info[MON_LUPART].max_num = 0;
+ r_info[MON_LUPART].r_pkills++;
+ if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++;
+ }
+ }
+
+ /* When the player kills a Nazgul, it stays dead */
+ else if (r_ptr->flags7 & RF7_NAZGUL) r_ptr->max_num--;
+ }
/* Recall even invisible uniques or winners */
if (m_ptr->ml || (r_ptr->flags1 & RF1_UNIQUE))
}
/* Extract monster name */
- monster_desc(m_name, m_ptr, 0x100);
+ monster_desc(m_name, m_ptr, MD_TRUE_NAME);
/* Don't kill Amberites */
if ((r_ptr->flags3 & RF3_AMBERITE) && one_in_(2))
chg_virtue(V_VALOUR, 2);
}
- if ((r_ptr->flags1 & RF1_UNIQUE) && ((r_ptr->flags3 & RF3_EVIL) ||
- (r_ptr->flags3 & RF3_GOOD)))
-
- chg_virtue(V_HARMONY, 2);
-
- if ((r_ptr->flags1 & RF1_UNIQUE) && (r_ptr->flags3 & RF3_GOOD))
+ if (r_ptr->flags1 & RF1_UNIQUE)
{
- chg_virtue(V_UNLIFE, 2);
- chg_virtue(V_VITALITY, -2);
- }
+ if (r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) chg_virtue(V_HARMONY, 2);
+
+ if (r_ptr->flags3 & RF3_GOOD)
+ {
+ chg_virtue(V_UNLIFE, 2);
+ chg_virtue(V_VITALITY, -2);
+ }
- if ((r_ptr->flags1 & RF1_UNIQUE) && one_in_(3))
- chg_virtue(V_INDIVIDUALISM, -1);
+ if (one_in_(3)) chg_virtue(V_INDIVIDUALISM, -1);
+ }
if (m_ptr->r_idx == MON_BEGGAR || m_ptr->r_idx == MON_LEPER)
{
if ((r_ptr->flags3 & RF3_GOOD) &&
((r_ptr->level) / 10 + (3 * dun_level) >= randint1(100)))
-
chg_virtue(V_UNLIFE, 1);
if (r_ptr->d_char == 'A')
{
chg_virtue(V_VALOUR, -1);
}
-
+
for (i = 0; i < 4; i++)
{
- if(r_ptr->blow[i].d_dice != 0) innocent = FALSE; /* Murderer! */
-
+ if (r_ptr->blow[i].d_dice != 0) innocent = FALSE; /* Murderer! */
+
if ((r_ptr->blow[i].effect == RBE_EAT_ITEM)
|| (r_ptr->blow[i].effect == RBE_EAT_GOLD))
-
+
thief = TRUE; /* Thief! */
}
chg_virtue(V_JUSTICE, 3);
else if (1+((r_ptr->level) / 10 + (2 * dun_level))
>= randint1(100))
-
chg_virtue(V_JUSTICE, 1);
}
else if (innocent)
if ((r_ptr->flags1 & RF1_UNIQUE) && record_destroy_uniq)
{
- char m_name[160];
+ char note_buf[160];
#ifdef JP
- sprintf(m_name, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(¥¯¥í¡¼¥ó)" : "");
+ sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(¥¯¥í¡¼¥ó)" : "");
#else
- sprintf(m_name, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : "");
+ sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : "");
#endif
- do_cmd_write_nikki(NIKKI_UNIQUE, 0, m_name);
+ do_cmd_write_nikki(NIKKI_UNIQUE, 0, note_buf);
}
/* Make a sound */
#endif
}
- if (r_ptr->flags1 & RF1_UNIQUE && !(m_ptr->smart & SM_CLONED))
+ if ((r_ptr->flags1 & RF1_UNIQUE) && !(m_ptr->smart & SM_CLONED) && !vanilla_town)
{
for (i = 0; i < MAX_KUBI; i++)
{
/* Generate treasure */
monster_death(m_idx, TRUE);
- if ((m_ptr->r_idx == MON_BANOR) || (m_ptr->r_idx == MON_LUPART))
- {
- r_info[MON_BANORLUPART].max_num = 0;
- r_info[MON_BANORLUPART].r_pkills++;
- if (r_info[MON_BANORLUPART].r_tkills < MAX_SHORT) r_info[MON_BANORLUPART].r_tkills++;
- }
-
- if (m_ptr->r_idx == MON_BANORLUPART)
- {
- r_info[MON_BANOR].max_num = 0;
- r_info[MON_BANOR].r_pkills++;
- if (r_info[MON_BANOR].r_tkills < MAX_SHORT) r_info[MON_BANOR].r_tkills++;
- r_info[MON_LUPART].max_num = 0;
- r_info[MON_LUPART].r_pkills++;
- if (r_info[MON_LUPART].r_tkills < MAX_SHORT) r_info[MON_LUPART].r_tkills++;
- }
/* Mega hack : replace IKETA to BIKETAL */
if ((m_ptr->r_idx == MON_IKETA) &&
/* Prevent bug of chaos patron's reward */
if (r_ptr->flags7 & RF7_KILL_EXP)
- get_exp_from_mon((long)m_ptr->max_maxhp*2, &exp_mon);
+ get_exp_from_mon((long)exp_mon.max_maxhp*2, &exp_mon);
else
- get_exp_from_mon(((long)m_ptr->max_maxhp+1L) * 9L / 10L, &exp_mon);
+ get_exp_from_mon(((long)exp_mon.max_maxhp+1L) * 9L / 10L, &exp_mon);
/* Not afraid */
(*fear) = FALSE;
/*
* Monster health description
*/
-cptr look_mon_desc(int m_idx, u32b mode)
+cptr look_mon_desc(monster_type *m_ptr, u32b mode)
{
- monster_type *m_ptr = &m_list[m_idx];
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
bool living;
int perc;
if (!(in_bounds(y, x))) return (FALSE);
/* Player grid is always interesting */
- if ((y == py) && (x == px)) return (TRUE);
+ if (player_bold(y, x)) return (TRUE);
/* Handle hallucination */
/* Interesting memorized features */
if (c_ptr->info & (CAVE_MARK))
{
- byte feat;
-
- /* Feature code (applying "mimic" field) */
- feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
-
- /* Notice glyphs */
+ /* Notice object features */
if (c_ptr->info & CAVE_OBJECT) return (TRUE);
- /* Notice the Pattern */
- if ((feat <= FEAT_PATTERN_XTRA2) &&
- (feat >= FEAT_PATTERN_START))
- return (TRUE);
-
- /* Notice doors */
- if (feat == FEAT_OPEN) return (TRUE);
- if (feat == FEAT_BROKEN) return (TRUE);
-
- /* Notice stairs */
- if (feat == FEAT_LESS) return (TRUE);
- if (feat == FEAT_MORE) return (TRUE);
- if (feat == FEAT_LESS_LESS) return (TRUE);
- if (feat == FEAT_MORE_MORE) return (TRUE);
-
- /* Notice shops */
- if ((feat >= FEAT_SHOP_HEAD) &&
- (feat <= FEAT_SHOP_TAIL)) return (TRUE);
-
- if (feat == FEAT_MUSEUM) return (TRUE);
-
- /* Notice buildings -KMW- */
- if ((feat >= FEAT_BLDG_HEAD) &&
- (feat <= FEAT_BLDG_TAIL)) return (TRUE);
-
- /* Notice traps */
- if (is_trap(feat)) return (TRUE);
-
- /* Notice doors */
- if ((feat >= FEAT_DOOR_HEAD) &&
- (feat <= FEAT_DOOR_TAIL)) return (TRUE);
-
-#if 0
- /* Notice rubble */
- /* I think FEAT_RUBBLEs should not be "interesting" */
- if (feat == FEAT_RUBBLE) return (TRUE);
-
- /* Notice veins with treasure */
- /* Now veins with treasure are too many */
- if (feat == FEAT_MAGMA_K) return (TRUE);
- if (feat == FEAT_QUARTZ_K) return (TRUE);
-#endif
-
- /* Notice quest features */
- if (feat == FEAT_QUEST_ENTER) return (TRUE);
- if (feat == FEAT_QUEST_EXIT) return (TRUE);
- if (feat == FEAT_QUEST_DOWN) return (TRUE);
- if (feat == FEAT_QUEST_UP) return (TRUE);
- if (feat == FEAT_TOWN) return (TRUE);
- if (feat == FEAT_ENTRANCE) return (TRUE);
+ /* Feature code (applying "mimic" field) */
+ if (have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_NOTICE)) return TRUE;
}
/* Nope */
{
cave_type *c_ptr;
- /* Require line of sight, unless "look" is "expanded" */
- if (!expand_look && !player_has_los_bold(y, x)) continue;
-
/* Require "interesting" contents */
if (!target_set_accept(y, x)) continue;
s16b this_o_idx, next_o_idx = 0;
cptr s1 = "", s2 = "", s3 = "", x_info = "";
bool boring = TRUE;
- byte feat;
+ s16b feat;
+ feature_type *f_ptr;
int query = '\001';
char out_val[MAX_NLEN+80];
#endif /* ALLOW_EASY_FLOOR */
/* Hack -- under the player */
- if ((y == py) && (x == px))
+ if (player_bold(y, x))
{
/* Description */
#ifdef JP
boring = FALSE;
/* Get the monster name ("a kobold") */
- monster_desc(m_name, m_ptr, 0x08);
+ monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
/* Hack -- track this monster race */
monster_race_track(m_ptr->ap_r_idx);
evaluate_monster_exp(acount, m_ptr);
#ifdef JP
- sprintf(out_val, "[%s]%s%s(%s)%s%s [r»× %s%s]", acount, s1, m_name, look_mon_desc(c_ptr->m_idx, 0x01), s2, s3, x_info, info);
+ sprintf(out_val, "[%s]%s%s(%s)%s%s [r»× %s%s]", acount, s1, m_name, look_mon_desc(m_ptr, 0x01), s2, s3, x_info, info);
#else
- sprintf(out_val, "[%s]%s%s%s%s(%s) [r, %s%s]", acount, s1, s2, s3, m_name, look_mon_desc(c_ptr->m_idx, 0x01), x_info, info);
+ sprintf(out_val, "[%s]%s%s%s%s(%s) [r, %s%s]", acount, s1, s2, s3, m_name, look_mon_desc(m_ptr, 0x01), x_info, info);
#endif
prt(out_val, 0, 0);
next_o_idx = o_ptr->next_o_idx;
/* Obtain an object description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Describe the object */
#ifdef JP
o_ptr = &o_list[floor_list[0]];
/* Describe the object */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Message */
#ifdef JP
while (1)
{
int i, o_idx;
- cave_type *c_ptr;
/* Save screen */
screen_save();
}
/* Get the object being moved. */
- c_ptr = &cave[y][x];
- o_idx = c_ptr->o_idx;
+ o_idx = c_ptr->o_idx;
/* Only rotate a pile of two or more objects. */
if (!(o_idx && o_list[o_idx].next_o_idx)) continue;
boring = FALSE;
/* Obtain an object description */
- object_desc(o_name, o_ptr, TRUE, 3);
+ object_desc(o_name, o_ptr, 0);
/* Describe the object */
#ifdef JP
/* Feature code (applying "mimic" field) */
- feat = c_ptr->mimic ? c_ptr->mimic : f_info[c_ptr->feat].mimic;
+ feat = get_feat_mimic(c_ptr);
/* Require knowledge about grid, or ability to see grid */
if (!(c_ptr->info & CAVE_MARK) && !player_can_see_bold(y, x))
feat = FEAT_NONE;
}
+ f_ptr = &f_info[feat];
+
/* Terrain feature if needed */
if (boring || (feat > FEAT_INVIS))
{
cptr name;
/* Hack -- special handling for building doors */
- if ((feat >= FEAT_BLDG_HEAD) && (feat <= FEAT_BLDG_TAIL))
+ if (have_flag(f_ptr->flags, FF_BLDG))
{
- name = building[feat - FEAT_BLDG_HEAD].name;
+ name = building[f_ptr->power].name;
}
- else if (feat == FEAT_ENTRANCE)
+ else if (have_flag(f_ptr->flags, FF_ENTRANCE))
{
#ifdef JP
name = format("%s(%d³¬ÁêÅö)", d_text + d_info[c_ptr->special].text, d_info[c_ptr->special].mindepth);
name = format("%s(level %d)", d_text + d_info[c_ptr->special].text, d_info[c_ptr->special].mindepth);
#endif
}
- else if (feat == FEAT_TOWN)
+ else if (have_flag(f_ptr->flags, FF_TOWN))
{
name = town[c_ptr->special].name;
}
}
else
{
- name = f_name + f_info[feat].name;
+ name = f_name + f_ptr->name;
}
/* Pick a prefix */
- if (*s2 && ((feat >= FEAT_MINOR_GLYPH) &&
- (feat <= FEAT_PATTERN_XTRA2)))
- {
-#ifdef JP
- s2 = "¤Î¾å";
-#else
- s2 = "on ";
-#endif
-
- }
- else if (*s2 && ((feat >= FEAT_DOOR_HEAD) &&
- (feat <= FEAT_PERM_SOLID)))
+ if (*s2 &&
+ (!have_flag(f_ptr->flags, FF_MOVE) ||
+ (!have_flag(f_ptr->flags, FF_LOS) &&
+ !have_flag(f_ptr->flags, FF_TREE)) ||
+ have_flag(f_ptr->flags, FF_TOWN)))
{
#ifdef JP
s2 = "¤ÎÃæ";
#else
s2 = "in ";
#endif
-
- }
- else if (*s2 && (feat == FEAT_TOWN))
- {
-#ifdef JP
- s2 = "¤ÎÃæ";
-#else
- s2 = "in ";
-#endif
-
}
/* Hack -- special introduction for store & building doors -KMW- */
- if (((feat >= FEAT_SHOP_HEAD) && (feat <= FEAT_SHOP_TAIL)) ||
- ((feat >= FEAT_BLDG_HEAD) && (feat <= FEAT_BLDG_TAIL)) ||
- (feat == FEAT_MUSEUM) ||
- (feat == FEAT_ENTRANCE))
+ if (have_flag(f_ptr->flags, FF_STORE) ||
+ have_flag(f_ptr->flags, FF_BLDG) ||
+ have_flag(f_ptr->flags, FF_ENTRANCE))
{
#ifdef JP
s2 = "¤ÎÆþ¸ý";
#else
s3 = "";
#endif
-
}
- else if ((feat == FEAT_TOWN) || (feat == FEAT_FLOOR) || (feat == FEAT_DIRT) || (feat == FEAT_FLOWER))
- {
#ifndef JP
+ else if (have_flag(f_ptr->flags, FF_FLOOR) || have_flag(f_ptr->flags, FF_TOWN))
+ {
s3 ="";
-#endif
}
else
{
/* Pick proper indefinite article */
-#ifndef JP
s3 = (is_a_vowel(name[0])) ? "an " : "a ";
-#endif
}
+#endif
/* Display a message */
if (p_ptr->wizard)
#ifdef JP
sprintf(out_val, "%s%s%s%s[%s] %x %d %d %d %d (%d,%d)", s1, name, s2, s3, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
#else
- sprintf(out_val, "%s%s%s%s [%s] %x %d %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
+ sprintf(out_val, "%s%s%s%s [%s] %x %d %d %d %d (%d,%d)", s1, s2, s3, name, info, c_ptr->info, c_ptr->feat, c_ptr->dist, c_ptr->cost, c_ptr->when, x, y);
#endif
else
#ifdef JP
sprintf(out_val, "%s%s%s%s[%s]", s1, name, s2, s3, info);
#else
- sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, name, info);
+ sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, name, info);
#endif
prt(out_val, 0, 0);
}
-int get_chaos_patron(void)
-{
- return ((p_ptr->age + p_ptr->sc) % MAX_PATRON);
-}
-
-
void gain_level_reward(int chosen_reward)
{
object_type *q_ptr;
msg_print("'Thou reliest too much on thy weapon.'");
#endif
- object_desc(o_name, &inventory[INVEN_RARM], TRUE, 0);
+ object_desc(o_name, &inventory[INVEN_RARM], OD_NAME_ONLY);
(void)curse_weapon(FALSE, INVEN_RARM);
#ifdef JP
reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
msg_print("'Thou reliest too much on thine equipment.'");
#endif
- object_desc(o_name, &inventory[INVEN_BODY], TRUE, 0);
+ object_desc(o_name, &inventory[INVEN_BODY], OD_NAME_ONLY);
(void)curse_armor();
#ifdef JP
reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
if (one_in_(2))
{
if (!buki_motteruka(INVEN_RARM)) break;
- object_desc(o_name, &inventory[INVEN_RARM], TRUE, 0);
+ object_desc(o_name, &inventory[INVEN_RARM], OD_NAME_ONLY);
(void)curse_weapon(FALSE, INVEN_RARM);
#ifdef JP
reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
else
{
if (!inventory[INVEN_BODY].k_idx) break;
- object_desc(o_name, &inventory[INVEN_BODY], TRUE, 0);
+ object_desc(o_name, &inventory[INVEN_BODY], OD_NAME_ONLY);
(void)curse_armor();
#ifdef JP
reward = format("%s¤¬Ç˲õ¤µ¤ì¤¿¡£", o_name);
case '5':
case '0':
/* illegal place */
- if (x == px && y == py) ch = 0;
-
+ if (player_bold(y, x)) ch = 0;
+
/* okay place */
else success = TRUE;