}
/*対邪平均ダメージの計算処理*/
-static HIT_POINT calc_arm_avgdamage(PlayerType *player_ptr, ObjectType *o_ptr)
+static int calc_arm_avgdamage(PlayerType *player_ptr, ObjectType *o_ptr)
{
auto flgs = object_flags(o_ptr);
- HIT_POINT base, forced, vorpal;
- HIT_POINT s_evil = forced = vorpal = 0;
- HIT_POINT dam = base = (o_ptr->dd * o_ptr->ds + o_ptr->dd) / 2;
+ int base, forced, vorpal;
+ int s_evil = forced = vorpal = 0;
+ int dam = base = (o_ptr->dd * o_ptr->ds + o_ptr->dd) / 2;
if (flgs.has(TR_KILL_EVIL)) {
dam = s_evil = dam * 7 / 2;
} else if (flgs.has_not(TR_KILL_EVIL) && flgs.has(TR_SLAY_EVIL)) {
if (one_in_(o_ptr->to_d) && one_in_(o_ptr->to_h))
break;
- o_ptr->to_d -= (HIT_POINT)randint0(3);
+ o_ptr->to_d -= (int)randint0(3);
o_ptr->to_h -= (HIT_PROB)randint0(3);
}
if (one_in_(o_ptr->to_d) || one_in_(o_ptr->to_h))
break;
- o_ptr->to_d -= (HIT_POINT)randint0(3);
+ o_ptr->to_d -= (int)randint0(3);
o_ptr->to_h -= (HIT_PROB)randint0(3);
}
}
{
o_ptr->art_flags.set(TR_SHOW_MODS);
HIT_PROB bonus_h = 4 + (HIT_PROB)randint1(11);
- HIT_POINT bonus_d = 4 + (HIT_POINT)randint1(11);
+ int bonus_d = 4 + (int)randint1(11);
if ((o_ptr->tval != ItemKindType::SWORD) && (o_ptr->tval != ItemKindType::POLEARM) && (o_ptr->tval != ItemKindType::HAFTED) && (o_ptr->tval != ItemKindType::DIGGING) && (o_ptr->tval != ItemKindType::GLOVES) && (o_ptr->tval != ItemKindType::RING)) {
bonus_h /= 2;
bonus_d /= 2;
BASE_STATUS stat_max[6]{}; /* Current "maximal" stat values */
BASE_STATUS stat_max_max[6]{}; /* Maximal "maximal" stat values */
- HIT_POINT player_hp[PY_MAX_LEVEL]{};
+ int player_hp[PY_MAX_LEVEL]{};
int16_t chaos_patron{}; /*! カオスパトロンのID */
DIRECTION dir;
PLAYER_LEVEL plev;
PLAYER_LEVEL summon_lev;
- HIT_POINT damage;
+ int damage;
bool pet;
bool no_trump;
BIT_FLAGS p_mode;
sound(SOUND_HIT);
msg_format(_("%sを%sで攻撃した。", "You hit %s with your %s."), m_name, atk_desc);
- HIT_POINT k = damroll(dice_num, dice_side);
+ int k = damroll(dice_num, dice_side);
k = critical_norm(player_ptr, n_weight, bonus, k, (int16_t)bonus, HISSATSU_NONE);
k += player_ptr->to_d_m;
if (k < 0)
* @param power ものまねの効力の種類
* @param dam ものまねの威力
*/
-static void mane_info(PlayerType *player_ptr, char *p, MonsterAbilityType power, HIT_POINT dam)
+static void mane_info(PlayerType *player_ptr, char *p, MonsterAbilityType power, int dam)
{
PLAYER_LEVEL plev = player_ptr->lev;
* @param dam 固定値
* @return フォーマットに従い整形された文字列
*/
-concptr info_multi_damage(HIT_POINT dam)
+concptr info_multi_damage(int dam)
{
return format(_("損傷:各%d", "dam %d each"), dam);
}
concptr info_range(POSITION range);
concptr info_heal(DICE_NUMBER dice, DICE_SID sides, int base);
concptr info_delay(int base, DICE_SID sides);
-concptr info_multi_damage(HIT_POINT dam);
+concptr info_multi_damage(int dam);
concptr info_multi_damage_dice(DICE_NUMBER dice, DICE_SID sides);
concptr info_power(int power);
concptr info_power_dice(DICE_NUMBER dice, DICE_SID sides);
}
case SV_ROD_LITE: {
- HIT_POINT dam = damroll((powerful ? 12 : 6), 8);
+ int dam = damroll((powerful ? 12 : 6), 8);
msg_print(_("青く輝く光線が放たれた。", "A line of blue shimmering light appears."));
(void)lite_line(player_ptr, dir, dam);
ident = true;
}
case SV_ROD_STONE_TO_MUD: {
- HIT_POINT dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+ int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
if (wall_to_mud(player_ptr, dir, dam))
ident = true;
break;
/* Analyze the wand */
switch (sval) {
case SV_WAND_HEAL_MONSTER: {
- HIT_POINT dam = damroll((powerful ? 20 : 10), 10);
+ int dam = damroll((powerful ? 20 : 10), 10);
if (heal_monster(player_ptr, dir, dam))
ident = true;
break;
}
case SV_WAND_STONE_TO_MUD: {
- HIT_POINT dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
+ int dam = powerful ? 40 + randint1(60) : 20 + randint1(30);
if (wall_to_mud(player_ptr, dir, dam))
ident = true;
break;
}
case SV_WAND_LITE: {
- HIT_POINT dam = damroll((powerful ? 12 : 6), 8);
+ int dam = damroll((powerful ? 12 : 6), 8);
msg_print(_("青く輝く光線が放たれた。", "A line of blue shimmering light appears."));
(void)lite_line(player_ptr, dir, dam);
ident = true;
}
case SV_WAND_DRAGON_BREATH: {
- HIT_POINT dam;
+ int dam;
AttributeType typ;
switch (randint1(5)) {
* @param base_dam クリティカル適用前のダメージ
* @return クリティカルを適用したダメージと、クリティカル発生時に表示するメッセージと、クリティカル効果音のタプルを返す
*/
-std::tuple<HIT_POINT, concptr, sound_type> apply_critical_norm_damage(int k, HIT_POINT base_dam)
+std::tuple<int, concptr, sound_type> apply_critical_norm_damage(int k, int base_dam)
{
if (k < 400) {
return { 2 * base_dam + 5, _("手ごたえがあった!", "It was a good hit!"), SOUND_GOOD_HIT };
* @param mode オプションフラグ
* @return クリティカル修正が入ったダメージ値
*/
-HIT_POINT critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact)
+int critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, int dam, int16_t meichuu, combat_options mode, bool impact)
{
/* Extract "blow" power */
int i = (weight + (meichuu * 3 + plus * 5) + player_ptr->skill_thn);
struct player_attack_type;
class PlayerType;
-std::tuple<HIT_POINT, concptr, sound_type> apply_critical_norm_damage(int k, HIT_POINT base_dam);
-HIT_POINT critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, combat_options mode, bool impact = false);
+std::tuple<int, concptr, sound_type> apply_critical_norm_damage(int k, int base_dam);
+int critical_norm(PlayerType *player_ptr, WEIGHT weight, int plus, int dam, int16_t meichuu, combat_options mode, bool impact = false);
void critical_attack(PlayerType *player_ptr, player_attack_type *pa_ptr);
return;
}
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sは突然熱くなった!", "%^s is suddenly very hot!"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::FIRE);
return;
}
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sは電撃をくらった!", "%^s gets zapped!"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::ELEC);
return;
}
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sは冷気をくらった!", "%^s is very cold!"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::COLD);
if (is_original_ap_and_seen(player_ptr, monap_ptr->m_ptr))
r_ptr->r_flagsr |= (r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK);
} else {
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sは鏡の破片をくらった!", "%^s gets sliced!"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::SHARDS);
return;
}
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sは聖なるオーラで傷ついた!", "%^s is injured by holy power!"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::HOLY_FIRE);
return;
}
- HIT_POINT dam = damroll(2, 6);
+ int dam = damroll(2, 6);
dam = mon_damage_mod(player_ptr, monap_ptr->m_ptr, dam, false);
msg_format(_("%^sが鋭い闘気のオーラで傷ついた!", "%^s is injured by the Force"), monap_ptr->m_name);
MonsterDamageProcessor mdp(player_ptr, monap_ptr->m_idx, dam, &monap_ptr->fear, AttributeType::MANA);
if (!SpellHex(player_ptr).is_spelling_specific(HEX_SHADOW_CLOAK) || !monap_ptr->alive || player_ptr->is_dead)
return;
- HIT_POINT dam = 1;
+ int dam = 1;
ObjectType *o_armed_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND];
auto *r_ptr = &r_info[monap_ptr->m_ptr->r_idx];
if (((r_ptr->flagsr & RFR_RES_ALL) != 0) || ((r_ptr->flagsr & RFR_RES_DARK) != 0)) {
* @return スレイ倍率をかけたダメージ量
*/
static MULTIPLY calc_shot_damage_with_slay(
- PlayerType *player_ptr, ObjectType *bow_ptr, ObjectType *arrow_ptr, HIT_POINT tdam, monster_type *monster_ptr, SPELL_IDX snipe_type)
+ PlayerType *player_ptr, ObjectType *bow_ptr, ObjectType *arrow_ptr, int tdam, monster_type *monster_ptr, SPELL_IDX snipe_type)
{
MULTIPLY mult = 10;
* @param dam 現在算出中のダメージ値
* @return クリティカル修正が入ったダメージ値
*/
-HIT_POINT critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam)
+int critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, int dam)
{
int i, k;
auto *j_ptr = &player_ptr->inventory_list[INVEN_BOW];
* @return ダメージ期待値
* @note 基本ダメージ量と重量はこの部位では計算に加わらない。
*/
-HIT_POINT calc_crit_ratio_shot(PlayerType *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow)
+int calc_crit_ratio_shot(PlayerType *player_ptr, int plus_ammo, int plus_bow)
{
- HIT_POINT i;
+ int i;
auto *j_ptr = &player_ptr->inventory_list[INVEN_BOW];
/* Extract "shot" power */
* @param dam 基本ダメージ量
* @return ダメージ期待値
*/
-HIT_POINT calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam)
+int calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, int dam)
{
uint32_t num;
int i, k, crit;
* @param impact 強撃かどうか
* @return ダメージ期待値
*/
-HIT_POINT calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact)
+int calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, int dam, int16_t meichuu, bool dokubari, bool impact)
{
if (dokubari)
return dam;
i = 0;
// 通常ダメージdam、武器重量weightでクリティカルが発生した時のクリティカルダメージ期待値
- auto calc_weight_expect_dam = [](HIT_POINT dam, WEIGHT weight) {
- HIT_POINT sum = 0;
+ auto calc_weight_expect_dam = [](int dam, WEIGHT weight) {
+ int sum = 0;
for (int d = 1; d <= 650; ++d) {
int k = weight + d;
sum += std::get<0>(apply_critical_norm_damage(k, dam));
class ObjectType;
class PlayerType;
bool test_hit_fire(PlayerType *player_ptr, int chance, monster_type *m_ptr, int vis, char *o_name);
-HIT_POINT critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam);
+int critical_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, int dam);
ENERGY bow_energy(OBJECT_SUBTYPE_VALUE sval);
int bow_tmul(OBJECT_SUBTYPE_VALUE sval);
-HIT_POINT calc_crit_ratio_shot(PlayerType *player_ptr, HIT_POINT plus_ammo, HIT_POINT plus_bow);
-HIT_POINT calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, HIT_POINT dam);
-HIT_POINT calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, HIT_POINT dam, int16_t meichuu, bool dokubari, bool impact);
+int calc_crit_ratio_shot(PlayerType *player_ptr, int plus_ammo, int plus_bow);
+int calc_expect_crit_shot(PlayerType *player_ptr, WEIGHT weight, int plus_ammo, int plus_bow, int dam);
+int calc_expect_crit(PlayerType *player_ptr, WEIGHT weight, int plus, int dam, int16_t meichuu, bool dokubari, bool impact);
void exe_fire(PlayerType *player_ptr, INVENTORY_IDX item, ObjectType *j_ptr, SPELL_IDX snipe_type);
* Note that most brands and slays are x3, except Slay Animal (x2),\n
* Slay Evil (x2), and Kill dragon (x5).\n
*/
-HIT_POINT calc_attack_damage_with_slay(PlayerType *player_ptr, ObjectType *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown)
+int calc_attack_damage_with_slay(PlayerType *player_ptr, ObjectType *o_ptr, int tdam, monster_type *m_ptr, combat_options mode, bool thrown)
{
auto flgs = object_flags(o_ptr);
torch_flags(o_ptr, flgs); /* torches has secret flags */
class PlayerType;
MULTIPLY mult_slaying(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr);
MULTIPLY mult_brand(PlayerType *player_ptr, MULTIPLY mult, const TrFlags &flgs, monster_type *m_ptr);
-HIT_POINT calc_attack_damage_with_slay(PlayerType *player_ptr, ObjectType *o_ptr, HIT_POINT tdam, monster_type *m_ptr, combat_options mode, bool thrown);
+int calc_attack_damage_with_slay(PlayerType *player_ptr, ObjectType *o_ptr, int tdam, monster_type *m_ptr, combat_options mode, bool thrown);
AttributeFlags melee_attribute(PlayerType *player_ptr, ObjectType *o_ptr, combat_options mode);
* Perhaps we should affect doors?
* </pre>
*/
-bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ)
+bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
{
auto *floor_ptr = player_ptr->current_floor_ptr;
auto *g_ptr = &floor_ptr->grid_array[y][x];
#include "effect/attribute-types.h"
class PlayerType;
-bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ);
+bool affect_feature(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
* @param typ 効果属性 / Type of damage to apply to monsters (and objects)
* @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
*/
-bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ)
+bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ)
{
auto *g_ptr = &player_ptr->current_floor_ptr->grid_array[y][x];
#include "effect/attribute-types.h"
class PlayerType;
-bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ);
+bool affect_item(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ);
* @param hp 計算対象のHP
* @return 捕まえられる最大HP
*/
-static HIT_POINT calcutate_capturable_hp(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT hp)
+static int calcutate_capturable_hp(PlayerType *player_ptr, monster_type *m_ptr, int hp)
{
if (is_pet(m_ptr))
return hp * 4L;
msg_format(_("%sを捕えた!", "You capture %^s!"), em_ptr->m_name);
cap_mon = em_ptr->m_ptr->r_idx;
- cap_mspeed = static_cast<byte>(em_ptr->m_ptr->mspeed);
+ cap_mspeed = em_ptr->m_ptr->mspeed;
cap_hp = static_cast<short>(em_ptr->m_ptr->hp);
cap_maxhp = static_cast<short>(em_ptr->m_ptr->max_maxhp);
cap_nickname = em_ptr->m_ptr->nickname;
* @param flag 効果フラグ
* @param see_s_msg TRUEならばメッセージを表示する
*/
-static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
+static void substitute_effect_monster(effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
{
em_ptr->who = who;
em_ptr->r = r;
* @param flag 効果フラグ
* @param see_s_msg TRUEならばメッセージを表示する
*/
-effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
+effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
{
substitute_effect_monster(em_ptr, who, r, y, x, dam, attribute, flag, see_s_msg);
POSITION r;
POSITION y;
POSITION x;
- HIT_POINT dam;
+ int dam;
AttributeType attribute;
BIT_FLAGS flag;
bool see_s_msg;
class PlayerType;
effect_monster_type *initialize_effect_monster(PlayerType *player_ptr, effect_monster_type *em_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x,
- HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg);
+ int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg);
* 3.ペット及び撮影による事後効果
*/
bool affect_monster(
- PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
+ PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType attribute, BIT_FLAGS flag, bool see_s_msg)
{
effect_monster_type tmp_effect;
effect_monster_type *em_ptr = initialize_effect_monster(player_ptr, &tmp_effect, who, r, y, x, dam, attribute, flag, see_s_msg);
#include "effect/attribute-types.h"
class PlayerType;
-bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg);
+bool affect_monster(PlayerType *player_ptr, MONSTER_IDX who, POSITION r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag, bool see_s_msg);
// 毒を除く4元素.
void effect_player_elements(
- PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(PlayerType *, HIT_POINT, concptr, bool))
+ PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr attack_message, int (*damage_func)(PlayerType *, int, concptr, bool))
{
if (player_ptr->blind)
msg_print(attack_message);
class EffectPlayerType;
class PlayerType;
void effect_player_elements(
- PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr attack_message, HIT_POINT (*damage_func)(PlayerType *, HIT_POINT, concptr, bool));
+ PlayerType *player_ptr, EffectPlayerType *ep_ptr, concptr attack_message, int (*damage_func)(PlayerType *, int, concptr, bool));
void effect_player_poison(PlayerType *player_ptr, EffectPlayerType *ep_ptr);
void effect_player_nuke(PlayerType *player_ptr, EffectPlayerType *ep_ptr);
void effect_player_missile(PlayerType *player_ptr, EffectPlayerType *ep_ptr);
* @param monspell 効果元のモンスター魔法ID
* @return 初期化後の構造体ポインタ
*/
-EffectPlayerType::EffectPlayerType(MONSTER_IDX who, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag)
+EffectPlayerType::EffectPlayerType(MONSTER_IDX who, int dam, AttributeType attribute, BIT_FLAGS flag)
: rlev(0), m_ptr(nullptr), killer(""), m_name(""), get_damage(0), who(who), dam(dam), attribute(attribute), flag(flag)
{
}
* @param monspell 効果元のモンスター魔法ID
* @return 何か一つでも効力があればTRUEを返す / TRUE if any "effects" of the projection were observed, else FALSE
*/
-bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType attribute,
+bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, int dam, AttributeType attribute,
BIT_FLAGS flag, project_func project)
{
EffectPlayerType tmp_effect(who, dam, attribute, flag);
int get_damage;
MONSTER_IDX who;
- HIT_POINT dam;
+ int dam;
AttributeType attribute;
BIT_FLAGS flag;
- EffectPlayerType(MONSTER_IDX who, HIT_POINT dam, AttributeType attribute, BIT_FLAGS flag);
+ EffectPlayerType(MONSTER_IDX who, int dam, AttributeType attribute, BIT_FLAGS flag);
};
class PlayerType;
using project_func = ProjectResult (*)(
- PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag);
+ PlayerType *player_ptr, MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag);
-bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, HIT_POINT dam, AttributeType typ, BIT_FLAGS flag,
+bool affect_player(MONSTER_IDX who, PlayerType *player_ptr, concptr who_name, int r, POSITION y, POSITION x, int dam, AttributeType typ, BIT_FLAGS flag,
project_func project);
* @todo 似たような処理が山ほど並んでいる、何とかならないものか
* @todo 引数にそのまま再代入していてカオスすぎる。直すのは簡単ではない
*/
-ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam,
+ProjectResult project(PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const int dam,
const AttributeType typ, BIT_FLAGS flag)
{
int dist;
class EffectPlayerType;
class PlayerType;
ProjectResult project(
- PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const HIT_POINT dam, const AttributeType typ,
+ PlayerType *player_ptr, const MONSTER_IDX who, POSITION rad, POSITION y, POSITION x, const int dam, const AttributeType typ,
BIT_FLAGS flag);
*/
static void hit_trap_pit(PlayerType *player_ptr, TrapType trap_feat_type)
{
- HIT_POINT dam;
+ int dam;
concptr trap_name = "";
concptr spike_name = "";
}
if (get_player_flags(player_ptr, TR_SELF_FIRE) && !has_immune_fire(player_ptr)) {
- HIT_POINT damage;
+ int damage;
damage = player_ptr->lev;
if (race.tr_flags().has(TR_VUL_FIRE))
damage += damage / 3;
}
if (get_player_flags(player_ptr, TR_SELF_ELEC) && !has_immune_elec(player_ptr)) {
- HIT_POINT damage;
+ int damage;
damage = player_ptr->lev;
if (race.tr_flags().has(TR_VUL_ELEC))
damage += damage / 3;
}
if (get_player_flags(player_ptr, TR_SELF_COLD) && !has_immune_cold(player_ptr)) {
- HIT_POINT damage;
+ int damage;
damage = player_ptr->lev;
if (race.tr_flags().has(TR_VUL_COLD))
damage += damage / 3;
}
if (player_ptr->riding) {
- HIT_POINT damage;
+ int damage;
auto auras = r_info[player_ptr->current_floor_ptr->m_list[player_ptr->riding].r_idx].aura_flags;
if (auras.has(MonsterAuraType::FIRE) && !has_immune_fire(player_ptr)) {
damage = r_info[player_ptr->current_floor_ptr->m_list[player_ptr->riding].r_idx].level / 2;
if (player_ptr->action == ACTION_HAYAGAKE)
return;
- HIT_POINT old_chp = player_ptr->chp;
+ int old_chp = player_ptr->chp;
/*
* Extract the new hitpoints
*
* 'percent' is the Regen factor in unit (1/2^16)
*/
- HIT_POINT new_chp = 0;
+ int new_chp = 0;
uint32_t new_chp_frac = (player_ptr->mhp * percent + PY_REGEN_HPBASE);
s64b_lshift(&new_chp, &new_chp_frac, 16);
s64b_add(&(player_ptr->chp), &(player_ptr->chp_frac), new_chp, new_chp_frac);
* @param force 理力特別計算フラグ
* @return ダメージ期待値
*/
-static HIT_POINT calc_slaydam(HIT_POINT dam, int mult, int div, bool force)
+static int calc_slaydam(int dam, int mult, int div, bool force)
{
int tmp;
if (force) {
* @param to_ac ACをアップさせる量
* @return 実際に行ったらTRUE
*/
-bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester& item_tester)
+bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, int to_dam, ARMOUR_CLASS to_ac, const ItemTester& item_tester)
{
clear_bldg(4, 18);
int maxenchant = (player_ptr->lev / 5);
class PlayerType;
class ItemTester;
-bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, HIT_POINT to_dam, ARMOUR_CLASS to_ac, const ItemTester &item_tester);
+bool enchant_item(PlayerType *player_ptr, PRICE cost, HIT_PROB to_hit, int to_dam, ARMOUR_CLASS to_ac, const ItemTester &item_tester);
monster_type *m_ptr;
bool seen;
GAME_TEXT m_name[160];
- HIT_POINT dam;
+ int dam;
bool known; /* Can the player be aware of this attack? */
concptr note;
bool *dead;
};
mam_pp_type *initialize_mam_pp_type(
- PlayerType *player_ptr, mam_pp_type *mam_pp_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
+ PlayerType *player_ptr, mam_pp_type *mam_pp_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
{
mam_pp_ptr->m_idx = m_idx;
mam_pp_ptr->m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
* @param who 打撃を行ったモンスターの参照ID
* @todo 打撃が当たった時の後処理 (爆発持ちのモンスターを爆発させる等)なので、関数名を変更する必要あり
*/
-void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
+void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who)
{
auto *floor_ptr = player_ptr->current_floor_ptr;
auto *m_ptr = &floor_ptr->m_list[m_idx];
#include "combat/combat-options-type.h"
class PlayerType;
-void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who);
+void mon_take_hit_mon(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *dead, bool *fear, concptr note, MONSTER_IDX who);
POSITION x;
MONSTER_IDX target_idx;
MonsterAbilityType thrown_spell;
- HIT_POINT dam;
+ int dam;
std::vector<MonsterAbilityType> spells;
GAME_TEXT m_name[160];
#ifdef JP
monster_type *t_ptr;
GAME_TEXT m_name[MAX_NLEN];
GAME_TEXT t_name[MAX_NLEN];
- HIT_POINT damage;
+ int damage;
bool see_m;
bool see_t;
bool see_either;
DEPTH rlev;
bool blinked;
bool do_silly_attack;
- HIT_POINT power;
+ int power;
bool obvious;
int d_dice;
int d_side;
AttributeType typ;
DIRECTION dir;
PLAYER_LEVEL plev = player_ptr->lev;
- HIT_POINT dam;
+ int dam;
POSITION y, x;
int num;
POSITION y = player_ptr->y + ddy[dir];
POSITION x = player_ptr->x + ddx[dir];
PLAYER_LEVEL plev = player_ptr->lev;
- HIT_POINT dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
+ int dam = damroll(8 + ((plev - 5) / 4) + boost / 12, 8);
fire_beam(player_ptr, AttributeType::MISSILE, dir, dam);
if (!player_ptr->current_floor_ptr->grid_array[y][x].m_idx)
return true;
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-bool binding_field(PlayerType *player_ptr, HIT_POINT dam)
+bool binding_field(PlayerType *player_ptr, int dam)
{
POSITION mirror_x[10], mirror_y[10]; /* 鏡はもっと少ない */
int mirror_num = 0; /* 鏡の数 */
* @param dam ダメージ量
* @return 効果があったらTRUEを返す
*/
-void seal_of_mirror(PlayerType *player_ptr, HIT_POINT dam)
+void seal_of_mirror(PlayerType *player_ptr, int dam)
{
for (POSITION x = 0; x < player_ptr->current_floor_ptr->width; x++) {
for (POSITION y = 0; y < player_ptr->current_floor_ptr->height; y++) {
for (x = 0; x < player_ptr->current_floor_ptr->width; x++)
for (y = 0; y < player_ptr->current_floor_ptr->height; y++)
if (player_ptr->current_floor_ptr->grid_array[y][x].is_mirror())
- project(player_ptr, 0, 2, y, x, (HIT_POINT)plev, AttributeType::OLD_SLEEP,
+ project(player_ptr, 0, 2, y, x, (int)plev, AttributeType::OLD_SLEEP,
(PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI));
break;
bool check_multishadow(PlayerType *player_ptr);
bool mirror_concentration(PlayerType *player_ptr);
void remove_all_mirrors(PlayerType *player_ptr, bool explode);
-bool binding_field(PlayerType *player_ptr, HIT_POINT dam);
-void seal_of_mirror(PlayerType *player_ptr, HIT_POINT dam);
+bool binding_field(PlayerType *player_ptr, int dam);
+void seal_of_mirror(PlayerType *player_ptr, int dam);
bool confusing_light(PlayerType *player_ptr);
bool place_mirror(PlayerType *player_ptr);
bool mirror_tunnel(PlayerType *player_ptr);
int d_side = 0;
ObjectType *o_ptr = nullptr;
bool obvious = false;
- HIT_POINT damage = 0;
+ int damage = 0;
bool blinked = false;
GAME_TEXT o_name[MAX_NLEN]{};
- HIT_POINT get_damage = 0;
+ int get_damage = 0;
GAME_TEXT ddesc[MAX_MONSTER_NAME]{};
ARMOUR_CLASS ac = 0;
bool alive = true;
object_kind *kind_ptr = &k_info[monap_ptr->o_ptr->k_idx];
PARAMETER_VALUE pval = kind_ptr->pval;
DEPTH level = monap_ptr->rlev;
- HIT_POINT drain = is_magic_mastery ? std::min<short>(pval, pval * level / 400 + pval * randint1(level) / 400) : pval;
+ int drain = is_magic_mastery ? std::min<short>(pval, pval * level / 400 + pval * randint1(level) / 400) : pval;
if (drain <= 0)
return false;
msg_print(_("しかし、あなたの魔法を操る力がその一部を取り返した!", "However, your skill of magic mastery got back the part of energy!"));
monap_ptr->obvious = true;
- HIT_POINT recovery = drain * kind_ptr->level;
+ int recovery = drain * kind_ptr->level;
if (monap_ptr->o_ptr->tval == ItemKindType::STAFF)
recovery *= monap_ptr->o_ptr->number;
AttributeType typ = mbe_info[enum2i(md_ptr->r_ptr->blow[i].effect)].explode_type;
DICE_NUMBER d_dice = md_ptr->r_ptr->blow[i].d_dice;
DICE_SID d_side = md_ptr->r_ptr->blow[i].d_side;
- HIT_POINT damage = damroll(d_dice, d_side);
+ int damage = damroll(d_dice, d_side);
(void)project(player_ptr, md_ptr->m_idx, 3, md_ptr->md_y, md_ptr->md_x, damage, typ, flg);
break;
}
/* Unused */
(void)player_ptr;
- HIT_POINT dam = 0;
+ int dam = 0;
auto *r_ptr = &r_info[r_idx];
bool unselectable = r_ptr->behavior_flags.has(MonsterBehaviorType::NEVER_MOVE);
unselectable |= any_bits(r_ptr->flags2, RF2_MULTIPLY);
* @param attribute 与えたダメージの種類 (単一属性)
* @param note モンスターが倒された際の特別なメッセージ述語
*/
-MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType attribute)
+MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *fear, AttributeType attribute)
: player_ptr(player_ptr)
, m_idx(m_idx)
, dam(dam)
* @param attribute_flags 与えたダメージの種類 (複数属性)
* @param note モンスターが倒された際の特別なメッセージ述語
*/
-MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags)
+MonsterDamageProcessor::MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *fear, AttributeFlags attribute_flags)
: player_ptr(player_ptr)
, m_idx(m_idx)
, dam(dam)
* experience point of a monster later.
* </pre>
*/
-void MonsterDamageProcessor::get_exp_from_mon(monster_type *m_ptr, HIT_POINT exp_dam)
+void MonsterDamageProcessor::get_exp_from_mon(monster_type *m_ptr, int exp_dam)
{
auto *r_ptr = &r_info[m_ptr->r_idx];
if (!monster_is_valid(m_ptr) || is_pet(m_ptr) || this->player_ptr->phase_out) {
typedef std::vector<std::tuple<monster_race_type, monster_race_type, monster_race_type>> combined_uniques;
class MonsterDamageProcessor {
public:
- MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeType type);
- MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam, bool *fear, AttributeFlags attribute_flags);
+ MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *fear, AttributeType type);
+ MonsterDamageProcessor(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam, bool *fear, AttributeFlags attribute_flags);
virtual ~MonsterDamageProcessor() = default;
bool mon_take_hit(concptr note);
private:
PlayerType *player_ptr;
MONSTER_IDX m_idx;
- HIT_POINT dam;
+ int dam;
bool *fear;
AttributeFlags attribute_flags{};
- void get_exp_from_mon(monster_type *m_ptr, HIT_POINT exp_dam);
+ void get_exp_from_mon(monster_type *m_ptr, int exp_dam);
bool genocide_chaos_patron();
bool process_dead_exp_virtue(concptr note, monster_type *exp_mon);
void death_special_flag_monster();
* @details
* Technically should attempt to treat "Beholder"'s as jelly's
*/
-void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam)
+void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam)
{
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
auto *r_ptr = &r_info[m_ptr->r_idx];
return;
}
- HIT_POINT newhp = m_ptr->hp;
- HIT_POINT oldhp = newhp + dam;
- HIT_POINT tmp = (newhp * 100L) / oldhp;
+ int newhp = m_ptr->hp;
+ int oldhp = newhp + dam;
+ int tmp = (newhp * 100L) / oldhp;
PERCENTAGE percentage = tmp;
if (angband_strchr(",ejmvwQ", r_ptr->d_char)) {
struct monster_type;
class PlayerType;
void monster_desc(PlayerType *player_ptr, char *desc, monster_type *m_ptr, BIT_FLAGS mode);
-void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, HIT_POINT dam);
+void message_pain(PlayerType *player_ptr, MONSTER_IDX m_idx, int dam);
* @return 修正を行った結果のダメージ量
* @details RES_ALL持ちはAC軽減後のダメージを1/100に補正する. 光の剣は無敵を無効化する. 一定確率で無敵は貫通できる.
*/
-HIT_POINT mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear)
+int mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, int dam, bool is_psy_spear)
{
auto *r_ptr = &r_info[m_ptr->r_idx];
if ((r_ptr->flagsr & RFR_RES_ALL) && dam > 0) {
bool monster_is_powerful(floor_type *floor_ptr, MONSTER_IDX m_idx);
DEPTH monster_level_idx(floor_type *floor_ptr, MONSTER_IDX m_idx);
-HIT_POINT mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear);
+int mon_damage_mod(PlayerType *player_ptr, monster_type *m_ptr, int dam, bool is_psy_spear);
bool monster_is_valid(monster_type *m_ptr);
void dispel_monster_status(PlayerType *player_ptr, MONSTER_IDX m_idx);
*/
MonsterSpellResult spell_RF4_BREATH(PlayerType *player_ptr, AttributeType GF_TYPE, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
{
- HIT_POINT dam, drs_type = 0;
+ int dam, drs_type = 0;
concptr type_s;
bool smart_learn_aux = true;
auto *floor_ptr = player_ptr->current_floor_ptr;
* @param MS_TYPE 呪文の番号
* @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
*/
-static MonsterSpellResult spell_RF5_CAUSE(PlayerType *player_ptr, AttributeType GF_TYPE, HIT_POINT dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx,
+static MonsterSpellResult spell_RF5_CAUSE(PlayerType *player_ptr, AttributeType GF_TYPE, int dam, POSITION y, POSITION x, MONSTER_IDX m_idx, MONSTER_IDX t_idx,
concptr msg1, concptr msg2, concptr msg3, int TARGET_TYPE)
{
auto res = MonsterSpellResult::make_valid(dam);
* @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。
* @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。
*/
-static HIT_POINT monspell_damage_roll(HIT_POINT dam, int dice_num, int dice_side, int mult, int div, int TYPE)
+static int monspell_damage_roll(int dam, int dice_num, int dice_side, int mult, int div, int TYPE)
{
switch (TYPE) {
case DAM_MAX:
* @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。
* @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。
*/
-static HIT_POINT monspell_damage_base(
+static int monspell_damage_base(
PlayerType *player_ptr, MonsterAbilityType ms_type, int hp, int rlev, bool powerful, int shoot_dd, int shoot_ds, int shoot_base, int TYPE)
{
- HIT_POINT dam = 0, dice_num = 0, dice_side = 0, mult = 1, div = 1;
+ int dam = 0, dice_num = 0, dice_side = 0, mult = 1, div = 1;
switch (ms_type) {
case MonsterAbilityType::SHRIEK:
* @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。
* @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。
*/
-HIT_POINT monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE)
+int monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE)
{
auto *floor_ptr = player_ptr->current_floor_ptr;
auto *m_ptr = &floor_ptr->m_list[m_idx];
auto *r_ptr = &r_info[m_ptr->r_idx];
DEPTH rlev = monster_level_idx(floor_ptr, m_idx);
- HIT_POINT hp = (TYPE == DAM_ROLL) ? m_ptr->hp : m_ptr->max_maxhp;
+ int hp = (TYPE == DAM_ROLL) ? m_ptr->hp : m_ptr->max_maxhp;
int shoot_dd, shoot_ds;
monspell_shoot_dice(r_ptr, &shoot_dd, &shoot_ds);
* @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。
* @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。
*/
-HIT_POINT monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE)
+int monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE)
{
auto *r_ptr = &r_info[r_idx];
DEPTH rlev = ((r_ptr->level >= 1) ? r_ptr->level : 1);
bool powerful = any_bits(r_ptr->flags2, RF2_POWERFUL);
- HIT_POINT hp = r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside;
+ int hp = r_ptr->hdice * (ironman_nightmare ? 2 : 1) * r_ptr->hside;
int shoot_dd, shoot_ds;
monspell_shoot_dice(r_ptr, &shoot_dd, &shoot_ds);
* @param TYPE DAM_MAXで最大値を返し、DAM_MINで最小値を返す。DAM_ROLLはダイスを振って値を決定する。
* @return 攻撃呪文のダメージを返す。攻撃呪文以外は-1を返す。
*/
-HIT_POINT monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE)
+int monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE)
{
int hp = player_ptr->chp;
int shoot_dd = 1, shoot_ds = 1, shoot_base = 0;
enum class MonsterAbilityType;
class PlayerType;
-HIT_POINT monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE);
-HIT_POINT monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE);
-HIT_POINT monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE);
+int monspell_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONSTER_IDX m_idx, int TYPE);
+int monspell_race_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, MONRACE_IDX r_idx, int TYPE);
+int monspell_bluemage_damage(PlayerType *player_ptr, MonsterAbilityType ms_type, PLAYER_LEVEL plev, int TYPE);
//! モンスターが魔法を使った際の結果。
struct MonsterSpellResult {
private:
- explicit MonsterSpellResult(const bool valid, const HIT_POINT dam = 0)
+ explicit MonsterSpellResult(const bool valid, const int dam = 0)
: valid(valid)
, dam(dam)
{
public:
bool valid; //!< 通常は true。何か変なこと(無効な魔法IDなど)が起こったら false
bool learnable{ false }; //!< ラーニングを試みるか
- HIT_POINT dam{}; //! ダメージ量(ものまね用)
+ int dam{}; //! ダメージ量(ものまね用)
- static MonsterSpellResult make_valid(HIT_POINT dam = 0)
+ static MonsterSpellResult make_valid(int dam = 0)
{
return MonsterSpellResult(true, dam);
}
{
auto *floor_ptr = player_ptr->current_floor_ptr;
auto *m_ptr = &floor_ptr->m_list[m_idx];
- HIT_POINT dummy_hp, dummy_maxhp;
+ int dummy_hp, dummy_maxhp;
POSITION dummy_y = m_ptr->fy;
POSITION dummy_x = m_ptr->fx;
BIT_FLAGS mode = 0L;
simple_monspell_message(player_ptr, m_idx, t_idx, msg, TARGET_TYPE);
bool fear, dead; /* dummy */
- HIT_POINT dam = damroll(4, 8);
+ int dam = damroll(4, 8);
if (monster_to_player || t_idx == player_ptr->riding)
teleport_player_to(player_ptr, m_ptr->fy, m_ptr->fx, i2enum<teleport_flags>(TELEPORT_NONMAGICAL | TELEPORT_PASSIVE));
if (player_ptr->muta.has(PlayerMutationType::SP_TO_HP) && one_in_(2000)) {
MANA_POINT wounds = (MANA_POINT)(player_ptr->mhp - player_ptr->chp);
if (wounds > 0) {
- HIT_POINT healing = player_ptr->csp;
+ int healing = player_ptr->csp;
if (healing > wounds)
healing = wounds;
}
if (player_ptr->muta.has(PlayerMutationType::HP_TO_SP) && !player_ptr->anti_magic && one_in_(4000)) {
- HIT_POINT wounds = (HIT_POINT)(player_ptr->msp - player_ptr->csp);
+ int wounds = (int)(player_ptr->msp - player_ptr->csp);
if (wounds > 0) {
- HIT_POINT healing = player_ptr->chp;
+ int healing = player_ptr->chp;
if (healing > wounds)
healing = wounds;
bool activate_ball_lite(PlayerType *player_ptr, concptr name)
{
- HIT_POINT num = damroll(5, 3);
+ int num = damroll(5, 3);
POSITION y = 0, x = 0;
msg_format(_("%sが稲妻で覆われた...", "The %s is surrounded by lightning..."), name);
for (int k = 0; k < num; k++) {
o_ptr->activation_id = e_ptr->act_idx;
o_ptr->to_h += (HIT_PROB)e_ptr->base_to_h;
- o_ptr->to_d += (HIT_POINT)e_ptr->base_to_d;
+ o_ptr->to_d += (int)e_ptr->base_to_d;
o_ptr->to_a += (ARMOUR_CLASS)e_ptr->base_to_a;
auto is_powerful = e_ptr->gen_flags.has(ItemGenerationTraitType::POWERFUL);
}
o_ptr->to_h += (HIT_PROB)randint1_signed(e_ptr->max_to_h);
- o_ptr->to_d += (HIT_POINT)randint1_signed(e_ptr->max_to_d);
+ o_ptr->to_d += (int)randint1_signed(e_ptr->max_to_d);
o_ptr->to_a += (ARMOUR_CLASS)randint1_signed(e_ptr->max_to_a);
if (gen_flags.has(ItemGenerationTraitType::MOD_ACCURACY)) {
RARITY rarity{}; //<! レアリティ
HIT_PROB base_to_h{}; //!< ベース命中修正
- HIT_POINT base_to_d{}; //!< べ^スダメージ修正
+ int base_to_d{}; //!< べ^スダメージ修正
ARMOUR_CLASS base_to_a{}; //!< ベースAC修正
HIT_PROB max_to_h{}; //!< 最大ボーナス命中修正
- HIT_POINT max_to_d{}; //!< 最大ボーナスダメージ修正
+ int max_to_d{}; //!< 最大ボーナスダメージ修正
ARMOUR_CLASS max_to_a{}; //!< 最大ボーナスAC修正
PARAMETER_VALUE max_pval{}; //!< 最大pval
break;
case SV_RING_DAMAGE:
- this->o_ptr->to_d = 1 + randint1(5) + (HIT_POINT)m_bonus(16, this->level);
+ this->o_ptr->to_d = 1 + randint1(5) + (int)m_bonus(16, this->level);
if (this->power < 0) {
set_bits(this->o_ptr->ident, IDENT_BROKEN);
this->o_ptr->curse_flags.set(CurseTraitType::CURSED);
break;
case SV_RING_SLAYING:
- this->o_ptr->to_d = randint1(5) + (HIT_POINT)m_bonus(12, this->level);
+ this->o_ptr->to_d = randint1(5) + (int)m_bonus(12, this->level);
this->o_ptr->to_h = randint1(5) + (HIT_PROB)m_bonus(12, this->level);
if (this->power < 0) {
while (one_in_(vorpal_chance))
vorpal_magnification++;
- pa_ptr->attack_damage *= (HIT_POINT)vorpal_magnification;
+ pa_ptr->attack_damage *= (int)vorpal_magnification;
auto *r_ptr = &r_info[pa_ptr->m_ptr->r_idx];
if (((r_ptr->flagsr & RFR_RES_ALL) ? pa_ptr->attack_damage / 100 : pa_ptr->attack_damage) > pa_ptr->m_ptr->hp)
msg_format(_("%sを真っ二つにした!", "You cut %s in half!"), pa_ptr->m_name);
PARAMETER_VALUE pval{}; /*!< ベースアイテムのpval(能力修正共通値) Object extra info */
HIT_PROB to_h{}; /*!< ベースアイテムの命中修正値 / Bonus to hit */
- HIT_POINT to_d{}; /*!< ベースアイテムのダメージ修正値 / Bonus to damage */
+ int to_d{}; /*!< ベースアイテムのダメージ修正値 / Bonus to damage */
ARMOUR_CLASS to_a{}; /*!< ベースアイテムのAC修正値 / Bonus to armor */
ARMOUR_CLASS ac{}; /*!< ベースアイテムのAC基本値 / Base armor */
* @param dam 基本ダメージ
* @param max 算出した最大ダメージを返すポインタ
*/
-static void spell_damcalc(PlayerType *player_ptr, monster_type *m_ptr, AttributeType typ, HIT_POINT dam, int *max)
+static void spell_damcalc(PlayerType *player_ptr, monster_type *m_ptr, AttributeType typ, int dam, int *max)
{
auto *r_ptr = &r_info[m_ptr->r_idx];
int rlev = r_ptr->level;
static void spell_damcalc_by_spellnum(PlayerType *player_ptr, MonsterAbilityType ms_type, AttributeType typ, MONSTER_IDX m_idx, int *max)
{
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[m_idx];
- HIT_POINT dam = monspell_damage(player_ptr, ms_type, m_idx, DAM_MAX);
+ int dam = monspell_damage(player_ptr, ms_type, m_idx, DAM_MAX);
spell_damcalc(player_ptr, m_ptr, typ, dam, max);
}
* @return FALSEなら落馬しないことで確定、TRUEなら処理続行
* @details レベルの低い乗馬からは落馬しにくい
*/
-static bool calc_fall_off_possibility(PlayerType *player_ptr, const HIT_POINT dam, const bool force, monster_race *r_ptr)
+static bool calc_fall_off_possibility(PlayerType *player_ptr, const int dam, const bool force, monster_race *r_ptr)
{
if (force)
return true;
* @param force TRUEならば強制的に落馬する
* @return 実際に落馬したらTRUEを返す
*/
-bool process_fall_off_horse(PlayerType *player_ptr, HIT_POINT dam, bool force)
+bool process_fall_off_horse(PlayerType *player_ptr, int dam, bool force)
{
POSITION sy = 0;
POSITION sx = 0;
class MonsterAttackPlayer;
class PlayerType;
void check_fall_off_horse(PlayerType *player_ptr, MonsterAttackPlayer *monap_ptr);
-bool process_fall_off_horse(PlayerType *player_ptr, HIT_POINT dam, bool force);
+bool process_fall_off_horse(PlayerType *player_ptr, int dam, bool force);
auto *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + pa_ptr->hand];
HIT_PROB to_h = o_ptr->to_h;
- HIT_POINT to_d = o_ptr->to_d;
+ int to_d = o_ptr->to_d;
bool flag = true;
for (int i = 0; i < to_h + 3; i++)
if (one_in_(4))
combat_options mode{}; //!< 剣術種別
bool monk_attack{}; //!< 素手/マーシャルアーツかどうか
const martial_arts *ma_ptr{}; //!< マーシャルアーツ種別
- HIT_POINT attack_damage{}; //!< 累積ダメージ
+ int attack_damage{}; //!< 累積ダメージ
int num_blow{}; //!< 打撃回数
TrFlags flags{}; //!< 武器フラグ
chaotic_effect chaos_effect{}; //!< カオス効果
struct mane_data_type {
struct mane_type {
MonsterAbilityType spell{};
- HIT_POINT damage{};
+ int damage{};
};
std::deque<mane_type> mane_list{};
}
if (player_ptr->food < PY_FOOD_STARVE) {
- HIT_POINT dam = (PY_FOOD_STARVE - player_ptr->food) / 10;
+ int dam = (PY_FOOD_STARVE - player_ptr->food) / 10;
if (!is_invuln(player_ptr))
take_hit(player_ptr, DAMAGE_LOSELIFE, dam, _("空腹", "starvation"));
}
#include "view/display-messages.h"
#include "world/world.h"
-using dam_func = HIT_POINT (*)(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura);
+using dam_func = int (*)(PlayerType *player_ptr, int dam, concptr kb_str, bool aura);
/*!
* @brief 酸攻撃による装備のAC劣化処理 /
* @return 修正HPダメージ量
* @details 酸オーラは存在しないが関数ポインタのために引数だけは用意している
*/
-HIT_POINT acid_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura)
+int acid_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura)
{
int inv = (dam < 30) ? 1 : (dam < 60) ? 2
: 3;
dam = (dam + 1) / 2;
}
- HIT_POINT get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
+ int get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
if (!aura && !(double_resist && has_resist_acid(player_ptr)))
inventory_damage(player_ptr, BreakerAcid(), inv);
* @param aura オーラよるダメージが原因ならばTRUE
* @return 修正HPダメージ量
*/
-HIT_POINT elec_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura)
+int elec_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura)
{
int inv = (dam < 30) ? 1 : (dam < 60) ? 2
: 3;
(void)do_dec_stat(player_ptr, A_DEX);
}
- HIT_POINT get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
+ int get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
if (!aura && !(double_resist && has_resist_elec(player_ptr)))
inventory_damage(player_ptr, BreakerElec(), inv);
* @param aura オーラよるダメージが原因ならばTRUE
* @return 修正HPダメージ量
*/
-HIT_POINT fire_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura)
+int fire_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura)
{
int inv = (dam < 30) ? 1 : (dam < 60) ? 2
: 3;
(void)do_dec_stat(player_ptr, A_STR);
}
- HIT_POINT get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
+ int get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
if (!aura && !(double_resist && has_resist_fire(player_ptr)))
inventory_damage(player_ptr, BreakerFire(), inv);
* @param aura オーラよるダメージが原因ならばTRUE
* @return 修正HPダメージ量
*/
-HIT_POINT cold_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura)
+int cold_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura)
{
int inv = (dam < 30) ? 1 : (dam < 60) ? 2
: 3;
(void)do_dec_stat(player_ptr, A_STR);
}
- HIT_POINT get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
+ int get_damage = take_hit(player_ptr, aura ? DAMAGE_NOESCAPE : DAMAGE_ATTACK, dam, kb_str);
if (!aura && !(double_resist && has_resist_cold(player_ptr)))
inventory_damage(player_ptr, BreakerCold(), inv);
* the game when he dies, since the "You die." message is shown before
* setting the player to "dead".
*/
-int take_hit(PlayerType *player_ptr, int damage_type, HIT_POINT damage, concptr hit_from)
+int take_hit(PlayerType *player_ptr, int damage_type, int damage, concptr hit_from)
{
int old_chp = player_ptr->chp;
struct monster_type;
class PlayerType;
-int take_hit(PlayerType *player_ptr, int damage_type, HIT_POINT damage, concptr kb_str);
-HIT_POINT acid_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura);
-HIT_POINT elec_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura);
-HIT_POINT fire_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura);
-HIT_POINT cold_dam(PlayerType *player_ptr, HIT_POINT dam, concptr kb_str, bool aura);
+int take_hit(PlayerType *player_ptr, int damage_type, int damage, concptr kb_str);
+int acid_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura);
+int elec_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura);
+int fire_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura);
+int cold_dam(PlayerType *player_ptr, int dam, concptr kb_str, bool aura);
void touch_zap_player(monster_type *m_ptr, PlayerType *player_ptr);
}
}
-void PlayerSkill::gain_riding_skill_exp_on_fall_off_check(HIT_POINT dam)
+void PlayerSkill::gain_riding_skill_exp_on_fall_off_check(int dam)
{
auto now_exp = this->player_ptr->skill_exp[PlayerSkillKindType::RIDING];
auto max_exp = s_info[enum2i(this->player_ptr->pclass)].s_max[PlayerSkillKindType::RIDING];
void gain_two_weapon_skill_exp();
void gain_riding_skill_exp_on_melee_attack(const monster_race *r_ptr);
void gain_riding_skill_exp_on_range_attack();
- void gain_riding_skill_exp_on_fall_off_check(HIT_POINT dam);
+ void gain_riding_skill_exp_on_fall_off_check(int dam);
void gain_spell_skill_exp(int realm, int spell_idx);
void gain_continuous_spell_skill_exp(int realm, int spell_idx);
PlayerSkillRank gain_spell_skill_exp_over_learning(int spell_idx);
return _("炎、電撃、冷気、酸のどれかの球を放つ。", "Fires a ball of some elements.");
{
- HIT_POINT dam = 75 + plev;
+ int dam = 75 + plev;
POSITION rad = 2;
if (info)
return _("自分を中心とした轟音の球を発生させる。", "Generates a ball of sound centered on you.");
{
- HIT_POINT dam = 60 + plev;
+ int dam = 60 + plev;
POSITION rad = plev / 10 + 2;
if (info)
return _("炎の球を放つ。", "Fires a ball of fire.");
{
- HIT_POINT dam = plev + 55;
+ int dam = plev + 55;
POSITION rad = 2;
if (info)
return _("巨大なカオスの球を放つ。", "Fires a huge ball of chaos.");
{
- HIT_POINT dam = plev * 2 + 99;
+ int dam = plev * 2 + 99;
POSITION rad = plev / 5;
if (info)
return _("巨大な分解の球を放つ。", "Fires a huge ball of disintegration.");
{
- HIT_POINT dam = plev + 70;
+ int dam = plev + 70;
POSITION rad = 3 + plev / 40;
if (info)
return _("ロケットを発射する。", "Fires a magic rocket.");
{
- HIT_POINT dam = 120 + plev * 2;
+ int dam = 120 + plev * 2;
POSITION rad = 2;
if (info)
return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
{
- HIT_POINT dam = plev * 2;
+ int dam = plev * 2;
POSITION rad = 2;
if (info)
return _("自分を中心とした超巨大な炎の球を発生させる。", "Generates a huge ball of fire centered on you.");
{
- HIT_POINT dam = 300 + 3 * plev;
+ int dam = 300 + 3 * plev;
POSITION rad = 8;
if (info)
return _("非常に強力で巨大な純粋な魔力の球を放つ。", "Fires an extremely powerful huge ball of pure mana.");
{
- HIT_POINT dam = 300 + plev * 4;
+ int dam = 300 + plev * 4;
POSITION rad = 4;
if (info)
return _("非常に強力なカオスの球を放つ。", "Fires an extremely powerful ball of chaos.");
{
- HIT_POINT dam = player_ptr->chp;
+ int dam = player_ptr->chp;
POSITION rad = 2;
if (info)
return _("強力な電撃のボルトを放つ。", "Fires a powerful bolt of lightning.");
{
- HIT_POINT dam = plev * 5;
+ int dam = plev * 5;
if (info)
return info_damage(0, 0, dam);
return _("巨大な閃光の球を放つ。", "Fires a huge ball of powerful light.");
{
- HIT_POINT dam = 100 + plev * 2;
+ int dam = 100 + plev * 2;
POSITION rad = 4;
if (info)
return _("ターゲットの周囲に分解の球を多数落とす。", "Drops many balls of disintegration near the target.");
{
- HIT_POINT dam = plev * 3 + 25;
+ int dam = plev * 3 + 25;
POSITION rad = 2;
if (info)
return _("毒の球を放つ。", "Fires a ball of poison.");
{
- HIT_POINT dam = 10 + plev / 2;
+ int dam = 10 + plev / 2;
POSITION rad = 2;
if (info)
return _("自分を中心とした毒の球を発生させる。", "Generates a ball of poison centered on you.");
{
- HIT_POINT dam = (30 + plev) * 2;
+ int dam = (30 + plev) * 2;
POSITION rad = plev / 10 + 2;
if (info)
return info_damage(dice, sides, base);
if (cast) {
- HIT_POINT dam = base + damroll(dice, sides);
+ int dam = base + damroll(dice, sides);
if (!get_aim_dir(player_ptr, &dir))
return nullptr;
return _("3連射のボルトによりモンスター1体から生命力を吸いとる。吸いとった生命力によって体力が回復する。",
"Fires 3 bolts. Each of the bolts absorbs some HP from a monster and gives them to you.");
{
- HIT_POINT dam = 100;
+ int dam = 100;
if (info)
return format("%s3*%d", KWD_DAM, dam);
return _("巨大な暗黒の球を放つ。", "Fires a huge ball of darkness.");
{
- HIT_POINT dam = 100 + plev * 2;
+ int dam = 100 + plev * 2;
POSITION rad = 4;
if (info)
"邪悪な力を持つ宝珠を放つ。善良なモンスターには大きなダメージを与える。", "Fires a powerful ball of evil power. Hurts good monsters greatly.");
{
- HIT_POINT dam = 666;
+ int dam = 666;
POSITION rad = 3;
if (info)
return _("炎の球を放つ。", "Fires a ball of fire.");
{
- HIT_POINT dam = plev + 55;
+ int dam = plev + 55;
POSITION rad = 2;
if (info)
return _("大きな地獄の球を放つ。", "Fires a huge ball of nether.");
{
- HIT_POINT dam = plev * 3 / 2 + 100;
+ int dam = plev * 3 / 2 + 100;
POSITION rad = plev / 20 + 2;
if (info)
return _("自分を中心とした炎の球を作り出し、床を溶岩に変える。", "Generates a ball of fire centered on you which transforms floors to magma.");
{
- HIT_POINT dam = (55 + plev) * 2;
+ int dam = (55 + plev) * 2;
POSITION rad = 3;
if (info)
return _("プラズマの球を放つ。", "Fires a ball of plasma.");
{
- HIT_POINT dam = plev * 3 / 2 + 80;
+ int dam = plev * 3 / 2 + 80;
POSITION rad = 2 + plev / 40;
if (info)
return _("因果混乱の球を放つ。", "Fires a ball of nexus.");
{
- HIT_POINT dam = 100 + plev * 2;
+ int dam = 100 + plev * 2;
POSITION rad = 4;
if (info)
"Generates balls of chaos, confusion and charm centered on you.");
{
- HIT_POINT dam = 50 + plev;
+ int dam = 50 + plev;
int power = 20 + plev;
POSITION rad = 3 + plev / 20;
return _("超巨大な地獄の球を放つ。", "Generates a huge ball of nether.");
{
- HIT_POINT dam = plev * 15;
+ int dam = plev * 15;
POSITION rad = plev / 5;
if (info)
"Puts blood curse, which damages and causes various effects, on a monster. You also take damage.");
{
- HIT_POINT dam = 600;
+ int dam = 600;
POSITION rad = 0;
if (info)
auto continuation = mode == SpellProcessType::CONTNUATION;
auto stop = mode == SpellProcessType::STOP;
auto should_continue = true;
- HIT_POINT power;
+ int power;
switch (spell) {
/*** 1st book (0-7) ***/
case HEX_BLESS:
return _("巨大な冷気の球を放つ。", "Fires a huge ball of cold.");
{
- HIT_POINT dam = 70 + plev * 3 / 2;
+ int dam = 70 + plev * 3 / 2;
POSITION rad = plev / 12 + 1;
if (info)
return _("巨大な電撃の球を放つ。", "Fires a huge electric ball.");
{
- HIT_POINT dam = 90 + plev * 3 / 2;
+ int dam = 90 + plev * 3 / 2;
POSITION rad = plev / 12 + 1;
if (info)
return _("巨大な水の球を放つ。", "Fires a huge ball of water.");
{
- HIT_POINT dam = 100 + plev * 3 / 2;
+ int dam = 100 + plev * 3 / 2;
POSITION rad = plev / 12 + 1;
if (info)
"Generates ball of light centered on you. Maps and lights whole dungeon level. Knows all objects location.");
{
- HIT_POINT dam = 150;
+ int dam = 150;
POSITION rad = 8;
if (info)
return _("自分の周辺に隕石を落とす。", "Causes meteorites to fall down on nearby random locations.");
{
- HIT_POINT dam = plev * 2;
+ int dam = plev * 2;
POSITION rad = 2;
if (info)
while (one_in_(4))
more_magnification++;
- pa_ptr->attack_damage *= (HIT_POINT)more_magnification;
+ pa_ptr->attack_damage *= (int)more_magnification;
}
/*!
pa_ptr->attack_damage = damroll(o_ptr->dd + player_ptr->to_dd[pa_ptr->hand], o_ptr->ds + player_ptr->to_ds[pa_ptr->hand]);
int magnification = calc_death_scythe_reflection_magnification(player_ptr);
compensate_death_scythe_reflection_magnification(player_ptr, &magnification, death_scythe_flags);
- pa_ptr->attack_damage *= (HIT_POINT)magnification;
+ pa_ptr->attack_damage *= (int)magnification;
pa_ptr->attack_damage /= 10;
pa_ptr->attack_damage = critical_norm(player_ptr, o_ptr->weight, o_ptr->to_h, pa_ptr->attack_damage, player_ptr->to_h[pa_ptr->hand], pa_ptr->mode);
death_scythe_reflection_critial_hit(pa_ptr);
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam)
+bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
return project_hook(player_ptr, AttributeType::KILL_WALL, dir, dam, flg);
#include "system/angband.h"
class PlayerType;
-bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam);
+bool wall_to_mud(PlayerType *player_ptr, DIRECTION dir, int dam);
bool wizard_lock(PlayerType *player_ptr, DIRECTION dir);
bool destroy_door(PlayerType *player_ptr, DIRECTION dir);
bool disarm_trap(PlayerType *player_ptr, DIRECTION dir);
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
+bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
if (typ == AttributeType::CHARM_LIVING)
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
+bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad)
{
return fire_ball(player_ptr, typ, dir, dam, -rad);
}
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
+bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad)
{
POSITION tx = player_ptr->x + 99 * ddx[dir];
POSITION ty = player_ptr->y + 99 * ddy[dir];
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
+bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad)
{
POSITION tx = player_ptr->x + 99 * ddx[dir];
POSITION ty = player_ptr->y + 99 * ddy[dir];
* Option to hurt the player.
* </pre>
*/
-bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, HIT_POINT dam, POSITION rad)
+bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION y, POSITION x, int dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
return project(player_ptr, who, rad, y, x, dam, typ, flg).notice;
* Affect monsters and grids (not objects).
* </pre>
*/
-bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam)
+bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
if (typ != AttributeType::MONSTER_SHOOT)
* Affect monsters, grids and objects.
* </pre>
*/
-bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam)
+bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
return project_hook(player_ptr, typ, dir, dam, flg);
* Affect monsters, grids and objects.
* </pre>
*/
-bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam)
+bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, int dam)
{
if (randint0(100) < prob) {
return (fire_beam(player_ptr, typ, dir, dam));
* @param flg フラグ
* @return 作用が実際にあった場合TRUEを返す
*/
-bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
+bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, BIT_FLAGS flg)
{
flg |= (PROJECT_THRU);
POSITION tx = player_ptr->x + ddx[dir];
#include "effect/attribute-types.h"
class PlayerType;
-bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
-bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
-bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
-bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, POSITION rad);
-bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, HIT_POINT dam, POSITION rad);
-bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam);
+bool fire_ball(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
+bool fire_breath(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
+bool fire_rocket(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
+bool fire_ball_hide(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, POSITION rad);
+bool fire_meteor(PlayerType *player_ptr, MONSTER_IDX who, AttributeType typ, POSITION x, POSITION y, int dam, POSITION rad);
+bool fire_bolt(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam);
bool fire_blast(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, DICE_NUMBER dd, DICE_SID ds, int num, int dev);
-bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam);
-bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, HIT_POINT dam);
-bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg);
+bool fire_beam(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam);
+bool fire_bolt_or_beam(PlayerType *player_ptr, PERCENTAGE prob, AttributeType typ, DIRECTION dir, int dam);
+bool project_hook(PlayerType *player_ptr, AttributeType typ, DIRECTION dir, int dam, BIT_FLAGS flg);
msg_print(_("杖の先が明るく輝いた...", "The end of the staff glows brightly..."));
}
- HIT_POINT num = damroll(5, 3);
+ int num = damroll(5, 3);
int attempts;
POSITION y = 0, x = 0;
for (int k = 0; k < num; k++) {
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool lite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad)
+bool lite_area(PlayerType *player_ptr, int dam, POSITION rad)
{
if (d_info[player_ptr->dungeon_idx].flags.has(DungeonFeatureType::DARKNESS)) {
msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorbs your light."));
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool unlite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad)
+bool unlite_area(PlayerType *player_ptr, int dam, POSITION rad)
{
if (!player_ptr->blind) {
msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool lite_line(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam)
+bool lite_line(PlayerType *player_ptr, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
return project_hook(player_ptr, AttributeType::LITE_WEAK, dir, dam, flg);
void lite_room(PlayerType *player_ptr, POSITION y1, POSITION x1);
bool starlight(PlayerType *player_ptr, bool magic);
void unlite_room(PlayerType *player_ptr, POSITION y1, POSITION x1);
-bool lite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad);
-bool unlite_area(PlayerType *player_ptr, HIT_POINT dam, POSITION rad);
-bool lite_line(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam);
+bool lite_area(PlayerType *player_ptr, int dam, POSITION rad);
+bool unlite_area(PlayerType *player_ptr, int dam, POSITION rad);
+bool lite_line(PlayerType *player_ptr, DIRECTION dir, int dam);
continue;
}
- HIT_POINT dam = m_ptr->maxhp / 2;
+ int dam = m_ptr->maxhp / 2;
if (dam > 100)
dam = (dam - 100) / 2 + 100;
if (dam > 400)
case 30:
case 31:
if (!(*count)) {
- HIT_POINT dam = damroll(10, 10);
+ int dam = damroll(10, 10);
msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
project(player_ptr, 0, 8, player_ptr->y, player_ptr->x, dam, AttributeType::MANA, flg);
take_hit(player_ptr, DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"));
* this is done in two passes. -- JDL
* </pre>
*/
-bool project_all_los(PlayerType *player_ptr, AttributeType typ, HIT_POINT dam)
+bool project_all_los(PlayerType *player_ptr, AttributeType typ, int dam)
{
for (MONSTER_IDX i = 1; i < player_ptr->current_floor_ptr->m_max; i++) {
auto *m_ptr = &player_ptr->current_floor_ptr->m_list[i];
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_undead(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_undead(PlayerType *player_ptr, int dam)
{
bool tester = (project_all_los(player_ptr, AttributeType::DISP_UNDEAD, dam));
if (tester)
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_evil(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_evil(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::DISP_EVIL, dam);
}
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_good(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_good(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::DISP_GOOD, dam);
}
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::DISP_ALL, dam);
}
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_living(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_living(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::DISP_LIVING, dam);
}
* @param player_ptr プレイヤーへの参照ポインタ
* @return 効力があった場合TRUEを返す
*/
-bool dispel_demons(PlayerType *player_ptr, HIT_POINT dam)
+bool dispel_demons(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::DISP_DEMON, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool confuse_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool confuse_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::OLD_CONF, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool charm_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool charm_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::CHARM, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool charm_animals(PlayerType *player_ptr, HIT_POINT dam)
+bool charm_animals(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::CONTROL_ANIMAL, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool stun_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool stun_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::STUN, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool stasis_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool stasis_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::STASIS, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool mindblast_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool mindblast_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::PSI, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool turn_evil(PlayerType *player_ptr, HIT_POINT dam)
+bool turn_evil(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::TURN_EVIL, dam);
}
* @param dam 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool turn_monsters(PlayerType *player_ptr, HIT_POINT dam)
+bool turn_monsters(PlayerType *player_ptr, int dam)
{
return project_all_los(player_ptr, AttributeType::TURN_ALL, dam);
}
struct monster_race;
struct monster_type;
class PlayerType;
-bool project_all_los(PlayerType *player_ptr, AttributeType typ, HIT_POINT dam);
+bool project_all_los(PlayerType *player_ptr, AttributeType typ, int dam);
bool speed_monsters(PlayerType *player_ptr);
bool slow_monsters(PlayerType *player_ptr, int power);
bool sleep_monsters(PlayerType *player_ptr, int power);
void aggravate_monsters(PlayerType *player_ptr, MONSTER_IDX who);
bool banish_evil(PlayerType *player_ptr, int dist);
bool turn_undead(PlayerType *player_ptr);
-bool dispel_evil(PlayerType *player_ptr, HIT_POINT dam);
-bool dispel_good(PlayerType *player_ptr, HIT_POINT dam);
-bool dispel_undead(PlayerType *player_ptr, HIT_POINT dam);
-bool dispel_monsters(PlayerType *player_ptr, HIT_POINT dam);
-bool dispel_living(PlayerType *player_ptr, HIT_POINT dam);
-bool dispel_demons(PlayerType *player_ptr, HIT_POINT dam);
+bool dispel_evil(PlayerType *player_ptr, int dam);
+bool dispel_good(PlayerType *player_ptr, int dam);
+bool dispel_undead(PlayerType *player_ptr, int dam);
+bool dispel_monsters(PlayerType *player_ptr, int dam);
+bool dispel_living(PlayerType *player_ptr, int dam);
+bool dispel_demons(PlayerType *player_ptr, int dam);
bool crusade(PlayerType *player_ptr);
-bool confuse_monsters(PlayerType *player_ptr, HIT_POINT dam);
-bool charm_monsters(PlayerType *player_ptr, HIT_POINT dam);
-bool charm_animals(PlayerType *player_ptr, HIT_POINT dam);
-bool stun_monsters(PlayerType *player_ptr, HIT_POINT dam);
-bool stasis_monsters(PlayerType *player_ptr, HIT_POINT dam);
-bool mindblast_monsters(PlayerType *player_ptr, HIT_POINT dam);
+bool confuse_monsters(PlayerType *player_ptr, int dam);
+bool charm_monsters(PlayerType *player_ptr, int dam);
+bool charm_animals(PlayerType *player_ptr, int dam);
+bool stun_monsters(PlayerType *player_ptr, int dam);
+bool stasis_monsters(PlayerType *player_ptr, int dam);
+bool mindblast_monsters(PlayerType *player_ptr, int dam);
bool banish_monsters(PlayerType *player_ptr, int dist);
-bool turn_evil(PlayerType *player_ptr, HIT_POINT dam);
-bool turn_monsters(PlayerType *player_ptr, HIT_POINT dam);
+bool turn_evil(PlayerType *player_ptr, int dam);
+bool turn_monsters(PlayerType *player_ptr, int dam);
bool deathray_monsters(PlayerType *player_ptr);
void probed_monster_info(char *buf, PlayerType *player_ptr, monster_type *m_ptr, monster_race *r_ptr);
bool probing(PlayerType *player_ptr);
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam)
+bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return project_hook(player_ptr, AttributeType::HYPODYNAMIA, dir, dam, flg);
#include "system/angband.h"
class PlayerType;
-bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam);
+bool hypodynamic_bolt(PlayerType *player_ptr, DIRECTION dir, int dam);
bool death_ray(PlayerType *player_ptr, DIRECTION dir, PLAYER_LEVEL plev);
* @param rad 効力の半径
* @details このファイルにいるのは、spells-trump.c と比べて行数が少なかったため。それ以上の意図はない
*/
-void cast_meteor(PlayerType *player_ptr, HIT_POINT dam, POSITION rad)
+void cast_meteor(PlayerType *player_ptr, int dam, POSITION rad)
{
int b = 10 + randint1(10);
for (int i = 0; i < b; i++) {
class PlayerType;
void call_the_void(PlayerType *player_ptr);
bool vanish_dungeon(PlayerType *player_ptr);
-void cast_meteor(PlayerType *player_ptr, HIT_POINT dam, POSITION rad);
+void cast_meteor(PlayerType *player_ptr, int dam, POSITION rad);
* @param rad 効力の半径
* @return ターゲットを指定し、実行したならばTRUEを返す。
*/
-bool cast_wrath_of_the_god(PlayerType *player_ptr, HIT_POINT dam, POSITION rad)
+bool cast_wrath_of_the_god(PlayerType *player_ptr, int dam, POSITION rad)
{
DIRECTION dir;
if (!get_aim_dir(player_ptr, &dir))
#include "system/angband.h"
class PlayerType;
-bool cast_wrath_of_the_god(PlayerType *player_ptr, HIT_POINT dam, POSITION rad);
+bool cast_wrath_of_the_god(PlayerType *player_ptr, int dam, POSITION rad);
bool set_tim_sh_holy(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec);
bool set_tim_eyeeye(PlayerType *player_ptr, TIME_EFFECT v, bool do_dec);
* @brief 復讐ダメージの追加を行う
* @param dam 蓄積されるダメージ量
*/
-void SpellHex::store_vengeful_damage(HIT_POINT dam)
+void SpellHex::store_vengeful_damage(int dam)
{
if (!this->spell_hex_data || (this->get_revenge_turn() == 0)) {
return;
void stop_all_spells();
bool is_casting_full_capacity() const;
void continue_revenge();
- void store_vengeful_damage(HIT_POINT dam);
+ void store_vengeful_damage(int dam);
bool check_hex_barrier(MONSTER_IDX m_idx, spell_hex_type type) const;
bool is_spelling_specific(int hex) const;
bool is_spelling_any() const;
* @param m_ptr 対象モンスター
* @return 魅了に抵抗したらTRUE
*/
-bool common_saving_throw_charm(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr)
+bool common_saving_throw_charm(PlayerType *player_ptr, int pow, monster_type *m_ptr)
{
auto *r_ptr = &r_info[m_ptr->r_idx];
* @param m_ptr 対象モンスター
* @return 服従に抵抗したらTRUE
*/
-bool common_saving_throw_control(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr)
+bool common_saving_throw_control(PlayerType *player_ptr, int pow, monster_type *m_ptr)
{
auto *r_ptr = &r_info[m_ptr->r_idx];
struct monster_type;
class PlayerType;
-bool common_saving_throw_control(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr);
-bool common_saving_throw_charm(PlayerType *player_ptr, HIT_POINT pow, monster_type *m_ptr);
+bool common_saving_throw_control(PlayerType *player_ptr, int pow, monster_type *m_ptr);
+bool common_saving_throw_charm(PlayerType *player_ptr, int pow, monster_type *m_ptr);
PERCENTAGE beam_chance(PlayerType *player_ptr);
* Note that "num_ac" requires armour, else weapon
* Returns TRUE if attempted, FALSE if cancelled
*/
-bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac)
+bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, int num_dam, ARMOUR_CLASS num_ac)
{
/* Assume enchant weapon */
FuncItemTester item_tester(&ObjectType::allow_enchant_weapon);
#define ENCH_TOAC 0x04 /*!< 装備強化処理: AC強化 / Enchant to AC */
#define ENCH_FORCE 0x08 /*!< 装備強化処理: 無条件に成功させる / Force enchantment */
bool enchant_equipment(PlayerType *player_ptr, ObjectType *o_ptr, int n, int eflag);
-bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, HIT_POINT num_dam, ARMOUR_CLASS num_ac);
+bool enchant_spell(PlayerType *player_ptr, HIT_PROB num_hit, int num_dam, ARMOUR_CLASS num_ac);
void brand_weapon(PlayerType *player_ptr, int brand_type);
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool heal_monster(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam)
+bool heal_monster(PlayerType *player_ptr, DIRECTION dir, int dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return project_hook(player_ptr, AttributeType::OLD_HEAL, dir, dam, flg);
*/
void roll_hitdice(PlayerType *player_ptr, spell_operation options)
{
- HIT_POINT min_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 3 / 8;
- HIT_POINT max_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 5 / 8;
+ int min_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 3 / 8;
+ int max_value = player_ptr->hitdie + ((PY_MAX_LEVEL + 2) * (player_ptr->hitdie + 1)) * 5 / 8;
/* Rerate */
while (true) {
/* Pre-calculate level 1 hitdice */
- player_ptr->player_hp[0] = (HIT_POINT)player_ptr->hitdie;
+ player_ptr->player_hp[0] = (int)player_ptr->hitdie;
for (int i = 1; i < 4; i++) {
player_ptr->player_hp[0] += randint1(player_ptr->hitdie);
return ident;
}
-bool cure_critical_wounds(PlayerType *player_ptr, HIT_POINT pow)
+bool cure_critical_wounds(PlayerType *player_ptr, int pow)
{
auto ident = false;
if (hp_player(player_ptr, pow)) {
return ident;
}
-bool true_healing(PlayerType *player_ptr, HIT_POINT pow)
+bool true_healing(PlayerType *player_ptr, int pow)
{
auto ident = false;
if (hp_player(player_ptr, pow)) {
class ObjectType;
class PlayerType;
struct monster_type;
-bool heal_monster(PlayerType *player_ptr, DIRECTION dir, HIT_POINT dam);
+bool heal_monster(PlayerType *player_ptr, DIRECTION dir, int dam);
bool speed_monster(PlayerType *player_ptr, DIRECTION dir, int power);
bool slow_monster(PlayerType *player_ptr, DIRECTION dir, int power);
bool sleep_monster(PlayerType *player_ptr, DIRECTION dir, int power);
bool berserk(PlayerType *player_ptr, int base);
bool cure_light_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides);
bool cure_serious_wounds(PlayerType *player_ptr, DICE_NUMBER dice, DICE_SID sides);
-bool cure_critical_wounds(PlayerType *player_ptr, HIT_POINT pow);
-bool true_healing(PlayerType *player_ptr, HIT_POINT pow);
+bool cure_critical_wounds(PlayerType *player_ptr, int pow);
+bool true_healing(PlayerType *player_ptr, int pow);
bool restore_mana(PlayerType *player_ptr, bool magic_eater);
bool restore_all_status(PlayerType *player_ptr);
OBJECT_SUBTYPE_VALUE sval{}; /*!< ベースアイテム小項目ID / Artifact sub type */
PARAMETER_VALUE pval{}; /*!< pval修正値 / Artifact extra info */
HIT_PROB to_h{}; /*!< 命中ボーナス値 / Bonus to hit */
- HIT_POINT to_d{}; /*!< ダメージボーナス値 / Bonus to damage */
+ int to_d{}; /*!< ダメージボーナス値 / Bonus to damage */
ARMOUR_CLASS to_a{}; /*!< ACボーナス値 / Bonus to armor */
ARMOUR_CLASS ac{}; /*!< 上書きベースAC値 / Base armor */
DICE_NUMBER dd{};
typedef char GAME_TEXT; /*!< ゲーム中のテキスト型定義 */
/*!
- * @var typedef int32_t HIT_POINT
- * @brief HPとその増減量の型定義
- * @details
- * HIT_POINTはプレイヤー及びモンスターのHPの各値とその増減量の型である。
- */
-typedef int32_t HIT_POINT;
-
-/*!
* @var typedef int32_t MANA_POINT
* @brief MPとその増減量の型定義
* @details
POSITION fy{}; /*!< 所在グリッドY座標 / Y location on map */
POSITION fx{}; /*!< 所在グリッドX座標 / X location on map */
- HIT_POINT hp{}; /*!< 現在のHP / Current Hit points */
- HIT_POINT maxhp{}; /*!< 現在の最大HP(衰弱効果などにより低下したものの反映) / Max Hit points */
- HIT_POINT max_maxhp{}; /*!< 生成時の初期最大HP / Max Max Hit points */
- HIT_POINT dealt_damage{}; /*!< これまでに蓄積して与えてきたダメージ / Sum of damages dealt by player */
+ int hp{}; /*!< 現在のHP / Current Hit points */
+ int maxhp{}; /*!< 現在の最大HP(衰弱効果などにより低下したものの反映) / Max Hit points */
+ int max_maxhp{}; /*!< 生成時の初期最大HP / Max Max Hit points */
+ int dealt_damage{}; /*!< これまでに蓄積して与えてきたダメージ / Sum of damages dealt by player */
TIME_EFFECT mtimed[MAX_MTIMED]{}; /*!< 与えられた時限効果の残りターン / Timed status counter */
byte mspeed{}; /*!< モンスターの個体加速値 / Monster "speed" */
ACTION_ENERGY energy_need{}; /*!< モンスター次ターンまでに必要な行動エネルギー / Monster "energy" */
std::optional<RandomArtActType> smith_act_idx; //!< 鍛冶で付与された発動効果のID
HIT_PROB to_h{}; /*!< Plusses to hit */
- HIT_POINT to_d{}; /*!< Plusses to damage */
+ int to_d{}; /*!< Plusses to damage */
ARMOUR_CLASS to_a{}; /*!< Plusses to AC */
ARMOUR_CLASS ac{}; /*!< Normal AC */
POSITION wilderness_y{};
bool wild_mode{};
- HIT_POINT mhp{}; /* Max hit pts */
- HIT_POINT chp{}; /* Cur hit pts */
+ int mhp{}; /* Max hit pts */
+ int chp{}; /* Cur hit pts */
uint32_t chp_frac{}; /* Cur hit frac (times 2^16) */
PERCENTAGE mutant_regenerate_mod{};
ClassSpecificData class_specific_data;
- HIT_POINT player_hp[PY_MAX_LEVEL]{};
+ int player_hp[PY_MAX_LEVEL]{};
char died_from[MAX_MONSTER_NAME]{}; /* What killed the player */
concptr last_message{}; /* Last message on death or retirement */
char history[4][60]{}; /* Textual "history" for the Player */
HIT_PROB dis_to_h[2]{}; /*!< 判明している現在の表記上の近接武器命中修正値 / Known bonus to hit (wield) */
HIT_PROB dis_to_h_b{}; /*!< 判明している現在の表記上の射撃武器命中修正値 / Known bonus to hit (bow) */
- HIT_POINT dis_to_d[2]{}; /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
+ int dis_to_d[2]{}; /*!< 判明している現在の表記上の近接武器ダメージ修正値 / Known bonus to dam (wield) */
ARMOUR_CLASS dis_to_a{}; /*!< 判明している現在の表記上の装備AC修正値 / Known bonus to ac */
ARMOUR_CLASS dis_ac{}; /*!< 判明している現在の表記上の装備AC基礎値 / Known base ac */
static void display_player_melee_bonus(PlayerType *player_ptr, int hand, int hand_entry)
{
HIT_PROB show_tohit = player_ptr->dis_to_h[hand];
- HIT_POINT show_todam = player_ptr->dis_to_d[hand];
+ int show_todam = player_ptr->dis_to_d[hand];
auto *o_ptr = &player_ptr->inventory_list[INVEN_MAIN_HAND + hand];
if (o_ptr->is_known())
{
auto *o_ptr = &player_ptr->inventory_list[INVEN_BOW];
HIT_PROB show_tohit = player_ptr->dis_to_h_b;
- HIT_POINT show_todam = 0;
+ int show_todam = 0;
if (o_ptr->is_known())
show_tohit += o_ptr->to_h;
if (o_ptr->is_known())
* @param self 自分に与えるか否か
* @details デフォルトは100万・GF_ARROW(射撃)。RES_ALL持ちも一撃で殺せる。
*/
-void wiz_kill_target(PlayerType *player_ptr, HIT_POINT dam, AttributeType effect_idx, const bool self)
+void wiz_kill_target(PlayerType *player_ptr, int dam, AttributeType effect_idx, const bool self)
{
if (dam <= 0) {
dam = 1000000;
} spell2;
struct debug_spell_type3 {
- bool (*spell_function)(PlayerType *, HIT_POINT);
+ bool (*spell_function)(PlayerType *, int);
} spell3;
struct debug_spell_type4 { // 実質 ty curse
void wiz_summon_random_enemy(PlayerType *player_ptr, int num);
void wiz_summon_specific_enemy(PlayerType *player_ptr, MONRACE_IDX r_idx);
void wiz_summon_pet(PlayerType *player_ptr, MONRACE_IDX r_idx);
-void wiz_kill_target(PlayerType *player_ptr, HIT_POINT dam = 1000000, AttributeType effect_idx = AttributeType::DEBUG, const bool self = false);
+void wiz_kill_target(PlayerType *player_ptr, int dam = 1000000, AttributeType effect_idx = AttributeType::DEBUG, const bool self = false);