* this is done in two passes. -- JDL
* </pre>
*/
-bool project_hack(int typ, HIT_POINT dam)
+bool project_hack(EFFECT_ID typ, HIT_POINT dam)
{
int i, x, y;
int flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
* "earthquake" by using the "full" to select "destruction".
* </pre>
*/
-bool destroy_area(int y1, int x1, int r, bool in_generate)
+bool destroy_area(POSITION y1, POSITION x1, POSITION r, bool in_generate)
{
- int y, x, k, t;
+ POSITION y, x;
+ int k, t;
cave_type *c_ptr;
bool flag = FALSE;
* This has allowed massive simplification of the "monster" code.
* </pre>
*/
-bool earthquake_aux(int cy, int cx, int r, MONSTER_IDX m_idx)
+bool earthquake_aux(POSITION cy, POSITION cx, POSITION r, MONSTER_IDX m_idx)
{
- int i, t, y, x, yy, xx, dy, dx;
+ int i, t;
+ POSITION y, x, yy, xx, dy, dx;
int damage = 0;
int sn = 0;
POSITION sy = 0, sx = 0;
* @param cx 中心X座標
* @param r 効果半径
*/
-bool earthquake(int cy, int cx, int r)
+bool earthquake(POSITION cy, POSITION cx, POSITION r)
{
return earthquake_aux(cy, cx, r, 0);
}
/* Clear them all */
for (i = 0; i < temp_n; i++)
{
- int y = temp_y[i];
- int x = temp_x[i];
+ POSITION y = temp_y[i];
+ POSITION x = temp_x[i];
cave_type *c_ptr = &cave[y][x];
/* Clear them all */
for (i = 0; i < temp_n; i++)
{
- int y = temp_y[i];
- int x = temp_x[i];
+ POSITION y = temp_y[i];
+ POSITION x = temp_x[i];
int j;
cave_type *c_ptr = &cave[y][x];
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_open(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
{
int i;
- int y, x;
+ POSITION y, x;
int len = 0;
int blen = 0;
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
+static int next_to_walls_adj(POSITION cy, POSITION cx, bool (*pass_bold)(POSITION, POSITION))
{
- int i;
-
- int y, x;
-
+ DIRECTION i;
+ POSITION y, x;
int c = 0;
for (i = 0; i < 8; i++)
* @param pass_bold 地形条件を返す関数ポインタ
* @return 該当地形の数
*/
-static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(int, int))
+static void cave_temp_room_aux(POSITION y, POSITION x, bool only_room, bool (*pass_bold)(POSITION, POSITION))
{
cave_type *c_ptr;
* @param x 指定X座標
* @return 光を通すならばtrueを返す。
*/
-static bool cave_pass_lite_bold(int y, int x)
+static bool cave_pass_lite_bold(POSITION y, POSITION x)
{
return cave_los_bold(y, x);
}
* @param x 指定X座標
* @return なし
*/
-static void cave_temp_lite_room_aux(int y, int x)
+static void cave_temp_lite_room_aux(POSITION y, POSITION x)
{
cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
}
* @param x 指定X座標
* @return 射線を通すならばtrueを返す。
*/
-static bool cave_pass_dark_bold(int y, int x)
+static bool cave_pass_dark_bold(POSITION y, POSITION x)
{
return cave_have_flag_bold(y, x, FF_PROJECT);
}
* @param x 指定X座標
* @return なし
*/
-static void cave_temp_unlite_room_aux(int y, int x)
+static void cave_temp_unlite_room_aux(POSITION y, POSITION x)
{
cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
}
* @param x1 指定X座標
* @return なし
*/
-void lite_room(int y1, int x1)
+void lite_room(POSITION y1, POSITION x1)
{
- int i, x, y;
+ int i;
+ POSITION x, y;
/* Add the initial grid */
cave_temp_lite_room_aux(y1, x1);
* @param x1 指定X座標
* @return なし
*/
-void unlite_room(int y1, int x1)
+void unlite_room(POSITION y1, POSITION x1)
{
- int i, x, y;
+ int i;
+ POSITION x, y;
/* Add the initial grid */
cave_temp_unlite_room_aux(y1, x1);
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool lite_area(HIT_POINT dam, int rad)
+bool lite_area(HIT_POINT dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
* @param rad 効果半径
* @return 作用が実際にあった場合TRUEを返す
*/
-bool unlite_area(HIT_POINT dam, int rad)
+bool unlite_area(HIT_POINT dam, POSITION rad)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_KILL;
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_ball(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
- int tx, ty;
+ POSITION tx, ty;
BIT_FLAGS flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_breath(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_breath(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
return fire_ball(typ, dir, dam, -rad);
}
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_rocket(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_rocket(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
int tx, ty;
* Affect grids, objects, and monsters
* </pre>
*/
-bool fire_ball_hide(int typ, int dir, HIT_POINT dam, int rad)
+bool fire_ball_hide(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, POSITION rad)
{
int tx, ty;
* @param dev 回数分散
* @return 作用が実際にあった場合TRUEを返す
*/
-bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
+bool fire_blast(EFFECT_ID typ, DIRECTION dir, int dd, int ds, int num, int dev)
{
int ly, lx, ld;
int ty, tx, y, x;
* @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool teleport_swap(int dir)
+bool teleport_swap(DIRECTION dir)
{
int tx, ty;
cave_type * c_ptr;
* @param flg フラグ
* @return 作用が実際にあった場合TRUEを返す
*/
-bool project_hook(int typ, int dir, HIT_POINT dam, BIT_FLAGS flg)
+bool project_hook(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam, BIT_FLAGS flg)
{
int tx, ty;
* Affect monsters and grids (not objects).
* </pre>
*/
-bool fire_bolt(int typ, int dir, HIT_POINT dam)
+bool fire_bolt(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
* Affect monsters, grids and objects.
* </pre>
*/
-bool fire_beam(int typ, int dir, HIT_POINT dam)
+bool fire_beam(EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
return (project_hook(typ, dir, dam, flg));
* Affect monsters, grids and objects.
* </pre>
*/
-bool fire_bolt_or_beam(int prob, int typ, int dir, HIT_POINT dam)
+bool fire_bolt_or_beam(int prob, EFFECT_ID typ, DIRECTION dir, HIT_POINT dam)
{
if (randint0(100) < prob)
{
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool lite_line(int dir, HIT_POINT dam)
+bool lite_line(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
return (project_hook(GF_LITE_WEAK, dir, dam, flg));
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool hypodynamic_bolt(int dir, HIT_POINT dam)
+bool hypodynamic_bolt(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_HYPODYNAMIA, dir, dam, flg));
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool wall_to_mud(int dir, HIT_POINT dam)
+bool wall_to_mud(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
return (project_hook(GF_KILL_WALL, dir, dam, flg));
* @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool wizard_lock(int dir)
+bool wizard_lock(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
* @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool destroy_door(int dir)
+bool destroy_door(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
return (project_hook(GF_KILL_DOOR, dir, 0, flg));
* @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool disarm_trap(int dir)
+bool disarm_trap(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
return (project_hook(GF_KILL_TRAP, dir, 0, flg));
* @param dam 威力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool heal_monster(int dir, HIT_POINT dam)
+bool heal_monster(DIRECTION dir, HIT_POINT dam)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_HEAL, dir, dam, flg));
* @param power 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool speed_monster(int dir, int power)
+bool speed_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_SPEED, dir, power, flg));
* @param power 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool slow_monster(int dir, int power)
+bool slow_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_SLOW, dir, power, flg));
* @param power 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool sleep_monster(int dir, int power)
+bool sleep_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_SLEEP, dir, power, flg));
* @return 作用が実際にあった場合TRUEを返す
* @details 威力はプレイヤーレベル*2に固定
*/
-bool stasis_monster(int dir)
+bool stasis_monster(DIRECTION dir)
{
return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
}
* @return 作用が実際にあった場合TRUEを返す
* @details 威力はプレイヤーレベル*2に固定
*/
-bool stasis_evil(int dir)
+bool stasis_evil(DIRECTION dir)
{
return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
}
* @param plev プレイヤーレベル(=効力)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool confuse_monster(int dir, int plev)
+bool confuse_monster(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_CONF, dir, plev, flg));
* @param plev プレイヤーレベル(=効力)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool stun_monster(int dir, int plev)
+bool stun_monster(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_STUN, dir, plev, flg));
* @param power 効力
* @return 作用が実際にあった場合TRUEを返す
*/
-bool poly_monster(int dir, int power)
+bool poly_monster(DIRECTION dir, int power)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
* @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool clone_monster(int dir)
+bool clone_monster(DIRECTION dir)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_OLD_CLONE, dir, 0, flg));
* @param plev プレイヤーレベル(=効力)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool fear_monster(int dir, int plev)
+bool fear_monster(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_TURN_ALL, dir, plev, flg));
* @param plev プレイヤーレベル(効力はplev*200)
* @return 作用が実際にあった場合TRUEを返す
*/
-bool death_ray(int dir, int plev)
+bool death_ray(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
* @param distance 移動距離
* @return 作用が実際にあった場合TRUEを返す
*/
-bool teleport_monster(int dir, int distance)
+bool teleport_monster(DIRECTION dir, int distance)
{
BIT_FLAGS flg = PROJECT_BEAM | PROJECT_KILL;
return (project_hook(GF_AWAY_ALL, dir, distance, flg));
* @param x 起点X座標
* @return 作用が実際にあった場合TRUEを返す
*/
-bool trap_creation(int y, int x)
+bool trap_creation(POSITION y, POSITION x)
{
BIT_FLAGS flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
* @param plev パワー
* @return 作用が実際にあった場合TRUEを返す
*/
-bool charm_monster(int dir, int plev)
+bool charm_monster(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
return (project_hook(GF_CHARM, dir, plev, flg));
* @param plev パワー
* @return 作用が実際にあった場合TRUEを返す
*/
-bool control_one_undead(int dir, int plev)
+bool control_one_undead(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
* @param plev パワー
* @return 作用が実際にあった場合TRUEを返す
*/
-bool control_one_demon(int dir, int plev)
+bool control_one_demon(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
* @param plev パワー
* @return 作用が実際にあった場合TRUEを返す
*/
-bool charm_animal(int dir, int plev)
+bool charm_animal(DIRECTION dir, int plev)
{
BIT_FLAGS flg = PROJECT_STOP | PROJECT_KILL;
return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
*/
bool rush_attack(bool *mdeath)
{
- int dir;
+ DIRECTION dir;
int tx, ty;
int tm_idx = 0;
u16b path_g[32];
*/
void remove_all_mirrors(bool explode)
{
- int x, y;
+ POSITION x, y;
for (x = 0; x < cur_wid; x++)
{
* @param dir 発動の方向ID
* @return なし
*/
-void ring_of_power(int dir)
+void ring_of_power(DIRECTION dir)
{
/* Pick a random effect */
switch (randint1(10))
* @param rad 効力の半径
* @return なし
*/
-void cast_meteor(HIT_POINT dam, int rad)
+void cast_meteor(HIT_POINT dam, POSITION rad)
{
int i;
int b = 10 + randint1(10);
* @param rad 効力の半径
* @return ターゲットを指定し、実行したならばTRUEを返す。
*/
-bool cast_wrath_of_the_god(HIT_POINT dam, int rad)
+bool cast_wrath_of_the_god(HIT_POINT dam, POSITION rad)
{
- int x, y, tx, ty;
- int nx, ny;
- int dir, i;
+ POSITION x, y, tx, ty;
+ POSITION nx, ny;
+ DIRECTION dir;
+ int i;
int b = 10 + randint1(10);
if (!get_aim_dir(&dir)) return FALSE;
* while keeping the results quite random. It also allows some potent\n
* effects only at high level.
*/
-void cast_wonder(int dir)
+void cast_wonder(DIRECTION dir)
{
int plev = p_ptr->lev;
int die = randint1(100) + plev / 5;
* @param dir 方向ID
* @return なし
*/
-void cast_invoke_spirits(int dir)
+void cast_invoke_spirits(DIRECTION dir)
{
int plev = p_ptr->lev;
int die = randint1(100) + plev / 5;
void cast_shuffle(void)
{
int plev = p_ptr->lev;
- int dir;
+ DIRECTION dir;
int die;
int vir = virtue_number(V_CHANCE);
int i;
(void)set_image(0);
(void)set_stun(0);
(void)set_cut(0);
- (void)do_res_stat(A_STR);
- (void)do_res_stat(A_CON);
- (void)do_res_stat(A_DEX);
- (void)do_res_stat(A_WIS);
- (void)do_res_stat(A_INT);
- (void)do_res_stat(A_CHR);
+ (void)restore_all_status();
(void)set_shero(0, TRUE);
update_stuff();
hp_player(5000);
return ident;
}
-bool_hack cure_light_wound(int dice, int sides)
+bool_hack berserk(int base)
+{
+ bool_hack ident = FALSE;
+ if (set_afraid(0)) ident = TRUE;
+ if (set_shero(p_ptr->hero + randint1(base) + base, FALSE)) ident = TRUE;
+ if (hp_player(30)) ident = TRUE;
+ return ident;
+}
+
+bool_hack cure_light_wounds(int dice, int sides)
{
bool_hack ident = FALSE;
if (hp_player(damroll(dice, sides))) ident = TRUE;
return ident;
}
-bool_hack cure_serious_wound(int dice, int sides)
+bool_hack cure_serious_wounds(int dice, int sides)
{
bool_hack ident = FALSE;
if (hp_player(damroll(dice, sides))) ident = TRUE;
if (set_shero(0, TRUE)) ident = TRUE;
return ident;
}
+
+bool_hack cure_critical_wounds(HIT_POINT pow)
+{
+ bool_hack ident = FALSE;
+ if (hp_player(pow)) ident = TRUE;
+ if (set_blind(0)) ident = TRUE;
+ if (set_confused(0)) ident = TRUE;
+ if (set_poisoned(0)) ident = TRUE;
+ if (set_stun(0)) ident = TRUE;
+ if (set_cut(0)) ident = TRUE;
+ if (set_shero(0, TRUE)) ident = TRUE;
+ return ident;
+}
+
+bool_hack true_healing(HIT_POINT pow)
+{
+ bool_hack ident = FALSE;
+ if (hp_player(pow)) ident = TRUE;
+ if (set_blind(0)) ident = TRUE;
+ if (set_confused(0)) ident = TRUE;
+ if (set_poisoned(0)) ident = TRUE;
+ if (set_stun(0)) ident = TRUE;
+ if (set_cut(0)) ident = TRUE;
+ if (set_image(0)) ident = TRUE;
+ return ident;
+}
+
+bool_hack restore_mana(bool_hack magic_eater)
+{
+ bool_hack ident = FALSE;
+
+ if (p_ptr->pclass == CLASS_MAGIC_EATER && magic_eater)
+ {
+ int i;
+ for (i = 0; i < EATER_EXT * 2; i++)
+ {
+ p_ptr->magic_num1[i] += (p_ptr->magic_num2[i] < 10) ? EATER_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_CHARGE / 3;
+ if (p_ptr->magic_num1[i] > p_ptr->magic_num2[i] * EATER_CHARGE) p_ptr->magic_num1[i] = p_ptr->magic_num2[i] * EATER_CHARGE;
+ }
+ for (; i < EATER_EXT * 3; i++)
+ {
+ KIND_OBJECT_IDX k_idx = lookup_kind(TV_ROD, i - EATER_EXT * 2);
+ p_ptr->magic_num1[i] -= ((p_ptr->magic_num2[i] < 10) ? EATER_ROD_CHARGE * 3 : p_ptr->magic_num2[i] * EATER_ROD_CHARGE / 3)*k_info[k_idx].pval;
+ if (p_ptr->magic_num1[i] < 0) p_ptr->magic_num1[i] = 0;
+ }
+ msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+ p_ptr->window |= (PW_PLAYER);
+ ident = TRUE;
+ }
+ else if (p_ptr->csp < p_ptr->msp)
+ {
+ p_ptr->csp = p_ptr->msp;
+ p_ptr->csp_frac = 0;
+ msg_print(_("頭がハッキリとした。", "You feel your head clear."));
+ p_ptr->redraw |= (PR_MANA);
+ p_ptr->window |= (PW_PLAYER);
+ p_ptr->window |= (PW_SPELL);
+ ident = TRUE;
+ }
+
+ return ident;
+}
+
+bool restore_all_status(void)
+{
+ bool ident = FALSE;
+ if (do_res_stat(A_STR)) ident = TRUE;
+ if (do_res_stat(A_INT)) ident = TRUE;
+ if (do_res_stat(A_WIS)) ident = TRUE;
+ if (do_res_stat(A_DEX)) ident = TRUE;
+ if (do_res_stat(A_CON)) ident = TRUE;
+ if (do_res_stat(A_CHR)) ident = TRUE;
+ return ident;
+}
+
+/*!
+ * @brief 口を使う継続的な処理を中断する
+ * @return なし
+ */
+void stop_mouth(void)
+{
+ if (music_singing_any()) stop_singing();
+ if (hex_spelling_any()) stop_hex_spell_all();
+}
+
+
+bool_hack vampirism(void)
+{
+ DIRECTION dir;
+ POSITION x, y;
+ int dummy;
+ cave_type *c_ptr;
+
+ if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
+ {
+ msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
+ return FALSE;
+ }
+
+ /* Only works on adjacent monsters */
+ if (!get_rep_dir2(&dir)) return FALSE;
+ y = p_ptr->y + ddy[dir];
+ x = p_ptr->x + ddx[dir];
+ c_ptr = &cave[y][x];
+
+ stop_mouth();
+
+ if (!(c_ptr->m_idx))
+ {
+ msg_print(_("何もない場所に噛みついた!", "You bite into thin air!"));
+ return FALSE;
+ }
+
+ msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
+
+ dummy = p_ptr->lev * 2;
+
+ if (hypodynamic_bolt(dir, dummy))
+ {
+ if (p_ptr->food < PY_FOOD_FULL)
+ /* No heal if we are "full" */
+ (void)hp_player(dummy);
+ else
+ msg_print(_("あなたは空腹ではありません。", "You were not hungry."));
+
+ /* Gain nutritional sustenance: 150/hp drained */
+ /* A Food ration gives 5000 food points (by contrast) */
+ /* Don't ever get more than "Full" this way */
+ /* But if we ARE Gorged, it won't cure us */
+ dummy = p_ptr->food + MIN(5000, 100 * dummy);
+ if (p_ptr->food < PY_FOOD_MAX) /* Not gorged already */
+ (void)set_food(dummy >= PY_FOOD_MAX ? PY_FOOD_MAX - 1 : dummy);
+ }
+ else
+ msg_print(_("げぇ!ひどい味だ。", "Yechh. That tastes foul."));
+ return TRUE;
+}
+
+bool panic_hit(void)
+{
+ DIRECTION dir;
+ POSITION x, y;
+
+ if (!get_rep_dir2(&dir)) return FALSE;
+ y = p_ptr->y + ddy[dir];
+ x = p_ptr->x + ddx[dir];
+ if (cave[y][x].m_idx)
+ {
+ py_attack(y, x, 0);
+ if (randint0(p_ptr->skill_dis) < 7)
+ msg_print(_("うまく逃げられなかった。", "You failed to run away."));
+ else
+ teleport_player(30, 0L);
+ return TRUE;
+ }
+ else
+ {
+ msg_print(_("その方向にはモンスターはいません。", "You don't see any monster in this direction"));
+ msg_print(NULL);
+ return FALSE;
+ }
+
+}
+
+/*!
+* @brief 超能力者のサイコメトリー処理/ Forcibly pseudo-identify an object in the inventory (or on the floor)
+* @return なし
+* @note
+* currently this function allows pseudo-id of any object,
+* including silly ones like potions & scrolls, which always
+* get '{average}'. This should be changed, either to stop such
+* items from being pseudo-id'd, or to allow psychometry to
+* detect whether the unidentified potion/scroll/etc is
+* good (Cure Light Wounds, Restore Strength, etc) or
+* bad (Poison, Weakness etc) or 'useless' (Slime Mold Juice, etc).
+*/
+bool psychometry(void)
+{
+ OBJECT_IDX item;
+ object_type *o_ptr;
+ char o_name[MAX_NLEN];
+ byte feel;
+ cptr q, s;
+ bool okay = FALSE;
+
+ item_tester_no_ryoute = TRUE;
+ /* Get an item */
+ q = _("どのアイテムを調べますか?", "Meditate on which item? ");
+ s = _("調べるアイテムがありません。", "You have nothing appropriate.");
+
+ if (!get_item(&item, q, s, (USE_EQUIP | USE_INVEN | USE_FLOOR))) return (FALSE);
+
+ /* Get the item (in the pack) */
+ if (item >= 0)
+ {
+ o_ptr = &inventory[item];
+ }
+
+ /* Get the item (on the floor) */
+ else
+ {
+ o_ptr = &o_list[0 - item];
+ }
+
+ /* It is fully known, no information needed */
+ if (object_is_known(o_ptr))
+ {
+ msg_print(_("何も新しいことは判らなかった。", "You cannot find out anything more about that."));
+ return TRUE;
+ }
+
+ /* Check for a feeling */
+ feel = value_check_aux1(o_ptr);
+
+ /* Get an object description */
+ object_desc(o_name, o_ptr, (OD_OMIT_PREFIX | OD_NAME_ONLY));
+
+ /* Skip non-feelings */
+ if (!feel)
+ {
+ msg_format(_("%sからは特に変わった事は感じとれなかった。", "You do not perceive anything unusual about the %s."), o_name);
+ return TRUE;
+ }
+
+#ifdef JP
+ msg_format("%sは%sという感じがする...",
+ o_name, game_inscriptions[feel]);
+#else
+ msg_format("You feel that the %s %s %s...",
+ o_name, ((o_ptr->number == 1) ? "is" : "are"),
+ game_inscriptions[feel]);
+#endif
+
+
+ /* We have "felt" it */
+ o_ptr->ident |= (IDENT_SENSE);
+
+ /* "Inscribe" it */
+ o_ptr->feeling = feel;
+
+ /* Player touches it */
+ o_ptr->marked |= OM_TOUCHED;
+
+ /* Combine / Reorder the pack (later) */
+ p_ptr->notice |= (PN_COMBINE | PN_REORDER);
+
+ /* Window stuff */
+ p_ptr->window |= (PW_INVEN | PW_EQUIP | PW_PLAYER);
+
+ /* Valid "tval" codes */
+ switch (o_ptr->tval)
+ {
+ case TV_SHOT:
+ case TV_ARROW:
+ case TV_BOLT:
+ case TV_BOW:
+ case TV_DIGGING:
+ case TV_HAFTED:
+ case TV_POLEARM:
+ case TV_SWORD:
+ case TV_BOOTS:
+ case TV_GLOVES:
+ case TV_HELM:
+ case TV_CROWN:
+ case TV_SHIELD:
+ case TV_CLOAK:
+ case TV_SOFT_ARMOR:
+ case TV_HARD_ARMOR:
+ case TV_DRAG_ARMOR:
+ case TV_CARD:
+ case TV_RING:
+ case TV_AMULET:
+ case TV_LITE:
+ case TV_FIGURINE:
+ okay = TRUE;
+ break;
+ }
+
+ /* Auto-inscription/destroy */
+ autopick_alter_item(item, (bool)(okay && destroy_feeling));
+
+ /* Something happened */
+ return (TRUE);
+}