OSDN Git Service

[Refactor] #2523 poison() をset_poison() に改名した
[hengbandforosx/hengbandosx.git] / src / spell / spells-staff-only.cpp
1 #include "spell/spells-staff-only.h"
2 #include "effect/attribute-types.h"
3 #include "effect/effect-characteristics.h"
4 #include "effect/effect-processor.h"
5 #include "hpmp/hp-mp-processor.h"
6 #include "player-base/player-class.h"
7 #include "player/player-damage.h"
8 #include "spell-kind/spells-sight.h"
9 #include "status/bad-status-setter.h"
10 #include "status/body-improvement.h"
11 #include "system/player-type-definition.h"
12 #include "view/display-messages.h"
13
14 /*!
15  * @brief 聖浄の杖の効果
16  * @param player_ptr プレイヤーへの参照ポインタ
17  * @magic 魔法の効果である場合TRUE (杖と同じ効果の呪文はあったか? 要調査)
18  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
19  */
20 bool cleansing_nova(PlayerType *player_ptr, bool magic, bool powerful)
21 {
22     bool ident = false;
23     if (dispel_evil(player_ptr, powerful ? 225 : 150)) {
24         ident = true;
25     }
26
27     int k = 3 * player_ptr->lev;
28     if (set_protevil(player_ptr, (magic ? 0 : player_ptr->protevil) + randint1(25) + k, false)) {
29         ident = true;
30     }
31
32     BadStatusSetter bss(player_ptr);
33     if (bss.set_poison(0)) {
34         ident = true;
35     }
36
37     if (bss.fear(0)) {
38         ident = true;
39     }
40
41     if (hp_player(player_ptr, 50)) {
42         ident = true;
43     }
44
45     if (bss.stun(0)) {
46         ident = true;
47     }
48
49     if (bss.cut(0)) {
50         ident = true;
51     }
52
53     return ident;
54 }
55
56 /*!
57  * @brief 魔力の嵐の杖の効果
58  * @param player_ptr プレイヤーへの参照ポインタ
59  * @powerful 効果が増強される時TRUE (TRUEになるタイミングはあるか? 要調査)
60  */
61 bool unleash_mana_storm(PlayerType *player_ptr, bool powerful)
62 {
63     msg_print(_("強力な魔力が敵を引き裂いた!", "Mighty magics rend your enemies!"));
64     project(player_ptr, 0, (powerful ? 7 : 5), player_ptr->y, player_ptr->x, (randint1(200) + (powerful ? 500 : 300)) * 2, AttributeType::MANA,
65         PROJECT_KILL | PROJECT_ITEM | PROJECT_GRID);
66
67     if (!PlayerClass(player_ptr).is_wizard()) {
68         (void)take_hit(player_ptr, DAMAGE_NOESCAPE, 50, _("コントロールし難い強力な魔力の解放", "unleashing magics too mighty to control"));
69     }
70
71     return true;
72 }