command_new = SPECIAL_KEY_BUILDING;
/* No energy needed to re-enter the arena */
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
return;
command_new = SPECIAL_KEY_BUILDING;
/* No energy needed to re-enter the arena */
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
((o_ptr->sval == SV_LITE_TORCH) || (o_ptr->sval == SV_LITE_LANTERN)))
{
msg_print(_("燃料がない。", "It has no fuel."));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
GAME_TEXT m_name[MAX_NLEN];
monster_desc(m_name, &m_list[cave[y][x].m_idx], 0);
msg_format(_("%sが邪魔だ!", "%^s is stand in your way."), m_name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
set_action(ACTION_FISH);
/* Artifacts cannot be destroyed */
if (!can_player_destroy_object(o_ptr))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
msg_format(_("%sは破壊不可能だ。", "You cannot destroy %s."), o_name);
return;
item = select_magic_eater(only_browse);
if (item == -1)
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
if (item >= EATER_EXT*2) {tval = TV_ROD;sval = item - EATER_EXT*2;}
/* Abort if needed */
if (!flag)
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
if (record_stair) do_cmd_write_nikki(NIKKI_PAT_TELE, 0, NULL);
p_ptr->inside_quest = 0;
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/*
* Clear all saved floors
which_power = _("祈り", "prayer");
msg_format(_("反魔法バリアが%sを邪魔した!", "An anti-magic shell disrupts your %s!"), which_power);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
else if (p_ptr->shero && (p_ptr->pclass != CLASS_BERSERKER))
{
msg_format(_("狂戦士化していて頭が回らない!", "You cannot think directly!"));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
else
{
if (!command_new) command_see = FALSE;
/* Assume free turn */
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
if (p_ptr->inside_battle)
{
#include "selfinfo.h"
#include "spells-summon.h"
#include "avatar.h"
+#include "player-status.h"
/*!
* @brief プレイヤーに突然変異を与える
break;
default:
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
msg_format(_("能力 %s は実装されていません。", "Power %s not implemented. Oops."), power);
}
{
disturb(FALSE, TRUE);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/* Hack -- Enter store */
command_new = SPECIAL_KEY_STORE;
}
{
disturb(FALSE, TRUE);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/* Hack -- Enter building */
command_new = SPECIAL_KEY_BUILDING;
}
{
disturb(FALSE, TRUE);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/* Hack -- Enter quest level */
command_new = SPECIAL_KEY_QUEST;
}
else
{
msg_format(_("%^sが邪魔だ!", "%^s is in your way!"), m_name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
oktomove = FALSE;
}
if (riding_r_ptr->flags1 & RF1_NEVER_MOVE)
{
msg_print(_("動けない!", "Can't move!"));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
}
(have_flag(f_ptr->flags, FF_DEEP) || (riding_r_ptr->flags2 & RF2_AURA_FIRE)))
{
msg_format(_("%sの上に行けない。", "Can't swim."), f_name + f_info[get_feat_mimic(c_ptr)].name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
}
else if (!have_flag(f_ptr->flags, FF_WATER) && (riding_r_ptr->flags7 & RF7_AQUATIC))
{
msg_format(_("%sから上がれない。", "Can't land."), f_name + f_info[get_feat_mimic(&cave[p_ptr->y][p_ptr->x])].name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
}
else if (have_flag(f_ptr->flags, FF_LAVA) && !(riding_r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
msg_format(_("%sの上に行けない。", "Too hot to go through."), f_name + f_info[get_feat_mimic(c_ptr)].name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
oktomove = FALSE;
disturb(FALSE, TRUE);
}
else if (!have_flag(f_ptr->flags, FF_MOVE) && have_flag(f_ptr->flags, FF_CAN_FLY) && !p_ptr->levitation)
{
msg_format(_("空を飛ばないと%sの上には行けない。", "You need to fly to go through the %s."), f_name + f_info[get_feat_mimic(c_ptr)].name);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
running = 0;
oktomove = FALSE;
}
{
msg_print(_("それ以上先には進めない。", "You cannot go any more."));
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
/* Wall (or secret door) */
* typing mistakes should not cost you a turn...
*/
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
}
{
if (!(p_ptr->confused || p_ptr->stun || p_ptr->image))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
/* To avoid a loop with running */
{
p_ptr->energy_use = (ENERGY)need_cost;
}
+
+void free_turn(player_type *creature_ptr)
+{
+ p_ptr->energy_use = 0;
+}
extern bool player_has_no_spellbooks(void);
extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
+extern void free_turn(player_type *creature_ptr);
\ No newline at end of file
msg_format(_("この能力を使用するにはレベル %d に達していなければなりません。",
"You need to attain level %d to use this power."), min_level);
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
if (cmd_limit_confused(p_ptr))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
{
if (!get_check(_("本当に今の衰弱した状態でこの能力を使いますか?", "Really use the power in your weakened state? ")))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
}
{
set_action(ACTION_LEARN);
}
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
break;
}
case CLASS_CAVALRY:
default:
msg_print(_("この種族は特殊な能力を持っていません。", "This race has no bonus power."));
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
}
}
return TRUE;
if (cmd_limit_confused(p_ptr))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
case '0':
{
screen_load();
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
/* Abort if needed */
if (!flag)
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return;
}
repeat_push(i);
p_ptr->window |= (PW_PLAYER | PW_SPELL);
}
}
- else p_ptr->energy_use = 0;
+ else free_turn(p_ptr);
/* Success */
return;
#include "monster-status.h"
#include "artifact.h"
#include "avatar.h"
+#include "player-status.h"
#include "shoot.h"
/*!
/* Get a direction (or cancel) */
if (!get_aim_dir(&dir))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
if (snipe_type == SP_AWAY) snipe_type = SP_NONE;
/* Don't shoot at my feet */
if (tx == p_ptr->x && ty == p_ptr->y)
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/* project_length is already reset to 0 */
#include "world.h"
#include "monster.h"
#include "realm-hex.h"
+#include "player-status.h"
/*!
* @brief 地形生成確率を決める要素100の配列を確率テーブルから作成する
#else
msg_print("You cannot enter global map, since there is some monsters nearby!");
#endif
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
if (!get_check_strict(msg, CHECK_OKAY_CANCEL))
{
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
return FALSE;
}
}
#include "mutation.h"
#include "quest.h"
#include "artifact.h"
+#include "player-status.h"
/*!
if (record_stair) do_cmd_write_nikki(NIKKI_WIZ_TELE,0,NULL);
p_ptr->inside_quest = 0;
- p_ptr->energy_use = 0;
+ free_turn(p_ptr);
/* Prevent energy_need from being too lower than 0 */
p_ptr->energy_need = 0;