extern bool create_ration(player_type *crature_ptr);
extern void hayagake(player_type *creature_ptr);
extern bool double_attack(player_type *creature_ptr);
+extern bool comvert_hp_to_mp(player_type *creature_ptr);
+extern bool comvert_mp_to_hp(player_type *creature_ptr);
/* spells3.c */
extern bool teleport_away(MONSTER_IDX m_idx, POSITION dis, BIT_FLAGS mode);
{
if (command == -3)
{
- int gain_sp = take_hit(DAMAGE_USELIFE, p_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
- if (gain_sp)
- {
- p_ptr->csp += gain_sp;
- if (p_ptr->csp > p_ptr->msp)
- {
- p_ptr->csp = p_ptr->msp;
- p_ptr->csp_frac = 0;
- }
- }
- else
- {
- msg_print(_("変換に失敗した。", "You failed to convert."));
- }
+ return comvert_hp_to_mp(p_ptr);
}
else if (command == -4)
{
- if (p_ptr->csp >= p_ptr->lev / 5)
- {
- p_ptr->csp -= p_ptr->lev / 5;
- hp_player(p_ptr->lev);
- }
- else
- {
- msg_print(_("変換に失敗した。", "You failed to convert."));
- }
+ return comvert_mp_to_hp(p_ptr);
}
-
- /* Redraw mana and hp */
- p_ptr->redraw |= (PR_HP | PR_MANA);
-
break;
}
case CLASS_CHAOS_WARRIOR:
}
return TRUE;
}
+
+bool comvert_hp_to_mp(player_type *creature_ptr)
+{
+ int gain_sp = take_hit(DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless convertion from HP to SP"), -1) / 5;
+ if (gain_sp)
+ {
+ creature_ptr->csp += gain_sp;
+ if (creature_ptr->csp > creature_ptr->msp)
+ {
+ creature_ptr->csp = creature_ptr->msp;
+ creature_ptr->csp_frac = 0;
+ }
+ }
+ else
+ {
+ msg_print(_("変換に失敗した。", "You failed to convert."));
+ }
+ creature_ptr->redraw |= (PR_HP | PR_MANA);
+ return TRUE;
+}
+
+bool comvert_mp_to_hp(player_type *creature_ptr)
+{
+ if (creature_ptr->csp >= creature_ptr->lev / 5)
+ {
+ creature_ptr->csp -= creature_ptr->lev / 5;
+ hp_player(creature_ptr->lev);
+ }
+ else
+ {
+ msg_print(_("変換に失敗した。", "You failed to convert."));
+ }
+ /* Redraw mana and hp */
+ creature_ptr->redraw |= (PR_HP | PR_MANA);
+ return TRUE;
+}
\ No newline at end of file