Integrate some processes to vampirism().
extern bool_hack restore_mana(bool_hack magic_eater);
extern bool restore_all_status(void);
extern void stop_mouth(void);
+extern bool_hack vampirism(void);
/* spells3.c */
extern bool teleport_away(MONSTER_IDX m_idx, int dis, BIT_FLAGS mode);
break;
case MUT1_VAMPIRISM:
- {
- int x, y, dummy;
- cave_type *c_ptr;
-
- /* 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!"));
-
- break;
- }
-
- msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
-
-
- dummy = lvl * 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."));
-
- }
+ vampirism();
break;
case MUT1_SMELL_MET:
break;
}
case MIMIC_VAMPIRE:
- if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
- {
- msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
- return FALSE;
- }
- else
- {
- int y, x, dummy = 0;
- cave_type *c_ptr;
-
- /* Only works on adjacent monsters */
- if (!get_rep_dir(&dir, FALSE)) return FALSE; /* was get_aim_dir */
- 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!"));
- break;
- }
-
- msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
- dummy = plev + randint1(plev) * MAX(1, plev / 10); /* Dmg */
- 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."));
- }
+ vampirism();
break;
}
}
break;
case RACE_VAMPIRE:
- if (d_info[dungeon_type].flags1 & DF1_NO_MELEE)
- {
- msg_print(_("なぜか攻撃することができない。", "Something prevent you from attacking."));
- return FALSE;
- }
- else
- {
- int y, x, dummy = 0;
- cave_type *c_ptr;
-
- /* Only works on adjacent monsters */
- if (!get_rep_dir(&dir,FALSE)) return FALSE; /* was get_aim_dir */
- 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!"));
- break;
- }
-
- msg_print(_("あなたはニヤリとして牙をむいた...", "You grin and bare your fangs..."));
- dummy = plev + randint1(plev) * MAX(1, plev / 10); /* Dmg */
- 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."));
- }
+ vampirism();
break;
case RACE_SPECTRE:
if (music_singing_any()) stop_singing();
if (hex_spelling_any()) stop_hex_spell_all();
}
+
+
+bool_hack vampirism(void)
+{
+ DIRECTION dir;
+ int x, y, 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;
+}
+