#include "quest.h"
#include "player-status.h"
#include "spells.h"
+#include "spells-status.h"
/*!
* オートローラーの内容を描画する間隔 /
p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
/* Roll for hit point unless quick-start */
- if (roll_hitdie) do_cmd_rerate(SPOP_NO_UPDATE);
+ if (roll_hitdie) roll_hitdice(SPOP_NO_UPDATE);
/* Initial hitpoints */
p_ptr->mhp = p_ptr->player_hp[0];
break;\r
\r
case SV_POTION_NEW_LIFE:\r
- do_cmd_rerate(0L);\r
+ roll_hitdice(0L);\r
get_max_stats();\r
p_ptr->update |= PU_BONUS;\r
lose_all_mutations();\r
else
p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
/* The experience level may be modified */
check_experience();
power -= 10;
get_max_stats();
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
}
while ((power > randint0(15)) && one_in_(3))
/* wizard2.c */
extern void strip_name(char *buf, KIND_OBJECT_IDX k_idx);
-extern void do_cmd_rerate(SPOP_FLAGS options);
extern void cheat_death(player_type *creature_ptr);
#include "store.h"
#include "artifact.h"
#include "avatar.h"
+#include "spells-status.h"
/*
if(z_older_than(10, 2, 2) && (p_ptr->pclass == CLASS_BEASTMASTER) && !p_ptr->is_dead)
{
p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
}
if(z_older_than(10, 3, 2) && (p_ptr->pclass == CLASS_ARCHER) && !p_ptr->is_dead)
{
p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
}
if(z_older_than(10, 2, 6) && (p_ptr->pclass == CLASS_SORCERER) && !p_ptr->is_dead)
{
p_ptr->hitdie = rp_ptr->r_mhp/2 + cp_ptr->c_mhp + ap_ptr->a_mhp;
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
}
if(z_older_than(10, 4, 7) && (p_ptr->pclass == CLASS_BLUE_MAGE) && !p_ptr->is_dead)
{
p_ptr->hitdie = rp_ptr->r_mhp + cp_ptr->c_mhp + ap_ptr->a_mhp;
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
}
/* Important -- Initialize the magic */
#include "avatar.h"
#include "spells-status.h"
#include "projection.h"
+#include "spells.h"
/*!
* @brief \83\82\83\93\83X\83^\81[\89ñ\95\9c\8f\88\97\9d
handle_stuff();
return TRUE;
}
+
+/*!
+ * @brief \83v\83\8c\83C\83\84\81[\82Ì\83q\83b\83g\83_\83C\83X\82ð\90U\82é / Role Hitpoints
+ * @param options \83X\83y\83\8b\8b¤\92Ê\83I\83v\83V\83\87\83\93
+ * @return \82È\82µ
+ */
+void roll_hitdice(SPOP_FLAGS options)
+{
+ PERCENTAGE percent;
+
+ /* Minimum hitpoints at highest level */
+ HIT_POINT min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
+
+ /* Maximum hitpoints at highest level */
+ HIT_POINT max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
+
+ int i;
+
+ /* Rerate */
+ while (1)
+ {
+ /* Pre-calculate level 1 hitdice */
+ p_ptr->player_hp[0] = (HIT_POINT)p_ptr->hitdie;
+
+ for (i = 1; i < 4; i++)
+ {
+ p_ptr->player_hp[0] += randint1(p_ptr->hitdie);
+ }
+
+ /* Roll the hitpoint values */
+ for (i = 1; i < PY_MAX_LEVEL; i++)
+ {
+ p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + randint1(p_ptr->hitdie);
+ }
+
+ /* Require "valid" hitpoints at highest level */
+ if ((p_ptr->player_hp[PY_MAX_LEVEL - 1] >= min_value) &&
+ (p_ptr->player_hp[PY_MAX_LEVEL - 1] <= max_value)) break;
+ }
+
+ percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
+ (2 * p_ptr->hitdie + ((PY_MAX_LEVEL - 1 + 3) * (p_ptr->hitdie + 1))));
+
+ /* Update and redraw hitpoints */
+ p_ptr->update |= (PU_HP);
+ p_ptr->redraw |= (PR_HP);
+ p_ptr->window |= (PW_PLAYER);
+
+ if (!(options & SPOP_NO_UPDATE)) handle_stuff();
+
+ if (options & SPOP_DISPLAY_MES)
+ {
+ if (options & SPOP_DEBUG)
+ {
+ msg_format(_("\8c»\8dÝ\82Ì\91Ì\97Í\83\89\83\93\83N\82Í %d/100 \82Å\82·\81B", "Your life rate is %d/100 now."), percent);
+ p_ptr->knowledge |= KNOW_HPRATE;
+ }
+ else
+ {
+ msg_print(_("\91Ì\97Í\83\89\83\93\83N\82ª\95Ï\82í\82Á\82½\81B", "Life rate is changed."));
+ p_ptr->knowledge &= ~(KNOW_HPRATE);
+ }
+ }
+}
extern bool clone_monster(DIRECTION dir);
extern void stop_singing(void);
extern bool time_walk(player_type *creature_ptr);
+extern void roll_hitdice(SPOP_FLAGS options);
else if (die < 111)
{
msg_print(_("《審判》だ。", "It's the Judgement."));
- do_cmd_rerate(0L);
+ roll_hitdice(0L);
lose_all_mutations();
}
else if (die < 120)
#include "spells.h"
#include "spells-object.h"
#include "spells-summon.h"
-
-/*!
- * @brief プレイヤーのヒットダイスを振り直す / Hack -- Rerate Hitpoints
- * @param options スペル共通オプション
- * @return なし
- */
-void do_cmd_rerate(SPOP_FLAGS options)
-{
- PERCENTAGE percent;
-
- /* Minimum hitpoints at highest level */
- HIT_POINT min_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 3 / 8;
-
- /* Maximum hitpoints at highest level */
- HIT_POINT max_value = p_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (p_ptr->hitdie + 1)) * 5 / 8;
-
- int i;
-
- /* Rerate */
- while (1)
- {
- /* Pre-calculate level 1 hitdice */
- p_ptr->player_hp[0] = (HIT_POINT)p_ptr->hitdie;
-
- for (i = 1; i < 4; i++)
- {
- p_ptr->player_hp[0] += randint1(p_ptr->hitdie);
- }
-
- /* Roll the hitpoint values */
- for (i = 1; i < PY_MAX_LEVEL; i++)
- {
- p_ptr->player_hp[i] = p_ptr->player_hp[i - 1] + randint1(p_ptr->hitdie);
- }
-
- /* Require "valid" hitpoints at highest level */
- if ((p_ptr->player_hp[PY_MAX_LEVEL - 1] >= min_value) &&
- (p_ptr->player_hp[PY_MAX_LEVEL - 1] <= max_value)) break;
- }
-
- percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
- (2 * p_ptr->hitdie + ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
-
- /* Update and redraw hitpoints */
- p_ptr->update |= (PU_HP);
- p_ptr->redraw |= (PR_HP);
- p_ptr->window |= (PW_PLAYER);
-
- if(!(options & SPOP_NO_UPDATE)) handle_stuff();
-
- if (options & SPOP_DISPLAY_MES)
- {
- if (options & SPOP_DEBUG)
- {
- msg_format(_("現在の体力ランクは %d/100 です。", "Your life rate is %d/100 now."), percent);
- p_ptr->knowledge |= KNOW_HPRATE;
- }
- else
- {
- msg_print(_("体力ランクが変わった。", "Life rate is changed."));
- p_ptr->knowledge &= ~(KNOW_HPRATE);
- }
- }
-}
-
+#include "spells-status.h"
#ifdef ALLOW_WIZARD
/* Hitpoint rerating */
case 'h':
- do_cmd_rerate(SPOP_DISPLAY_MES | SPOP_DEBUG);
+ roll_hitdice(SPOP_DISPLAY_MES | SPOP_DEBUG);
break;
case 'H':