OSDN Git Service

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