/* Redraw experience */
p_ptr->redraw |= (PR_EXP);
-
- /* Handle stuff */
handle_stuff();
{
/* Lose a level */
p_ptr->lev--;
-
- /* 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->window |= (PW_PLAYER);
-
- /* Handle stuff */
handle_stuff();
}
msg_format(_("レベル %d にようこそ。", "Welcome to level %d."), p_ptr->lev);
- /* Update some stuff */
p_ptr->update |= (PU_BONUS | PU_HP | PU_MANA | PU_SPELLS);
-
- /* Redraw some stuff */
p_ptr->redraw |= (PR_LEV | PR_TITLE | PR_EXP);
-
p_ptr->window |= (PW_PLAYER | PW_SPELL | PW_INVEN);
/* HPとMPの上昇量を表示 */
level_up = 1;
-
- /* Handle stuff */
handle_stuff();
level_up = 0;
level_reward = FALSE;
}
- /* 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->window |= (PW_PLAYER | PW_SPELL);
-
- /* Handle stuff */
handle_stuff();
}
for (i = 0; i < (dun_level / 15)+1; i++)
{
- /* Get local object */
o_ptr = &forge;
-
- /* Wipe the object */
object_wipe(o_ptr);
/* Make a great object */
*/
void monster_death(MONSTER_IDX m_idx, bool drop_item)
{
- int i, j, y, x;
+ int i, j;
+ POSITION y, x;
int dump_item = 0;
int dump_gold = 0;
-
int number = 0;
monster_type *m_ptr = &m_list[m_idx];
-
monster_race *r_ptr = &r_info[m_ptr->r_idx];
bool visible = ((m_ptr->ml && !p_ptr->image) || (r_ptr->flags1 & RF1_UNIQUE));
if (arena_info[p_ptr->arena_number].tval)
{
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a prize */
object_prep(q_ptr, lookup_kind(arena_info[p_ptr->arena_number].tval, arena_info[p_ptr->arena_number].sval));
-
apply_magic(q_ptr, object_level, AM_NO_FIXED_ART);
/* Drop it in the dungeon */
if (!one_in_(5)) corpse = TRUE;
}
}
-
- /* Get local object */
q_ptr = &forge;
/* Prepare to make an object */
/* Bloodletters of Khorne may drop a blade of chaos */
if (drop_chosen_item && (randint1(100) < 15))
{
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a Blade of Chaos */
case MON_RAAL:
if (drop_chosen_item && (dun_level > 9))
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
case MON_SERPENT:
if (!drop_chosen_item) break;
-
- /* Get local object */
q_ptr = &forge;
/* Mega-Hack -- Prepare to make "Grond" */
/* Drop it in the dungeon */
(void)drop_near(q_ptr, -1, y, x);
-
- /* Get local object */
q_ptr = &forge;
/* Mega-Hack -- Prepare to make "Chaos" */
case MON_B_DEATH_SWORD:
if (drop_chosen_item)
{
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a broken sword */
if (drop_chosen_item && ((m_ptr->r_idx == MON_A_GOLD) ||
((m_ptr->r_idx == MON_A_SILVER) && (r_ptr->r_akills % 5 == 0))))
{
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a Can of Toys */
case '(':
if (dun_level > 0)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
case '/':
if (dun_level > 4)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
case '[':
if (dun_level > 19)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
case '\\':
if (dun_level > 4)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
case '|':
if (m_ptr->r_idx != MON_STORMBRINGER)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Activate restriction */
if (k_idx)
{
- /* Get local object */
q_ptr = &forge;
/* Prepare to make a reward */
/* Drop some objects */
for (j = 0; j < number; j++)
{
- /* Get local object */
q_ptr = &forge;
-
- /* Wipe the object */
object_wipe(q_ptr);
/* Make Gold */
*/
bool mon_take_hit(MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, cptr note)
{
- monster_type *m_ptr = &m_list[m_idx];
- monster_race *r_ptr = &r_info[m_ptr->r_idx];
-
- monster_type exp_mon;
+ monster_type *m_ptr = &m_list[m_idx];
+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
+ monster_type exp_mon;
/* Innocent until proven otherwise */
- bool innocent = TRUE, thief = FALSE;
- int i;
- int expdam;
+ bool innocent = TRUE, thief = FALSE;
+ int i;
+ HIT_POINT expdam;
(void)COPY(&exp_mon, m_ptr, monster_type);
if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
if (p_ptr->riding == m_idx) p_ptr->redraw |= (PR_UHEALTH);
- /* Wake it up */
(void)set_monster_csleep(m_idx, 0);
/* Hack - Cancel any special player stealth magics. -LM- */
/* Genocided by chaos patron */
if (!m_idx) return TRUE;
- /* Hurt it */
m_ptr->hp -= dam;
-
m_ptr->dealt_damage += dam;
+
if(m_ptr->dealt_damage > m_ptr->max_maxhp * 100) m_ptr->dealt_damage = m_ptr->max_maxhp * 100;
+
if (p_ptr->wizard)
{
- msg_format( _("合計%d/%dのダメージを与えた。","You do %d (out of %d) damage."),
- m_ptr->dealt_damage, m_ptr->maxhp);
+ msg_format( _("合計%d/%dのダメージを与えた。","You do %d (out of %d) damage."), m_ptr->dealt_damage, m_ptr->maxhp);
}
/* It is dead now */
/* Dump a message */
if (!get_rnd_line(_("mondeath_j.txt", "mondeath.txt"), m_ptr->r_idx, line_got))
-
+ {
msg_format("%^s %s", m_name, line_got);
+ }
#ifdef WORLD_SCORE
if (m_ptr->r_idx == MON_SERPENT)
{
- /* Make screen dump */
screen_dump = make_screen_dump();
}
#endif
chg_virtue(V_COMPASSION, -1);
}
- if ((r_ptr->flags3 & RF3_GOOD) &&
- ((r_ptr->level) / 10 + (3 * dun_level) >= randint1(100)))
+ 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')
{
if (r_ptr->flags1 & RF1_UNIQUE)
chg_virtue(V_JUSTICE, 3);
- else if (1+((r_ptr->level) / 10 + (2 * dun_level))
- >= randint1(100))
+ 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 note_buf[160];
-#ifdef JP
- sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(クローン)" : "");
-#else
- sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? "(Clone)" : "");
-#endif
+ sprintf(note_buf, "%s%s", r_name + r_ptr->name, (m_ptr->smart & SM_CLONED) ? _("(クローン)", "(Clone)") : "");
do_cmd_write_nikki(NIKKI_UNIQUE, 0, note_buf);
}
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
msg_format("せっかくだから%sを倒した。", m_name);
else
-msg_format("%sを倒した。", m_name);
+ msg_format("%sを倒した。", m_name);
#else
msg_format("You have destroyed %s.", m_name);
#endif
if ((p_ptr->pseikaku == SEIKAKU_COMBAT) || (inventory[INVEN_BOW].name1 == ART_CRIMSON))
msg_format("せっかくだから%sを葬り去った。", m_name);
else
-msg_format("%sを葬り去った。", m_name);
+ msg_format("%sを葬り去った。", m_name);
#else
msg_format("You have slain %s.", m_name);
#endif
monster_death(m_idx, TRUE);
/* Mega hack : replace IKETA to BIKETAL */
- if ((m_ptr->r_idx == MON_IKETA) &&
- !(p_ptr->inside_arena || p_ptr->inside_battle))
+ if ((m_ptr->r_idx == MON_IKETA) && !(p_ptr->inside_arena || p_ptr->inside_battle))
{
- int dummy_y = m_ptr->fy;
- int dummy_x = m_ptr->fx;
+ POSITION dummy_y = m_ptr->fy;
+ POSITION dummy_x = m_ptr->fx;
BIT_FLAGS mode = 0L;
-
if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
-
-
delete_monster_idx(m_idx);
-
if (summon_named_creature(0, dummy_y, dummy_x, MON_BIKETAL, mode))
{
msg_print(_("「ハァッハッハッハ!!私がバイケタルだ!!」", "Uwa-hahaha! *I* am Biketal!"));
}
else
{
-
delete_monster_idx(m_idx);
}
* Run (sometimes) if at 10% or less of max hit points,
* or (usually) when hit for half its current hit points
*/
- if ((randint1(10) >= percentage) ||
- ((dam >= m_ptr->hp) && (randint0(100) < 80)))
+ if ((randint1(10) >= percentage) || ((dam >= m_ptr->hp) && (randint0(100) < 80)))
{
/* Hack -- note fear */
(*fear) = TRUE;
#endif
-#if 0
- if (p_ptr->riding && (p_ptr->riding == m_idx) && (dam > 0))
- {
- char m_name[80];
-
- /* Extract monster name */
- monster_desc(m_name, m_ptr, 0);
-
- if (m_ptr->hp > m_ptr->maxhp/3) dam = (dam + 1) / 2;
- if (rakuba((dam > 200) ? 200 : dam, FALSE))
- {
- msg_format(_("%^sに振り落とされた!", "%^s has thrown you off!"), m_name);
- }
- }
-#endif
-
/* Not dead yet */
return (FALSE);
}
{
int wid, hgt;
- /* Get size */
get_screen_size(&wid, &hgt);
panel_row_max = panel_row_min + hgt - 1;
/* Hack -- update */
handle_stuff();
-
- /* Redraw */
Term_redraw();
/*
if (!character_dungeon) return;
p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_SPELL | PW_PLAYER);
-
p_ptr->window |= (PW_MESSAGE | PW_OVERHEAD | PW_DUNGEON | PW_MONSTER | PW_OBJECT);
/* Hack -- update */
handle_stuff();
-
- /* Redraw */
Term_redraw();
}
POSITION y, x;
TERM_LEN wid, hgt;
- /* Get size */
get_screen_size(&wid, &hgt);
/* Apply the motion */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
-
- /* Handle stuff */
handle_stuff();
/* Success */
POSITION dy = 0, dx = 0;
TERM_LEN wid, hgt;
- /* Get size */
get_screen_size(&wid, &hgt);
if (y < panel_row_min) dy = -1;
int max_prow_min;
int max_pcol_min;
- /* Get size */
get_screen_size(&wid, &hgt);
max_prow_min = cur_hgt - hgt;
panel_col_min = pcol_min;
/* Hack -- optional disturb on "panel change" */
- if (disturb_panel && !center_player) disturb(0, 0);
+ if (disturb_panel && !center_player) disturb(FALSE, FALSE);
/* Recalculate the boundaries */
panel_bounds_center();
p_ptr->update |= (PU_MONSTERS);
-
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
-
p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
}
cptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode)
{
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
- bool living;
- int perc;
+ bool living;
+ int perc;
cptr desc;
cptr attitude;
cptr clone;
/* Healthy monsters */
if (m_ptr->hp >= m_ptr->maxhp)
{
- /* No damage */
-#ifdef JP
- desc = living ? "無傷" : "無ダメージ";
-#else
- desc = living ? "unhurt" : "undamaged";
-#endif
-
+ desc = living ? _("無傷", "unhurt") : _("無ダメージ", "undamaged");
}
else if (perc >= 60)
{
-#ifdef JP
- desc = living ? "軽傷" : "小ダメージ";
-#else
- desc = living ? "somewhat wounded" : "somewhat damaged";
-#endif
-
+ desc = living ? _("軽傷", "somewhat wounded") : _("小ダメージ", "somewhat damaged");
}
else if (perc >= 25)
{
-#ifdef JP
- desc = living ? "負傷" : "中ダメージ";
-#else
- desc = living ? "wounded" : "damaged";
-#endif
-
+ desc = living ? _("負傷", "wounded") : _("中ダメージ", "damaged");
}
else if (perc >= 10)
{
-#ifdef JP
- desc = living ? "重傷" : "大ダメージ";
-#else
- desc = living ? "badly wounded" : "badly damaged";
-#endif
-
+ desc = living ? _("重傷", "badly wounded") : _("大ダメージ", "badly damaged");
}
else
{
-#ifdef JP
- desc = living ? "半死半生" : "倒れかけ";
-#else
- desc = living ? "almost dead" : "almost destroyed";
-#endif
+ desc = living ? _("半死半生", "almost dead") : _("倒れかけ", "almost destroyed");
}
-
/* Need attitude information? */
if (!(mode & 0x01))
{
attitude = _("", "");
}
-
/* Clone monster? */
if (m_ptr->smart & SM_CLONED)
{
{
return format(_("レベル???, %s%s%s", "Level ???, %s%s%s"), desc, attitude, clone);
}
+
}
/* Track best */
b_i = i; b_v = v;
}
-
- /* Result */
return (b_i);
}
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
feature_type *f_ptr;
char query = '\001';
char out_val[MAX_NLEN+80];
-
-#ifdef ALLOW_EASY_FLOOR
OBJECT_IDX floor_list[23];
ITEM_NUMBER floor_num = 0;
}
}
-#endif /* ALLOW_EASY_FLOOR */
-
/* Hack -- under the player */
if (player_bold(y, x))
{
/* Hack -- health bar for this monster */
health_track(c_ptr->m_idx);
-
- /* Hack -- handle stuff */
handle_stuff();
/* Interact */
char o_name[MAX_NLEN];
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* Obtain an object description */
object_desc(o_name, o_ptr, 0);
- /* Describe the object */
#ifdef JP
sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info);
#else
#endif
}
-
-#ifdef ALLOW_EASY_FLOOR
if (floor_num)
{
int min_width = 0;
char o_name[MAX_NLEN];
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[floor_list[0]];
- /* Describe the object */
object_desc(o_name, o_ptr, 0);
#ifdef JP
- sprintf(out_val, "%s%s%s%s[%s]",
- s1, o_name, s2, s3, info);
+ sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info);
#else
- sprintf(out_val, "%s%s%s%s [%s]",
- s1, s2, s3, o_name, info);
+ sprintf(out_val, "%s%s%s%s [%s]", s1, s2, s3, o_name, info);
#endif
prt(out_val, 0, 0);
{
/* Display rough information about items */
#ifdef JP
- sprintf(out_val, "%s %d個のアイテム%s%s ['x'で一覧, %s]",
- s1, (int)floor_num, s2, s3, info);
+ sprintf(out_val, "%s %d個のアイテム%s%s ['x'で一覧, %s]", s1, (int)floor_num, s2, s3, info);
#else
- sprintf(out_val, "%s%s%sa pile of %d items [x,%s]",
- s1, s2, s3, (int)floor_num, info);
+ sprintf(out_val, "%s%s%sa pile of %d items [x,%s]", s1, s2, s3, (int)floor_num, info);
#endif
prt(out_val, 0, 0);
{
int i;
OBJECT_IDX o_idx;
-
- /* Save screen */
screen_save();
/* Display */
/* Prompt */
#ifdef JP
- sprintf(out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]",
- s1, (int)floor_num, s2, s3, info);
+ sprintf(out_val, "%s %d個のアイテム%s%s [Enterで次へ, %s]", s1, (int)floor_num, s2, s3, info);
#else
- sprintf(out_val, "%s%s%sa pile of %d items [Enter,%s]",
- s1, s2, s3, (int)floor_num, info);
+ sprintf(out_val, "%s%s%sa pile of %d items [Enter,%s]", s1, s2, s3, (int)floor_num, info);
#endif
prt(out_val, 0, 0);
-
- /* Wait */
query = inkey();
-
- /* Load screen */
screen_load();
/* Exit unless 'Enter' */
/* NOTREACHED */
}
-#endif /* ALLOW_EASY_FLOOR */
-
/* Scan all objects in the grid */
for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
{
object_type *o_ptr;
-
- /* Acquire object */
o_ptr = &o_list[this_o_idx];
/* Acquire next object */
/* Obtain an object description */
object_desc(o_name, o_ptr, 0);
- /* Describe the object */
#ifdef JP
sprintf(out_val, "%s%s%s%s[%s]", s1, o_name, s2, s3, info);
#else
* some form of "scrolling" the map around the cursor.
* That is, consider the possibility of "auto-scrolling" the screen
* while the cursor moves around. This may require changes in the
- * "update_mon()" code to allow "visibility" even if off panel, and
+ * "update_monster()" code to allow "visibility" even if off panel, and
* may require dynamic recalculation of the "temp" grid set.
*
* Hack -- targeting/observing an "outer border grid" may induce
int wid, hgt;
- /* Get size */
get_screen_size(&wid, &hgt);
/* Cancel target */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
/* Recalculate interesting grids */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
/* Recalculate interesting grids */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
/* Recalculate interesting grids */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
/* Failure to set target */
cptr p;
COMMAND_CODE code;
- /* Initialize */
(*dp) = 0;
/* Global direction */
/* Hack -- auto-target if requested */
if (use_old_target && target_okay()) dir = 5;
-#ifdef ALLOW_REPEAT /* TNB */
-
if (repeat_pull(&code))
{
/* Confusion? */
}
*dp = (DIRECTION)code;
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Ask until satisfied */
while (!dir)
{
/* Save direction */
(*dp) = dir;
-#ifdef ALLOW_REPEAT /* TNB */
-
/* repeat_push(dir); */
repeat_push((COMMAND_CODE)command_dir);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* A "valid" direction was entered */
return (TRUE);
}
-
-/*
- * Request a "movement" direction (1,2,3,4,6,7,8,9) from the user,
- * and place it into "command_dir", unless we already have one.
- *
- * This function should be used for all "repeatable" commands, such as
- * run, walk, open, close, bash, disarm, spike, tunnel, etc, as well
- * as all commands which must reference a grid adjacent to the player,
- * and which may not reference the grid under the player. Note that,
- * for example, it is no longer possible to "disarm" or "open" chests
- * in the same grid as the player.
- *
- * Direction "5" is illegal and will (cleanly) abort the command.
- *
- * This function tracks and uses the "global direction", and uses
- * that as the "desired direction", to which "confusion" is applied.
- */
-bool get_rep_dir(DIRECTION *dp, bool under)
+bool get_direction(DIRECTION *dp, bool allow_under, bool with_steed)
{
DIRECTION dir;
cptr prompt;
COMMAND_CODE code;
- /* Initialize */
(*dp) = 0;
/* Global direction */
dir = command_dir;
-#ifdef ALLOW_REPEAT /* TNB */
-
if (repeat_pull(&code))
{
dir = (DIRECTION)code;
-/* return (TRUE); */
+ /* return (TRUE); */
}
*dp = (DIRECTION)code;
-#endif /* ALLOW_REPEAT -- TNB */
-
- if (under)
+ if (allow_under)
{
prompt = _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? ");
}
{
prompt = _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? ");
}
-
+
/* Get a direction */
while (!dir)
{
if (!get_com(prompt, &ch, TRUE)) break;
/* Look down */
- if ((under) && ((ch == '5') || (ch == '-') || (ch == '.')))
+ if ((allow_under) && ((ch == '5') || (ch == '-') || (ch == '.')))
{
dir = 5;
}
}
/* Prevent weirdness */
- if ((dir == 5) && (!under)) dir = 0;
+ if ((dir == 5) && (!allow_under)) dir = 0;
/* Aborted */
if (!dir) return (FALSE);
dir = ddd[randint0(8)];
}
}
- else if (p_ptr->riding)
+ else if (p_ptr->riding && with_steed)
{
monster_type *m_ptr = &m_list[p_ptr->riding];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
/* Save direction */
(*dp) = dir;
-#ifdef ALLOW_REPEAT /* TNB */
-
-/* repeat_push(dir); */
+ /* repeat_push(dir); */
repeat_push((COMMAND_CODE)command_dir);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Success */
return (TRUE);
}
-
-bool get_rep_dir2(DIRECTION *dp)
+/*
+ * @brief 進行方向を指定する(騎乗対象の混乱の影響を受ける) / Request a "movement" direction (1,2,3,4,6,7,8,9) from the user,
+ * and place it into "command_dir", unless we already have one.
+ *
+ * This function should be used for all "repeatable" commands, such as
+ * run, walk, open, close, bash, disarm, spike, tunnel, etc, as well
+ * as all commands which must reference a grid adjacent to the player,
+ * and which may not reference the grid under the player. Note that,
+ * for example, it is no longer possible to "disarm" or "open" chests
+ * in the same grid as the player.
+ *
+ * Direction "5" is illegal and will (cleanly) abort the command.
+ *
+ * This function tracks and uses the "global direction", and uses
+ * that as the "desired direction", to which "confusion" is applied.
+ */
+bool get_rep_dir(DIRECTION *dp, bool under)
{
DIRECTION dir;
+ cptr prompt;
COMMAND_CODE code;
- /* Initialize */
(*dp) = 0;
/* Global direction */
dir = command_dir;
-#ifdef ALLOW_REPEAT /* TNB */
-
if (repeat_pull(&code))
{
dir = (DIRECTION)code;
}
*dp = (DIRECTION)code;
-#endif /* ALLOW_REPEAT -- TNB */
-
+ if (under)
+ {
+ prompt = _("方向 ('.'足元, ESCで中断)? ", "Direction ('.' at feet, Escape to cancel)? ");
+ }
+ else
+ {
+ prompt = _("方向 (ESCで中断)? ", "Direction (Escape to cancel)? ");
+ }
+
/* Get a direction */
while (!dir)
{
char ch;
/* Get a command (or Cancel) */
- if (!get_com(_("方向 (ESCで中断)? ", "Direction (Escape to cancel)? "), &ch, TRUE)) break;
+ if (!get_com(prompt, &ch, TRUE)) break;
- /* Look up the direction */
- dir = get_keymap_dir(ch);
+ /* Look down */
+ if ((under) && ((ch == '5') || (ch == '-') || (ch == '.')))
+ {
+ dir = 5;
+ }
+ else
+ {
+ /* Look up the direction */
+ dir = get_keymap_dir(ch);
- if (!dir) bell();
+ if (!dir) bell();
+ }
}
/* Prevent weirdness */
- if (dir == 5) dir = 0;
+ if ((dir == 5) && (!under)) dir = 0;
/* Aborted */
if (!dir) return (FALSE);
dir = ddd[randint0(8)];
}
}
+ else if (p_ptr->riding)
+ {
+ monster_type *m_ptr = &m_list[p_ptr->riding];
+ monster_race *r_ptr = &r_info[m_ptr->r_idx];
+
+ if (MON_CONFUSED(m_ptr))
+ {
+ /* Standard confusion */
+ if (randint0(100) < 75)
+ {
+ /* Random direction */
+ dir = ddd[randint0(8)];
+ }
+ }
+ else if ((r_ptr->flags1 & RF1_RAND_50) && (r_ptr->flags1 & RF1_RAND_25) && (randint0(100) < 50))
+ {
+ /* Random direction */
+ dir = ddd[randint0(8)];
+ }
+ else if ((r_ptr->flags1 & RF1_RAND_50) && (randint0(100) < 25))
+ {
+ /* Random direction */
+ dir = ddd[randint0(8)];
+ }
+ }
/* Notice confusion */
if (command_dir != dir)
{
- /* Warn the user */
- msg_print(_("あなたは混乱している。", "You are confused."));
+ if (p_ptr->confused)
+ {
+ /* Warn the user */
+ msg_print(_("あなたは混乱している。", "You are confused."));
+ }
+ else
+ {
+ char m_name[80];
+ monster_type *m_ptr = &m_list[p_ptr->riding];
+
+ monster_desc(m_name, m_ptr, 0);
+ if (MON_CONFUSED(m_ptr))
+ {
+ msg_format(_("%sは混乱している。", "%^s is confusing."), m_name);
+ }
+ else
+ {
+ msg_format(_("%sは思い通りに動いてくれない。", "You cannot control %s."), m_name);
+ }
+ }
}
/* Save direction */
(*dp) = dir;
-#ifdef ALLOW_REPEAT /* TNB */
-
/* repeat_push(dir); */
repeat_push((COMMAND_CODE)command_dir);
-#endif /* ALLOW_REPEAT -- TNB */
-
/* Success */
return (TRUE);
}
msg_format(_("%sの声が響き渡った:", "The voice of %s booms out:"), chaos_patrons[p_ptr->chaos_patron]);
msg_print(_("「汝の行いは貴き剣に値せり。」", "'Thy deed hath earned thee a worthy blade.'"));
-
- /* Get local object */
q_ptr = &forge;
dummy = TV_SWORD;
switch (randint1(p_ptr->lev))
int wid, hgt;
- /* Get size */
get_screen_size(&wid, &hgt);
x = p_ptr->x;
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
}
else /* move cursor to next stair and change panel */
p_ptr->update |= (PU_MONSTERS);
- /* Redraw map */
p_ptr->redraw |= (PR_MAP);
p_ptr->window |= (PW_OVERHEAD);
-
- /* Handle stuff */
handle_stuff();
*x_ptr = x;
cptr p;
char command;
- /* Initialize */
(*dp) = 0;
/* Global direction */