OSDN Git Service

[Refactor] #40014 Separated monster-summonc./h from monster-generator.c/h
[hengband/hengband.git] / src / spell-realm / spells-trump.c
1 #include "spell-realm/spells-trump.h"
2 #include "floor/floor.h"
3 #include "io/targeting.h"
4 #include "monster-floor/monster-summon.h"
5 #include "monster-floor/place-monster-types.h"
6 #include "mutation/mutation.h"
7 #include "player/avatar.h"
8 #include "player/player-effects.h"
9 #include "spell-kind/earthquake.h"
10 #include "spell-kind/spells-charm.h"
11 #include "spell-kind/spells-floor.h"
12 #include "spell-kind/spells-lite.h"
13 #include "spell-kind/spells-neighbor.h"
14 #include "spell-kind/spells-random.h"
15 #include "spell-kind/spells-sight.h"
16 #include "spell-kind/spells-teleport.h"
17 #include "spell/spells-status.h"
18 #include "spell/spells-summon.h"
19
20 /*!
21  * @brief トランプ領域の「シャッフル」の効果をランダムに決めて処理する。
22  * @param caster_ptr プレーヤーへの参照ポインタ
23  * @return なし
24  */
25 void cast_shuffle(player_type *caster_ptr)
26 {
27     PLAYER_LEVEL plev = caster_ptr->lev;
28     DIRECTION dir;
29     int die;
30     int vir = virtue_number(caster_ptr, V_CHANCE);
31     int i;
32
33     if ((caster_ptr->pclass == CLASS_ROGUE) || (caster_ptr->pclass == CLASS_HIGH_MAGE) || (caster_ptr->pclass == CLASS_SORCERER))
34         die = (randint1(110)) + plev / 5;
35     else
36         die = randint1(120);
37
38     if (vir) {
39         if (caster_ptr->virtues[vir - 1] > 0) {
40             while (randint1(400) < caster_ptr->virtues[vir - 1])
41                 die++;
42         } else {
43             while (randint1(400) < (0 - caster_ptr->virtues[vir - 1]))
44                 die--;
45         }
46     }
47
48     msg_print(_("あなたはカードを切って一枚引いた...", "You shuffle the deck and draw a card..."));
49
50     if (die < 30) {
51         chg_virtue(caster_ptr, V_CHANCE, 1);
52     }
53
54     floor_type *floor_ptr = caster_ptr->current_floor_ptr;
55     if (die < 7) {
56         msg_print(_("なんてこった!《死》だ!", "Oh no! It's Death!"));
57
58         for (i = 0; i < randint1(3); i++) {
59             activate_hi_summon(caster_ptr, caster_ptr->y, caster_ptr->x, FALSE);
60         }
61
62         return;
63     }
64
65     if (die < 14) {
66         msg_print(_("なんてこった!《悪魔》だ!", "Oh no! It's the Devil!"));
67         summon_specific(caster_ptr, 0, caster_ptr->y, caster_ptr->x, floor_ptr->dun_level, SUMMON_DEMON, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
68         return;
69     }
70
71     if (die < 18) {
72         int count = 0;
73         msg_print(_("なんてこった!《吊られた男》だ!", "Oh no! It's the Hanged Man."));
74         activate_ty_curse(caster_ptr, FALSE, &count);
75         return;
76     }
77
78     if (die < 22) {
79         msg_print(_("《不調和の剣》だ。", "It's the swords of discord."));
80         aggravate_monsters(caster_ptr, 0);
81         return;
82     }
83
84     if (die < 26) {
85         msg_print(_("《愚者》だ。", "It's the Fool."));
86         do_dec_stat(caster_ptr, A_INT);
87         do_dec_stat(caster_ptr, A_WIS);
88         return;
89     }
90
91     if (die < 30) {
92         msg_print(_("奇妙なモンスターの絵だ。", "It's the picture of a strange monster."));
93         trump_summoning(
94             caster_ptr, 1, FALSE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), (32 + randint1(6)), PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
95         return;
96     }
97
98     if (die < 33) {
99         msg_print(_("《月》だ。", "It's the Moon."));
100         unlite_area(caster_ptr, 10, 3);
101         return;
102     }
103
104     if (die < 38) {
105         msg_print(_("《運命の輪》だ。", "It's the Wheel of Fortune."));
106         wild_magic(caster_ptr, randint0(32));
107         return;
108     }
109
110     if (die < 40) {
111         msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
112         teleport_player(caster_ptr, 10, TELEPORT_PASSIVE);
113         return;
114     }
115
116     if (die < 42) {
117         msg_print(_("《正義》だ。", "It's Justice."));
118         set_blessed(caster_ptr, caster_ptr->lev, FALSE);
119         return;
120     }
121
122     if (die < 47) {
123         msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
124         teleport_player(caster_ptr, 100, TELEPORT_PASSIVE);
125         return;
126     }
127
128     if (die < 52) {
129         msg_print(_("テレポート・カードだ。", "It's a teleport trump card."));
130         teleport_player(caster_ptr, 200, TELEPORT_PASSIVE);
131         return;
132     }
133
134     if (die < 60) {
135         msg_print(_("《塔》だ。", "It's the Tower."));
136         wall_breaker(caster_ptr);
137         return;
138     }
139
140     if (die < 72) {
141         msg_print(_("《節制》だ。", "It's Temperance."));
142         sleep_monsters_touch(caster_ptr);
143         return;
144     }
145
146     if (die < 80) {
147         msg_print(_("《塔》だ。", "It's the Tower."));
148         earthquake(caster_ptr, caster_ptr->y, caster_ptr->x, 5, 0);
149         return;
150     }
151
152     if (die < 82) {
153         msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
154         trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_MOLD, 0L);
155         return;
156     }
157
158     if (die < 84) {
159         msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
160         trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_BAT, 0L);
161         return;
162     }
163
164     if (die < 86) {
165         msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
166         trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_VORTEX, 0L);
167         return;
168     }
169
170     if (die < 88) {
171         msg_print(_("友好的なモンスターの絵だ。", "It's the picture of a friendly monster."));
172         trump_summoning(caster_ptr, 1, TRUE, caster_ptr->y, caster_ptr->x, (floor_ptr->dun_level * 3 / 2), SUMMON_COIN_MIMIC, 0L);
173         return;
174     }
175
176     if (die < 96) {
177         msg_print(_("《恋人》だ。", "It's the Lovers."));
178
179         if (get_aim_dir(caster_ptr, &dir)) {
180             charm_monster(caster_ptr, dir, MIN(caster_ptr->lev, 20));
181         }
182
183         return;
184     }
185
186     if (die < 101) {
187         msg_print(_("《隠者》だ。", "It's the Hermit."));
188         wall_stone(caster_ptr);
189         return;
190     }
191
192     if (die < 111) {
193         msg_print(_("《審判》だ。", "It's the Judgement."));
194         roll_hitdice(caster_ptr, 0L);
195         lose_all_mutations(caster_ptr);
196         return;
197     }
198
199     if (die < 120) {
200         msg_print(_("《太陽》だ。", "It's the Sun."));
201         chg_virtue(caster_ptr, V_KNOWLEDGE, 1);
202         chg_virtue(caster_ptr, V_ENLIGHTEN, 1);
203         wiz_lite(caster_ptr, FALSE);
204         return;
205     }
206
207     msg_print(_("《世界》だ。", "It's the World."));
208     if (caster_ptr->exp >= PY_MAX_EXP) {
209         return;
210     }
211
212     s32b ee = (caster_ptr->exp / 25) + 1;
213     if (ee > 5000)
214         ee = 5000;
215     msg_print(_("更に経験を積んだような気がする。", "You feel more experienced."));
216     gain_exp(caster_ptr, ee);
217 }