#include "artifact.h"
#include "cmd-spell.h"
#include "rumor.h"
+#include "player-status.h"
/*!
* ループ中で / hack as in leave_store in store.c
{
if(p_ptr->wild_mode) return;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (!cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_QUEST_ENTER))
{
if(p_ptr->wild_mode) return;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (!cave_have_flag_bold(p_ptr->y, p_ptr->x, FF_BLDG))
{
#include "avatar.h"
#include "spells-status.h"
#include "realm-hex.h"
+#include "player-status.h"
/*!
* @brief ペット入りモンスターボールをソートするための比較関数
o_ptr = &o_list[0 - item];
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Extract the item level */
lev = k_info[o_ptr->k_idx].level;
#include "avatar.h"\r
#include "spells-status.h"\r
#include "realm-hex.h"\r
+#include "player-status.h"\r
\r
/*!\r
* @brief 食料を食べるコマンドのサブルーチン\r
\r
sound(SOUND_EAT);\r
\r
- p_ptr->energy_use = 100;\r
+ take_turn(p_ptr, 100);;\r
\r
/* Identity not known yet */\r
ident = FALSE;\r
autopick_alter_item(item, FALSE);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
q_ptr = &forge;
/* Obtain local object */
object_desc(o_name, o_ptr, 0);
o_ptr->number = old_number;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Artifacts cannot be destroyed */
if (!can_player_destroy_object(o_ptr))
#include "cmd-zaprod.h"
#include "cmd-zapwand.h"
#include "avatar.h"
+#include "player-status.h"
/*!
sound(SOUND_FAIL);
if (randint1(100) >= chance)
chg_virtue(V_CHANCE,-1);
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return TRUE;
}
if (randint1(100) < chance)
chg_virtue(V_CHANCE,1);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (tval == TV_ROD) p_ptr->magic_num1[item] += k_info[k_idx].pval * EATER_ROD_CHARGE;
else p_ptr->magic_num1[item] -= EATER_CHARGE;
if (c_ptr->m_idx)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
msg_print(_("モンスターが立ちふさがっている!", "There is a monster in the way!"));
if (r_info[m_ptr->r_idx].level > randint1((p_ptr->skill_exp[GINOU_RIDING] / 50 + p_ptr->lev / 2 + 20)))
{
msg_print(_("うまく乗れなかった。", "You failed to ride."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return FALSE;
}
if (p_ptr->riding == p_ptr->health_who) health_track(0);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Mega-Hack -- Forget the view and lite */
p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
o_ptr = &o_list[0 - item];\r
}\r
\r
- p_ptr->energy_use = 100;\r
+ take_turn(p_ptr, 100);;\r
if (cmd_limit_time_walk(p_ptr)) return;\r
\r
if (p_ptr->pclass == CLASS_BERSERKER)\r
#endif\r
}\r
\r
- p_ptr->energy_use = 100;\r
+ take_turn(p_ptr, 100);;\r
\r
switch (mp_ptr->spell_book)\r
{\r
}\r
}\r
\r
- p_ptr->energy_use = 100;\r
+ take_turn(p_ptr, 100);;\r
\r
\r
/* Over-exert the player */\r
#include "projection.h"\r
#include "spells-summon.h"\r
#include "avatar.h"\r
+#include "player-status.h"\r
\r
\r
\r
}\r
\r
\r
- p_ptr->energy_use = 100;\r
+ take_turn(p_ptr, 100);;\r
\r
/* Extract the item level */\r
lev = k_info[o_ptr->k_idx].level;\r
#include "angband.h"
#include "avatar.h"
#include "spells-status.h"
+#include "player-status.h"
/*!
* @brief ロッドの効果を発動する
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Extract the item level */
lev = k_info[o_ptr->k_idx].level;
#include "angband.h"
#include "avatar.h"
#include "spells-status.h"
+#include "player-status.h"
/*!
}
target_pet = old_target_pet;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Get the level */
lev = k_info[o_ptr->k_idx].level;
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))
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;
/* Paralyzed or Knocked Out */
else if (p_ptr->paralyzed || (p_ptr->stun >= 100))
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
}
/* Resting */
p_ptr->redraw |= (PR_STATE);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
}
/* Fishing */
else if (p_ptr->action == ACTION_FISH)
{
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
}
/* Running */
case ACTION_HAYAGAKE:
{
msg_print(_("足が重くなった。", "You are no longer walking extremely fast."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
break;
}
case ACTION_SPELL:
/* Cast the spell */
if (!do_spell(REALM_HISSATSU, n, SPELL_CAST)) return;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Use some mana */
p_ptr->csp -= spell.smana;
msg_print(_("何も覚えられなかった。", "You were not able to learn any special attacks."));
else
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
p_ptr->update |= (PU_SPELLS);
}
#include "spells-summon.h"
#include "spells-status.h"
#include "cmd-spell.h"
+#include "player-status.h"
static int damage;
p_ptr->mane_dam[j] = p_ptr->mane_dam[j+1];
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
p_ptr->redraw |= (PR_IMITATION);
p_ptr->window |= (PW_PLAYER);
disturb(FALSE, TRUE);
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (!p_ptr->migite && !p_ptr->hidarite &&
!(p_ptr->muta2 & (MUT2_HORNS | MUT2_BEAK | MUT2_SCOR_TAIL | MUT2_TRUNK | MUT2_TENTACLES)))
/* Gives a multiplier of 2 at first, up to 3 at 40th */
do_cmd_throw(1, FALSE, slot);
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
}
break;
}
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* teleport from mirror costs small energy */
if( on_mirror && p_ptr->pclass == CLASS_MIRROR_MASTER )
{
#include "avatar.h"
#include "spells-status.h"
#include "cmd-spell.h"
+#include "player-status.h"
#define pseudo_plev() (((p_ptr->lev + 40) * (p_ptr->lev + 40) - 1550) / 130) /*!< モンスター魔法をプレイヤーが使用する場合の換算レベル */
}
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
p_ptr->redraw |= (PR_MANA);
p_ptr->window |= (PW_PLAYER | PW_SPELL);
if (!get_check(format(_("本当に%sから抽出してよろしいですか?", "Really extract from %s? "), o_name))) return;
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
object_flags(o_ptr, old_flgs);
if (have_flag(old_flgs, TR_KILL_DRAGON)) add_flag(old_flgs, TR_SLAY_DRAGON);
if ((o_ptr->to_h >= p_ptr->lev/5+5) && (o_ptr->to_d >= p_ptr->lev/5+5))
{
msg_print(_("改良に失敗した。", "You failed to enchant."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return;
}
else
if (o_ptr->to_a >= p_ptr->lev/5+5)
{
msg_print(_("改良に失敗した。", "You failed to enchant."));
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return;
}
else
}
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
#ifdef JP
msg_format("%sに%sの能力を付加しました。", o_name, es_ptr->add_name);
object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
if (!get_check(format(_("よろしいですか? [%s]", "Are you sure? [%s]"), o_name))) return;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
if (o_ptr->xtra3 == 1 + ESSENCE_SLAY_GLOVE)
{
}
p_ptr->leaving = TRUE;
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return;
}
if (--running <= 0) return;
/* Take time */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Move the player, using the "pickup" flag */
move_player(find_current, FALSE, FALSE);
return;
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
move_player(travel.dir, always_pickup, FALSE);
return TRUE;
}
+
+void take_turn(player_type *creature_ptr, PERCENTAGE need_cost)
+{
+ p_ptr->energy_use = (ENERGY)need_cost;
+}
extern void update_creature(player_type *creature_ptr);
extern BIT_FLAGS16 empty_hands(bool riding_control);
extern bool player_has_no_spellbooks(void);
+
+extern void take_turn(player_type *creature_ptr, PERCENTAGE need_cost);
}
/* take time and pay the price */
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
/* Success? */
if (randint1(p_ptr->stat_cur[use_stat]) >= ((difficulty / 2) + randint1(difficulty / 2)))
*/
#include "angband.h"
+#include "player-status.h"
#define MAX_SNIPE_POWERS 16
{
case 0: /* Concentration */
if (!snipe_concentrate()) return (FALSE);
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return (TRUE);
case 1: snipe_type = SP_LITE; break;
case 2: snipe_type = SP_AWAY; break;
#include "angband.h"
#include "spells-object.h"
#include "object-hook.h"
+#include "player-status.h"
/*!
* @brief「弾/矢の製造」処理 / do_cmd_cast calls this function if the player's class is 'archer'.
floor_item_describe(0 - item);
floor_item_optimize(0 - item);
}
- p_ptr->energy_use = 100;
+ take_turn(p_ptr, 100);;
return TRUE;
}
#include "avatar.h"
#include "cmd-spell.h"
#include "rumor.h"
+#include "player-status.h"
#define MIN_STOCK 12
p_ptr->town_num = old_town_num;
- /* Free turn */
- p_ptr->energy_use = 100;
-
+ take_turn(p_ptr, 100);;
/* Hack -- Character is no longer in "icky" mode */
character_icky = FALSE;
-
/* Hack -- Cancel automatic command */
command_new = 0;