OSDN Git Service

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