OSDN Git Service

Merge remote-tracking branch 'remotes/hengbandosx/english-market-edits' into feature...
[hengband/hengband.git] / src / mspell / specified-summon.c
1 #include "mspell/specified-summon.h"
2 #include "effect/effect-characteristics.h"
3 #include "effect/effect-processor.h"
4 #include "floor/cave.h"
5 #include "floor/floor-util.h"
6 #include "monster-floor/monster-summon.h"
7 #include "monster-floor/place-monster-types.h"
8 #include "monster-race/monster-race.h"
9 #include "monster-race/race-indice-types.h"
10 #include "monster/monster-info.h"
11 #include "mspell/mspell-checker.h"
12 #include "mspell/mspell-util.h"
13 #include "spell-kind/spells-launcher.h"
14 #include "spell/spell-types.h"
15 #include "spell/summon-types.h"
16 #include "view/display-messages.h"
17
18 /*!
19  * @brief 鷹召喚の処理。 /
20  * @param target_ptr プレーヤーへの参照ポインタ
21  * @param y 対象の地点のy座標
22  * @param x 対象の地点のx座標
23  * @param rlev 呪文を唱えるモンスターのレベル
24  * @param m_idx 呪文を唱えるモンスターID
25  * @return 召喚したモンスターの数を返す。
26  */
27 MONSTER_NUMBER summon_EAGLE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
28 {
29     int count = 0;
30     int num = 4 + randint1(3);
31     for (int k = 0; k < num; k++) {
32         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_EAGLES, PM_ALLOW_GROUP | PM_ALLOW_UNIQUE);
33     }
34
35     return count;
36 }
37
38 /*!
39  * @brief エッヂ召喚の処理。 /
40  * @param target_ptr プレーヤーへの参照ポインタ
41  * @param y 対象の地点のy座標
42  * @param x 対象の地点のx座標
43  * @param rlev 呪文を唱えるモンスターのレベル
44  * @param m_idx 呪文を唱えるモンスターID
45  * @return 召喚したモンスターの数を返す。
46  */
47 MONSTER_NUMBER summon_EDGE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
48 {
49     int count = 0;
50     int num = 2 + randint1(1 + rlev / 20);
51     for (int k = 0; k < num; k++)
52         count += summon_named_creature(target_ptr, m_idx, y, x, MON_EDGE, PM_NONE);
53
54     return count;
55 }
56
57 /*!
58  * @brief ダンジョンの主召喚の処理。 /
59  * @param target_ptr プレーヤーへの参照ポインタ
60  * @param y 対象の地点のy座標
61  * @param x 対象の地点のx座標
62  * @param rlev 呪文を唱えるモンスターのレベル
63  * @param m_idx 呪文を唱えるモンスターID
64  * @param t_idx 呪文を受けるモンスターID。プレイヤーの場合はdummyで0とする。
65  * @param TARGET_TYPE プレイヤーを対象とする場合MONSTER_TO_PLAYER、モンスターを対象とする場合MONSTER_TO_MONSTER
66  * @return 召喚したモンスターの数を返す。
67  */
68 MONSTER_NUMBER summon_guardian(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx, MONSTER_IDX t_idx, int TARGET_TYPE)
69 {
70     int num = 2 + randint1(3);
71     bool mon_to_mon = (TARGET_TYPE == MONSTER_TO_MONSTER);
72     bool mon_to_player = (TARGET_TYPE == MONSTER_TO_PLAYER);
73
74     if (r_info[MON_JORMUNGAND].cur_num < r_info[MON_JORMUNGAND].max_num && one_in_(6)) {
75         simple_monspell_message(target_ptr, m_idx, t_idx, _("地面から水が吹き出した!", "Water blew off from the ground!"),
76             _("地面から水が吹き出した!", "Water blew off from the ground!"), TARGET_TYPE);
77
78         if (mon_to_player)
79             fire_ball_hide(target_ptr, GF_WATER_FLOW, 0, 3, 8);
80         else if (mon_to_mon)
81             project(target_ptr, t_idx, 8, y, x, 3, GF_WATER_FLOW, PROJECT_GRID | PROJECT_HIDE, -1);
82     }
83
84     int count = 0;
85     for (int k = 0; k < num; k++) {
86         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_GUARDIANS, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE));
87     }
88
89     return count;
90 }
91
92 /*!
93  * @brief ロックのクローン召喚の処理。 /
94  * @param target_ptr プレーヤーへの参照ポインタ
95  * @param y 対象の地点のy座標
96  * @param x 対象の地点のx座標
97  * @param m_idx 呪文を唱えるモンスターID
98  * @return 召喚したモンスターの数を返す。
99  */
100 MONSTER_NUMBER summon_LOCKE_CLONE(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
101 {
102     int count = 0;
103     int num = randint1(3);
104     for (int k = 0; k < num; k++) {
105         count += summon_named_creature(target_ptr, m_idx, y, x, MON_LOCKE_CLONE, PM_NONE);
106     }
107
108     return count;
109 }
110
111 /*!
112  * @brief シラミ召喚の処理。 /
113  * @param target_ptr プレーヤーへの参照ポインタ
114  * @param y 対象の地点のy座標
115  * @param x 対象の地点のx座標
116  * @param rlev 呪文を唱えるモンスターのレベル
117  * @param m_idx 呪文を唱えるモンスターID
118  * @return 召喚したモンスターの数を返す。
119  */
120 MONSTER_NUMBER summon_LOUSE(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
121 {
122     int count = 0;
123     int num = 2 + randint1(3);
124     for (int k = 0; k < num; k++)
125         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_LOUSE, PM_ALLOW_GROUP);
126
127     return count;
128 }
129
130 MONSTER_NUMBER summon_MOAI(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
131 {
132     int count = 0;
133     int num = 3 + randint1(3);
134     for (int k = 0; k < num; k++)
135         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_SMALL_MOAI, PM_NONE);
136
137     return count;
138 }
139
140 MONSTER_NUMBER summon_DEMON_SLAYER(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
141 {
142     int count = 0;
143     const int num = 5;
144     for (int k = 0; k < num; k++)
145         count += summon_named_creature(target_ptr, m_idx, y, x, MON_DEMON_SLAYER_MEMBER, PM_NONE);
146
147     if (count == 0)
148         msg_print(_("しかし、隊士は全滅していた…。", "However, all demon slayer member were murdered..."));
149
150     return count;
151 }
152
153 /*!
154  * @brief ナズグル戦隊召喚の処理。 /
155  * @param target_ptr プレーヤーへの参照ポインタ
156  * @param y 対象の地点のy座標
157  * @param x 対象の地点のx座標
158  * @param m_idx 呪文を唱えるモンスターID
159  * @return 召喚したモンスターの数を返す。
160  */
161 MONSTER_NUMBER summon_NAZGUL(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
162 {
163     BIT_FLAGS mode = 0L;
164     POSITION cy = y;
165     POSITION cx = x;
166     GAME_TEXT m_name[MAX_NLEN];
167     monster_name(target_ptr, m_idx, m_name);
168
169     if (target_ptr->blind)
170         msg_format(_("%^sが何かをつぶやいた。", "%^s mumbles."), m_name);
171     else
172         msg_format(_("%^sが魔法で幽鬼戦隊を召喚した!", "%^s magically summons rangers of Nazgul!"), m_name);
173
174     msg_print(NULL);
175
176     int count = 0;
177     for (int k = 0; k < 30; k++) {
178         if (!summon_possible(target_ptr, cy, cx) || !is_cave_empty_bold(target_ptr, cy, cx)) {
179             int j;
180             for (j = 100; j > 0; j--) {
181                 scatter(target_ptr, &cy, &cx, y, x, 2, PROJECT_NONE);
182                 if (is_cave_empty_bold(target_ptr, cy, cx))
183                     break;
184             }
185
186             if (!j)
187                 break;
188         }
189
190         if (!is_cave_empty_bold(target_ptr, cy, cx))
191             continue;
192
193         if (!summon_named_creature(target_ptr, m_idx, cy, cx, MON_NAZGUL, mode))
194             continue;
195
196         y = cy;
197         x = cx;
198         count++;
199         if (count == 1)
200             msg_format(_("「幽鬼戦隊%d号、ナズグル・ブラック!」", "A Nazgul says 'Nazgul-Rangers Number %d, Nazgul-Black!'"), count);
201         else
202             msg_format(_("「同じく%d号、ナズグル・ブラック!」", "Another one says 'Number %d, Nazgul-Black!'"), count);
203
204         msg_print(NULL);
205     }
206
207     msg_format(_("「%d人そろって、リングレンジャー!」", "They say 'The %d meets! We are the Ring-Ranger!'."), count);
208     msg_print(NULL);
209     return count;
210 }
211
212 MONSTER_NUMBER summon_APOCRYPHA(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
213 {
214     int count = 0;
215     int num = 4 + randint1(4);
216     summon_type followers = next_bool() ? SUMMON_APOCRYPHA_FOLLOWERS : SUMMON_APOCRYPHA_DRAGONS;
217     for (int k = 0; k < num; k++)
218         count += summon_specific(target_ptr, m_idx, y, x, 200, followers, PM_ALLOW_UNIQUE);
219
220     return count;
221 }
222
223 MONSTER_NUMBER summon_HIGHEST_DRAGON(player_type *target_ptr, POSITION y, POSITION x, MONSTER_IDX m_idx)
224 {
225     int count = 0;
226     int num = 4 + randint1(4);
227     for (int k = 0; k < num; k++)
228         count += summon_specific(target_ptr, m_idx, y, x, 100, SUMMON_APOCRYPHA_DRAGONS, PM_ALLOW_UNIQUE);
229
230     return count;
231 }
232
233 MONSTER_NUMBER summon_PYRAMID(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
234 {
235     int count = 0;
236     int num = 2 + randint1(3);
237     for (int k = 0; k < num; k++)
238         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_PYRAMID, PM_NONE);
239
240     return count;
241 }
242
243 MONSTER_NUMBER summon_EYE_PHORN(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
244 {
245     int count = 0;
246     int num = 2 + randint1(1 + rlev / 20);
247     for (int k = 0; k < num; k++)
248         count += summon_named_creature(target_ptr, m_idx, y, x, MON_EYE_PHORN, PM_NONE);
249
250     return count;
251 }
252
253 MONSTER_NUMBER summon_VESPOID(player_type *target_ptr, POSITION y, POSITION x, int rlev, MONSTER_IDX m_idx)
254 {
255     int count = 0;
256     int num = 2 + randint1(3);
257     for (int k = 0; k < num; k++)
258         count += summon_specific(target_ptr, m_idx, y, x, rlev, SUMMON_VESPOID, PM_NONE);
259
260     return count;
261 }