return FALSE;
}
+/*!
+ * @brief 魔法系コマンドが制限されているかを返す。
+ * @return 魔法系コマンドを使用可能ならFALSE、不可能ならば理由をメッセージ表示してTRUEを返す。
+ */
+bool cmd_limit_cast(player_type *creature_ptr)
+{
+ if (dun_level && (d_info[dungeon_type].flags1 & DF1_NO_MAGIC))
+ {
+ msg_print(_("ダンジョンが魔法を吸収した!", "The dungeon absorbs all attempted magic!"));
+ msg_print(NULL);
+ return TRUE;
+ }
+ else if (creature_ptr->anti_magic)
+ {
+ msg_print(_("反魔法バリアが魔法を邪魔した!", "An anti-magic shell disrupts your magic!"));
+ return TRUE;
+ }
+ else if (creature_ptr->shero)
+ {
+ msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
+ return TRUE;
+ }
+ else
+ return FALSE;
+}
bool cmd_limit_confused(player_type *creature_ptr)
{
- if (p_ptr->confused)
+ if (creature_ptr->confused)
{
msg_print(_("混乱していてできない!", "You are too confused!"));
return TRUE;
bool cmd_limit_arena(player_type *creature_ptr)
{
- if (p_ptr->inside_arena)
+ if (creature_ptr->inside_arena)
{
msg_print(_("アリーナが魔法を吸収した!", "The arena absorbs all attempted magic!"));
msg_print(NULL);
bool cmd_limit_time_walk(player_type *creature_ptr)
{
- if (world_player)
+ if (creature_ptr->timewalk)
{
if (flush_failure) flush();
msg_print(_("止まった時の中ではうまく働かないようだ。", "It shows no reaction."));
p_ptr->oldpx = 0;
p_ptr->oldpy = 0;
- /* Hack -- take a turn */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
/* End the command */
return;
/* Cancel the command */
if (!go_up) return;
- /* Hack -- take a turn */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
if (autosave_l) do_cmd_save_game(TRUE);
/* Leaving */
p_ptr->leaving = TRUE;
-
p_ptr->oldpx = 0;
p_ptr->oldpy = 0;
-
- /* Hack -- take a turn */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
}
else
prepare_change_floor_mode(CFM_FIRST_FLOOR);
}
- /* Hack -- take a turn */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);
if (autosave_l) do_cmd_save_game(TRUE);
/* Cancel the arg */
command_arg = 0;
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Search */
search();
bool more = FALSE;
object_type *o_ptr = &o_list[o_idx];
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Attempt to unlock it */
if (o_ptr->pval > 0)
feature_type *f_ptr = &f_info[c_ptr->feat];
bool more = FALSE;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Seeing true feature code (ignore mimic) */
/* Monster in the way */
else if (c_ptr->m_idx && p_ptr->riding != c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
py_attack(y, x, 0);
}
FEAT_IDX old_feat = c_ptr->feat;
bool more = FALSE;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Seeing true feature code (ignore mimic) */
/* Monster in the way */
else if (c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Verify legality */
if (!do_cmd_tunnel_test(y, x)) return (FALSE);
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Get grid */
c_ptr = &cave[y][x];
/* A monster is in the way */
else if (c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
bool more = FALSE;
object_type *o_ptr = &o_list[o_idx];
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Get the "disarm" factor */
i = p_ptr->skill_dis;
int i = p_ptr->skill_dis;
int j;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Penalize some conditions */
if (p_ptr->blind || no_lite()) i = i / 10;
concptr name = f_name + f_info[get_feat_mimic(c_ptr)].name;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_format(_("%sに体当たりをした!", "You smash into the %s!"), name);
/* Monster in the way */
else if (c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
feat = get_feat_mimic(c_ptr);
f_ptr = &f_info[feat];
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (c_ptr->m_idx)
{
/* Is a monster in the way? */
else if (c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
/* Go for it */
else
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Successful jamming */
msg_format(_("%sにくさびを打ち込んだ。", "You jam the %s with a spike."), f_name + f_info[feat].name);
/* Get a "repeated" direction */
if (get_rep_dir(&dir, FALSE))
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if ((dir != 5) && (p_ptr->special_defense & KATA_MUSOU))
{
change_wild_mode();
/* Give first move to monsters */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* HACk -- set the encouter flag for the wilderness generation */
generate_encounter = TRUE;
command_arg = 0;
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (pickup) mpe_mode |= MPE_DO_PICKUP;
(void)move_player_effect(p_ptr->y, p_ptr->x, mpe_mode);
if (p_ptr->special_defense & NINJA_S_STEALTH) set_superstealth(FALSE);
/* Take a turn (?) */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* The sin of sloth */
if (command_arg > 100) chg_virtue(V_DILIGENCE, -1);
p_ptr->redraw |= (PR_EQUIPPY);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Rogue and Ninja gets bonus */
if ((p_ptr->pclass == CLASS_ROGUE) || (p_ptr->pclass == CLASS_NINJA))