}
}
-/*!
- * @todo サーペントのHPがマジックナンバー扱いになっている
- */
process_result effect_monster_old_heal(player_type *player_ptr, effect_monster_type *em_ptr)
{
if (em_ptr->seen)
/* Wake up */
(void)set_monster_csleep(player_ptr, em_ptr->g_ptr->m_idx, 0);
effect_monster_old_heal_recovery(player_ptr, em_ptr);
- if (em_ptr->m_ptr->hp < 30000)
+ if (em_ptr->m_ptr->hp < MONSTER_MAXHP)
em_ptr->m_ptr->hp += em_ptr->dam;
if (em_ptr->m_ptr->hp > em_ptr->m_ptr->maxhp)
em_ptr->m_ptr->hp = em_ptr->m_ptr->maxhp;
else
o_ptr->xtra5 = damroll(r_info[o_ptr->pval].hdice, r_info[o_ptr->pval].hside);
if (ironman_nightmare) {
- o_ptr->xtra5 = std::min<short>(30000, o_ptr->xtra5 * 2L);
+ o_ptr->xtra5 = std::min<short>(MONSTER_MAXHP, o_ptr->xtra5 * 2L);
}
o_ptr->xtra4 = o_ptr->xtra5;
}
if (ironman_nightmare) {
auto hp = m_ptr->max_maxhp * 2;
- m_ptr->max_maxhp = std::min(30000, hp);
+ m_ptr->max_maxhp = std::min(MONSTER_MAXHP, hp);
}
m_ptr->maxhp = m_ptr->max_maxhp;
if (ironman_nightmare) {
auto hp = m_ptr->max_maxhp * 2;
- m_ptr->max_maxhp = std::min(30000, hp);
+ m_ptr->max_maxhp = std::min(MONSTER_MAXHP, hp);
}
m_ptr->maxhp = (long)(m_ptr->maxhp * m_ptr->max_maxhp) / oldmaxhp;
m_ptr->max_maxhp = any_bits(r_ptr->flags1, RF1_FORCE_MAXHP) ? maxroll(r_ptr->hdice, r_ptr->hside) : damroll(r_ptr->hdice, r_ptr->hside);
if (ironman_nightmare) {
auto hp = m_ptr->max_maxhp * 2;
- m_ptr->max_maxhp = std::min(30000, hp);
+ m_ptr->max_maxhp = std::min(MONSTER_MAXHP, hp);
}
m_ptr->maxhp = m_ptr->max_maxhp;
int shoot_dd, shoot_ds;
monspell_shoot_dice(r_ptr, &shoot_dd, &shoot_ds);
- return monspell_damage_base(player_ptr, ms_type, std::min(30000, hp), rlev, powerful, shoot_dd, shoot_ds, 0, TYPE);
+ return monspell_damage_base(player_ptr, ms_type, std::min(MONSTER_MAXHP, hp), rlev, powerful, shoot_dd, shoot_ds, 0, TYPE);
}
/*!
* The "hold_o_idx" field points to the first object of a stack
* of objects (if any) being carried by the monster (see above).
*/
+constexpr int MONSTER_MAXHP = 30000; //!< モンスターの最大HP
+
struct floor_type;
struct monster_race;
typedef struct monster_type {
#include "monster-race/race-flags3.h"
#include "monster-race/race-flags7.h"
#include "system/monster-race-definition.h"
+#include "system/monster-type-definition.h"
#include "term/term-color-types.h"
void display_monster_hp_ac(lore_type *lore_ptr)
hooked_roff(format(_("%^sは AC%d の防御力と", "%^s has an armor rating of %d"), Who::who(lore_ptr->msex), lore_ptr->r_ptr->ac));
if ((lore_ptr->flags1 & RF1_FORCE_MAXHP) || (lore_ptr->r_ptr->hside == 1)) {
auto hp = lore_ptr->r_ptr->hdice * (lore_ptr->nightmare ? 2 : 1) * lore_ptr->r_ptr->hside;
- hooked_roff(format(_(" %d の体力がある。", " and a life rating of %d. "), std::min(30000, hp)));
+ hooked_roff(format(_(" %d の体力がある。", " and a life rating of %d. "), std::min(MONSTER_MAXHP, hp)));
} else {
hooked_roff(format(
_(" %dd%d の体力がある。", " and a life rating of %dd%d. "), lore_ptr->r_ptr->hdice * (lore_ptr->nightmare ? 2 : 1), lore_ptr->r_ptr->hside));