OSDN Git Service

[Add] @return を不要に書き込んだことによる警告をひとまず置換で修正.
[hengbandforosx/hengbandosx.git] / src / mind / mind-warrior-mage.cpp
1 #include "mind/mind-warrior-mage.h"
2 #include "core/player-redraw-types.h"
3 #include "hpmp/hp-mp-processor.h"
4 #include "player/player-damage.h"
5 #include "system/player-type-definition.h"
6 #include "view/display-messages.h"
7
8 bool comvert_hp_to_mp(player_type *creature_ptr)
9 {
10     int gain_sp = take_hit(creature_ptr, DAMAGE_USELIFE, creature_ptr->lev, _("HPからMPへの無謀な変換", "thoughtless conversion from HP to SP")) / 5;
11     if (!gain_sp) {
12         msg_print(_("変換に失敗した。", "You failed to convert."));
13         creature_ptr->redraw |= (PR_HP | PR_MANA);
14         return TRUE;
15     }
16
17     creature_ptr->csp += gain_sp;
18     if (creature_ptr->csp > creature_ptr->msp) {
19         creature_ptr->csp = creature_ptr->msp;
20         creature_ptr->csp_frac = 0;
21     }
22
23     creature_ptr->redraw |= (PR_HP | PR_MANA);
24     return TRUE;
25 }
26
27 bool comvert_mp_to_hp(player_type *creature_ptr)
28 {
29     if (creature_ptr->csp >= creature_ptr->lev / 5) {
30         creature_ptr->csp -= creature_ptr->lev / 5;
31         hp_player(creature_ptr, creature_ptr->lev);
32     } else {
33         msg_print(_("変換に失敗した。", "You failed to convert."));
34     }
35
36     creature_ptr->redraw |= (PR_HP | PR_MANA);
37     return TRUE;
38 }