case 28:
case 29:
{
- hit_prob bonus_h;
- hit_point bonus_d;
+ HIT_PROB bonus_h;
+ HIT_POINT bonus_d;
add_flag(o_ptr->art_flags, TR_SHOW_MODS);
- bonus_h = 4 + (hit_prob)(randint1(11));
- bonus_d = 4 + (hit_point)(randint1(11));
+ bonus_h = 4 + (HIT_PROB)(randint1(11));
+ bonus_d = 4 + (HIT_POINT)(randint1(11));
if ((o_ptr->tval != TV_SWORD) && (o_ptr->tval != TV_POLEARM) && (o_ptr->tval != TV_HAFTED) && (o_ptr->tval != TV_DIGGING) && (o_ptr->tval != TV_GLOVES) && (o_ptr->tval != TV_RING))
{
bonus_h /= 2;
case ACT_ULTIMATE_RESIST:
{
- time_effect v = randint1(25)+25;
+ TIME_EFFECT v = randint1(25)+25;
(void)set_afraid(0);
(void)set_hero(v, FALSE);
(void)hp_player(10);
for (i = 0; i < 2; i++)
{
s32b tmp = randint0(60*60*60);
- base_status val;
+ BASE_STATUS val;
/* Extract 5 + 1d3 + 1d4 + 1d5 */
val = 5 + 3;
val = 5 + 3;
val += tmp % 3; tmp /= 3;
val += tmp % 4; tmp /= 4;
- val += (base_status)tmp;
+ val += (BASE_STATUS)tmp;
/* Save that value */
sum += val;
/* Acquire the stats */
for (i = 0; i < 6; i++)
{
- base_status max_max = 18 + 60 + dice[i]*10;
+ BASE_STATUS max_max = 18 + 60 + dice[i]*10;
/* Save that value */
p_ptr->stat_max_max[i] = max_max;
* @param dam 現在算出中のダメージ値
* @return クリティカル修正が入ったダメージ値
*/
-hit_point critical_shot(int weight, int plus_ammo, int plus_bow, hit_point dam)
+HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam)
{
int i, k;
object_type *j_ptr = &inventory[INVEN_BOW];
* @param mode オプションフラグ
* @return クリティカル修正が入ったダメージ値
*/
-hit_point critical_norm(int weight, int plus, hit_point dam, s16b meichuu, int mode)
+HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, int mode)
{
int i, k;
hit_trap_set_abnormal_status(
_("黒いガスに包み込まれた!", "A black gas surrounds you!"),
p_ptr->resist_blind,
- set_blind, p_ptr->blind + (time_effect)randint0(50) + 25);
+ set_blind, p_ptr->blind + (TIME_EFFECT)randint0(50) + 25);
break;
}
hit_trap_set_abnormal_status(
_("きらめくガスに包み込まれた!", "A gas of scintillating colors surrounds you!"),
p_ptr->resist_conf,
- set_confused, p_ptr->confused + (time_effect)randint0(20) + 10);
+ set_confused, p_ptr->confused + (TIME_EFFECT)randint0(20) + 10);
break;
}
hit_trap_set_abnormal_status(
_("刺激的な緑色のガスに包み込まれた!", "A pungent green gas surrounds you!"),
p_ptr->resist_pois || IS_OPPOSE_POIS(),
- set_poisoned, p_ptr->poisoned + (time_effect)randint0(20) + 10);
+ set_poisoned, p_ptr->poisoned + (TIME_EFFECT)randint0(20) + 10);
break;
}
*/
static void natural_attack(s16b m_idx, int attack, bool *fear, bool *mdeath)
{
- hit_point k;
+ HIT_POINT k;
int bonus, chance;
int n_weight = 0;
monster_type *m_ptr = &m_list[m_idx];
static void py_attack_aux(int y, int x, bool *fear, bool *mdeath, s16b hand, int mode)
{
int num = 0, bonus, chance, vir;
- hit_point k;
+ HIT_POINT k;
cave_type *c_ptr = &cave[y][x];
int now_exp = p_ptr->weapon_exp[tval][sval];
if (now_exp < s_info[p_ptr->pclass].w_max[tval][sval])
{
- sub_exp amount = 0;
+ SUB_EXP amount = 0;
if (now_exp < WEAPON_EXP_BEGINNER) amount = 80;
else if (now_exp < WEAPON_EXP_SKILLED) amount = 10;
else if ((now_exp < WEAPON_EXP_EXPERT) && (p_ptr->lev > 19)) amount = 1;
mult++;
}
- k *= (hit_point)mult;
+ k *= (HIT_POINT)mult;
/* Ouch! */
if (((r_ptr->flagsr & RFR_RES_ALL) ? k/100 : k) > m_ptr->hp)
{
if (is_human)
{
- hit_prob to_h = o_ptr->to_h;
- hit_point to_d = o_ptr->to_d;
+ HIT_PROB to_h = o_ptr->to_h;
+ HIT_POINT to_d = o_ptr->to_d;
int i, flag;
flag = 1;
p_ptr->redraw |= (PR_MANA);
mult = mult * 3 / 2 + 20;
}
- k *= (hit_point)mult;
+ k *= (HIT_POINT)mult;
k /= 10;
}
mult++;
}
- k *= (hit_point)mult;
+ k *= (HIT_POINT)mult;
}
k += (p_ptr->to_d[hand] + o_ptr->to_d);
if (k < 0) k = 0;
* @param mpe_mode 移動オプションフラグ
* @return プレイヤーが死亡やフロア離脱を行わず、実際に移動が可能ならばTRUEを返す。
*/
-bool move_player_effect(position ny, position nx, u32b mpe_mode)
+bool move_player_effect(POSITION ny, POSITION nx, u32b mpe_mode)
{
cave_type *c_ptr = &cave[ny][nx];
feature_type *f_ptr = &f_info[c_ptr->feat];
if (!(mpe_mode & MPE_STAYING))
{
- position oy = p_ptr->y;
- position ox = p_ptr->x;
+ POSITION oy = p_ptr->y;
+ POSITION ox = p_ptr->x;
cave_type *oc_ptr = &cave[oy][ox];
- idx om_idx = oc_ptr->m_idx;
- idx nm_idx = c_ptr->m_idx;
+ IDX om_idx = oc_ptr->m_idx;
+ IDX nm_idx = c_ptr->m_idx;
/* Move the player */
p_ptr->y = ny;
* any monster which might be in the destination grid. Previously,\n
* moving into walls was "free" and did NOT hit invisible monsters.\n
*/
-void move_player(direction dir, bool do_pickup, bool break_trap)
+void move_player(DIRECTION dir, bool do_pickup, bool break_trap)
{
/* Find the result of moving */
- position y = p_ptr->y + ddy[dir];
- position x = p_ptr->x + ddx[dir];
+ POSITION y = p_ptr->y + ddy[dir];
+ POSITION x = p_ptr->x + ddx[dir];
/* Examine the destination */
cave_type *c_ptr = &cave[y][x];
/*
* The direction we are running
*/
-static direction find_current;
+static DIRECTION find_current;
/*
* The direction we came from
*/
-static direction find_prevdir;
+static DIRECTION find_prevdir;
/*
* We are looking for open area
* @details Return the number of features around (or under) the character.
* Usually look for doors and floor traps.
*/
-static int count_dt(position *y, position *x, bool (*test)(int feat), bool under)
+static int count_dt(POSITION *y, POSITION *x, bool (*test)(int feat), bool under)
{
int d, count, xx, yy;
* @param x 方角を確認したX座標
* @return 方向ID
*/
-static direction coords_to_dir(position y, position x)
+static DIRECTION coords_to_dir(POSITION y, POSITION x)
{
int d[3][3] = { {7, 4, 1}, {8, 5, 2}, {9, 6, 3} };
int dy, dx;
*/
void do_cmd_open(void)
{
- position y, x;
- direction dir;
- idx o_idx;
+ POSITION y, x;
+ DIRECTION dir;
+ IDX o_idx;
bool more = FALSE;
*/
void do_cmd_close(void)
{
- position y, x;
- direction dir;
+ POSITION y, x;
+ DIRECTION dir;
bool more = FALSE;
*/
void do_cmd_disarm(void)
{
- position y, x;
- direction dir;
+ POSITION y, x;
+ DIRECTION dir;
s16b o_idx;
bool more = FALSE;
type == NIKKI_RAND_QUEST_F ||
type == NIKKI_TO_QUEST)
{
- idx old_quest;
+ IDX old_quest;
old_quest = p_ptr->inside_quest;
p_ptr->inside_quest = (quest[num].type == QUEST_TYPE_RANDOM) ? 0 : num;
*/
static void do_cmd_macro_aux(char *buf)
{
- int i, n = 0;
-
+ char i;
+ int n = 0;
char tmp[1024];
-
/* Flush */
flush();
if (desc) return _("一定時間、あらゆる耐性を付け、ACと魔法防御能力を上昇させる。", "Gives ultimate resistance, bonus to AC and speed.");
{
- time_effect base = (time_effect)plev / 2;
+ TIME_EFFECT base = (TIME_EFFECT)plev / 2;
if (info) return info_duration(base, base);
if (cast)
{
- time_effect v = randint1(base) + base;
+ TIME_EFFECT v = randint1(base) + base;
set_fast(v, FALSE);
set_oppose_acid(v, FALSE);
set_oppose_elec(v, FALSE);
"Removes fear. Gives resistance to fire and cold, and aura of fire. These resistances can be added to which from equipment for more powerful resistances.");
{
- time_effect base = 20;
+ TIME_EFFECT base = 20;
if (info) return info_duration(base, base);
if (cast)
{
- time_effect dur = randint1(base) + base;
+ TIME_EFFECT dur = randint1(base) + base;
set_oppose_fire(dur, FALSE);
set_oppose_cold(dur, FALSE);
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_mimic(time_effect v, int p, bool do_dec)
+bool set_mimic(TIME_EFFECT v, int p, bool do_dec)
{
bool notice = FALSE;
* Note that blindness is currently the only thing which can affect\n
* "player_can_see_bold()".\n
*/
-bool set_blind(time_effect v)
+bool set_blind(TIME_EFFECT v)
{
bool notice = FALSE;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_confused(time_effect v)
+bool set_confused(TIME_EFFECT v)
{
bool notice = FALSE;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_poisoned(time_effect v)
+bool set_poisoned(TIME_EFFECT v)
{
bool notice = FALSE;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_afraid(time_effect v)
+bool set_afraid(TIME_EFFECT v)
{
bool notice = FALSE;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_paralyzed(time_effect v)
+bool set_paralyzed(TIME_EFFECT v)
{
bool notice = FALSE;
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
* @details Note that we must redraw the map when hallucination changes.
*/
-bool set_image(time_effect v)
+bool set_image(TIME_EFFECT v)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_fast(time_effect v, bool do_dec)
+bool set_fast(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_lightspeed(time_effect v, bool do_dec)
+bool set_lightspeed(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_slow(time_effect v, bool do_dec)
+bool set_slow(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_shield(time_effect v, bool do_dec)
+bool set_shield(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tsubureru(time_effect v, bool do_dec)
+bool set_tsubureru(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_magicdef(time_effect v, bool do_dec)
+bool set_magicdef(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_blessed(time_effect v, bool do_dec)
+bool set_blessed(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_hero(time_effect v, bool do_dec)
+bool set_hero(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_shero(time_effect v, bool do_dec)
+bool set_shero(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_protevil(time_effect v, bool do_dec)
+bool set_protevil(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_wraith_form(time_effect v, bool do_dec)
+bool set_wraith_form(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_invuln(time_effect v, bool do_dec)
+bool set_invuln(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_esp(time_effect v, bool do_dec)
+bool set_tim_esp(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_invis(time_effect v, bool do_dec)
+bool set_tim_invis(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_infra(time_effect v, bool do_dec)
+bool set_tim_infra(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_regen(time_effect v, bool do_dec)
+bool set_tim_regen(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_stealth(time_effect v, bool do_dec)
+bool set_tim_stealth(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_levitation(time_effect v, bool do_dec)
+bool set_tim_levitation(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_touki(time_effect v, bool do_dec)
+bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_fire(time_effect v, bool do_dec)
+bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_sh_holy(time_effect v, bool do_dec)
+bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_eyeeye(time_effect v, bool do_dec)
+bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_resist_magic(time_effect v, bool do_dec)
+bool set_resist_magic(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tim_reflect(time_effect v, bool do_dec)
+bool set_tim_reflect(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
/*
* Set "p_ptr->multishadow", notice observable changes
*/
-bool set_multishadow(time_effect v, bool do_dec)
+bool set_multishadow(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_dustrobe(time_effect v, bool do_dec)
+bool set_dustrobe(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_kabenuke(time_effect v, bool do_dec)
+bool set_kabenuke(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_tsuyoshi(time_effect v, bool do_dec)
+bool set_tsuyoshi(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_ele_attack(u32b attack_type, time_effect v)
+bool set_ele_attack(u32b attack_type, TIME_EFFECT v)
{
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
* @param v 継続時間
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_ele_immune(u32b immune_type, time_effect v)
+bool set_ele_immune(u32b immune_type, TIME_EFFECT v)
{
/* Hack -- Force good values */
v = (v > 10000) ? 10000 : (v < 0) ? 0 : v;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_acid(time_effect v, bool do_dec)
+bool set_oppose_acid(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_elec(time_effect v, bool do_dec)
+bool set_oppose_elec(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_fire(time_effect v, bool do_dec)
+bool set_oppose_fire(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_cold(time_effect v, bool do_dec)
+bool set_oppose_cold(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @param do_dec 現在の継続時間より長い値のみ上書きする
* @return ステータスに影響を及ぼす変化があった場合TRUEを返す。
*/
-bool set_oppose_pois(time_effect v, bool do_dec)
+bool set_oppose_pois(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
* @details
* Note the special code to only notice "range" changes.
*/
-bool set_stun(time_effect v)
+bool set_stun(TIME_EFFECT v)
{
int old_aux, new_aux;
bool notice = FALSE;
* @details
* Note the special code to only notice "range" changes.
*/
-bool set_cut(time_effect v)
+bool set_cut(TIME_EFFECT v)
{
int old_aux, new_aux;
bool notice = FALSE;
* game turns, or 500/(100/5) = 25 player turns (if nothing else is
* affecting the player speed).\n
*/
-bool set_food(time_effect v)
+bool set_food(TIME_EFFECT v)
{
int old_aux, new_aux;
*/
bool inc_stat(int stat)
{
- base_status value, gain;
+ BASE_STATUS value, gain;
/* Then augment the current/max stat */
value = p_ptr->stat_cur[stat];
}
-bool set_ultimate_res(time_effect v, bool do_dec)
+bool set_ultimate_res(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
return (TRUE);
}
-bool set_tim_res_nether(time_effect v, bool do_dec)
+bool set_tim_res_nether(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
return (TRUE);
}
-bool set_tim_res_time(time_effect v, bool do_dec)
+bool set_tim_res_time(TIME_EFFECT v, bool do_dec)
{
bool notice = FALSE;
/*
* Choose a elemental immune. -LM-
*/
-bool choose_ele_immune(time_effect immune_turn)
+bool choose_ele_immune(TIME_EFFECT immune_turn)
{
char choice;
extern s16b panel_row_min, panel_row_max;
extern s16b panel_col_min, panel_col_max;
extern s16b panel_col_prt, panel_row_prt;
-extern idx target_who;
-extern position target_col;
-extern position target_row;
+extern IDX target_who;
+extern POSITION target_col;
+extern POSITION target_row;
extern int player_uid;
extern int player_euid;
extern int player_egid;
/* cmd1.c */
extern bool test_hit_fire(int chance, monster_type *m_ptr, int vis, char* o_name);
extern bool test_hit_norm(int chance, int ac, int vis);
-extern hit_point critical_shot(int weight, int plus_ammo, int plus_bow, hit_point dam);
-extern hit_point critical_norm(int weight, int plus, hit_point dam, s16b meichuu, int mode);
+extern HIT_POINT critical_shot(int weight, int plus_ammo, int plus_bow, HIT_POINT dam);
+extern HIT_POINT critical_norm(int weight, int plus, HIT_POINT dam, s16b meichuu, int mode);
extern s16b tot_dam_aux(object_type *o_ptr, int tdam, monster_type *m_ptr, int mode, bool thrown);
extern void search(void);
extern void py_pickup_aux(int o_idx);
extern bool py_attack(int y, int x, int mode);
extern bool pattern_seq(int c_y, int c_x, int n_y, int n_x);
extern bool player_can_enter(s16b feature, u16b mode);
-extern bool move_player_effect(position ny, position nx, u32b mpe_mode);
+extern bool move_player_effect(POSITION ny, POSITION nx, u32b mpe_mode);
extern bool trap_can_be_ignored(int feat);
-extern void move_player(direction dir, bool do_pickup, bool break_trap);
+extern void move_player(DIRECTION dir, bool do_pickup, bool break_trap);
extern void run_step(int dir);
#ifdef TRAVEL
extern void travel_step(void);
/* melee1.c */
/* melee2.c */
-extern bool make_attack_normal(idx m_idx);
+extern bool make_attack_normal(IDX m_idx);
extern void process_monsters(void);
extern int get_mproc_idx(int m_idx, int mproc_type);
extern void mproc_init(void);
extern bool make_object(object_type *j_ptr, u32b mode);
extern void place_object(int y, int x, u32b mode);
extern bool make_gold(object_type *j_ptr);
-extern void place_gold(position y, position x);
+extern void place_gold(POSITION y, POSITION x);
extern s16b drop_near(object_type *o_ptr, int chance, int y, int x);
extern void acquirement(int y1, int x1, int num, bool great, bool special, bool known);
extern void amusement(int y1, int x1, int num, bool known);
extern void remove_all_mirrors(bool explode);
/* spells3.c */
-extern bool teleport_away(idx m_idx, int dis, u32b mode);
+extern bool teleport_away(IDX m_idx, int dis, u32b mode);
extern void teleport_monster_to(int m_idx, int ty, int tx, int power, u32b mode);
extern bool cave_player_teleportable_bold(int y, int x, u32b mode);
extern bool teleport_player_aux(int dis, u32b mode);
extern void teleport_player(int dis, u32b mode);
extern void teleport_player_away(int m_idx, int dis);
-extern void teleport_player_to(position ny, position nx, u32b mode);
+extern void teleport_player_to(POSITION ny, POSITION nx, u32b mode);
extern void teleport_away_followable(int m_idx);
extern void teleport_level(int m_idx);
extern int choose_dungeon(cptr note, int y, int x);
extern void set_action(int typ);
extern void reset_tim_flags(void);
extern void dispel_player(void);
-extern bool set_mimic(time_effect v, int p, bool do_dec);
-extern bool set_blind(time_effect v);
-extern bool set_confused(time_effect v);
-extern bool set_poisoned(time_effect v);
-extern bool set_afraid(time_effect v);
-extern bool set_paralyzed(time_effect v);
-extern bool set_image(time_effect v);
-extern bool set_fast(time_effect v, bool do_dec);
-extern bool set_slow(time_effect v, bool do_dec);
-extern bool set_shield(time_effect v, bool do_dec);
-extern bool set_tsubureru(time_effect v, bool do_dec);
-extern bool set_magicdef(time_effect v, bool do_dec);
-extern bool set_blessed(time_effect v, bool do_dec);
-extern bool set_hero(time_effect v, bool do_dec);
-extern bool set_shero(time_effect v, bool do_dec);
-extern bool set_protevil(time_effect v, bool do_dec);
-extern bool set_invuln(time_effect v, bool do_dec);
-extern bool set_tim_invis(time_effect v, bool do_dec);
-extern bool set_tim_infra(time_effect v, bool do_dec);
-extern bool set_tim_regen(time_effect v, bool do_dec);
-extern bool set_tim_stealth(time_effect v, bool do_dec);
-extern bool set_lightspeed(time_effect v, bool do_dec);
-extern bool set_tim_levitation(time_effect v, bool do_dec);
-extern bool set_tim_sh_touki(time_effect v, bool do_dec);
-extern bool set_tim_sh_fire(time_effect v, bool do_dec);
-extern bool set_tim_sh_holy(time_effect v, bool do_dec);
-extern bool set_tim_eyeeye(time_effect v, bool do_dec);
-extern bool set_resist_magic(time_effect v, bool do_dec);
-extern bool set_tim_reflect(time_effect v, bool do_dec);
-extern bool set_multishadow(time_effect v, bool do_dec);
-extern bool set_dustrobe(time_effect v, bool do_dec);
-extern bool set_kabenuke(time_effect v, bool do_dec);
-extern bool set_tsuyoshi(time_effect v, bool do_dec);
-extern bool set_ele_attack(u32b attack_type, time_effect v);
-extern bool set_ele_immune(u32b immune_type, time_effect v);
-extern bool set_oppose_acid(time_effect v, bool do_dec);
-extern bool set_oppose_elec(time_effect v, bool do_dec);
-extern bool set_oppose_fire(time_effect v, bool do_dec);
-extern bool set_oppose_cold(time_effect v, bool do_dec);
-extern bool set_oppose_pois(time_effect v, bool do_dec);
-extern bool set_stun(time_effect v);
-extern bool set_cut(time_effect v);
-extern bool set_food(time_effect v);
+extern bool set_mimic(TIME_EFFECT v, int p, bool do_dec);
+extern bool set_blind(TIME_EFFECT v);
+extern bool set_confused(TIME_EFFECT v);
+extern bool set_poisoned(TIME_EFFECT v);
+extern bool set_afraid(TIME_EFFECT v);
+extern bool set_paralyzed(TIME_EFFECT v);
+extern bool set_image(TIME_EFFECT v);
+extern bool set_fast(TIME_EFFECT v, bool do_dec);
+extern bool set_slow(TIME_EFFECT v, bool do_dec);
+extern bool set_shield(TIME_EFFECT v, bool do_dec);
+extern bool set_tsubureru(TIME_EFFECT v, bool do_dec);
+extern bool set_magicdef(TIME_EFFECT v, bool do_dec);
+extern bool set_blessed(TIME_EFFECT v, bool do_dec);
+extern bool set_hero(TIME_EFFECT v, bool do_dec);
+extern bool set_shero(TIME_EFFECT v, bool do_dec);
+extern bool set_protevil(TIME_EFFECT v, bool do_dec);
+extern bool set_invuln(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_invis(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_infra(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_regen(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_stealth(TIME_EFFECT v, bool do_dec);
+extern bool set_lightspeed(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_levitation(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_sh_touki(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_sh_fire(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_sh_holy(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_eyeeye(TIME_EFFECT v, bool do_dec);
+extern bool set_resist_magic(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_reflect(TIME_EFFECT v, bool do_dec);
+extern bool set_multishadow(TIME_EFFECT v, bool do_dec);
+extern bool set_dustrobe(TIME_EFFECT v, bool do_dec);
+extern bool set_kabenuke(TIME_EFFECT v, bool do_dec);
+extern bool set_tsuyoshi(TIME_EFFECT v, bool do_dec);
+extern bool set_ele_attack(u32b attack_type, TIME_EFFECT v);
+extern bool set_ele_immune(u32b immune_type, TIME_EFFECT v);
+extern bool set_oppose_acid(TIME_EFFECT v, bool do_dec);
+extern bool set_oppose_elec(TIME_EFFECT v, bool do_dec);
+extern bool set_oppose_fire(TIME_EFFECT v, bool do_dec);
+extern bool set_oppose_cold(TIME_EFFECT v, bool do_dec);
+extern bool set_oppose_pois(TIME_EFFECT v, bool do_dec);
+extern bool set_stun(TIME_EFFECT v);
+extern bool set_cut(TIME_EFFECT v);
+extern bool set_food(TIME_EFFECT v);
extern bool inc_stat(int stat);
extern bool dec_stat(int stat, int amount, int permanent);
extern bool res_stat(int stat);
extern void lose_exp(s32b amount);
extern bool drain_exp(s32b drain, s32b slip, int hold_exp_prob);
extern void do_poly_self(void);
-extern bool set_ultimate_res(time_effect v, bool do_dec);
-extern bool set_tim_res_nether(time_effect v, bool do_dec);
-extern bool set_tim_res_time(time_effect v, bool do_dec);
+extern bool set_ultimate_res(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_res_nether(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_res_time(TIME_EFFECT v, bool do_dec);
extern bool choose_ele_attack(void);
-extern bool choose_ele_immune(time_effect turn);
-extern bool set_wraith_form(time_effect v, bool do_dec);
-extern bool set_tim_esp(time_effect v, bool do_dec);
+extern bool choose_ele_immune(TIME_EFFECT turn);
+extern bool set_wraith_form(TIME_EFFECT v, bool do_dec);
+extern bool set_tim_esp(TIME_EFFECT v, bool do_dec);
extern bool set_superstealth(bool set);
/* xtra2.c */
extern bool tgt_pt (int *x, int *y);
extern void do_poly_wounds(void);
extern void change_race(int new_race, cptr effect_msg);
-extern hit_point mon_damage_mod(monster_type *m_ptr, hit_point dam, bool is_psy_spear);
+extern HIT_POINT mon_damage_mod(monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear);
extern s16b gain_energy(void);
extern s16b bow_energy(int sval);
extern int bow_tmul(int sval);
/* mspells2.c */
extern void get_project_point(int sy, int sx, int *ty, int *tx, int flg);
-extern bool monst_spell_monst(idx m_idx);
+extern bool monst_spell_monst(IDX m_idx);
/* mspells3.c */
extern bool do_cmd_cast_learned(void);
for (i = 0; i < max_num; i++)
{
- position cy = 0, cx = 0;
- idx m_idx;
+ POSITION cy = 0, cx = 0;
+ IDX m_idx;
if (!(party_mon[i].r_idx)) continue;
*/
bool new_player_spot(void)
{
- position y = 0, x = 0;
+ POSITION y = 0, x = 0;
int max_attempts = 10000;
cave_type *c_ptr;
while (max_attempts--)
{
/* Pick a legal spot */
- y = (position)rand_range(1, cur_hgt - 2);
- x = (position)rand_range(1, cur_wid - 2);
+ y = (POSITION)rand_range(1, cur_hgt - 2);
+ x = (POSITION)rand_range(1, cur_wid - 2);
c_ptr = &cave[y][x];
* solid -- solid room walls\n
* TODO: tmp_row/tmp_col をposition型に後から直す。
*/
-bool build_tunnel(position row1, position col1, position row2, position col2)
+bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2)
{
int y, x;
int tmp_row, tmp_col;
if (is_solid_bold(y, x)) continue;
/* Accept this location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = (POSITION)tmp_row;
+ col1 = (POSITION)tmp_col;
/* Save the wall location */
if (dun->wall_n < WALL_MAX)
else if (c_ptr->info & (CAVE_ROOM))
{
/* Accept the location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
}
/* Tunnel through all other walls */
else if (is_extra_grid(c_ptr) || is_inner_grid(c_ptr) || is_solid_grid(c_ptr))
{
/* Accept this location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
/* Save the tunnel location */
if (dun->tunn_n < TUNN_MAX)
else
{
/* Accept the location */
- row1 = (position)tmp_row;
- col1 = (position)tmp_col;
+ row1 = tmp_row;
+ col1 = tmp_col;
/* Collect legal door locations */
if (!door_flag)
* routine.\n
* @todo 特に詳細な処理の意味を調査すべし
*/
-static bool set_tunnel(position *x, position *y, bool affectwall)
+static bool set_tunnel(POSITION *x, POSITION *y, bool affectwall)
{
int i, j, dx, dy;
* Note that this routine is only called on "even" squares - so it gives
* a natural checkerboard pattern.
*/
-static void create_cata_tunnel(position x, position y)
+static void create_cata_tunnel(POSITION x, POSITION y)
{
- position x1, y1;
+ POSITION x1, y1;
/* Build tunnel */
x1 = x - 1;
static void short_seg_hack(int x1, int y1, int x2, int y2, int type, int count, bool *fail)
{
int i;
- position x, y;
+ POSITION x, y;
int length;
/* Check for early exit */
* Note it is VERY important that the "stop if hit another passage" logic\n
* stays as is. Without this the dungeon turns into Swiss Cheese...\n
*/
-bool build_tunnel2(position x1, position y1, position x2, position y2, int type, int cutoff)
+bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff)
{
int x3, y3, dx, dy; // TODO: いずれpositon型に変える
int changex, changey;
/* Save the door location */
if (dun->door_n < DOOR_MAX)
{
- dun->door[dun->door_n].y = (position)y3;
- dun->door[dun->door_n].x = (position)x3;
+ dun->door[dun->door_n].y = (POSITION)y3;
+ dun->door[dun->door_n].x = (POSITION)x3;
dun->door_n++;
}
else return FALSE;
else
{
/* tunnel through walls */
- if (build_tunnel2(x1, y1, (position)x3, (position)y3, type, cutoff))
+ if (build_tunnel2(x1, y1, (POSITION)x3, (POSITION)y3, type, cutoff))
{
- retval = build_tunnel2((position)x3, (position)y3, x2, y2, type, cutoff);
+ retval = build_tunnel2((POSITION)x3, (POSITION)y3, x2, y2, type, cutoff);
firstsuccede = TRUE;
}
else
extern bool get_is_floor(int x, int y);
extern void set_floor(int x, int y);
-extern bool build_tunnel(position row1, position col1, position row2, position col2);
-extern bool build_tunnel2(position x1, position y1, position x2, position y2, int type, int cutoff);
+extern bool build_tunnel(POSITION row1, POSITION col1, POSITION row2, POSITION col2);
+extern bool build_tunnel2(POSITION x1, POSITION y1, POSITION x2, POSITION y2, int type, int cutoff);
#endif
-typedef s16b idx; /*!< ゲーム中のID型を定義 */
-typedef byte position; /*!< ゲーム中の座標型を定義 */
-typedef s16b hit_point; /*!< ゲーム中のHP/ダメージ型を定義 */
-typedef s16b hit_prob; /*!< ゲーム中の命中修正値を定義 */
-typedef s16b base_status; /*!< ゲーム中の基礎能力値型を定義 */
-typedef byte item_number; /*!< ゲーム中のアイテム数型を定義 */
-typedef s16b action_energy; /*!< ゲーム中の行動エネルギー型を定義 */
-typedef s16b armour_class; /*!< ゲーム中の行動アーマークラス型を定義 */
-typedef s16b time_effect; /*!< ゲーム中の時限期間の型を定義 */
-typedef byte character_idx; /*!< ゲーム中のキャラクター特性各種IDの型を定義 */
-typedef byte discount_rate; /*!< ゲーム中の値引き率の型を定義 */
-
-typedef s16b player_level; /*!< ゲーム中のプレイヤーレベルの型を定義 */
-typedef int direction; /*!< ゲーム中の方角の型定義 */
-typedef s16b sub_exp; /*!< ゲーム中の副経験値の型定義 */
-
-typedef byte object_type_value; /*!< ゲーム中のアイテム主分類の型定義 */
-typedef byte object_subtype_value; /*!< ゲーム中のアイテム副分類の型定義 */
-typedef s16b parameter_value; /*!< ゲーム中のアイテム能力値の型定義 */
-
-typedef u32b str_offset; /*!< テキストオフセットの型定義 */
+typedef s16b IDX; /*!< ゲーム中のID型を定義 */
+typedef byte POSITION; /*!< ゲーム中の座標型を定義 */
+typedef s16b HIT_POINT; /*!< ゲーム中のHP/ダメージ型を定義 */
+typedef s16b HIT_PROB; /*!< ゲーム中の命中修正値を定義 */
+typedef s16b BASE_STATUS; /*!< ゲーム中の基礎能力値型を定義 */
+typedef byte ITEM_NUMBER; /*!< ゲーム中のアイテム数型を定義 */
+typedef s16b ACTION_ENERGY; /*!< ゲーム中の行動エネルギー型を定義 */
+typedef s16b ARMOUR_CLASS; /*!< ゲーム中の行動アーマークラス型を定義 */
+typedef s16b TIME_EFFECT; /*!< ゲーム中の時限期間の型を定義 */
+typedef byte CHARACTER_IDX; /*!< ゲーム中のキャラクター特性各種IDの型を定義 */
+typedef byte DISCOUNT_RATE; /*!< ゲーム中の値引き率の型を定義 */
+
+typedef s16b PLAYER_LEVEL; /*!< ゲーム中のプレイヤーレベルの型を定義 */
+typedef int DIRECTION; /*!< ゲーム中の方角の型定義 */
+typedef s16b SUB_EXP; /*!< ゲーム中の副経験値の型定義 */
+
+typedef byte OBJECT_TYPE_VALUE; /*!< ゲーム中のアイテム主分類の型定義 */
+typedef byte OBJECT_SUBTYPE_VALUE; /*!< ゲーム中のアイテム副分類の型定義 */
+typedef s16b PARAMETER_VALUE; /*!< ゲーム中のアイテム能力値の型定義 */
+typedef s16b WEIGHT; /*!< ゲーム中の重量の型定義 */
+
+typedef u32b STR_OFFSET; /*!< テキストオフセットの型定義 */
/*** Pointers to all the basic types defined above ***/
u16b head_size; /* Size of the "header" in bytes */
- str_offset info_size; /* Size of the "info" array in bytes */
- str_offset name_size; /* Size of the "name" array in bytes */
- str_offset text_size; /* Size of the "text" array in bytes */
- str_offset tag_size; /* Size of the "tag" array in bytes */
+ STR_OFFSET info_size; /* Size of the "info" array in bytes */
+ STR_OFFSET name_size; /* Size of the "name" array in bytes */
+ STR_OFFSET text_size; /* Size of the "text" array in bytes */
+ STR_OFFSET tag_size; /* Size of the "tag" array in bytes */
void *info_ptr;
char *name_ptr;
/* Read the dungeon items */
for (i = 1; i < limit; i++)
{
- idx o_idx;
+ IDX o_idx;
object_type *o_ptr;
* @param m_idx 打撃を行うモンスターのID
* @return 実際に攻撃処理を行った場合TRUEを返す
*/
-bool make_attack_normal(idx m_idx)
+bool make_attack_normal(IDX m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
obvious = TRUE;
/* Heal the monster */
- m_ptr->hp += (hit_point)heal;
+ m_ptr->hp += (HIT_POINT)heal;
/* Redraw (later) if needed */
if (p_ptr->health_who == m_idx) p_ptr->redraw |= (PR_HEALTH);
{
if (!(r_ptr->flagsr & RFR_EFF_IM_FIRE_MASK))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
{
if (!(r_ptr->flagsr & RFR_EFF_IM_ELEC_MASK))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
{
if (!(r_ptr->flagsr & RFR_EFF_IM_COLD_MASK))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
{
if (!(r_ptr->flagsr & RFR_EFF_RES_SHAR_MASK))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
{
if (!(r_ptr->flagsr & RFR_RES_ALL))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
{
if (!(r_ptr->flagsr & RFR_RES_ALL))
{
- hit_point dam = damroll(2, 6);
+ HIT_POINT dam = damroll(2, 6);
/* Modify the damage */
dam = mon_damage_mod(m_ptr, dam, FALSE);
if (hex_spelling(HEX_SHADOW_CLOAK) && alive && !p_ptr->is_dead)
{
- hit_point dam = 1;
+ HIT_POINT dam = 1;
object_type *o_armed_ptr = &inventory[INVEN_RARM];
if (!(r_ptr->flagsr & RFR_RES_ALL || r_ptr->flagsr & RFR_RES_DARK))
monster_race *ap_r_ptr = &r_info[m_ptr->ap_r_idx];
int i, d;
- position oy, ox, ny, nx;
+ POSITION oy, ox, ny, nx;
int mm[8];
{
int b = 0;
int dir;
- time_effect t;
- player_level plev = p_ptr->lev;
+ TIME_EFFECT t;
+ PLAYER_LEVEL plev = p_ptr->lev;
/* spell code */
switch (spell)
}
if ((plev > 24) && (plev < 40))
- set_tim_esp((time_effect)plev, FALSE);
+ set_tim_esp((TIME_EFFECT)plev, FALSE);
if (!b) msg_print(_("安全な気がする。", "You feel safe."));
break;
case 6:
/* Character Armour */
- set_shield((time_effect)plev, FALSE);
- if (plev > 14) set_oppose_acid((time_effect)plev, FALSE);
- if (plev > 19) set_oppose_fire((time_effect)plev, FALSE);
- if (plev > 24) set_oppose_cold((time_effect)plev, FALSE);
- if (plev > 29) set_oppose_elec((time_effect)plev, FALSE);
- if (plev > 34) set_oppose_pois((time_effect)plev, FALSE);
+ set_shield((TIME_EFFECT)plev, FALSE);
+ if (plev > 14) set_oppose_acid((TIME_EFFECT)plev, FALSE);
+ if (plev > 19) set_oppose_fire((TIME_EFFECT)plev, FALSE);
+ if (plev > 24) set_oppose_cold((TIME_EFFECT)plev, FALSE);
+ if (plev > 29) set_oppose_elec((TIME_EFFECT)plev, FALSE);
+ if (plev > 34) set_oppose_pois((TIME_EFFECT)plev, FALSE);
break;
case 7:
/* Psychometry */
int dir;
int plev = p_ptr->lev;
int tmp;
- time_effect t;
+ TIME_EFFECT t;
int x,y;
/* spell code */
tmp = is_mirror_grid(&cave[p_ptr->y][p_ptr->x]) ? 4 : 0;
if( plev + tmp > 4)detect_monsters_normal(DETECT_RAD_DEFAULT);
if( plev + tmp > 18 )detect_monsters_invis(DETECT_RAD_DEFAULT);
- if( plev + tmp > 28 )set_tim_esp((time_effect)plev, FALSE);
+ if( plev + tmp > 28 )set_tim_esp((TIME_EFFECT)plev, FALSE);
if( plev + tmp > 38 )map_area(DETECT_RAD_MAP);
if( tmp == 0 && plev < 5 ){
msg_print(_("鏡がなくて集中できなかった!", "You need a mirror to concentrate!"));
*/
static bool cast_berserk_spell(int spell)
{
- position y, x;
- direction dir;
+ POSITION y, x;
+ DIRECTION dir;
/* spell code */
switch (spell)
case 9:
fire_ball(GF_FIRE, 0, 50+plev, plev/10+2);
teleport_player(30, 0L);
- set_oppose_fire((time_effect)plev, FALSE);
+ set_oppose_fire((TIME_EFFECT)plev, FALSE);
break;
case 10:
return rush_attack(NULL);
break;
case 16:
(void)set_kabenuke(randint1(plev/2) + plev/2, FALSE);
- set_oppose_acid((time_effect)plev, FALSE);
+ set_oppose_acid((TIME_EFFECT)plev, FALSE);
break;
case 17:
fire_ball(GF_POIS, 0, 75+plev*2/3, plev/5+2);
if (ironman_nightmare)
{
u32b hp = m_ptr->max_maxhp * 2L;
- m_ptr->max_maxhp = (hit_point)MIN(30000, hp);
+ m_ptr->max_maxhp = (HIT_POINT)MIN(30000, hp);
}
m_ptr->maxhp = (long)(m_ptr->maxhp * m_ptr->max_maxhp) / oldmaxhp;
{
u32b hp = m_ptr->max_maxhp * 2L;
- m_ptr->max_maxhp = (hit_point)MIN(30000, hp);
+ m_ptr->max_maxhp = (HIT_POINT)MIN(30000, hp);
}
m_ptr->maxhp = m_ptr->max_maxhp;
* @details
* The player is only disturbed if able to be affected by the spell.
*/
-bool monst_spell_monst(idx m_idx)
+bool monst_spell_monst(IDX m_idx)
{
int y = 0, x = 0;
int i, k, t_idx = 0;
int spell_RF6_SPECIAL_BANORLUPART(int m_idx)
{
monster_type *m_ptr = &m_list[m_idx];
- hit_point dummy_hp, dummy_maxhp;
+ HIT_POINT dummy_hp, dummy_maxhp;
int k;
int dummy_y = m_ptr->fy;
int dummy_x = m_ptr->fx;
case MUT1_RESIST:
{
int num = lvl / 10;
- time_effect dur = randint1(20) + 20;
+ TIME_EFFECT dur = randint1(20) + 20;
if (randint0(5) < num)
{
* @param i2 整理したい配列の終点
* @return なし
*/
-static void compact_objects_aux(idx i1, idx i2)
+static void compact_objects_aux(IDX i1, IDX i2)
{
- idx i;
+ IDX i;
cave_type *c_ptr;
object_type *o_ptr;
*/
static void a_m_aux_1(object_type *o_ptr, int level, int power)
{
- hit_prob tohit1 = randint1(5) + m_bonus(5, level);
- hit_point todam1 = randint1(5) + m_bonus(5, level);
+ HIT_PROB tohit1 = randint1(5) + m_bonus(5, level);
+ HIT_POINT todam1 = randint1(5) + m_bonus(5, level);
- hit_prob tohit2 = m_bonus(10, level);
- hit_point todam2 = m_bonus(10, level);
+ HIT_PROB tohit2 = m_bonus(10, level);
+ HIT_POINT todam2 = m_bonus(10, level);
if ((o_ptr->tval == TV_BOLT) || (o_ptr->tval == TV_ARROW) || (o_ptr->tval == TV_SHOT))
{
*/
static void a_m_aux_2(object_type *o_ptr, int level, int power)
{
- armour_class toac1 = randint1(5) + m_bonus(5, level);
- armour_class toac2 = m_bonus(10, level);
+ ARMOUR_CLASS toac1 = randint1(5) + m_bonus(5, level);
+ ARMOUR_CLASS toac2 = m_bonus(10, level);
/* Good */
if (power > 0)
* This routine uses "object_level" for the "generation level".\n
* This routine requires a clean floor grid destination.\n
*/
-void place_object(position y, position x, u32b mode)
+void place_object(POSITION y, POSITION x, u32b mode)
{
- idx o_idx;
+ IDX o_idx;
/* Acquire grid */
cave_type *c_ptr = &cave[y][x];
* @details
* The location must be a legal, clean, floor grid.
*/
-void place_gold(position y, position x)
+void place_gold(POSITION y, POSITION x)
{
s16b o_idx;
else if (num < 0) num = 0;
/* Un-apply */
- num -= (item_number)o_ptr->number;
+ num -= (ITEM_NUMBER)o_ptr->number;
/* Change the number and weight */
if (num)
num -= (int)o_ptr->number;
/* Change the number */
- o_ptr->number += (item_number)num;
+ o_ptr->number += (ITEM_NUMBER)num;
}
* "flg" was added.
* </pre>
*/
-static bool project_m(int who, int r, int y, int x, hit_point dam, int typ, int flg, bool see_s_msg)
+static bool project_m(int who, int r, int y, int x, HIT_POINT dam, int typ, int flg, bool see_s_msg)
{
int tmp;
* Attempt to move the monster at least "dis/2" grids away.
* But allow variation to prevent infinite loops.
*/
-bool teleport_away(idx m_idx, int dis, u32b mode)
+bool teleport_away(IDX m_idx, int dis, u32b mode)
{
int oy, ox, d, i, min;
int tries = 0;
- position ny = 0, nx = 0;
+ POSITION ny = 0, nx = 0;
bool look = TRUE;
{
int candidates_at[MAX_TELEPORT_DISTANCE + 1];
int total_candidates, cur_candidates;
- position y = 0, x = 0;
+ POSITION y = 0, x = 0;
int min, pick, i;
int left = MAX(1, p_ptr->x - dis);
* This function allows teleporting into vaults (!)
* </pre>
*/
-void teleport_player_to(position ny, position nx, u32b mode)
+void teleport_player_to(POSITION ny, POSITION nx, u32b mode)
{
- position y, x;
+ POSITION y, x;
int dis = 0, ctr = 0;
if (p_ptr->anti_tele && !(mode & TELEPORT_NONMAGICAL))
/* Pick a nearby legal location */
while (1)
{
- y = (position)rand_spread(ny, dis);
- x = (position)rand_spread(nx, dis);
+ y = (POSITION)rand_spread(ny, dis);
+ x = (POSITION)rand_spread(nx, dis);
if (in_bounds(y, x)) break;
}
*/
void mutate_player(void)
{
- base_status max1, cur1, max2, cur2;
+ BASE_STATUS max1, cur1, max2, cur2;
int ii, jj, i;
/* Pick a pair of stats */
bool alchemy(void)
{
int item, amt = 1;
- item_number old_number;
+ ITEM_NUMBER old_number;
long price;
bool force = FALSE;
object_type *o_ptr;
static void mass_produce(object_type *o_ptr)
{
int size = 1;
- discount_rate discount = 0;
+ DISCOUNT_RATE discount = 0;
s32b cost = object_value(o_ptr);
}
else
{
- item_number old_num = o_ptr->number;
- item_number remain = j_ptr->number + o_ptr->number - max_num;
+ ITEM_NUMBER old_num = o_ptr->number;
+ ITEM_NUMBER remain = j_ptr->number + o_ptr->number - max_num;
/* Add together the item counts */
object_absorb(j_ptr, o_ptr);
* Increase, by a given amount, the number of a certain item
* in a certain store. This can result in zero items.
* </pre>
- * @todo numは本来item_number型にしたい。
+ * @todo numは本来ITEM_NUMBER型にしたい。
*/
static void store_item_increase(int item, int num)
{
num = cnt - o_ptr->number;
/* Save the new number */
- o_ptr->number += (item_number)num;
+ o_ptr->number += (ITEM_NUMBER)num;
}
int i, choice;
int item, item_new;
- item_number amt;
+ ITEM_NUMBER amt;
s32b price, best;
* @param width 基本幅
* @return なし
*/
-static void recursive_river(int x1, int y1, int x2, int y2, idx feat1, idx feat2, int width)
+static void recursive_river(int x1, int y1, int x2, int y2, IDX feat1, IDX feat2, int width)
{
int dx, dy, length, l, x, y;
int changex, changey;
struct feature_type
{
- str_offset name; /*!< 地形名参照のためのネームバッファオフセット値 / Name (offset) */
- str_offset text; /*!< 地形説明参照のためのネームバッファオフセット値 / Text (offset) */
+ STR_OFFSET name; /*!< 地形名参照のためのネームバッファオフセット値 / Name (offset) */
+ STR_OFFSET text; /*!< 地形説明参照のためのネームバッファオフセット値 / Text (offset) */
s16b tag; /*!< 地形特性タグ参照のためのネームバッファオフセット値 / Tag (offset) */
s16b mimic; /*!< 未確定時の外形地形ID / Feature to mimic */
struct object_kind
{
- str_offset name; /*!< ベースアイテム名参照のためのネームバッファオフセット値 / Name (offset) */
- str_offset text; /*!< 解説テキスト参照のためのネームバッファオフセット値 / Text (offset) */
- str_offset flavor_name; /*!< 未確定名参照のためのネームバッファオフセット値 / Flavor name (offset) */
+ STR_OFFSET name; /*!< ベースアイテム名参照のためのネームバッファオフセット値 / Name (offset) */
+ STR_OFFSET text; /*!< 解説テキスト参照のためのネームバッファオフセット値 / Text (offset) */
+ STR_OFFSET flavor_name; /*!< 未確定名参照のためのネームバッファオフセット値 / Flavor name (offset) */
byte tval; /*!< ベースアイテム種別の大項目値 Object type */
byte sval; /*!< ベースアイテム種別の小項目値 Object sub type */
*/
struct artifact_type
{
- str_offset name; /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
- str_offset text; /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
+ STR_OFFSET name; /*!< アーティファクト名(headerオフセット参照) / Name (offset) */
+ STR_OFFSET text; /*!< アーティファクト解説(headerオフセット参照) / Text (offset) */
byte tval; /*!< ベースアイテム大項目ID / Artifact type */
byte sval; /*!< ベースアイテム小項目ID / Artifact sub type */
struct ego_item_type
{
- str_offset name; /* Name (offset) */
- str_offset text; /* Text (offset) */
+ STR_OFFSET name; /* Name (offset) */
+ STR_OFFSET text; /* Text (offset) */
byte slot; /* Standard slot value */
byte rating; /* Rating boost */
struct monster_race
{
- str_offset name; /*!< 名前データのオフセット(日本語) / Name offset(Japanese) */
+ STR_OFFSET name; /*!< 名前データのオフセット(日本語) / Name offset(Japanese) */
#ifdef JP
- str_offset E_name; /*!< 名前データのオフセット(英語) / Name offset(English) */
+ STR_OFFSET E_name; /*!< 名前データのオフセット(英語) / Name offset(English) */
#endif
- str_offset text; /*!< 思い出テキストのオフセット / Lore text offset */
+ STR_OFFSET text; /*!< 思い出テキストのオフセット / Lore text offset */
byte hdice; /*!< HPのダイス数 / Creatures hit dice count */
byte hside; /*!< HPのダイス面数 / Creatures hit dice sides */
struct vault_type
{
- str_offset name; /* Name (offset) */
- str_offset text; /* Text (offset) */
+ STR_OFFSET name; /* Name (offset) */
+ STR_OFFSET text; /* Text (offset) */
byte typ; /* Vault type */
byte rat; /* Vault rating */
{
u16b info; /* Hack -- cave flags */
- idx feat; /* Hack -- feature type */
- idx o_idx; /* Object in this grid */
- idx m_idx; /* Monster in this grid */
+ IDX feat; /* Hack -- feature type */
+ IDX o_idx; /* Object in this grid */
+ IDX m_idx; /* Monster in this grid */
s16b special; /* Special cave info */
struct coord
{
- position y;
- position x;
+ POSITION y;
+ POSITION x;
};
struct object_type
{
- idx k_idx; /* Kind index (zero if "dead") */
+ IDX k_idx; /* Kind index (zero if "dead") */
- position iy; /* Y-position on map, or zero */
- position ix; /* X-position on map, or zero */
+ POSITION iy; /* Y-position on map, or zero */
+ POSITION ix; /* X-position on map, or zero */
- object_type_value tval; /* Item type (from kind) */
- object_subtype_value sval; /* Item sub-type (from kind) */
+ OBJECT_TYPE_VALUE tval; /* Item type (from kind) */
+ OBJECT_SUBTYPE_VALUE sval; /* Item sub-type (from kind) */
- parameter_value pval; /* Item extra-parameter */
+ PARAMETER_VALUE pval; /* Item extra-parameter */
- discount_rate discount; /* Discount (if any) */
+ DISCOUNT_RATE discount; /* Discount (if any) */
- item_number number; /* Number of items */
+ ITEM_NUMBER number; /* Number of items */
- s16b weight; /* Item weight */
+ WEIGHT weight; /* Item weight */
byte name1; /* Artifact type, if any */
byte name2; /* Ego-Item type, if any */
s16b xtra4; /* Extra info fuel or captured monster's current HP */
s16b xtra5; /* Extra info captured monster's max HP */
- hit_prob to_h; /* Plusses to hit */
- hit_point to_d; /* Plusses to damage */
- armour_class to_a; /* Plusses to AC */
+ HIT_PROB to_h; /* Plusses to hit */
+ HIT_POINT to_d; /* Plusses to damage */
+ ARMOUR_CLASS to_a; /* Plusses to AC */
- armour_class ac; /* Normal AC */
+ ARMOUR_CLASS ac; /* Normal AC */
byte dd, ds; /* Damage dice/sides */
u32b curse_flags; /* Flags for curse */
- idx next_o_idx; /* Next object in stack (if any) */
- idx held_m_idx; /* Monster holding us (if any) */
+ IDX next_o_idx; /* Next object in stack (if any) */
+ IDX held_m_idx; /* Monster holding us (if any) */
};
s16b ap_r_idx; /* Monster race appearance index */
byte sub_align; /* Sub-alignment for a neutral monster */
- position fy; /* Y location on map */
- position fx; /* X location on map */
+ POSITION fy; /* Y location on map */
+ POSITION fx; /* X location on map */
- hit_point hp; /* Current Hit points */
- hit_point maxhp; /* Max Hit points */
- hit_point max_maxhp; /* Max Max Hit points */
+ HIT_POINT hp; /* Current Hit points */
+ HIT_POINT maxhp; /* Max Hit points */
+ HIT_POINT max_maxhp; /* Max Max Hit points */
u32b dealt_damage; /* Sum of damages dealt by player */
s16b mtimed[MAX_MTIMED]; /* Timed status counter */
byte mspeed; /* Monster "speed" */
- action_energy energy_need; /* Monster "energy" */
+ ACTION_ENERGY energy_need; /* Monster "energy" */
- position cdis; /* Current dis from player */
+ POSITION cdis; /* Current dis from player */
byte mflag; /* Extra monster flags */
byte mflag2; /* Extra monster flags */
bool ml; /* Monster is "visible" */
- idx hold_o_idx; /* Object being held (if any) */
+ IDX hold_o_idx; /* Object being held (if any) */
s16b target_y; /* Can attack !los player */
s16b target_x; /* Can attack !los player */
s16b oldpy; /* Previous player location -KMW- */
s16b oldpx; /* Previous player location -KMW- */
- character_idx psex; /* Sex index */
- character_idx prace; /* Race index */
- character_idx pclass; /* Class index */
- character_idx pseikaku; /* Seikaku index */
- character_idx realm1; /* First magic realm */
- character_idx realm2; /* Second magic realm */
- character_idx oops; /* Unused */
+ CHARACTER_IDX psex; /* Sex index */
+ CHARACTER_IDX prace; /* Race index */
+ CHARACTER_IDX pclass; /* Class index */
+ CHARACTER_IDX pseikaku; /* Seikaku index */
+ CHARACTER_IDX realm1; /* First magic realm */
+ CHARACTER_IDX realm2; /* Second magic realm */
+ CHARACTER_IDX oops; /* Unused */
byte hitdie; /* Hit dice (sides) */
u16b expfact; /* Experience factor
s32b exp; /* Cur experience */
u32b exp_frac; /* Cur exp frac (times 2^16) */
- player_level lev; /* Level */
+ PLAYER_LEVEL lev; /* Level */
s16b town_num; /* Current town number */
s16b arena_number; /* monster number in arena -KMW- */
bool inside_arena; /* Is character inside arena? */
- idx inside_quest; /* Inside quest level */
+ IDX inside_quest; /* Inside quest level */
bool inside_battle; /* Is character inside tougijou? */
s32b wilderness_x; /* Coordinates in the wilderness */
s16b max_plv; /* Max Player Level */
- base_status stat_max[6]; /* Current "maximal" stat values */
- base_status stat_max_max[6]; /* Maximal "maximal" stat values */
- base_status stat_cur[6]; /* Current "natural" stat values */
+ BASE_STATUS stat_max[6]; /* Current "maximal" stat values */
+ BASE_STATUS stat_max_max[6]; /* Maximal "maximal" stat values */
+ BASE_STATUS stat_cur[6]; /* Current "natural" stat values */
s16b learned_spells;
s16b add_spells;
u32b count;
- time_effect fast; /* Timed -- Fast */
- time_effect slow; /* Timed -- Slow */
- time_effect blind; /* Timed -- Blindness */
- time_effect paralyzed; /* Timed -- Paralysis */
- time_effect confused; /* Timed -- Confusion */
- time_effect afraid; /* Timed -- Fear */
- time_effect image; /* Timed -- Hallucination */
- time_effect poisoned; /* Timed -- Poisoned */
- time_effect cut; /* Timed -- Cut */
- time_effect stun; /* Timed -- Stun */
-
- time_effect protevil; /* Timed -- Protection */
- time_effect invuln; /* Timed -- Invulnerable */
- time_effect ult_res; /* Timed -- Ultimate Resistance */
- time_effect hero; /* Timed -- Heroism */
- time_effect shero; /* Timed -- Super Heroism */
- time_effect shield; /* Timed -- Shield Spell */
- time_effect blessed; /* Timed -- Blessed */
- time_effect tim_invis; /* Timed -- See Invisible */
- time_effect tim_infra; /* Timed -- Infra Vision */
- time_effect tsuyoshi; /* Timed -- Tsuyoshi Special */
- time_effect ele_attack; /* Timed -- Elemental Attack */
- time_effect ele_immune; /* Timed -- Elemental Immune */
-
- time_effect oppose_acid; /* Timed -- oppose acid */
- time_effect oppose_elec; /* Timed -- oppose lightning */
- time_effect oppose_fire; /* Timed -- oppose heat */
- time_effect oppose_cold; /* Timed -- oppose cold */
- time_effect oppose_pois; /* Timed -- oppose poison */
-
- time_effect tim_esp; /* Timed ESP */
- time_effect wraith_form; /* Timed wraithform */
-
- time_effect resist_magic; /* Timed Resist Magic (later) */
- time_effect tim_regen;
- time_effect kabenuke;
- time_effect tim_stealth;
- time_effect tim_levitation;
- time_effect tim_sh_touki;
- time_effect lightspeed;
- time_effect tsubureru;
- time_effect magicdef;
- time_effect tim_res_nether; /* Timed -- Nether resistance */
- time_effect tim_res_time; /* Timed -- Time resistance */
+ TIME_EFFECT fast; /* Timed -- Fast */
+ TIME_EFFECT slow; /* Timed -- Slow */
+ TIME_EFFECT blind; /* Timed -- Blindness */
+ TIME_EFFECT paralyzed; /* Timed -- Paralysis */
+ TIME_EFFECT confused; /* Timed -- Confusion */
+ TIME_EFFECT afraid; /* Timed -- Fear */
+ TIME_EFFECT image; /* Timed -- Hallucination */
+ TIME_EFFECT poisoned; /* Timed -- Poisoned */
+ TIME_EFFECT cut; /* Timed -- Cut */
+ TIME_EFFECT stun; /* Timed -- Stun */
+
+ TIME_EFFECT protevil; /* Timed -- Protection */
+ TIME_EFFECT invuln; /* Timed -- Invulnerable */
+ TIME_EFFECT ult_res; /* Timed -- Ultimate Resistance */
+ TIME_EFFECT hero; /* Timed -- Heroism */
+ TIME_EFFECT shero; /* Timed -- Super Heroism */
+ TIME_EFFECT shield; /* Timed -- Shield Spell */
+ TIME_EFFECT blessed; /* Timed -- Blessed */
+ TIME_EFFECT tim_invis; /* Timed -- See Invisible */
+ TIME_EFFECT tim_infra; /* Timed -- Infra Vision */
+ TIME_EFFECT tsuyoshi; /* Timed -- Tsuyoshi Special */
+ TIME_EFFECT ele_attack; /* Timed -- Elemental Attack */
+ TIME_EFFECT ele_immune; /* Timed -- Elemental Immune */
+
+ TIME_EFFECT oppose_acid; /* Timed -- oppose acid */
+ TIME_EFFECT oppose_elec; /* Timed -- oppose lightning */
+ TIME_EFFECT oppose_fire; /* Timed -- oppose heat */
+ TIME_EFFECT oppose_cold; /* Timed -- oppose cold */
+ TIME_EFFECT oppose_pois; /* Timed -- oppose poison */
+
+ TIME_EFFECT tim_esp; /* Timed ESP */
+ TIME_EFFECT wraith_form; /* Timed wraithform */
+
+ TIME_EFFECT resist_magic; /* Timed Resist Magic (later) */
+ TIME_EFFECT tim_regen;
+ TIME_EFFECT kabenuke;
+ TIME_EFFECT tim_stealth;
+ TIME_EFFECT tim_levitation;
+ TIME_EFFECT tim_sh_touki;
+ TIME_EFFECT lightspeed;
+ TIME_EFFECT tsubureru;
+ TIME_EFFECT magicdef;
+ TIME_EFFECT tim_res_nether; /* Timed -- Nether resistance */
+ TIME_EFFECT tim_res_time; /* Timed -- Time resistance */
byte mimic_form;
- time_effect tim_mimic;
- time_effect tim_sh_fire;
- time_effect tim_sh_holy;
- time_effect tim_eyeeye;
+ TIME_EFFECT tim_mimic;
+ TIME_EFFECT tim_sh_fire;
+ TIME_EFFECT tim_sh_holy;
+ TIME_EFFECT tim_eyeeye;
/* for mirror master */
- time_effect tim_reflect; /* Timed -- Reflect */
- time_effect multishadow; /* Timed -- Multi-shadow */
- time_effect dustrobe; /* Timed -- Robe of dust */
+ TIME_EFFECT tim_reflect; /* Timed -- Reflect */
+ TIME_EFFECT multishadow; /* Timed -- Multi-shadow */
+ TIME_EFFECT dustrobe; /* Timed -- Robe of dust */
s16b chaos_patron;
u32b muta1;
u32b spell_forgotten2; /* bit mask of spells learned but forgotten */
byte spell_order[64]; /* order spells learned/remembered/forgotten */
- sub_exp spell_exp[64]; /* Proficiency of spells */
- sub_exp weapon_exp[5][64]; /* Proficiency of weapons */
- sub_exp skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */
+ SUB_EXP spell_exp[64]; /* Proficiency of spells */
+ SUB_EXP weapon_exp[5][64]; /* Proficiency of weapons */
+ SUB_EXP skill_exp[GINOU_MAX]; /* Proficiency of misc. skill */
s32b magic_num1[108]; /* Array for non-spellbook type magic */
byte magic_num2[108]; /* Flags for non-spellbook type magics */
s16b energy_use; /* Energy use this turn */
- position y; /* Player location in dungeon */
- position x; /* Player location in dungeon */
+ POSITION y; /* Player location in dungeon */
+ POSITION x; /* Player location in dungeon */
char name[32]; /* Current player's character name */
};
/* A structure for the != dungeon types */
typedef struct dungeon_info_type dungeon_info_type;
struct dungeon_info_type {
- str_offset name; /* Name */
- str_offset text; /* Description */
+ STR_OFFSET name; /* Name */
+ STR_OFFSET text; /* Description */
byte dy;
byte dx;
/*
* Targetting variables
*/
-idx target_who;
-position target_col;
-position target_row;
+IDX target_who;
+POSITION target_col;
+POSITION target_row;
/*
for (*x = xmin, i = 0; ((*x < xmax) && (i < len)); (*x)++, s++, i++)
{
- int idx = s[0];
-
- wilderness[*y][*x].terrain = w_letter[idx].terrain;
-
- wilderness[*y][*x].level = w_letter[idx].level;
-
- wilderness[*y][*x].town = w_letter[idx].town;
-
- wilderness[*y][*x].road = w_letter[idx].road;
-
- strcpy(town[w_letter[idx].town].name, w_letter[idx].name);
+ int id = s[0];
+ wilderness[*y][*x].terrain = w_letter[id].terrain;
+ wilderness[*y][*x].level = w_letter[id].level;
+ wilderness[*y][*x].town = w_letter[id].town;
+ wilderness[*y][*x].road = w_letter[id].road;
+ strcpy(town[w_letter[id].town].name, w_letter[id].name);
}
(*y)++;
* "type" is not yet used and should be 0.
* </pre>
*/
-hit_point mon_damage_mod(monster_type *m_ptr, hit_point dam, bool is_psy_spear)
+HIT_POINT mon_damage_mod(monster_type *m_ptr, HIT_POINT dam, bool is_psy_spear)
{
monster_race *r_ptr = &r_info[m_ptr->r_idx];