OSDN Git Service

9af8b83980c74866e6e91052d970d3717d92fdb8
[hengband/hengband.git] / src / spells2.c
1 /*!
2  * @file spells2.c
3  * @brief 魔法効果の実装/ Spell code (part 2)
4  * @date 2014/07/15
5  * @author
6  * <pre>
7  * Copyright (c) 1997 Ben Harrison, James E. Wilson, Robert A. Koeneke
8  * This software may be copied and distributed for educational, research,
9  * and not for profit purposes provided that this copyright and statement
10  * are included in all such copies.  Other copyrights may also apply.
11  * </pre>
12  */
13
14 #include "angband.h"
15 #include "grid.h"
16
17 /*!
18  * @brief 自己分析処理(Nethackからのアイデア) / self-knowledge... idea from nethack.
19  * @return なし
20  * @details
21  * <pre>
22  * Useful for determining powers and
23  * resistences of items.  It saves the screen, clears it, then starts listing
24  * attributes, a screenful at a time.  (There are a LOT of attributes to
25  * list.  It will probably take 2 or 3 screens for a powerful character whose
26  * using several artifacts...) -CFT
27  *
28  * It is now a lot more efficient. -BEN-
29  *
30  * See also "identify_fully()".
31  *
32  * XXX XXX XXX Use the "show_file()" method, perhaps.
33  * </pre>
34  */
35 void self_knowledge(void)
36 {
37         int i = 0, j, k;
38
39         int v_nr = 0;
40         char v_string [8] [128];
41         char s_string [6] [128];
42
43         u32b flgs[TR_FLAG_SIZE];
44
45         object_type *o_ptr;
46
47         char Dummy[80];
48         char buf[2][80];
49
50         cptr info[220];
51
52         int plev = p_ptr->lev;
53
54         int percent;
55
56         for (j = 0; j < TR_FLAG_SIZE; j++)
57                 flgs[j] = 0L;
58
59         p_ptr->knowledge |= (KNOW_STAT | KNOW_HPRATE);
60
61         strcpy(Dummy, "");
62
63         percent = (int)(((long)p_ptr->player_hp[PY_MAX_LEVEL - 1] * 200L) /
64                 (2 * p_ptr->hitdie +
65                 ((PY_MAX_LEVEL - 1+3) * (p_ptr->hitdie + 1))));
66
67         sprintf(Dummy, _("現在の体力ランク : %d/100", "Your current Life Rating is %d/100."), percent);
68         strcpy(buf[0], Dummy);
69         info[i++] = buf[0];
70         info[i++] = "";
71
72         chg_virtue(V_KNOWLEDGE, 1);
73         chg_virtue(V_ENLIGHTEN, 1);
74
75         /* Acquire item flags from equipment */
76         for (k = INVEN_RARM; k < INVEN_TOTAL; k++)
77         {
78                 u32b tflgs[TR_FLAG_SIZE];
79
80                 o_ptr = &inventory[k];
81
82                 /* Skip non-objects */
83                 if (!o_ptr->k_idx) continue;
84
85                 /* Extract the flags */
86                 object_flags(o_ptr, tflgs);
87
88                 /* Extract flags */
89                 for (j = 0; j < TR_FLAG_SIZE; j++)
90                         flgs[j] |= tflgs[j];
91         }
92
93         info[i++] = _("能力の最大値", "Limits of maximum stats");
94
95         for (v_nr = 0; v_nr < 6; v_nr++)
96         {
97                 char stat_desc[80];
98
99                 sprintf(stat_desc, "%s 18/%d", stat_names[v_nr], p_ptr->stat_max_max[v_nr]-18);
100
101                 strcpy(s_string[v_nr], stat_desc);
102
103                 info[i++] = s_string[v_nr];
104         }
105         info[i++] = "";
106
107         sprintf(Dummy, _("現在の属性 : %s(%ld)", "Your alighnment : %s(%ld)"), your_alignment(), (long int)p_ptr->align);
108         strcpy(buf[1], Dummy);
109         info[i++] = buf[1];
110         for (v_nr = 0; v_nr < 8; v_nr++)
111         {
112                 char vir_name [20];
113                 char vir_desc[80];
114                 int tester = p_ptr->virtues[v_nr];
115         
116                 strcpy(vir_name, virtue[(p_ptr->vir_types[v_nr])-1]);
117  
118                 sprintf(vir_desc, _("おっと。%sの情報なし。", "Oops. No info about %s."), vir_name);
119                 if (tester < -100)
120                         sprintf(vir_desc, _("[%s]の対極 (%d)", "You are the polar opposite of %s (%d)."),
121                                 vir_name, tester);
122                 else if (tester < -80)
123                         sprintf(vir_desc, _("[%s]の大敵 (%d)", "You are an arch-enemy of %s (%d)."),
124                                 vir_name, tester);
125                 else if (tester < -60)
126                         sprintf(vir_desc, _("[%s]の強敵 (%d)", "You are a bitter enemy of %s (%d)."),
127                                 vir_name, tester);
128                 else if (tester < -40)
129                         sprintf(vir_desc, _("[%s]の敵 (%d)", "You are an enemy of %s (%d)."),
130                                 vir_name, tester);
131                 else if (tester < -20)
132                         sprintf(vir_desc, _("[%s]の罪者 (%d)", "You have sinned against %s (%d)."),
133                                 vir_name, tester);
134                 else if (tester < 0)
135                         sprintf(vir_desc, _("[%s]の迷道者 (%d)", "You have strayed from the path of %s (%d)."),
136                                 vir_name, tester);
137                 else if (tester == 0)
138                         sprintf(vir_desc, _("[%s]の中立者 (%d)", "You are neutral to %s (%d)."),
139                                 vir_name, tester);
140                 else if (tester < 20)
141                         sprintf(vir_desc, _("[%s]の小徳者 (%d)", "You are somewhat virtuous in %s (%d)."),
142                                 vir_name, tester);
143                 else if (tester < 40)
144                         sprintf(vir_desc, _("[%s]の中徳者 (%d)", "You are virtuous in %s (%d)."),
145                                 vir_name, tester);
146                 else if (tester < 60)
147                         sprintf(vir_desc, _("[%s]の高徳者 (%d)", "You are very virtuous in %s (%d)."),
148                                 vir_name, tester);
149                 else if (tester < 80)
150                         sprintf(vir_desc, _("[%s]の覇者 (%d)", "You are a champion of %s (%d)."),
151                                 vir_name, tester);
152                 else if (tester < 100)
153                         sprintf(vir_desc, _("[%s]の偉大な覇者 (%d)", "You are a great champion of %s (%d)."),
154                                 vir_name, tester);
155                 else
156                         sprintf(vir_desc, _("[%s]の具現者 (%d)", "You are the living embodiment of %s (%d)."),
157                                 vir_name, tester);
158         
159                 strcpy(v_string[v_nr], vir_desc);
160         
161                 info[i++] = v_string[v_nr];
162         }
163         info[i++] = "";
164         
165         /* Racial powers... */
166         if (p_ptr->mimic_form)
167         {
168                 switch (p_ptr->mimic_form)
169                 {
170                         case MIMIC_DEMON:
171                         case MIMIC_DEMON_LORD:
172                         sprintf(Dummy, _("あなたは %d ダメージの地獄か火炎のブレスを吐くことができる。(%d MP)", 
173                                                         "You can nether breathe, dam. %d (cost %d)."), 3 * plev, 10+plev/3);
174
175                                 info[i++] = Dummy;
176                         break;
177                 case MIMIC_VAMPIRE:
178                         if (plev > 1)
179                         {
180                                 sprintf(Dummy, _("あなたは敵から %d-%d HP の生命力を吸収できる。(%d MP)", 
181                                                                 "You can steal life from a foe, dam. %d-%d (cost %d)."),
182                                     plev + MAX(1, plev / 10), plev + plev * MAX(1, plev / 10), 1 + (plev / 3));
183                                 info[i++] = Dummy;
184                         }
185                         break;
186                 }
187         }
188         else
189         {
190         switch (p_ptr->prace)
191         {
192                 case RACE_NIBELUNG:
193                 case RACE_DWARF:
194                         if (plev > 4)
195                         info[i++] = _("あなたは罠とドアと階段を感知できる。(5 MP)", "You can find traps, doors and stairs (cost 5).");
196                         break;
197                 case RACE_HOBBIT:
198                         if (plev > 14)
199                         {
200                                 info[i++] = _("あなたは食料を生成できる。(10 MP)", "You can produce food (cost 10).");
201                         }
202                         break;
203                 case RACE_GNOME:
204                         if (plev > 4)
205                         {
206                                 sprintf(Dummy, _("あなたは範囲 %d 以内にテレポートできる。(%d MP)", "You can teleport, range %d (cost %d)."),
207                                     (1 + plev), (5 + (plev / 5)));
208                                 info[i++] = Dummy;
209                         }
210                         break;
211                 case RACE_HALF_ORC:
212                         if (plev > 2)
213                                 info[i++] = _("あなたは恐怖を除去できる。(5 MP)", "You can remove fear (cost 5).");
214                         break;
215                 case RACE_HALF_TROLL:
216                         if (plev > 9)
217                                 info[i++] = _("あなたは狂暴化することができる。(12 MP) ", "You enter berserk fury (cost 12).");
218                         break;
219                 case RACE_AMBERITE:
220                         if (plev > 29)
221                                 info[i++] = _("あなたはシャドウシフトすることができる。(50 MP)", "You can Shift Shadows (cost 50).");
222
223                         if (plev > 39)
224                                 info[i++] = _("あなたは「パターン」を心に描いて歩くことができる。(75 MP)", "You can mentally Walk the Pattern (cost 75).");
225
226                         break;
227                 case RACE_BARBARIAN:
228                         if (plev > 7)
229                                 info[i++] = _("あなたは狂暴化することができる。(10 MP) ", "You can enter berserk fury (cost 10).");
230
231                         break;
232                 case RACE_HALF_OGRE:
233                         if (plev > 24)
234                                 info[i++] = _("あなたは爆発のルーンを仕掛けることができる。(35 MP)", "You can set an Explosive Rune (cost 35).");
235
236                         break;
237                 case RACE_HALF_GIANT:
238                         if (plev > 19)
239                                 info[i++] = _("あなたは石の壁を壊すことができる。(10 MP)", "You can break stone walls (cost 10).");
240                         break;
241                 case RACE_HALF_TITAN:
242                         if (plev > 34)
243                                 info[i++] = _("あなたはモンスターをスキャンすることができる。(20 MP)", "You can probe monsters (cost 20).");
244                         break;
245                 case RACE_CYCLOPS:
246                         if (plev > 19)
247                         {
248                                 sprintf(Dummy, _("あなたは %d ダメージの岩石を投げることができる。(15 MP)", 
249                                                          "You can throw a boulder, dam. %d (cost 15)."), 3 * plev);
250                                 info[i++] = Dummy;
251                         }
252                         break;
253                 case RACE_YEEK:
254                         if (plev > 14)
255                                 info[i++] = _("あなたは恐怖を呼び起こす叫び声を発することができる。(15 MP)", "You can make a terrifying scream (cost 15).");
256                         break;
257                 case RACE_KLACKON:
258                         if (plev > 8)
259                         {
260                                 sprintf(Dummy, _("あなたは %d ダメージの酸を吹きかけることができる。(9 MP)", "You can spit acid, dam. %d (cost 9)."), plev);
261                                 info[i++] = Dummy;
262                         }
263                         break;
264                 case RACE_KOBOLD:
265                         if (plev > 11)
266                         {
267                                 sprintf(Dummy,
268                                                 _("あなたは %d ダメージの毒矢を投げることができる。(8 MP)", "You can throw a dart of poison, dam. %d (cost 8)."), plev);
269                                 info[i++] = Dummy;
270                         }
271                         break;
272                 case RACE_DARK_ELF:
273                         if (plev > 1)
274                         {
275                                 sprintf(Dummy, _("あなたは %d ダメージのマジック・ミサイルの呪文を使える。(2 MP)", "You can cast a Magic Missile, dam %d (cost 2)."),
276                                     (3 + ((plev-1) / 5)));
277                                 info[i++] = Dummy;
278                         }
279                         break;
280                 case RACE_DRACONIAN:
281                         sprintf(Dummy, _("あなたは %d ダメージのブレスを吐くことができる。(%d MP)", "You can breathe, dam. %d (cost %d)."), 2 * plev, plev);
282                         info[i++] = Dummy;
283                         break;
284                 case RACE_MIND_FLAYER:
285                         if (plev > 14)
286                                 sprintf(Dummy, _("あなたは %d ダメージの精神攻撃をすることができる。(12 MP)", "You can mind blast your enemies, dam %d (cost 12)."), plev);
287                         info[i++] = Dummy;
288                         break;
289                 case RACE_IMP:
290                         if (plev > 29)
291                         {
292                                 sprintf(Dummy, _("あなたは %d ダメージのファイア・ボールの呪文を使える。(15 MP)", "You can cast a Fire Ball, dam. %d (cost 15)."), plev);
293                                 info[i++] = Dummy;
294                         }
295                         else if (plev > 8)
296                         {
297                                 sprintf(Dummy, _("あなたは %d ダメージのファイア・ボルトの呪文を使える。(15 MP)", "You can cast a Fire Bolt, dam. %d (cost 15)."), plev);
298                                 info[i++] = Dummy;
299                         }
300                         break;
301                 case RACE_GOLEM:
302                         if (plev > 19)
303                                 info[i++] = _("あなたは d20+30 ターンの間肌を石に変化させられる。(15 MP)", "You can turn your skin to stone, dur d20+30 (cost 15).");
304                         break;
305                 case RACE_ZOMBIE:
306                 case RACE_SKELETON:
307                         if (plev > 29)
308                                 info[i++] = _("あなたは失った経験値を回復することができる。(30 MP)", "You can restore lost experience (cost 30).");
309                         break;
310                 case RACE_VAMPIRE:
311                         if (plev > 1)
312                         {
313                                 sprintf(Dummy, _("あなたは敵から %d-%d HP の生命力を吸収できる。(%d MP)", "You can steal life from a foe, dam. %d-%d (cost %d)."),
314                                     plev + MAX(1, plev / 10), plev + plev * MAX(1, plev / 10), 1 + (plev / 3));
315                                 info[i++] = Dummy;
316                         }
317                         break;
318                 case RACE_SPECTRE:
319                         if (plev > 3)
320                         {
321                                 info[i++] = _("あなたは泣き叫んで敵を恐怖させることができる。(3 MP)", "You can wail to terrify your enemies (cost 3).");
322                         }
323                         break;
324                 case RACE_SPRITE:
325                         if (plev > 11)
326                         {
327                                 info[i++] = _("あなたは敵を眠らせる魔法の粉を投げることができる。(12 MP)", "You can throw magical dust which induces sleep (cost 12).");
328                         }
329                         break;
330                 case RACE_DEMON:
331                         sprintf(Dummy, _("あなたは %d ダメージの地獄か火炎のブレスを吐くことができる。(%d MP)", 
332                                                 "You can breathe nether, dam. %d (cost %d)."), 3 * plev, 10+plev/3);
333
334                         info[i++] = Dummy;
335                         break;
336                 case RACE_KUTAR:
337                         if (plev > 19)
338                                 info[i++] = _("あなたは d20+30 ターンの間横に伸びることができる。(15 MP)", "You can expand horizontally, dur d20+30 (cost 15).");
339                         break;
340                 case RACE_ANDROID:
341                         if (plev < 10)
342                                 sprintf(Dummy, _("あなたは %d ダメージのレイガンを撃つことができる。(7 MP)", "You can fire a ray gun with damage %d (cost 7)."), 
343                                         (plev + 1) / 2);
344                         else if (plev < 25)
345                                 sprintf(Dummy, _("あなたは %d ダメージのブラスターを撃つことができる。(13 MP)", "You can fire a blaster with damage %d (cost 13)."), plev);
346                         else if (plev < 35)
347                                 sprintf(Dummy, _("あなたは %d ダメージのバズーカを撃つことができる。(26 MP)", "You can fire a bazooka with damage %d (cost 26)."), plev * 2);
348                         else if (plev < 45)
349                                 sprintf(Dummy, _("あなたは %d ダメージのビームキャノンを撃つことができる。(40 MP)", 
350                                                 "You can fire a beam cannon with damage %d (cost 40)."), plev * 2);
351                         else
352                                 sprintf(Dummy, _("あなたは %d ダメージのロケットを撃つことができる。(60 MP)", 
353                                                 "You can fire a rocket with damage %d (cost 60)."), plev * 5);
354
355                         info[i++] = Dummy;
356                         break;
357                 default:
358                         break;
359         }
360         }
361
362         switch(p_ptr->pclass)
363         {
364                 case CLASS_WARRIOR:
365                         if (plev > 39)
366                         {
367                                 info[i++] = _("あなたはランダムな方向に対して数回攻撃することができる。(75 MP)", 
368                                                         "You can attack some random directions at a time (cost 75).");
369                         }
370                         break;
371                 case CLASS_HIGH_MAGE:
372                         if (p_ptr->realm1 == REALM_HEX) break;
373                 case CLASS_MAGE:
374                 case CLASS_SORCERER:
375                         if (plev > 24)
376                         {
377                                 info[i++] = _("あなたはアイテムの魔力を吸収することができる。(1 MP)", 
378                                                 "You can absorb charges from an item (cost 1).");
379                         }
380                         break;
381                 case CLASS_PRIEST:
382                         if (is_good_realm(p_ptr->realm1))
383                         {
384                                 if (plev > 34)
385                                 {
386                                         info[i++] = _("あなたは武器を祝福することができる。(70 MP)", "You can bless a weapon (cost 70).");
387                                 }
388                         }
389                         else
390                         {
391                                 if (plev > 41)
392                                 {
393                                         info[i++] = _("あなたは周りのすべてのモンスターを攻撃することができる。(40 MP)", "You can damages all monsters in sight (cost 40).");
394                                 }
395                         }
396                         break;
397                 case CLASS_ROGUE:
398                         if (plev > 7)
399                         {
400                                 info[i++] = _("あなたは攻撃して即座に逃げることができる。(12 MP)", "You can hit a monster and teleport at a time (cost 12).");
401                         }
402                         break;
403                 case CLASS_RANGER:
404                         if (plev > 14)
405                         {
406                                 info[i++] = _("あなたは怪物を調査することができる。(20 MP)", "You can prove monsters (cost 20).");
407                         }
408                         break;
409                 case CLASS_PALADIN:
410                         if (is_good_realm(p_ptr->realm1))
411                         {
412                                 if (plev > 29)
413                                 {
414                                         info[i++] = _("あなたは聖なる槍を放つことができる。(30 MP)", "You can fires a holy spear (cost 30).");
415                                 }
416                         }
417                         else
418                         {
419                                 if (plev > 29)
420                                 {
421                                         info[i++] = _("あなたは生命力を減少させる槍を放つことができる。(30 MP)", "You can fires a spear which drains vitality (cost 30).");
422                                 }
423                         }
424                         break;
425                 case CLASS_WARRIOR_MAGE:
426                         if (plev > 24)
427                         {
428                                 info[i++] = _("あなたはHPをMPに変換することができる。(0 MP)", "You can convert HP to SP (cost 0).");
429                                 info[i++] = _("あなたはMPをHPに変換することができる。(0 MP)", "You can convert SP to HP (cost 0).");
430                         }
431                         break;
432                 case CLASS_CHAOS_WARRIOR:
433                         if (plev > 39)
434                         {
435                                 info[i++] = _("あなたは周囲に怪物を惑わす光を発生させることができる。(50 MP)",
436                                                 "You can radiate light which confuses nearby monsters (cost 50).");
437                         }
438                         break;
439                 case CLASS_MONK:
440                         if (plev > 24)
441                         {
442                                 info[i++] = _("あなたは構えることができる。(0 MP)", "You can assume a posture of special form (cost 0).");
443                         }
444                         if (plev > 29)
445                         {
446                                 info[i++] = _("あなたは通常の2倍の攻撃を行うことができる。(30 MP)", "You can perform double attacks in a time (cost 30).");
447                         }
448                         break;
449                 case CLASS_MINDCRAFTER:
450                 case CLASS_FORCETRAINER:
451                         if (plev > 14)
452                         {
453                                 info[i++] = _("あなたは精神を集中してMPを回復させることができる。(0 MP)", "You can concentrate to regenerate your mana (cost 0).");
454                         }
455                         break;
456                 case CLASS_TOURIST:
457                         info[i++] = _("あなたは写真を撮影することができる。(0 MP)", "You can take a photograph (cost 0).");
458                         if (plev > 24)
459                         {
460                                 info[i++] = _("あなたはアイテムを完全に鑑定することができる。(20 MP)", "You can *identify* items (cost 20).");
461                         }
462                         break;
463                 case CLASS_IMITATOR:
464                         if (plev > 29)
465                         {
466                                 info[i++] = _("あなたは怪物の特殊攻撃をダメージ2倍でまねることができる。(100 MP)", 
467                                                 "You can imitate monster's special attacks with double damage (cost 100).");
468                         }
469                         break;
470                 case CLASS_BEASTMASTER:
471                         info[i++] = _("あなたは1体の生命のあるモンスターを支配することができる。(レベル/4 MP)", "You can dominate a monster (cost level/4).");
472                         if (plev > 29)
473                         {
474                                 info[i++] = _("あなたは視界内の生命のあるモンスターを支配することができる。((レベル+20)/2 MP)", 
475                                                 "You can dominate living monsters in sight (cost (level+20)/4).");
476                         }
477                         break;
478                 case CLASS_MAGIC_EATER:
479                         info[i++] = _("あなたは杖/魔法棒/ロッドの魔力を自分のものにすることができる。", "You can absorb a staff, wand or rod itself.");
480                         break;
481                 case CLASS_RED_MAGE:
482                         if (plev > 47)
483                         {
484                                 info[i++] = _("あなたは1ターンに2回魔法を唱えることができる。(20 MP)", "You can cast two spells in one time (cost 20).");
485                         }
486                         break;
487                 case CLASS_SAMURAI:
488                         {
489                                 info[i++] = _("あなたは精神を集中して気合いを溜めることができる。", "You can concentrate to regenerate your mana.");
490                         }
491                         if (plev > 24)
492                         {
493                                 info[i++] = _("あなたは特殊な型で構えることができる。", "You can assume a posture of special form.");
494                         }
495                         break;
496                 case CLASS_BLUE_MAGE:
497                         info[i++] = _("あなたは相手に使われた魔法を学ぶことができる。", "You can study spells which your enemy casts on you.");
498                         break;
499                 case CLASS_CAVALRY:
500                         if (plev > 9)
501                         {
502                                 info[i++] = _("あなたはモンスターに乗って無理矢理ペットにすることができる。", "You can ride on a hostile monster forcibly to turn it into pet.");
503                         }
504                         break;
505                 case CLASS_BERSERKER:
506                         if (plev > 9)
507                         {
508                                 info[i++] = _("あなたは街とダンジョンの間を行き来することができる。", "You can travel between town and the depths.");
509                         }
510                         break;
511                 case CLASS_MIRROR_MASTER:
512                         info[i++] = _("あなたは鏡を作り出すことができる。(2 MP)", "You can create a Mirror (cost 2).");
513                         info[i++] = _("あなたは鏡を割ることができる。(0 MP)", "You can break distant Mirrors (cost 0).");
514                         break;
515                 case CLASS_NINJA:
516                         if (plev > 19)
517                         {
518                                 info[i++] = _("あなたは素早く移動することができる。", "You can walk extremery fast.");
519                         }
520                         break;
521         }
522
523         if (p_ptr->muta1)
524         {
525                 if (p_ptr->muta1 & MUT1_SPIT_ACID)
526                 {
527                         info[i++] = _("あなたは酸を吹きかけることができる。(ダメージ レベルX1)", "You can spit acid (dam lvl).");
528                 }
529                 if (p_ptr->muta1 & MUT1_BR_FIRE)
530                 {
531                         info[i++] = _("あなたは炎のブレスを吐くことができる。(ダメージ レベルX2)", "You can breathe fire (dam lvl * 2).");
532                 }
533                 if (p_ptr->muta1 & MUT1_HYPN_GAZE)
534                 {
535                         info[i++] = _("あなたの睨みは催眠効果をもつ。", "Your gaze is hypnotic.");
536                 }
537                 if (p_ptr->muta1 & MUT1_TELEKINES)
538                 {
539                         info[i++] = _("あなたは念動力をもっている。", "You are telekinetic.");
540                 }
541                 if (p_ptr->muta1 & MUT1_VTELEPORT)
542                 {
543                         info[i++] = _("あなたは自分の意思でテレポートできる。", "You can teleport at will.");
544                 }
545                 if (p_ptr->muta1 & MUT1_MIND_BLST)
546                 {
547                         info[i++] = _("あなたは精神攻撃を行える。(ダメージ 3~12d3)", "You can Mind Blast your enemies (3 to 12d3 dam).");
548                 }
549                 if (p_ptr->muta1 & MUT1_RADIATION)
550                 {
551                         info[i++] = _("あなたは自分の意思で強い放射線を発生することができる。(ダメージ レベルX2)", "You can emit hard radiation at will (dam lvl * 2).");
552                 }
553                 if (p_ptr->muta1 & MUT1_VAMPIRISM)
554                 {
555                         info[i++] = _("あなたは吸血鬼のように敵から生命力を吸収することができる。(ダメージ レベルX2)", 
556                                                 "You can drain life from a foe like a vampire (dam lvl * 2).");
557                 }
558                 if (p_ptr->muta1 & MUT1_SMELL_MET)
559                 {
560                         info[i++] = _("あなたは近くにある貴金属をかぎ分けることができる。", "You can smell nearby precious metal.");
561                 }
562                 if (p_ptr->muta1 & MUT1_SMELL_MON)
563                 {
564                         info[i++] = _("あなたは近くのモンスターの存在をかぎ分けることができる。", "You can smell nearby monsters.");
565                 }
566                 if (p_ptr->muta1 & MUT1_BLINK)
567                 {
568                         info[i++] = _("あなたは短い距離をテレポートできる。", "You can teleport yourself short distances.");
569                 }
570                 if (p_ptr->muta1 & MUT1_EAT_ROCK)
571                 {
572                         info[i++] = _("あなたは硬い岩を食べることができる。", "You can consume solid rock.");
573                 }
574                 if (p_ptr->muta1 & MUT1_SWAP_POS)
575                 {
576                         info[i++] = _("あなたは他の者と場所を入れ替わることができる。", "You can switch locations with another being.");
577                 }
578                 if (p_ptr->muta1 & MUT1_SHRIEK)
579                 {
580                         info[i++] = _("あなたは身の毛もよだつ叫び声を発することができる。(ダメージ レベルX2)", "You can emit a horrible shriek (dam 2 * lvl).");
581                 }
582                 if (p_ptr->muta1 & MUT1_ILLUMINE)
583                 {
584                         info[i++] = _("あなたは明るい光を放つことができる。", "You can emit bright light.");
585                 }
586                 if (p_ptr->muta1 & MUT1_DET_CURSE)
587                 {
588                         info[i++] = _("あなたは邪悪な魔法の危険を感じとることができる。", "You can feel the danger of evil magic.");
589                 }
590                 if (p_ptr->muta1 & MUT1_BERSERK)
591                 {
592                         info[i++] = _("あなたは自分の意思で狂乱戦闘状態になることができる。", "You can drive yourself into a berserk frenzy.");
593                 }
594                 if (p_ptr->muta1 & MUT1_POLYMORPH)
595                 {
596                         info[i++] = _("あなたは自分の意志で変化できる。", "You can polymorph yourself at will.");
597                 }
598                 if (p_ptr->muta1 & MUT1_MIDAS_TCH)
599                 {
600                         info[i++] = _("あなたは通常アイテムを金に変えることができる。", "You can turn ordinary items to gold.");
601                 }
602                 if (p_ptr->muta1 & MUT1_GROW_MOLD)
603                 {
604                         info[i++] = _("あなたは周囲にキノコを生やすことができる。", "You can cause mold to grow near you.");
605                 }
606                 if (p_ptr->muta1 & MUT1_RESIST)
607                 {
608                         info[i++] = _("あなたは元素の攻撃に対して身を硬くすることができる。", "You can harden yourself to the ravages of the elements.");
609                 }
610                 if (p_ptr->muta1 & MUT1_EARTHQUAKE)
611                 {
612                         info[i++] = _("あなたは周囲のダンジョンを崩壊させることができる。", "You can bring down the dungeon around your ears.");
613                 }
614                 if (p_ptr->muta1 & MUT1_EAT_MAGIC)
615                 {
616                         info[i++] = _("あなたは魔法のエネルギーを自分の物として使用できる。", "You can consume magic energy for your own use.");
617                 }
618                 if (p_ptr->muta1 & MUT1_WEIGH_MAG)
619                 {
620                         info[i++] = _("あなたは自分に影響を与える魔法の力を感じることができる。", "You can feel the strength of the magics affecting you.");
621                 }
622                 if (p_ptr->muta1 & MUT1_STERILITY)
623                 {
624                         info[i++] = _("あなたは集団的生殖不能を起こすことができる。", "You can cause mass impotence.");
625                 }
626                 if (p_ptr->muta1 & MUT1_PANIC_HIT)
627                 {
628                         info[i++] = _("あなたは攻撃した後身を守るため逃げることができる。", "You can run for your life after hitting something.");
629                 }
630                 if (p_ptr->muta1 & MUT1_DAZZLE)
631                 {
632                         info[i++] = _("あなたは混乱と盲目を引き起こす放射能を発生することができる。 ", "You can emit confusing, blinding radiation.");
633                 }
634                 if (p_ptr->muta1 & MUT1_LASER_EYE)
635                 {
636                         info[i++] = _("あなたは目からレーザー光線を発することができる。(ダメージ レベルX2)", "Your eyes can fire laser beams (dam 2 * lvl).");
637                 }
638                 if (p_ptr->muta1 & MUT1_RECALL)
639                 {
640                         info[i++] = _("あなたは街とダンジョンの間を行き来することができる。", "You can travel between town and the depths.");
641                 }
642                 if (p_ptr->muta1 & MUT1_BANISH)
643                 {
644                         info[i++] = _("あなたは邪悪なモンスターを地獄に落とすことができる。", "You can send evil creatures directly to Hell.");
645                 }
646                 if (p_ptr->muta1 & MUT1_COLD_TOUCH)
647                 {
648                         info[i++] = _("あなたは敵を触って凍らせることができる。(ダメージ レベルX3)", "You can freeze things with a touch (dam 3 * lvl).");
649                 }
650                 if (p_ptr->muta1 & MUT1_LAUNCHER)
651                 {
652                         info[i++] = _("あなたはアイテムを力強く投げることができる。", "You can hurl objects with great force.");
653                 }
654         }
655
656         if (p_ptr->muta2)
657         {
658                 if (p_ptr->muta2 & MUT2_BERS_RAGE)
659                 {
660                         info[i++] = _("あなたは狂戦士化の発作を起こす。", "You are subject to berserker fits.");
661                 }
662                 if (p_ptr->muta2 & MUT2_COWARDICE)
663                 {
664                         info[i++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
665                 }
666                 if (p_ptr->muta2 & MUT2_RTELEPORT)
667                 {
668                         info[i++] = _("あなたはランダムにテレポートする。", "You are teleporting randomly.");
669                 }
670                 if (p_ptr->muta2 & MUT2_ALCOHOL)
671                 {
672                         info[i++] = _("あなたの体はアルコールを分泌する。", "Your body produces alcohol.");
673                 }
674                 if (p_ptr->muta2 & MUT2_HALLU)
675                 {
676                         info[i++] = _("あなたは幻覚を引き起こす精神錯乱に侵されている。", "You have a hallucinatory insanity.");
677                 }
678                 if (p_ptr->muta2 & MUT2_FLATULENT)
679                 {
680                         info[i++] = _("あなたは制御できない強烈な屁をこく。", "You are subject to uncontrollable flatulence.");
681                 }
682                 if (p_ptr->muta2 & MUT2_PROD_MANA)
683                 {
684                         info[i++] = _("あなたは制御不能な魔法のエネルギーを発している。", "You are producing magical energy uncontrollably.");
685                 }
686                 if (p_ptr->muta2 & MUT2_ATT_DEMON)
687                 {
688                         info[i++] = _("あなたはデーモンを引きつける。", "You attract demons.");
689                 }
690                 if (p_ptr->muta2 & MUT2_SCOR_TAIL)
691                 {
692                         info[i++] = _("あなたはサソリの尻尾が生えている。(毒、ダメージ 3d7)", "You have a scorpion tail (poison, 3d7).");
693                 }
694                 if (p_ptr->muta2 & MUT2_HORNS)
695                 {
696                         info[i++] = _("あなたは角が生えている。(ダメージ 2d6)", "You have horns (dam. 2d6).");
697                 }
698                 if (p_ptr->muta2 & MUT2_BEAK)
699                 {
700                         info[i++] = _("あなたはクチバシが生えている。(ダメージ 2d4)", "You have a beak (dam. 2d4).");
701                 }
702                 if (p_ptr->muta2 & MUT2_SPEED_FLUX)
703                 {
704                         info[i++] = _("あなたはランダムに早く動いたり遅く動いたりする。", "You move faster or slower randomly.");
705                 }
706                 if (p_ptr->muta2 & MUT2_BANISH_ALL)
707                 {
708                         info[i++] = _("あなたは時々近くのモンスターを消滅させる。", "You sometimes cause nearby creatures to vanish.");
709                 }
710                 if (p_ptr->muta2 & MUT2_EAT_LIGHT)
711                 {
712                         info[i++] = _("あなたは時々周囲の光を吸収して栄養にする。", "You sometimes feed off of the light around you.");
713                 }
714                 if (p_ptr->muta2 & MUT2_TRUNK)
715                 {
716                         info[i++] = _("あなたは象のような鼻を持っている。(ダメージ 1d4)", "You have an elephantine trunk (dam 1d4).");
717                 }
718                 if (p_ptr->muta2 & MUT2_ATT_ANIMAL)
719                 {
720                         info[i++] = _("あなたは動物を引きつける。", "You attract animals.");
721                 }
722                 if (p_ptr->muta2 & MUT2_TENTACLES)
723                 {
724                         info[i++] = _("あなたは邪悪な触手を持っている。(ダメージ 2d5)", "You have evil looking tentacles (dam 2d5).");
725                 }
726                 if (p_ptr->muta2 & MUT2_RAW_CHAOS)
727                 {
728                         info[i++] = _("あなたはしばしば純カオスに包まれる。", "You occasionally are surrounded with raw chaos.");
729                 }
730                 if (p_ptr->muta2 & MUT2_NORMALITY)
731                 {
732                         info[i++] = _("あなたは変異していたが、回復してきている。", "You may be mutated, but you're recovering.");
733                 }
734                 if (p_ptr->muta2 & MUT2_WRAITH)
735                 {
736                         info[i++] = _("あなたの肉体は幽体化したり実体化したりする。", "You fade in and out of physical reality.");
737                 }
738                 if (p_ptr->muta2 & MUT2_POLY_WOUND)
739                 {
740                         info[i++] = _("あなたの健康はカオスの力に影響を受ける。", "Your health is subject to chaotic forces.");
741                 }
742                 if (p_ptr->muta2 & MUT2_WASTING)
743                 {
744                         info[i++] = _("あなたは衰弱する恐ろしい病気にかかっている。", "You have a horrible wasting disease.");
745                 }
746                 if (p_ptr->muta2 & MUT2_ATT_DRAGON)
747                 {
748                         info[i++] = _("あなたはドラゴンを引きつける。", "You attract dragons.");
749                 }
750                 if (p_ptr->muta2 & MUT2_WEIRD_MIND)
751                 {
752                         info[i++] = _("あなたの精神はランダムに拡大したり縮小したりしている。", "Your mind randomly expands and contracts.");
753                 }
754                 if (p_ptr->muta2 & MUT2_NAUSEA)
755                 {
756                         info[i++] = _("あなたの胃は非常に落ち着きがない。", "You have a seriously upset stomach.");
757                 }
758                 if (p_ptr->muta2 & MUT2_CHAOS_GIFT)
759                 {
760                         info[i++] = _("あなたはカオスの守護悪魔から褒美をうけとる。", "Chaos deities give you gifts.");
761                 }
762                 if (p_ptr->muta2 & MUT2_WALK_SHAD)
763                 {
764                         info[i++] = _("あなたはしばしば他の「影」に迷い込む。", "You occasionally stumble into other shadows.");
765                 }
766                 if (p_ptr->muta2 & MUT2_WARNING)
767                 {
768                         info[i++] = _("あなたは敵に関する警告を感じる。", "You receive warnings about your foes.");
769                 }
770                 if (p_ptr->muta2 & MUT2_INVULN)
771                 {
772                         info[i++] = _("あなたは時々負け知らずな気分になる。", "You occasionally feel invincible.");
773                 }
774                 if (p_ptr->muta2 & MUT2_SP_TO_HP)
775                 {
776                         info[i++] = _("あなたは時々血が筋肉にどっと流れる。", "Your blood sometimes rushes to your muscles.");
777                 }
778                 if (p_ptr->muta2 & MUT2_HP_TO_SP)
779                 {
780                         info[i++] = _("あなたは時々頭に血がどっと流れる。", "Your blood sometimes rushes to your head.");
781                 }
782                 if (p_ptr->muta2 & MUT2_DISARM)
783                 {
784                         info[i++] = _("あなたはよくつまづいて物を落とす。", "You occasionally stumble and drop things.");
785                 }
786         }
787
788         if (p_ptr->muta3)
789         {
790                 if (p_ptr->muta3 & MUT3_HYPER_STR)
791                 {
792                         info[i++] = _("あなたは超人的に強い。(腕力+4)", "You are superhumanly strong (+4 STR).");
793                 }
794                 if (p_ptr->muta3 & MUT3_PUNY)
795                 {
796                         info[i++] = _("あなたは虚弱だ。(腕力-4)", "You are puny (-4 STR).");
797                 }
798                 if (p_ptr->muta3 & MUT3_HYPER_INT)
799                 {
800                         info[i++] = _("あなたの脳は生体コンピュータだ。(知能&賢さ+4)", "Your brain is a living computer (+4 INT/WIS).");
801                 }
802                 if (p_ptr->muta3 & MUT3_MORONIC)
803                 {
804                         info[i++] = _("あなたは精神薄弱だ。(知能&賢さ-4)", "You are moronic (-4 INT/WIS).");
805                 }
806                 if (p_ptr->muta3 & MUT3_RESILIENT)
807                 {
808                         info[i++] = _("あなたは非常にタフだ。(耐久+4)", "You are very resilient (+4 CON).");
809                 }
810                 if (p_ptr->muta3 & MUT3_XTRA_FAT)
811                 {
812                         info[i++] = _("あなたは極端に太っている。(耐久+2,スピード-2)", "You are extremely fat (+2 CON, -2 speed).");
813                 }
814                 if (p_ptr->muta3 & MUT3_ALBINO)
815                 {
816                         info[i++] = _("あなたはアルビノだ。(耐久-4)", "You are albino (-4 CON).");
817                 }
818                 if (p_ptr->muta3 & MUT3_FLESH_ROT)
819                 {
820                         info[i++] = _("あなたの肉体は腐敗している。(耐久-2,魅力-1)", "Your flesh is rotting (-2 CON, -1 CHR).");
821                 }
822                 if (p_ptr->muta3 & MUT3_SILLY_VOI)
823                 {
824                         info[i++] = _("あなたの声は間抜けなキーキー声だ。(魅力-4)", "Your voice is a silly squeak (-4 CHR).");
825                 }
826                 if (p_ptr->muta3 & MUT3_BLANK_FAC)
827                 {
828                         info[i++] = _("あなたはのっぺらぼうだ。(魅力-1)", "Your face is featureless (-1 CHR).");
829                 }
830                 if (p_ptr->muta3 & MUT3_ILL_NORM)
831                 {
832                         info[i++] = _("あなたは幻影に覆われている。", "Your appearance is masked with illusion.");
833                 }
834                 if (p_ptr->muta3 & MUT3_XTRA_EYES)
835                 {
836                         info[i++] = _("あなたは余分に二つの目を持っている。(探索+15)", "You have an extra pair of eyes (+15 search).");
837                 }
838                 if (p_ptr->muta3 & MUT3_MAGIC_RES)
839                 {
840                         info[i++] = _("あなたは魔法への耐性をもっている。", "You are resistant to magic.");
841                 }
842                 if (p_ptr->muta3 & MUT3_XTRA_NOIS)
843                 {
844                         info[i++] = _("あなたは変な音を発している。(隠密-3)", "You make a lot of strange noise (-3 stealth).");
845                 }
846                 if (p_ptr->muta3 & MUT3_INFRAVIS)
847                 {
848                         info[i++] = _("あなたは素晴らしい赤外線視力を持っている。(+3)", "You have remarkable infravision (+3).");
849                 }
850                 if (p_ptr->muta3 & MUT3_XTRA_LEGS)
851                 {
852                         info[i++] = _("あなたは余分に二本の足が生えている。(加速+3)", "You have an extra pair of legs (+3 speed).");
853                 }
854                 if (p_ptr->muta3 & MUT3_SHORT_LEG)
855                 {
856                         info[i++] = _("あなたの足は短い突起だ。(加速-3)", "Your legs are short stubs (-3 speed).");
857                 }
858                 if (p_ptr->muta3 & MUT3_ELEC_TOUC)
859                 {
860                         info[i++] = _("あなたの血管には電流が流れている。", "Electricity is running through your veins.");
861                 }
862                 if (p_ptr->muta3 & MUT3_FIRE_BODY)
863                 {
864                         info[i++] = _("あなたの体は炎につつまれている。", "Your body is enveloped in flames.");
865                 }
866                 if (p_ptr->muta3 & MUT3_WART_SKIN)
867                 {
868                         info[i++] = _("あなたの肌はイボに被われている。(魅力-2, AC+5)", "Your skin is covered with warts (-2 CHR, +5 AC).");
869                 }
870                 if (p_ptr->muta3 & MUT3_SCALES)
871                 {
872                         info[i++] = _("あなたの肌は鱗になっている。(魅力-1, AC+10)", "Your skin has turned into scales (-1 CHR, +10 AC).");
873                 }
874                 if (p_ptr->muta3 & MUT3_IRON_SKIN)
875                 {
876                         info[i++] = _("あなたの肌は鉄でできている。(器用-1, AC+25)", "Your skin is made of steel (-1 DEX, +25 AC).");
877                 }
878                 if (p_ptr->muta3 & MUT3_WINGS)
879                 {
880                         info[i++] = _("あなたは羽を持っている。", "You have wings.");
881                 }
882                 if (p_ptr->muta3 & MUT3_FEARLESS)
883                 {
884                         /* Unnecessary */
885                 }
886                 if (p_ptr->muta3 & MUT3_REGEN)
887                 {
888                         /* Unnecessary */
889                 }
890                 if (p_ptr->muta3 & MUT3_ESP)
891                 {
892                         /* Unnecessary */
893                 }
894                 if (p_ptr->muta3 & MUT3_LIMBER)
895                 {
896                         info[i++] = _("あなたの体は非常にしなやかだ。(器用+3)", "Your body is very limber (+3 DEX).");
897                 }
898                 if (p_ptr->muta3 & MUT3_ARTHRITIS)
899                 {
900                         info[i++] = _("あなたはいつも関節に痛みを感じている。(器用-3)", "Your joints ache constantly (-3 DEX).");
901                 }
902                 if (p_ptr->muta3 & MUT3_VULN_ELEM)
903                 {
904                         info[i++] = _("あなたは元素の攻撃に弱い。", "You are susceptible to damage from the elements.");
905                 }
906                 if (p_ptr->muta3 & MUT3_MOTION)
907                 {
908                         info[i++] = _("あなたの動作は正確で力強い。(隠密+1)", "Your movements are precise and forceful (+1 STL).");
909                 }
910                 if (p_ptr->muta3 & MUT3_GOOD_LUCK)
911                 {
912                         info[i++] = _("あなたは白いオーラにつつまれている。", "There is a white aura surrounding you.");
913                 }
914                 if (p_ptr->muta3 & MUT3_BAD_LUCK)
915                 {
916                         info[i++] = _("あなたは黒いオーラにつつまれている。", "There is a black aura surrounding you.");
917                 }
918         }
919
920         if (p_ptr->blind)
921         {
922                 info[i++] = _("あなたは目が見えない。", "You cannot see.");
923         }
924         if (p_ptr->confused)
925         {
926                 info[i++] = _("あなたは混乱している。", "You are confused.");
927         }
928         if (p_ptr->afraid)
929         {
930                 info[i++] = _("あなたは恐怖に侵されている。", "You are terrified.");
931         }
932         if (p_ptr->cut)
933         {
934                 info[i++] = _("あなたは出血している。", "You are bleeding.");
935         }
936         if (p_ptr->stun)
937         {
938                 info[i++] = _("あなたはもうろうとしている。", "You are stunned.");
939         }
940         if (p_ptr->poisoned)
941         {
942                 info[i++] = _("あなたは毒に侵されている。", "You are poisoned.");
943         }
944         if (p_ptr->image)
945         {
946                 info[i++] = _("あなたは幻覚を見ている。", "You are hallucinating.");
947         }
948         if (p_ptr->cursed & TRC_TY_CURSE)
949         {
950                 info[i++] = _("あなたは邪悪な怨念に包まれている。", "You carry an ancient foul curse.");
951         }
952         if (p_ptr->cursed & TRC_AGGRAVATE)
953         {
954                 info[i++] = _("あなたはモンスターを怒らせている。", "You aggravate monsters.");
955         }
956         if (p_ptr->cursed & TRC_DRAIN_EXP)
957         {
958                 info[i++] = _("あなたは経験値を吸われている。", "You are drained.");
959         }
960         if (p_ptr->cursed & TRC_SLOW_REGEN)
961         {
962                 info[i++] = _("あなたの回復力は非常に遅い。", "You regenerate slowly.");
963         }
964         if (p_ptr->cursed & TRC_ADD_L_CURSE)
965         {
966                 info[i++] = _("あなたの弱い呪いは増える。","Your weak curses multiply."); /* 暫定的 -- henkma */
967         }
968         if (p_ptr->cursed & TRC_ADD_H_CURSE)
969         {
970                 info[i++] = _("あなたの強い呪いは増える。","Your heavy curses multiply."); /* 暫定的 -- henkma */
971         }
972         if (p_ptr->cursed & TRC_CALL_ANIMAL)
973         {
974                 info[i++] = _("あなたは動物に狙われている。", "You attract animals.");
975         }
976         if (p_ptr->cursed & TRC_CALL_DEMON)
977         {
978                 info[i++] = _("あなたは悪魔に狙われている。", "You attract demons.");
979         }
980         if (p_ptr->cursed & TRC_CALL_DRAGON)
981         {
982                 info[i++] = _("あなたはドラゴンに狙われている。", "You attract dragons.");
983         }
984         if (p_ptr->cursed & TRC_COWARDICE)
985         {
986                 info[i++] = _("あなたは時々臆病になる。", "You are subject to cowardice.");
987         }
988         if (p_ptr->cursed & TRC_TELEPORT)
989         {
990                 info[i++] = _("あなたの位置はひじょうに不安定だ。", "Your position is very uncertain.");
991         }
992         if (p_ptr->cursed & TRC_LOW_MELEE)
993         {
994                 info[i++] = _("あなたの武器は攻撃を外しやすい。", "Your weapon causes you to miss blows.");
995         }
996         if (p_ptr->cursed & TRC_LOW_AC)
997         {
998                 info[i++] = _("あなたは攻撃を受けやすい。", "You are subject to be hit.");
999         }
1000         if (p_ptr->cursed & TRC_LOW_MAGIC)
1001         {
1002                 info[i++] = _("あなたは魔法を失敗しやすい。", "You are subject to fail spellcasting.");
1003         }
1004         if (p_ptr->cursed & TRC_FAST_DIGEST)
1005         {
1006                 info[i++] = _("あなたはすぐお腹がへる。", "You have a good appetite.");
1007         }
1008         if (p_ptr->cursed & TRC_DRAIN_HP)
1009         {
1010                 info[i++] = _("あなたは体力を吸われている。", "You are drained.");
1011         }
1012         if (p_ptr->cursed & TRC_DRAIN_MANA)
1013         {
1014                 info[i++] = _("あなたは魔力を吸われている。", "You brain is drained.");
1015         }
1016         if (IS_BLESSED())
1017         {
1018                 info[i++] = _("あなたは高潔さを感じている。", "You feel rightous.");
1019         }
1020         if (IS_HERO())
1021         {
1022                 info[i++] = _("あなたはヒーロー気分だ。", "You feel heroic.");
1023         }
1024         if (p_ptr->shero)
1025         {
1026                 info[i++] = _("あなたは戦闘狂だ。", "You are in a battle rage.");
1027         }
1028         if (p_ptr->protevil)
1029         {
1030                 info[i++] = _("あなたは邪悪なる存在から守られている。", "You are protected from evil.");
1031         }
1032         if (p_ptr->shield)
1033         {
1034                 info[i++] = _("あなたは神秘のシールドで守られている。", "You are protected by a mystic shield.");
1035         }
1036         if (IS_INVULN())
1037         {
1038                 info[i++] = _("あなたは現在傷つかない。", "You are temporarily invulnerable.");
1039         }
1040         if (p_ptr->wraith_form)
1041         {
1042                 info[i++] = _("あなたは一時的に幽体化している。", "You are temporarily incorporeal.");
1043         }
1044         if (p_ptr->special_attack & ATTACK_CONFUSE)
1045         {
1046                 info[i++] = _("あなたの手は赤く輝いている。", "Your hands are glowing dull red.");
1047         }
1048         if (p_ptr->special_attack & ATTACK_FIRE)
1049         {
1050                 info[i++] = _("あなたの手は火炎に覆われている。", "You can strike the enemy with flame.");
1051         }
1052         if (p_ptr->special_attack & ATTACK_COLD)
1053         {
1054                 info[i++] = _("あなたの手は冷気に覆われている。", "You can strike the enemy with cold.");
1055         }
1056         if (p_ptr->special_attack & ATTACK_ACID)
1057         {
1058                 info[i++] = _("あなたの手は酸に覆われている。", "You can strike the enemy with acid.");
1059         }
1060         if (p_ptr->special_attack & ATTACK_ELEC)
1061         {
1062                 info[i++] = _("あなたの手は電撃に覆われている。", "You can strike the enemy with electoric shock.");
1063         }
1064         if (p_ptr->special_attack & ATTACK_POIS)
1065         {
1066                 info[i++] = _("あなたの手は毒に覆われている。", "You can strike the enemy with poison.");
1067         }
1068         switch (p_ptr->action)
1069         {
1070                 case ACTION_SEARCH:
1071                         info[i++] = _("あなたはひじょうに注意深く周囲を見渡している。", "You are looking around very carefully.");
1072                         break;
1073         }
1074         if (p_ptr->new_spells)
1075         {
1076                 info[i++] = _("あなたは呪文や祈りを学ぶことができる。", "You can learn some spells/prayers.");
1077         }
1078         if (p_ptr->word_recall)
1079         {
1080                 info[i++] = _("あなたはすぐに帰還するだろう。", "You will soon be recalled.");
1081         }
1082         if (p_ptr->alter_reality)
1083         {
1084                 info[i++] = _("あなたはすぐにこの世界を離れるだろう。", "You will soon be altered.");
1085         }
1086         if (p_ptr->see_infra)
1087         {
1088                 info[i++] = _("あなたの瞳は赤外線に敏感である。", "Your eyes are sensitive to infrared light.");
1089         }
1090         if (p_ptr->see_inv)
1091         {
1092                 info[i++] = _("あなたは透明なモンスターを見ることができる。", "You can see invisible creatures.");
1093         }
1094         if (p_ptr->levitation)
1095         {
1096                 info[i++] = _("あなたは飛ぶことができる。", "You can fly.");
1097         }
1098         if (p_ptr->free_act)
1099         {
1100                 info[i++] = _("あなたは麻痺知らずの効果を持っている。", "You have free action.");
1101         }
1102         if (p_ptr->regenerate)
1103         {
1104                 info[i++] = _("あなたは素早く体力を回復する。", "You regenerate quickly.");
1105         }
1106         if (p_ptr->slow_digest)
1107         {
1108                 info[i++] = _("あなたは食欲が少ない。", "Your appetite is small.");
1109         }
1110         if (p_ptr->telepathy)
1111         {
1112                 info[i++] = _("あなたはテレパシー能力を持っている。", "You have ESP.");
1113         }
1114         if (p_ptr->esp_animal)
1115         {
1116                 info[i++] = _("あなたは自然界の生物の存在を感じる能力を持っている。", "You sense natural creatures.");
1117         }
1118         if (p_ptr->esp_undead)
1119         {
1120                 info[i++] = _("あなたはアンデッドの存在を感じる能力を持っている。", "You sense undead.");
1121         }
1122         if (p_ptr->esp_demon)
1123         {
1124                 info[i++] = _("あなたは悪魔の存在を感じる能力を持っている。", "You sense demons.");
1125         }
1126         if (p_ptr->esp_orc)
1127         {
1128                 info[i++] = _("あなたはオークの存在を感じる能力を持っている。", "You sense orcs.");
1129         }
1130         if (p_ptr->esp_troll)
1131         {
1132                 info[i++] = _("あなたはトロルの存在を感じる能力を持っている。", "You sense trolls.");
1133         }
1134         if (p_ptr->esp_giant)
1135         {
1136                 info[i++] = _("あなたは巨人の存在を感じる能力を持っている。", "You sense giants.");
1137         }
1138         if (p_ptr->esp_dragon)
1139         {
1140                 info[i++] = _("あなたはドラゴンの存在を感じる能力を持っている。", "You sense dragons.");
1141         }
1142         if (p_ptr->esp_human)
1143         {
1144                 info[i++] = _("あなたは人間の存在を感じる能力を持っている。", "You sense humans.");
1145         }
1146         if (p_ptr->esp_evil)
1147         {
1148                 info[i++] = _("あなたは邪悪な生き物の存在を感じる能力を持っている。", "You sense evil creatures.");
1149         }
1150         if (p_ptr->esp_good)
1151         {
1152                 info[i++] = _("あなたは善良な生き物の存在を感じる能力を持っている。", "You sense good creatures.");
1153         }
1154         if (p_ptr->esp_nonliving)
1155         {
1156                 info[i++] = _("あなたは活動する無生物体の存在を感じる能力を持っている。", "You sense non-living creatures.");
1157         }
1158         if (p_ptr->esp_unique)
1159         {
1160                 info[i++] = _("あなたは特別な強敵の存在を感じる能力を持っている。", "You sense unique monsters.");
1161         }
1162         if (p_ptr->hold_exp)
1163         {
1164                 info[i++] = _("あなたは自己の経験値をしっかりと維持する。", "You have a firm hold on your experience.");
1165         }
1166         if (p_ptr->reflect)
1167         {
1168                 info[i++] = _("あなたは矢の呪文を反射する。", "You reflect bolt spells.");
1169         }
1170         if (p_ptr->sh_fire)
1171         {
1172                 info[i++] = _("あなたは炎のオーラに包まれている。", "You are surrounded with a fiery aura.");
1173         }
1174         if (p_ptr->sh_elec)
1175         {
1176                 info[i++] = _("あなたは電気に包まれている。", "You are surrounded with electricity.");
1177         }
1178         if (p_ptr->sh_cold)
1179         {
1180                 info[i++] = _("あなたは冷気のオーラに包まれている。", "You are surrounded with an aura of coldness.");
1181         }
1182         if (p_ptr->tim_sh_holy)
1183         {
1184                 info[i++] = _("あなたは聖なるオーラに包まれている。", "You are surrounded with a holy aura.");
1185         }
1186         if (p_ptr->tim_sh_touki)
1187         {
1188                 info[i++] = _("あなたは闘気のオーラに包まれている。", "You are surrounded with a energy aura.");
1189         }
1190         if (p_ptr->anti_magic)
1191         {
1192                 info[i++] = _("あなたは反魔法シールドに包まれている。", "You are surrounded by an anti-magic shell.");
1193         }
1194         if (p_ptr->anti_tele)
1195         {
1196                 info[i++] = _("あなたはテレポートできない。", "You cannot teleport.");
1197         }
1198         if (p_ptr->lite)
1199         {
1200                 info[i++] = _("あなたの身体は光っている。", "You are carrying a permanent light.");
1201         }
1202         if (p_ptr->warning)
1203         {
1204                 info[i++] = _("あなたは行動の前に危険を察知することができる。", "You will be warned before dangerous actions.");
1205         }
1206         if (p_ptr->dec_mana)
1207         {
1208                 info[i++] = _("あなたは少ない消費魔力で魔法を唱えることができる。", "You can cast spells with fewer mana points.");
1209         }
1210         if (p_ptr->easy_spell)
1211         {
1212                 info[i++] = _("あなたは低い失敗率で魔法を唱えることができる。", "Fail rate of your magic is decreased.");
1213         }
1214         if (p_ptr->heavy_spell)
1215         {
1216                 info[i++] = _("あなたは高い失敗率で魔法を唱えなければいけない。", "Fail rate of your magic is increased.");
1217         }
1218         if (p_ptr->mighty_throw)
1219         {
1220                 info[i++] = _("あなたは強く物を投げる。", "You can throw objects powerfully.");
1221         }
1222
1223         if (p_ptr->immune_acid)
1224         {
1225                 info[i++] = _("あなたは酸に対する完全なる免疫を持っている。", "You are completely immune to acid.");
1226         }
1227         else if (p_ptr->resist_acid && IS_OPPOSE_ACID())
1228         {
1229                 info[i++] = _("あなたは酸への強力な耐性を持っている。", "You resist acid exceptionally well.");
1230         }
1231         else if (p_ptr->resist_acid || IS_OPPOSE_ACID())
1232         {
1233                 info[i++] = _("あなたは酸への耐性を持っている。", "You are resistant to acid.");
1234         }
1235
1236         if (p_ptr->immune_elec)
1237         {
1238                 info[i++] = _("あなたは電撃に対する完全なる免疫を持っている。", "You are completely immune to lightning.");
1239         }
1240         else if (p_ptr->resist_elec && IS_OPPOSE_ELEC())
1241         {
1242                 info[i++] = _("あなたは電撃への強力な耐性を持っている。", "You resist lightning exceptionally well.");
1243         }
1244         else if (p_ptr->resist_elec || IS_OPPOSE_ELEC())
1245         {
1246                 info[i++] = _("あなたは電撃への耐性を持っている。", "You are resistant to lightning.");
1247         }
1248
1249         if (prace_is_(RACE_ANDROID) && !p_ptr->immune_elec)
1250         {
1251                 info[i++] = _("あなたは電撃に弱い。", "You are susceptible to damage from lightning.");
1252         }
1253
1254         if (p_ptr->immune_fire)
1255         {
1256                 info[i++] = _("あなたは火に対する完全なる免疫を持っている。", "You are completely immune to fire.");
1257         }
1258         else if (p_ptr->resist_fire && IS_OPPOSE_FIRE())
1259         {
1260                 info[i++] = _("あなたは火への強力な耐性を持っている。", "You resist fire exceptionally well.");
1261         }
1262         else if (p_ptr->resist_fire || IS_OPPOSE_FIRE())
1263         {
1264                 info[i++] = _("あなたは火への耐性を持っている。", "You are resistant to fire.");
1265         }
1266
1267         if (prace_is_(RACE_ENT) && !p_ptr->immune_fire)
1268         {
1269                 info[i++] = _("あなたは火に弱い。", "You are susceptible to damage from fire.");
1270         }
1271
1272         if (p_ptr->immune_cold)
1273         {
1274                 info[i++] = _("あなたは冷気に対する完全なる免疫を持っている。", "You are completely immune to cold.");
1275         }
1276         else if (p_ptr->resist_cold && IS_OPPOSE_COLD())
1277         {
1278                 info[i++] = _("あなたは冷気への強力な耐性を持っている。", "You resist cold exceptionally well.");
1279         }
1280         else if (p_ptr->resist_cold || IS_OPPOSE_COLD())
1281         {
1282                 info[i++] = _("あなたは冷気への耐性を持っている。", "You are resistant to cold.");
1283         }
1284
1285         if (p_ptr->resist_pois && IS_OPPOSE_POIS())
1286         {
1287                 info[i++] = _("あなたは毒への強力な耐性を持っている。", "You resist poison exceptionally well.");
1288         }
1289         else if (p_ptr->resist_pois || IS_OPPOSE_POIS())
1290         {
1291                 info[i++] = _("あなたは毒への耐性を持っている。", "You are resistant to poison.");
1292         }
1293
1294         if (p_ptr->resist_lite)
1295         {
1296                 info[i++] = _("あなたは閃光への耐性を持っている。", "You are resistant to bright light.");
1297         }
1298
1299         if (prace_is_(RACE_VAMPIRE) || prace_is_(RACE_S_FAIRY) || (p_ptr->mimic_form == MIMIC_VAMPIRE))
1300         {
1301                 info[i++] = _("あなたは閃光に弱い。", "You are susceptible to damage from bright light.");
1302         }
1303
1304         if (prace_is_(RACE_VAMPIRE) || (p_ptr->mimic_form == MIMIC_VAMPIRE) || p_ptr->wraith_form)
1305         {
1306                 info[i++] = _("あなたは暗黒に対する完全なる免疫を持っている。", "You are completely immune to darkness.");
1307         }
1308
1309         else if (p_ptr->resist_dark)
1310         {
1311                 info[i++] = _("あなたは暗黒への耐性を持っている。", "You are resistant to darkness.");
1312         }
1313         if (p_ptr->resist_conf)
1314         {
1315                 info[i++] = _("あなたは混乱への耐性を持っている。", "You are resistant to confusion.");
1316         }
1317         if (p_ptr->resist_sound)
1318         {
1319                 info[i++] = _("あなたは音波の衝撃への耐性を持っている。", "You are resistant to sonic attacks.");
1320         }
1321         if (p_ptr->resist_disen)
1322         {
1323                 info[i++] = _("あなたは劣化への耐性を持っている。", "You are resistant to disenchantment.");
1324         }
1325         if (p_ptr->resist_chaos)
1326         {
1327                 info[i++] = _("あなたはカオスの力への耐性を持っている。", "You are resistant to chaos.");
1328         }
1329         if (p_ptr->resist_shard)
1330         {
1331                 info[i++] = _("あなたは破片の攻撃への耐性を持っている。", "You are resistant to blasts of shards.");
1332         }
1333         if (p_ptr->resist_nexus)
1334         {
1335                 info[i++] = _("あなたは因果混乱の攻撃への耐性を持っている。", "You are resistant to nexus attacks.");
1336         }
1337
1338         if (prace_is_(RACE_SPECTRE))
1339         {
1340                 info[i++] = _("あなたは地獄の力を吸収できる。", "You can drain nether forces.");
1341         }
1342         else if (p_ptr->resist_neth)
1343         {
1344                 info[i++] = _("あなたは地獄の力への耐性を持っている。", "You are resistant to nether forces.");
1345         }
1346         if (p_ptr->resist_fear)
1347         {
1348                 info[i++] = _("あなたは全く恐怖を感じない。", "You are completely fearless.");
1349         }
1350         if (p_ptr->resist_blind)
1351         {
1352                 info[i++] = _("あなたの目は盲目への耐性を持っている。", "Your eyes are resistant to blindness.");
1353         }
1354         if (p_ptr->resist_time)
1355         {
1356                 info[i++] = _("あなたは時間逆転への耐性を持っている。", "You are resistant to time.");
1357         }
1358
1359         if (p_ptr->sustain_str)
1360         {
1361                 info[i++] = _("あなたの腕力は維持されている。", "Your strength is sustained.");
1362         }
1363         if (p_ptr->sustain_int)
1364         {
1365                 info[i++] = _("あなたの知能は維持されている。", "Your intelligence is sustained.");
1366         }
1367         if (p_ptr->sustain_wis)
1368         {
1369                 info[i++] = _("あなたの賢さは維持されている。", "Your wisdom is sustained.");
1370         }
1371         if (p_ptr->sustain_con)
1372         {
1373                 info[i++] = _("あなたの耐久力は維持されている。", "Your constitution is sustained.");
1374         }
1375         if (p_ptr->sustain_dex)
1376         {
1377                 info[i++] = _("あなたの器用さは維持されている。", "Your dexterity is sustained.");
1378         }
1379         if (p_ptr->sustain_chr)
1380         {
1381                 info[i++] = _("あなたの魅力は維持されている。", "Your charisma is sustained.");
1382         }
1383
1384         if (have_flag(flgs, TR_STR))
1385         {
1386                 info[i++] = _("あなたの腕力は装備によって影響を受けている。", "Your strength is affected by your equipment.");
1387         }
1388         if (have_flag(flgs, TR_INT))
1389         {
1390                 info[i++] = _("あなたの知能は装備によって影響を受けている。", "Your intelligence is affected by your equipment.");
1391         }
1392         if (have_flag(flgs, TR_WIS))
1393         {
1394                 info[i++] = _("あなたの賢さは装備によって影響を受けている。", "Your wisdom is affected by your equipment.");
1395         }
1396         if (have_flag(flgs, TR_DEX))
1397         {
1398                 info[i++] = _("あなたの器用さは装備によって影響を受けている。", "Your dexterity is affected by your equipment.");
1399         }
1400         if (have_flag(flgs, TR_CON))
1401         {
1402                 info[i++] = _("あなたの耐久力は装備によって影響を受けている。", "Your constitution is affected by your equipment.");
1403         }
1404         if (have_flag(flgs, TR_CHR))
1405         {
1406                 info[i++] = _("あなたの魅力は装備によって影響を受けている。", "Your charisma is affected by your equipment.");
1407         }
1408
1409         if (have_flag(flgs, TR_STEALTH))
1410         {
1411                 info[i++] = _("あなたの隠密行動能力は装備によって影響を受けている。", "Your stealth is affected by your equipment.");
1412         }
1413         if (have_flag(flgs, TR_SEARCH))
1414         {
1415                 info[i++] = _("あなたの探索能力は装備によって影響を受けている。", "Your searching ability is affected by your equipment.");
1416         }
1417         if (have_flag(flgs, TR_INFRA))
1418         {
1419                 info[i++] = _("あなたの赤外線視力は装備によって影響を受けている。", "Your infravision is affected by your equipment.");
1420         }
1421         if (have_flag(flgs, TR_TUNNEL))
1422         {
1423                 info[i++] = _("あなたの採掘能力は装備によって影響を受けている。", "Your digging ability is affected by your equipment.");
1424         }
1425         if (have_flag(flgs, TR_SPEED))
1426         {
1427                 info[i++] = _("あなたのスピードは装備によって影響を受けている。", "Your speed is affected by your equipment.");
1428         }
1429         if (have_flag(flgs, TR_BLOWS))
1430         {
1431                 info[i++] = _("あなたの攻撃速度は装備によって影響を受けている。", "Your attack speed is affected by your equipment.");
1432         }
1433
1434
1435         /* Access the current weapon */
1436         o_ptr = &inventory[INVEN_RARM];
1437
1438         /* Analyze the weapon */
1439         if (o_ptr->k_idx)
1440         {
1441                 /* Indicate Blessing */
1442                 if (have_flag(flgs, TR_BLESSED))
1443                 {
1444                         info[i++] = _("あなたの武器は神の祝福を受けている。", "Your weapon has been blessed by the gods.");
1445                 }
1446
1447                 if (have_flag(flgs, TR_CHAOTIC))
1448                 {
1449                         info[i++] = _("あなたの武器はログルスの徴の属性をもつ。", "Your weapon is branded with the Sign of Logrus.");
1450                 }
1451
1452                 /* Hack */
1453                 if (have_flag(flgs, TR_IMPACT))
1454                 {
1455                         info[i++] = _("あなたの武器は打撃で地震を発生することができる。", "The impact of your weapon can cause earthquakes.");
1456                 }
1457
1458                 if (have_flag(flgs, TR_VORPAL))
1459                 {
1460                         info[i++] = _("あなたの武器は非常に鋭い。", "Your weapon is very sharp.");
1461                 }
1462
1463                 if (have_flag(flgs, TR_VAMPIRIC))
1464                 {
1465                         info[i++] = _("あなたの武器は敵から生命力を吸収する。", "Your weapon drains life from your foes.");
1466                 }
1467
1468                 /* Special "Attack Bonuses" */
1469                 if (have_flag(flgs, TR_BRAND_ACID))
1470                 {
1471                         info[i++] = _("あなたの武器は敵を溶かす。", "Your weapon melts your foes.");
1472                 }
1473                 if (have_flag(flgs, TR_BRAND_ELEC))
1474                 {
1475                         info[i++] = _("あなたの武器は敵を感電させる。", "Your weapon shocks your foes.");
1476                 }
1477                 if (have_flag(flgs, TR_BRAND_FIRE))
1478                 {
1479                         info[i++] = _("あなたの武器は敵を燃やす。", "Your weapon burns your foes.");
1480                 }
1481                 if (have_flag(flgs, TR_BRAND_COLD))
1482                 {
1483                         info[i++] = _("あなたの武器は敵を凍らせる。", "Your weapon freezes your foes.");
1484                 }
1485                 if (have_flag(flgs, TR_BRAND_POIS))
1486                 {
1487                         info[i++] = _("あなたの武器は敵を毒で侵す。", "Your weapon poisons your foes.");
1488                 }
1489
1490                 /* Special "slay" flags */
1491                 if (have_flag(flgs, TR_KILL_ANIMAL))
1492                 {
1493                         info[i++] = _("あなたの武器は動物の天敵である。", "Your weapon is a great bane of animals.");
1494                 }
1495                 else if (have_flag(flgs, TR_SLAY_ANIMAL))
1496                 {
1497                         info[i++] = _("あなたの武器は動物に対して強い力を発揮する。", "Your weapon strikes at animals with extra force.");
1498                 }
1499                 if (have_flag(flgs, TR_KILL_EVIL))
1500                 {
1501                         info[i++] = _("あなたの武器は邪悪なる存在の天敵である。", "Your weapon is a great bane of evil.");
1502                 }
1503                 else if (have_flag(flgs, TR_SLAY_EVIL))
1504                 {
1505                         info[i++] = _("あなたの武器は邪悪なる存在に対して強い力を発揮する。", "Your weapon strikes at evil with extra force.");
1506                 }
1507                 if (have_flag(flgs, TR_KILL_HUMAN))
1508                 {
1509                         info[i++] = _("あなたの武器は人間の天敵である。", "Your weapon is a great bane of humans.");
1510                 }
1511                 else if (have_flag(flgs, TR_SLAY_HUMAN))
1512                 {
1513                         info[i++] = _("あなたの武器は人間に対して特に強い力を発揮する。", "Your weapon is especially deadly against humans.");
1514                 }
1515                 if (have_flag(flgs, TR_KILL_UNDEAD))
1516                 {
1517                         info[i++] = _("あなたの武器はアンデッドの天敵である。", "Your weapon is a great bane of undead.");
1518                 }
1519                 else if (have_flag(flgs, TR_SLAY_UNDEAD))
1520                 {
1521                         info[i++] = _("あなたの武器はアンデッドに対して神聖なる力を発揮する。", "Your weapon strikes at undead with holy wrath.");
1522                 }
1523                 if (have_flag(flgs, TR_KILL_DEMON))
1524                 {
1525                         info[i++] = _("あなたの武器はデーモンの天敵である。", "Your weapon is a great bane of demons.");
1526                 }
1527                 else if (have_flag(flgs, TR_SLAY_DEMON))
1528                 {
1529                         info[i++] = _("あなたの武器はデーモンに対して神聖なる力を発揮する。", "Your weapon strikes at demons with holy wrath.");
1530                 }
1531                 if (have_flag(flgs, TR_KILL_ORC))
1532                 {
1533                         info[i++] = _("あなたの武器はオークの天敵である。", "Your weapon is a great bane of orcs.");
1534                 }
1535                 else if (have_flag(flgs, TR_SLAY_ORC))
1536                 {
1537                         info[i++] = _("あなたの武器はオークに対して特に強い力を発揮する。", "Your weapon is especially deadly against orcs.");
1538                 }
1539                 if (have_flag(flgs, TR_KILL_TROLL))
1540                 {
1541                         info[i++] = _("あなたの武器はトロルの天敵である。", "Your weapon is a great bane of trolls.");
1542                 }
1543                 else if (have_flag(flgs, TR_SLAY_TROLL))
1544                 {
1545                         info[i++] = _("あなたの武器はトロルに対して特に強い力を発揮する。", "Your weapon is especially deadly against trolls.");
1546                 }
1547                 if (have_flag(flgs, TR_KILL_GIANT))
1548                 {
1549                         info[i++] = _("あなたの武器はジャイアントの天敵である。", "Your weapon is a great bane of giants.");
1550                 }
1551                 else if (have_flag(flgs, TR_SLAY_GIANT))
1552                 {
1553                         info[i++] = _("あなたの武器はジャイアントに対して特に強い力を発揮する。", "Your weapon is especially deadly against giants.");
1554                 }
1555                 /* Special "kill" flags */
1556                 if (have_flag(flgs, TR_KILL_DRAGON))
1557                 {
1558                         info[i++] = _("あなたの武器はドラゴンの天敵である。", "Your weapon is a great bane of dragons.");
1559                 }
1560                 else if (have_flag(flgs, TR_SLAY_DRAGON))
1561                 {
1562                         info[i++] = _("あなたの武器はドラゴンに対して特に強い力を発揮する。", "Your weapon is especially deadly against dragons.");
1563                 }
1564
1565                 if (have_flag(flgs, TR_FORCE_WEAPON))
1566                 {
1567                         info[i++] = _("あなたの武器はMPを使って攻撃する。", "Your weapon causes greate damages using your MP.");
1568                 }
1569                 if (have_flag(flgs, TR_THROW))
1570                 {
1571                         info[i++] = _("あなたの武器は投げやすい。", "Your weapon can be thrown well.");
1572                 }
1573         }
1574
1575
1576         /* Save the screen */
1577         screen_save();
1578
1579         /* Erase the screen */
1580         for (k = 1; k < 24; k++) prt("", k, 13);
1581
1582         /* Label the information */
1583         prt(_("        あなたの状態:", "     Your Attributes:"), 1, 15);
1584
1585         /* We will print on top of the map (column 13) */
1586         for (k = 2, j = 0; j < i; j++)
1587         {
1588                 /* Show the info */
1589                 prt(info[j], k++, 15);
1590
1591                 /* Every 20 entries (lines 2 to 21), start over */
1592                 if ((k == 22) && (j+1 < i))
1593                 {
1594                         prt(_("-- 続く --", "-- more --"), k, 15);
1595                         inkey();
1596                         for (; k > 2; k--) prt("", k, 15);
1597                 }
1598         }
1599
1600         /* Pause */
1601         prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);
1602         inkey();
1603
1604         /* Restore the screen */
1605         screen_load();
1606 }
1607
1608 /*!
1609  * @brief 魔法効果時間のターン数に基づいて表現IDを返す。
1610  * @param dur 効果ターン数
1611  * @return 効果時間の表現ID
1612  */
1613 static int report_magics_aux(int dur)
1614 {
1615         if (dur <= 5)
1616         {
1617                 return 0;
1618         }
1619         else if (dur <= 10)
1620         {
1621                 return 1;
1622         }
1623         else if (dur <= 20)
1624         {
1625                 return 2;
1626         }
1627         else if (dur <= 50)
1628         {
1629                 return 3;
1630         }
1631         else if (dur <= 100)
1632         {
1633                 return 4;
1634         }
1635         else if (dur <= 200)
1636         {
1637                 return 5;
1638         }
1639         else
1640         {
1641                 return 6;
1642         }
1643 }
1644
1645 static cptr report_magic_durations[] =
1646 {
1647 #ifdef JP
1648 "ごく短い間",
1649 "少しの間",
1650 "しばらくの間",
1651 "多少長い間",
1652 "長い間",
1653 "非常に長い間",
1654 "信じ難いほど長い間",
1655 "モンスターを攻撃するまで"
1656 #else
1657         "for a short time",
1658         "for a little while",
1659         "for a while",
1660         "for a long while",
1661         "for a long time",
1662         "for a very long time",
1663         "for an incredibly long time",
1664         "until you hit a monster"
1665 #endif
1666
1667 };
1668
1669 /*!
1670  * @brief 現在の一時的効果一覧を返す / Report all currently active magical effects.
1671  * @return なし
1672  */
1673 void report_magics(void)
1674 {
1675         int     i = 0, j, k;
1676         char    Dummy[80];
1677         cptr    info[128];
1678         int     info2[128];
1679
1680
1681         if (p_ptr->blind)
1682         {
1683                 info2[i]  = report_magics_aux(p_ptr->blind);
1684                 info[i++] = _("あなたは目が見えない", "You cannot see");
1685         }
1686         if (p_ptr->confused)
1687         {
1688                 info2[i]  = report_magics_aux(p_ptr->confused);
1689                 info[i++] = _("あなたは混乱している", "You are confused");
1690         }
1691         if (p_ptr->afraid)
1692         {
1693                 info2[i]  = report_magics_aux(p_ptr->afraid);
1694                 info[i++] = _("あなたは恐怖に侵されている", "You are terrified");
1695         }
1696         if (p_ptr->poisoned)
1697         {
1698                 info2[i]  = report_magics_aux(p_ptr->poisoned);
1699                 info[i++] = _("あなたは毒に侵されている", "You are poisoned");
1700         }
1701         if (p_ptr->image)
1702         {
1703                 info2[i]  = report_magics_aux(p_ptr->image);
1704                 info[i++] = _("あなたは幻覚を見ている", "You are hallucinating");
1705         }
1706         if (p_ptr->blessed)
1707         {
1708                 info2[i]  = report_magics_aux(p_ptr->blessed);
1709                 info[i++] = _("あなたは高潔さを感じている", "You feel rightous");
1710         }
1711         if (p_ptr->hero)
1712         {
1713                 info2[i]  = report_magics_aux(p_ptr->hero);
1714                 info[i++] = _("あなたはヒーロー気分だ", "You feel heroic");
1715         }
1716         if (p_ptr->shero)
1717         {
1718                 info2[i]  = report_magics_aux(p_ptr->shero);
1719                 info[i++] = _("あなたは戦闘狂だ", "You are in a battle rage");
1720         }
1721         if (p_ptr->protevil)
1722         {
1723                 info2[i]  = report_magics_aux(p_ptr->protevil);
1724                 info[i++] = _("あなたは邪悪なる存在から守られている", "You are protected from evil");
1725         }
1726         if (p_ptr->shield)
1727         {
1728                 info2[i]  = report_magics_aux(p_ptr->shield);
1729                 info[i++] = _("あなたは神秘のシールドで守られている", "You are protected by a mystic shield");
1730         }
1731         if (p_ptr->invuln)
1732         {
1733                 info2[i]  = report_magics_aux(p_ptr->invuln);
1734                 info[i++] = _("あなたは無敵だ", "You are invulnerable");
1735         }
1736         if (p_ptr->wraith_form)
1737         {
1738                 info2[i]  = report_magics_aux(p_ptr->wraith_form);
1739                 info[i++] = _("あなたは幽体化している", "You are incorporeal");
1740         }
1741         if (p_ptr->special_attack & ATTACK_CONFUSE)
1742         {
1743                 info2[i]  = 7;
1744                 info[i++] = _("あなたの手は赤く輝いている", "Your hands are glowing dull red.");
1745         }
1746         if (p_ptr->word_recall)
1747         {
1748                 info2[i]  = report_magics_aux(p_ptr->word_recall);
1749                 info[i++] = _("この後帰還の詔が発動する", "You are waiting to be recalled");
1750         }
1751         if (p_ptr->alter_reality)
1752         {
1753                 info2[i]  = report_magics_aux(p_ptr->alter_reality);
1754                 info[i++] = _("この後現実変容が発動する", "You waiting to be altered");
1755         }
1756         if (p_ptr->oppose_acid)
1757         {
1758                 info2[i]  = report_magics_aux(p_ptr->oppose_acid);
1759                 info[i++] = _("あなたは酸への耐性を持っている", "You are resistant to acid");
1760         }
1761         if (p_ptr->oppose_elec)
1762         {
1763                 info2[i]  = report_magics_aux(p_ptr->oppose_elec);
1764                 info[i++] = _("あなたは電撃への耐性を持っている", "You are resistant to lightning");
1765         }
1766         if (p_ptr->oppose_fire)
1767         {
1768                 info2[i]  = report_magics_aux(p_ptr->oppose_fire);
1769                 info[i++] = _("あなたは火への耐性を持っている", "You are resistant to fire");
1770         }
1771         if (p_ptr->oppose_cold)
1772         {
1773                 info2[i]  = report_magics_aux(p_ptr->oppose_cold);
1774                 info[i++] = _("あなたは冷気への耐性を持っている", "You are resistant to cold");
1775         }
1776         if (p_ptr->oppose_pois)
1777         {
1778                 info2[i]  = report_magics_aux(p_ptr->oppose_pois);
1779                 info[i++] = _("あなたは毒への耐性を持っている", "You are resistant to poison");
1780         }
1781
1782         /* Save the screen */
1783         screen_save();
1784
1785         /* Erase the screen */
1786         for (k = 1; k < 24; k++) prt("", k, 13);
1787
1788         /* Label the information */
1789         prt(_("    現在かかっている魔法     :", "     Your Current Magic:"), 1, 15);
1790
1791
1792         /* We will print on top of the map (column 13) */
1793         for (k = 2, j = 0; j < i; j++)
1794         {
1795                 /* Show the info */
1796                 sprintf(Dummy, _("%-28s : 期間 - %s ", "%s %s."), info[j],
1797                         report_magic_durations[info2[j]]);
1798                 prt(Dummy, k++, 15);
1799
1800                 /* Every 20 entries (lines 2 to 21), start over */
1801                 if ((k == 22) && (j + 1 < i))
1802                 {
1803                         prt(_("-- 続く --", "-- more --"), k, 15);
1804                         inkey();
1805                         for (; k > 2; k--) prt("", k, 15);
1806                 }
1807         }
1808
1809         /* Pause */
1810         prt(_("[何かキーを押すとゲームに戻ります]", "[Press any key to continue]"), k, 13);
1811         inkey();
1812
1813         /* Restore the screen */
1814         screen_load();
1815 }
1816
1817 /*!
1818  * @brief プレイヤー周辺の地形を感知する
1819  * @param range 効果範囲
1820  * @param flag 特定地形ID
1821  * @param known 地形から危険フラグを外すならTRUE
1822  * @return 効力があった場合TRUEを返す
1823  */
1824 static bool detect_feat_flag(int range, int flag, bool known)
1825 {
1826         int       x, y;
1827         bool      detect = FALSE;
1828         cave_type *c_ptr;
1829
1830         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
1831
1832         /* Scan the current panel */
1833         for (y = 1; y < cur_hgt - 1; y++)
1834         {
1835                 for (x = 1; x <= cur_wid - 1; x++)
1836                 {
1837                         int dist = distance(p_ptr->y, p_ptr->x, y, x);
1838                         if (dist > range) continue;
1839
1840                         /* Access the grid */
1841                         c_ptr = &cave[y][x];
1842
1843                         /* Hack -- Safe */
1844                         if (flag == FF_TRAP)
1845                         {
1846                                 /* Mark as detected */
1847                                 if (dist <= range && known)
1848                                 {
1849                                         if (dist <= range - 1) c_ptr->info |= (CAVE_IN_DETECT);
1850
1851                                         c_ptr->info &= ~(CAVE_UNSAFE);
1852
1853                                         /* Redraw */
1854                                         lite_spot(y, x);
1855                                 }
1856                         }
1857
1858                         /* Detect flags */
1859                         if (cave_have_flag_grid(c_ptr, flag))
1860                         {
1861                                 /* Detect secrets */
1862                                 disclose_grid(y, x);
1863
1864                                 /* Hack -- Memorize */
1865                                 c_ptr->info |= (CAVE_MARK);
1866
1867                                 /* Redraw */
1868                                 lite_spot(y, x);
1869
1870                                 /* Obvious */
1871                                 detect = TRUE;
1872                         }
1873                 }
1874         }
1875
1876         /* Result */
1877         return detect;
1878 }
1879
1880
1881 /*!
1882  * @brief プレイヤー周辺のトラップを感知する / Detect all traps on current panel
1883  * @param range 効果範囲
1884  * @param known 感知外範囲を超える警告フラグを立てる場合TRUEを返す
1885  * @return 効力があった場合TRUEを返す
1886  */
1887 bool detect_traps(int range, bool known)
1888 {
1889         bool detect = detect_feat_flag(range, FF_TRAP, known);
1890
1891         if (known) p_ptr->dtrap = TRUE;
1892
1893         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
1894
1895         /* Describe */
1896         if (detect)
1897         {
1898                 msg_print(_("トラップの存在を感じとった!", "You sense the presence of traps!"));
1899         }
1900
1901         /* Result */
1902         return detect;
1903 }
1904
1905
1906 /*!
1907  * @brief プレイヤー周辺のドアを感知する / Detect all doors on current panel
1908  * @param range 効果範囲
1909  * @return 効力があった場合TRUEを返す
1910  */
1911 bool detect_doors(int range)
1912 {
1913         bool detect = detect_feat_flag(range, FF_DOOR, TRUE);
1914
1915         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
1916
1917         /* Describe */
1918         if (detect)
1919         {
1920                 msg_print(_("ドアの存在を感じとった!", "You sense the presence of doors!"));
1921         }
1922
1923         /* Result */
1924         return detect;
1925 }
1926
1927
1928 /*!
1929  * @brief プレイヤー周辺の階段を感知する / Detect all stairs on current panel
1930  * @param range 効果範囲
1931  * @return 効力があった場合TRUEを返す
1932  */
1933 bool detect_stairs(int range)
1934 {
1935         bool detect = detect_feat_flag(range, FF_STAIRS, TRUE);
1936
1937         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 0) detect = FALSE;
1938
1939         /* Describe */
1940         if (detect)
1941         {
1942                 msg_print(_("階段の存在を感じとった!", "You sense the presence of stairs!"));
1943         }
1944
1945         /* Result */
1946         return detect;
1947 }
1948
1949
1950 /*!
1951  * @brief プレイヤー周辺の地形財宝を感知する / Detect any treasure on the current panel
1952  * @param range 効果範囲
1953  * @return 効力があった場合TRUEを返す
1954  */
1955 bool detect_treasure(int range)
1956 {
1957         bool detect = detect_feat_flag(range, FF_HAS_GOLD, TRUE);
1958
1959         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
1960
1961         /* Describe */
1962         if (detect)
1963         {
1964                 msg_print(_("埋蔵された財宝の存在を感じとった!", "You sense the presence of buried treasure!"));
1965         }
1966
1967         /* Result */
1968         return detect;
1969 }
1970
1971
1972 /*!
1973  * @brief プレイヤー周辺のアイテム財宝を感知する / Detect all "gold" objects on the current panel
1974  * @param range 効果範囲
1975  * @return 効力があった場合TRUEを返す
1976  */
1977 bool detect_objects_gold(int range)
1978 {
1979         int i, y, x;
1980         int range2 = range;
1981
1982         bool detect = FALSE;
1983
1984         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
1985
1986         /* Scan objects */
1987         for (i = 1; i < o_max; i++)
1988         {
1989                 object_type *o_ptr = &o_list[i];
1990
1991                 /* Skip dead objects */
1992                 if (!o_ptr->k_idx) continue;
1993
1994                 /* Skip held objects */
1995                 if (o_ptr->held_m_idx) continue;
1996
1997                 /* Location */
1998                 y = o_ptr->iy;
1999                 x = o_ptr->ix;
2000
2001                 /* Only detect nearby objects */
2002                 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
2003
2004                 /* Detect "gold" objects */
2005                 if (o_ptr->tval == TV_GOLD)
2006                 {
2007                         /* Hack -- memorize it */
2008                         o_ptr->marked |= OM_FOUND;
2009
2010                         /* Redraw */
2011                         lite_spot(y, x);
2012
2013                         /* Detect */
2014                         detect = TRUE;
2015                 }
2016         }
2017
2018         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
2019
2020         /* Describe */
2021         if (detect)
2022         {
2023                 msg_print(_("財宝の存在を感じとった!", "You sense the presence of treasure!"));
2024         }
2025
2026         if (detect_monsters_string(range, "$"))
2027         {
2028                 detect = TRUE;
2029         }
2030
2031         /* Result */
2032         return (detect);
2033 }
2034
2035
2036 /*!
2037  * @brief 通常のアイテムオブジェクトを感知する / Detect all "normal" objects on the current panel
2038  * @param range 効果範囲
2039  * @return 効力があった場合TRUEを返す
2040  */
2041 bool detect_objects_normal(int range)
2042 {
2043         int i, y, x;
2044         int range2 = range;
2045
2046         bool detect = FALSE;
2047
2048         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range2 /= 3;
2049
2050         /* Scan objects */
2051         for (i = 1; i < o_max; i++)
2052         {
2053                 object_type *o_ptr = &o_list[i];
2054
2055                 /* Skip dead objects */
2056                 if (!o_ptr->k_idx) continue;
2057
2058                 /* Skip held objects */
2059                 if (o_ptr->held_m_idx) continue;
2060
2061                 /* Location */
2062                 y = o_ptr->iy;
2063                 x = o_ptr->ix;
2064
2065                 /* Only detect nearby objects */
2066                 if (distance(p_ptr->y, p_ptr->x, y, x) > range2) continue;
2067
2068                 /* Detect "real" objects */
2069                 if (o_ptr->tval != TV_GOLD)
2070                 {
2071                         /* Hack -- memorize it */
2072                         o_ptr->marked |= OM_FOUND;
2073
2074                         /* Redraw */
2075                         lite_spot(y, x);
2076
2077                         /* Detect */
2078                         detect = TRUE;
2079                 }
2080         }
2081
2082         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 6) detect = FALSE;
2083
2084         /* Describe */
2085         if (detect)
2086         {
2087                 msg_print(_("アイテムの存在を感じとった!", "You sense the presence of objects!"));
2088         }
2089
2090         if (detect_monsters_string(range, "!=?|/`"))
2091         {
2092                 detect = TRUE;
2093         }
2094
2095         /* Result */
2096         return (detect);
2097 }
2098
2099
2100 /*!
2101  * @brief 魔法効果のあるのアイテムオブジェクトを感知する / Detect all "magic" objects on the current panel.
2102  * @param range 効果範囲
2103  * @return 効力があった場合TRUEを返す
2104  * @details
2105  * <pre>
2106  * This will light up all spaces with "magic" items, including artifacts,
2107  * ego-items, potions, scrolls, books, rods, wands, staves, amulets, rings,
2108  * and "enchanted" items of the "good" variety.
2109  *
2110  * It can probably be argued that this function is now too powerful.
2111  * </pre>
2112  */
2113 bool detect_objects_magic(int range)
2114 {
2115         int i, y, x, tv;
2116
2117         bool detect = FALSE;
2118
2119         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2120
2121         /* Scan all objects */
2122         for (i = 1; i < o_max; i++)
2123         {
2124                 object_type *o_ptr = &o_list[i];
2125
2126                 /* Skip dead objects */
2127                 if (!o_ptr->k_idx) continue;
2128
2129                 /* Skip held objects */
2130                 if (o_ptr->held_m_idx) continue;
2131
2132                 /* Location */
2133                 y = o_ptr->iy;
2134                 x = o_ptr->ix;
2135
2136                 /* Only detect nearby objects */
2137                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2138
2139                 /* Examine the tval */
2140                 tv = o_ptr->tval;
2141
2142                 /* Artifacts, misc magic items, or enchanted wearables */
2143                 if (object_is_artifact(o_ptr) ||
2144                         object_is_ego(o_ptr) ||
2145                     (tv == TV_WHISTLE) ||
2146                     (tv == TV_AMULET) ||
2147                         (tv == TV_RING) ||
2148                     (tv == TV_STAFF) ||
2149                         (tv == TV_WAND) ||
2150                         (tv == TV_ROD) ||
2151                     (tv == TV_SCROLL) ||
2152                         (tv == TV_POTION) ||
2153                     (tv == TV_LIFE_BOOK) ||
2154                         (tv == TV_SORCERY_BOOK) ||
2155                     (tv == TV_NATURE_BOOK) ||
2156                         (tv == TV_CHAOS_BOOK) ||
2157                     (tv == TV_DEATH_BOOK) ||
2158                     (tv == TV_TRUMP_BOOK) ||
2159                         (tv == TV_ARCANE_BOOK) ||
2160                         (tv == TV_CRAFT_BOOK) ||
2161                         (tv == TV_DAEMON_BOOK) ||
2162                         (tv == TV_CRUSADE_BOOK) ||
2163                         (tv == TV_MUSIC_BOOK) ||
2164                         (tv == TV_HISSATSU_BOOK) ||
2165                         (tv == TV_HEX_BOOK) ||
2166                     ((o_ptr->to_a > 0) || (o_ptr->to_h + o_ptr->to_d > 0)))
2167                 {
2168                         /* Memorize the item */
2169                         o_ptr->marked |= OM_FOUND;
2170
2171                         /* Redraw */
2172                         lite_spot(y, x);
2173
2174                         /* Detect */
2175                         detect = TRUE;
2176                 }
2177         }
2178
2179         /* Describe */
2180         if (detect)
2181         {
2182                 msg_print(_("魔法のアイテムの存在を感じとった!", "You sense the presence of magic objects!"));
2183         }
2184
2185         /* Return result */
2186         return (detect);
2187 }
2188
2189
2190 /*!
2191  * @brief 一般のモンスターを感知する / Detect all "normal" monsters on the current panel
2192  * @param range 効果範囲
2193  * @return 効力があった場合TRUEを返す
2194  */
2195 bool detect_monsters_normal(int range)
2196 {
2197         int i, y, x;
2198
2199         bool flag = FALSE;
2200
2201         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2202
2203         /* Scan monsters */
2204         for (i = 1; i < m_max; i++)
2205         {
2206                 monster_type *m_ptr = &m_list[i];
2207                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2208
2209                 /* Skip dead monsters */
2210                 if (!m_ptr->r_idx) continue;
2211
2212                 /* Location */
2213                 y = m_ptr->fy;
2214                 x = m_ptr->fx;
2215
2216                 /* Only detect nearby monsters */
2217                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2218
2219                 /* Detect all non-invisible monsters */
2220                 if (!(r_ptr->flags2 & RF2_INVISIBLE) || p_ptr->see_inv)
2221                 {
2222                         /* Repair visibility later */
2223                         repair_monsters = TRUE;
2224
2225                         /* Hack -- Detect monster */
2226                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2227
2228                         /* Update the monster */
2229                         update_mon(i, FALSE);
2230
2231                         /* Detect */
2232                         flag = TRUE;
2233                 }
2234         }
2235
2236         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
2237
2238         /* Describe */
2239         if (flag)
2240         {
2241                 /* Describe result */
2242                 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
2243         }
2244
2245         /* Result */
2246         return (flag);
2247 }
2248
2249
2250 /*!
2251  * @brief 不可視のモンスターを感知する / Detect all "invisible" monsters around the player
2252  * @param range 効果範囲
2253  * @return 効力があった場合TRUEを返す
2254  */
2255 bool detect_monsters_invis(int range)
2256 {
2257         int i, y, x;
2258         bool flag = FALSE;
2259
2260         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2261
2262         /* Scan monsters */
2263         for (i = 1; i < m_max; i++)
2264         {
2265                 monster_type *m_ptr = &m_list[i];
2266                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2267
2268                 /* Skip dead monsters */
2269                 if (!m_ptr->r_idx) continue;
2270
2271                 /* Location */
2272                 y = m_ptr->fy;
2273                 x = m_ptr->fx;
2274
2275                 /* Only detect nearby monsters */
2276                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2277
2278                 /* Detect invisible monsters */
2279                 if (r_ptr->flags2 & RF2_INVISIBLE)
2280                 {
2281                         /* Update monster recall window */
2282                         if (p_ptr->monster_race_idx == m_ptr->r_idx)
2283                         {
2284                                 /* Window stuff */
2285                                 p_ptr->window |= (PW_MONSTER);
2286                         }
2287
2288                         /* Repair visibility later */
2289                         repair_monsters = TRUE;
2290
2291                         /* Hack -- Detect monster */
2292                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2293
2294                         /* Update the monster */
2295                         update_mon(i, FALSE);
2296
2297                         /* Detect */
2298                         flag = TRUE;
2299                 }
2300         }
2301
2302         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
2303
2304         /* Describe */
2305         if (flag)
2306         {
2307                 /* Describe result */
2308                 msg_print(_("透明な生物の存在を感じとった!", "You sense the presence of invisible creatures!"));
2309         }
2310
2311         /* Result */
2312         return (flag);
2313 }
2314
2315 /*!
2316  * @brief 邪悪なモンスターを感知する / Detect all "evil" monsters on current panel
2317  * @param range 効果範囲
2318  * @return 効力があった場合TRUEを返す
2319  */
2320 bool detect_monsters_evil(int range)
2321 {
2322         int i, y, x;
2323         bool flag = FALSE;
2324
2325         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2326
2327         /* Scan monsters */
2328         for (i = 1; i < m_max; i++)
2329         {
2330                 monster_type *m_ptr = &m_list[i];
2331                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2332
2333                 /* Skip dead monsters */
2334                 if (!m_ptr->r_idx) continue;
2335
2336                 /* Location */
2337                 y = m_ptr->fy;
2338                 x = m_ptr->fx;
2339
2340                 /* Only detect nearby monsters */
2341                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2342
2343                 /* Detect evil monsters */
2344                 if (r_ptr->flags3 & RF3_EVIL)
2345                 {
2346                         if (is_original_ap(m_ptr))
2347                         {
2348                                 /* Take note that they are evil */
2349                                 r_ptr->r_flags3 |= (RF3_EVIL);
2350
2351                                 /* Update monster recall window */
2352                                 if (p_ptr->monster_race_idx == m_ptr->r_idx)
2353                                 {
2354                                         /* Window stuff */
2355                                         p_ptr->window |= (PW_MONSTER);
2356                                 }
2357                         }
2358
2359                         /* Repair visibility later */
2360                         repair_monsters = TRUE;
2361
2362                         /* Hack -- Detect monster */
2363                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2364
2365                         /* Update the monster */
2366                         update_mon(i, FALSE);
2367
2368                         /* Detect */
2369                         flag = TRUE;
2370                 }
2371         }
2372
2373         /* Describe */
2374         if (flag)
2375         {
2376                 /* Describe result */
2377                 msg_print(_("邪悪なる生物の存在を感じとった!", "You sense the presence of evil creatures!"));
2378         }
2379
2380         /* Result */
2381         return (flag);
2382 }
2383
2384 /*!
2385  * @brief 無生命のモンスターを感知する(アンデッド、悪魔系を含む) / Detect all "nonliving", "undead" or "demonic" monsters on current panel
2386  * @param range 効果範囲
2387  * @return 効力があった場合TRUEを返す
2388  */
2389 bool detect_monsters_nonliving(int range)
2390 {
2391         int     i, y, x;
2392         bool    flag = FALSE;
2393
2394         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2395
2396         /* Scan monsters */
2397         for (i = 1; i < m_max; i++)
2398         {
2399                 monster_type *m_ptr = &m_list[i];
2400                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2401
2402                 /* Skip dead monsters */
2403                 if (!m_ptr->r_idx) continue;
2404
2405                 /* Location */
2406                 y = m_ptr->fy;
2407                 x = m_ptr->fx;
2408
2409                 /* Only detect nearby monsters */
2410                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2411
2412                 /* Detect non-living monsters */
2413                 if (!monster_living(r_ptr))
2414                 {
2415                         /* Update monster recall window */
2416                         if (p_ptr->monster_race_idx == m_ptr->r_idx)
2417                         {
2418                                 /* Window stuff */
2419                                 p_ptr->window |= (PW_MONSTER);
2420                         }
2421
2422                         /* Repair visibility later */
2423                         repair_monsters = TRUE;
2424
2425                         /* Hack -- Detect monster */
2426                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2427
2428                         /* Update the monster */
2429                         update_mon(i, FALSE);
2430
2431                         /* Detect */
2432                         flag = TRUE;
2433                 }
2434         }
2435
2436         /* Describe */
2437         if (flag)
2438         {
2439                 /* Describe result */
2440                 msg_print(_("自然でないモンスターの存在を感じた!", "You sense the presence of unnatural beings!"));
2441         }
2442
2443         /* Result */
2444         return (flag);
2445 }
2446
2447 /*!
2448  * @brief 精神のあるモンスターを感知する / Detect all monsters it has mind on current panel
2449  * @param range 効果範囲
2450  * @return 効力があった場合TRUEを返す
2451  */
2452 bool detect_monsters_mind(int range)
2453 {
2454         int     i, y, x;
2455         bool    flag = FALSE;
2456
2457         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2458
2459         /* Scan monsters */
2460         for (i = 1; i < m_max; i++)
2461         {
2462                 monster_type *m_ptr = &m_list[i];
2463                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2464
2465                 /* Skip dead monsters */
2466                 if (!m_ptr->r_idx) continue;
2467
2468                 /* Location */
2469                 y = m_ptr->fy;
2470                 x = m_ptr->fx;
2471
2472                 /* Only detect nearby monsters */
2473                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2474
2475                 /* Detect non-living monsters */
2476                 if (!(r_ptr->flags2 & RF2_EMPTY_MIND))
2477                 {
2478                         /* Update monster recall window */
2479                         if (p_ptr->monster_race_idx == m_ptr->r_idx)
2480                         {
2481                                 /* Window stuff */
2482                                 p_ptr->window |= (PW_MONSTER);
2483                         }
2484
2485                         /* Repair visibility later */
2486                         repair_monsters = TRUE;
2487
2488                         /* Hack -- Detect monster */
2489                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2490
2491                         /* Update the monster */
2492                         update_mon(i, FALSE);
2493
2494                         /* Detect */
2495                         flag = TRUE;
2496                 }
2497         }
2498
2499         /* Describe */
2500         if (flag)
2501         {
2502                 /* Describe result */
2503                 msg_print(_("殺気を感じとった!", "You sense the presence of someone's mind!"));
2504         }
2505
2506         /* Result */
2507         return (flag);
2508 }
2509
2510
2511 /*!
2512  * @brief 該当シンボルのモンスターを感知する / Detect all (string) monsters on current panel
2513  * @param range 効果範囲
2514  * @param Match 対応シンボルの混じったモンスター文字列(複数指定化)
2515  * @return 効力があった場合TRUEを返す
2516  */
2517 bool detect_monsters_string(int range, cptr Match)
2518 {
2519         int i, y, x;
2520         bool flag = FALSE;
2521
2522         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2523
2524         /* Scan monsters */
2525         for (i = 1; i < m_max; i++)
2526         {
2527                 monster_type *m_ptr = &m_list[i];
2528                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2529
2530                 /* Skip dead monsters */
2531                 if (!m_ptr->r_idx) continue;
2532
2533                 /* Location */
2534                 y = m_ptr->fy;
2535                 x = m_ptr->fx;
2536
2537                 /* Only detect nearby monsters */
2538                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2539
2540                 /* Detect monsters with the same symbol */
2541                 if (my_strchr(Match, r_ptr->d_char))
2542                 {
2543                         /* Update monster recall window */
2544                         if (p_ptr->monster_race_idx == m_ptr->r_idx)
2545                         {
2546                                 /* Window stuff */
2547                                 p_ptr->window |= (PW_MONSTER);
2548                         }
2549
2550                         /* Repair visibility later */
2551                         repair_monsters = TRUE;
2552
2553                         /* Hack -- Detect monster */
2554                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2555
2556                         /* Update the monster */
2557                         update_mon(i, FALSE);
2558
2559                         /* Detect */
2560                         flag = TRUE;
2561                 }
2562         }
2563
2564         if (music_singing(MUSIC_DETECT) && p_ptr->magic_num1[2] > 3) flag = FALSE;
2565
2566         /* Describe */
2567         if (flag)
2568         {
2569                 /* Describe result */
2570                 msg_print(_("モンスターの存在を感じとった!", "You sense the presence of monsters!"));
2571         }
2572
2573         /* Result */
2574         return (flag);
2575 }
2576
2577 /*!
2578  * @brief flags3に対応するモンスターを感知する / A "generic" detect monsters routine, tagged to flags3
2579  * @param range 効果範囲
2580  * @param match_flag 感知フラグ
2581  * @return 効力があった場合TRUEを返す
2582  */
2583 bool detect_monsters_xxx(int range, u32b match_flag)
2584 {
2585         int  i, y, x;
2586         bool flag = FALSE;
2587         cptr desc_monsters = _("変なモンスター", "weird monsters");
2588
2589         if (d_info[dungeon_type].flags1 & DF1_DARKNESS) range /= 3;
2590
2591         /* Scan monsters */
2592         for (i = 1; i < m_max; i++)
2593         {
2594                 monster_type *m_ptr = &m_list[i];
2595                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
2596
2597                 /* Skip dead monsters */
2598                 if (!m_ptr->r_idx) continue;
2599
2600                 /* Location */
2601                 y = m_ptr->fy;
2602                 x = m_ptr->fx;
2603
2604                 /* Only detect nearby monsters */
2605                 if (distance(p_ptr->y, p_ptr->x, y, x) > range) continue;
2606
2607                 /* Detect evil monsters */
2608                 if (r_ptr->flags3 & (match_flag))
2609                 {
2610                         if (is_original_ap(m_ptr))
2611                         {
2612                                 /* Take note that they are something */
2613                                 r_ptr->r_flags3 |= (match_flag);
2614
2615                                 /* Update monster recall window */
2616                                 if (p_ptr->monster_race_idx == m_ptr->r_idx)
2617                                 {
2618                                         /* Window stuff */
2619                                         p_ptr->window |= (PW_MONSTER);
2620                                 }
2621                         }
2622
2623                         /* Repair visibility later */
2624                         repair_monsters = TRUE;
2625
2626                         /* Hack -- Detect monster */
2627                         m_ptr->mflag2 |= (MFLAG2_MARK | MFLAG2_SHOW);
2628
2629                         /* Update the monster */
2630                         update_mon(i, FALSE);
2631
2632                         /* Detect */
2633                         flag = TRUE;
2634                 }
2635         }
2636
2637         /* Describe */
2638         if (flag)
2639         {
2640                 switch (match_flag)
2641                 {
2642                         case RF3_DEMON:
2643                         desc_monsters = _("デーモン", "demons");
2644                                 break;
2645                         case RF3_UNDEAD:
2646                         desc_monsters = _("アンデッド", "the undead");
2647                                 break;
2648                 }
2649
2650                 /* Describe result */
2651                 msg_format(_("%sの存在を感じとった!", "You sense the presence of %s!"), desc_monsters);
2652                 msg_print(NULL);
2653         }
2654
2655         /* Result */
2656         return (flag);
2657 }
2658
2659
2660 /*!
2661  * @brief 全感知処理 / Detect everything
2662  * @param range 効果範囲
2663  * @return 効力があった場合TRUEを返す
2664  */
2665 bool detect_all(int range)
2666 {
2667         bool detect = FALSE;
2668
2669         /* Detect everything */
2670         if (detect_traps(range, TRUE)) detect = TRUE;
2671         if (detect_doors(range)) detect = TRUE;
2672         if (detect_stairs(range)) detect = TRUE;
2673
2674         /* There are too many hidden treasure.  So... */
2675         /* if (detect_treasure(range)) detect = TRUE; */
2676
2677         if (detect_objects_gold(range)) detect = TRUE;
2678         if (detect_objects_normal(range)) detect = TRUE;
2679         if (detect_monsters_invis(range)) detect = TRUE;
2680         if (detect_monsters_normal(range)) detect = TRUE;
2681
2682         /* Result */
2683         return (detect);
2684 }
2685
2686
2687 /*!
2688  * @brief 視界内モンスターに魔法効果を与える / Apply a "project()" directly to all viewable monsters
2689  * @param typ 属性効果
2690  * @param dam 効果量
2691  * @return 効力があった場合TRUEを返す
2692  * @details
2693  * <pre>
2694  * Note that affected monsters are NOT auto-tracked by this usage.
2695  *
2696  * To avoid misbehavior when monster deaths have side-effects,
2697  * this is done in two passes. -- JDL
2698  * </pre>
2699  */
2700 bool project_hack(int typ, int dam)
2701 {
2702         int     i, x, y;
2703         int     flg = PROJECT_JUMP | PROJECT_KILL | PROJECT_HIDE;
2704         bool    obvious = FALSE;
2705
2706
2707         /* Mark all (nearby) monsters */
2708         for (i = 1; i < m_max; i++)
2709         {
2710                 monster_type *m_ptr = &m_list[i];
2711
2712                 /* Paranoia -- Skip dead monsters */
2713                 if (!m_ptr->r_idx) continue;
2714
2715                 /* Location */
2716                 y = m_ptr->fy;
2717                 x = m_ptr->fx;
2718
2719                 /* Require line of sight */
2720                 if (!player_has_los_bold(y, x) || !projectable(p_ptr->y, p_ptr->x, y, x)) continue;
2721
2722                 /* Mark the monster */
2723                 m_ptr->mflag |= (MFLAG_TEMP);
2724         }
2725
2726         /* Affect all marked monsters */
2727         for (i = 1; i < m_max; i++)
2728         {
2729                 monster_type *m_ptr = &m_list[i];
2730
2731                 /* Skip unmarked monsters */
2732                 if (!(m_ptr->mflag & (MFLAG_TEMP))) continue;
2733
2734                 /* Remove mark */
2735                 m_ptr->mflag &= ~(MFLAG_TEMP);
2736
2737                 /* Location */
2738                 y = m_ptr->fy;
2739                 x = m_ptr->fx;
2740
2741                 /* Jump directly to the target monster */
2742                 if (project(0, 0, y, x, dam, typ, flg, -1)) obvious = TRUE;
2743         }
2744
2745         /* Result */
2746         return (obvious);
2747 }
2748
2749
2750 /*!
2751  * @brief 視界内モンスターを加速する処理 / Speed monsters
2752  * @return 効力があった場合TRUEを返す
2753  */
2754 bool speed_monsters(void)
2755 {
2756         return (project_hack(GF_OLD_SPEED, p_ptr->lev));
2757 }
2758
2759 /*!
2760  * @brief 視界内モンスターを加速する処理 / Slow monsters
2761  * @return 効力があった場合TRUEを返す
2762  */
2763 bool slow_monsters(int power)
2764 {
2765         return (project_hack(GF_OLD_SLOW, power));
2766 }
2767
2768 /*!
2769  * @brief 視界内モンスターを眠らせる処理 / Sleep monsters
2770  * @return 効力があった場合TRUEを返す
2771  */
2772 bool sleep_monsters(int power)
2773 {
2774         return (project_hack(GF_OLD_SLEEP, power));
2775 }
2776
2777 /*!
2778  * @brief 視界内の邪悪なモンスターをテレポート・アウェイさせる処理 / Banish evil monsters
2779  * @return 効力があった場合TRUEを返す
2780  */
2781 bool banish_evil(int dist)
2782 {
2783         return (project_hack(GF_AWAY_EVIL, dist));
2784 }
2785
2786 /*!
2787  * @brief 視界内のアンデッド・モンスターを恐怖させる処理 / Turn undead
2788  * @return 効力があった場合TRUEを返す
2789  */
2790 bool turn_undead(void)
2791 {
2792         bool tester = (project_hack(GF_TURN_UNDEAD, p_ptr->lev));
2793         if (tester)
2794                 chg_virtue(V_UNLIFE, -1);
2795         return tester;
2796 }
2797
2798 /*!
2799  * @brief 視界内のアンデッド・モンスターにダメージを与える処理 / Dispel undead monsters
2800  * @return 効力があった場合TRUEを返す
2801  */
2802 bool dispel_undead(int dam)
2803 {
2804         bool tester = (project_hack(GF_DISP_UNDEAD, dam));
2805         if (tester)
2806                 chg_virtue(V_UNLIFE, -2);
2807         return tester;
2808 }
2809
2810 /*!
2811  * @brief 視界内の邪悪なモンスターにダメージを与える処理 / Dispel evil monsters
2812  * @return 効力があった場合TRUEを返す
2813  */
2814 bool dispel_evil(int dam)
2815 {
2816         return (project_hack(GF_DISP_EVIL, dam));
2817 }
2818
2819 /*!
2820  * @brief 視界内の善良なモンスターにダメージを与える処理 / Dispel good monsters
2821  * @return 効力があった場合TRUEを返す
2822  */
2823 bool dispel_good(int dam)
2824 {
2825         return (project_hack(GF_DISP_GOOD, dam));
2826 }
2827
2828 /*!
2829  * @brief 視界内のあらゆるモンスターにダメージを与える処理 / Dispel all monsters
2830  * @return 効力があった場合TRUEを返す
2831  */
2832 bool dispel_monsters(int dam)
2833 {
2834         return (project_hack(GF_DISP_ALL, dam));
2835 }
2836
2837 /*!
2838  * @brief 視界内の生命のあるモンスターにダメージを与える処理 / Dispel 'living' monsters
2839  * @return 効力があった場合TRUEを返す
2840  */
2841 bool dispel_living(int dam)
2842 {
2843         return (project_hack(GF_DISP_LIVING, dam));
2844 }
2845
2846 /*!
2847  * @brief 視界内の悪魔系モンスターにダメージを与える処理 / Dispel 'living' monsters
2848  * @return 効力があった場合TRUEを返す
2849  */
2850 bool dispel_demons(int dam)
2851 {
2852         return (project_hack(GF_DISP_DEMON, dam));
2853 }
2854
2855 /*!
2856  * @brief 視界内のモンスターに「聖戦」効果を与える処理
2857  * @return 効力があった場合TRUEを返す
2858  */
2859 bool crusade(void)
2860 {
2861         return (project_hack(GF_CRUSADE, p_ptr->lev*4));
2862 }
2863
2864 /*!
2865  * @brief 視界内モンスターを怒らせる処理 / Wake up all monsters, and speed up "los" monsters.
2866  * @param who 怒らせる原因を起こしたモンスター(0ならばプレイヤー)
2867  * @return なし
2868  */
2869 void aggravate_monsters(int who)
2870 {
2871         int     i;
2872         bool    sleep = FALSE;
2873         bool    speed = FALSE;
2874
2875
2876         /* Aggravate everyone nearby */
2877         for (i = 1; i < m_max; i++)
2878         {
2879                 monster_type    *m_ptr = &m_list[i];
2880 /*              monster_race    *r_ptr = &r_info[m_ptr->r_idx]; */
2881
2882                 /* Paranoia -- Skip dead monsters */
2883                 if (!m_ptr->r_idx) continue;
2884
2885                 /* Skip aggravating monster (or player) */
2886                 if (i == who) continue;
2887
2888                 /* Wake up nearby sleeping monsters */
2889                 if (m_ptr->cdis < MAX_SIGHT * 2)
2890                 {
2891                         /* Wake up */
2892                         if (MON_CSLEEP(m_ptr))
2893                         {
2894                                 (void)set_monster_csleep(i, 0);
2895                                 sleep = TRUE;
2896                         }
2897                         if (!is_pet(m_ptr)) m_ptr->mflag2 |= MFLAG2_NOPET;
2898                 }
2899
2900                 /* Speed up monsters in line of sight */
2901                 if (player_has_los_bold(m_ptr->fy, m_ptr->fx))
2902                 {
2903                         if (!is_pet(m_ptr))
2904                         {
2905                                 (void)set_monster_fast(i, MON_FAST(m_ptr) + 100);
2906                                 speed = TRUE;
2907                         }
2908                 }
2909         }
2910
2911         /* Messages */
2912 #ifdef JP
2913         if (speed) msg_print("付近で何かが突如興奮したような感じを受けた!");
2914         else if (sleep) msg_print("何かが突如興奮したような騒々しい音が遠くに聞こえた!");
2915 #else
2916         if (speed) msg_print("You feel a sudden stirring nearby!");
2917         else if (sleep) msg_print("You hear a sudden stirring in the distance!");
2918 #endif
2919         if (p_ptr->riding) p_ptr->update |= PU_BONUS;
2920 }
2921
2922
2923 /*!
2924  * @brief モンスターへの単体抹殺処理サブルーチン / Delete a non-unique/non-quest monster
2925  * @param m_idx 抹殺するモンスターID
2926  * @param power 抹殺の威力
2927  * @param player_cast プレイヤーの魔法によるものならば TRUE
2928  * @param dam_side プレイヤーへの負担ダメージ量(1d(dam_side))
2929  * @param spell_name 抹殺効果を起こした魔法の名前
2930  * @return 効力があった場合TRUEを返す
2931  */
2932 bool genocide_aux(int m_idx, int power, bool player_cast, int dam_side, cptr spell_name)
2933 {
2934         int          msec = delay_factor * delay_factor * delay_factor;
2935         monster_type *m_ptr = &m_list[m_idx];
2936         monster_race *r_ptr = &r_info[m_ptr->r_idx];
2937         bool         resist = FALSE;
2938
2939         if (is_pet(m_ptr) && !player_cast) return FALSE;
2940
2941         /* Hack -- Skip Unique Monsters or Quest Monsters */
2942         if (r_ptr->flags1 & (RF1_UNIQUE | RF1_QUESTOR)) resist = TRUE;
2943
2944         else if (r_ptr->flags7 & RF7_UNIQUE2) resist = TRUE;
2945
2946         else if (m_idx == p_ptr->riding) resist = TRUE;
2947
2948         else if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle) resist = TRUE;
2949
2950         else if (player_cast && (r_ptr->level > randint0(power))) resist = TRUE;
2951
2952         else if (player_cast && (m_ptr->mflag2 & MFLAG2_NOGENO)) resist = TRUE;
2953
2954         /* Delete the monster */
2955         else
2956         {
2957                 if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
2958                 {
2959                         char m_name[80];
2960
2961                         monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
2962                         do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_GENOCIDE, m_name);
2963                 }
2964
2965                 delete_monster_idx(m_idx);
2966         }
2967
2968         if (resist && player_cast)
2969         {
2970                 bool see_m = is_seen(m_ptr);
2971                 char m_name[80];
2972
2973                 monster_desc(m_name, m_ptr, 0);
2974                 if (see_m)
2975                 {
2976                         msg_format(_("%^sには効果がなかった。", "%^s is unaffected."), m_name);
2977                 }
2978                 if (MON_CSLEEP(m_ptr))
2979                 {
2980                         (void)set_monster_csleep(m_idx, 0);
2981                         if (m_ptr->ml)
2982                         {
2983                                 msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
2984                         }
2985                 }
2986                 if (is_friendly(m_ptr) && !is_pet(m_ptr))
2987                 {
2988                         if (see_m)
2989                         {
2990                                 msg_format(_("%sは怒った!", "%^s gets angry!"), m_name);
2991                         }
2992                         set_hostile(m_ptr);
2993                 }
2994                 if (one_in_(13)) m_ptr->mflag2 |= MFLAG2_NOGENO;
2995         }
2996
2997         if (player_cast)
2998         {
2999                 /* Take damage */
3000                 take_hit(DAMAGE_GENO, randint1(dam_side), format(_("%^sの呪文を唱えた疲労", "the strain of casting %^s"), spell_name), -1);
3001         }
3002
3003         /* Visual feedback */
3004         move_cursor_relative(p_ptr->y, p_ptr->x);
3005
3006         /* Redraw */
3007         p_ptr->redraw |= (PR_HP);
3008
3009         /* Window stuff */
3010         p_ptr->window |= (PW_PLAYER);
3011
3012         /* Handle */
3013         handle_stuff();
3014
3015         /* Fresh */
3016         Term_fresh();
3017
3018         /* Delay */
3019         Term_xtra(TERM_XTRA_DELAY, msec);
3020
3021         return !resist;
3022 }
3023
3024
3025 /*!
3026  * @brief モンスターへのシンボル抹殺処理ルーチン / Delete all non-unique/non-quest monsters of a given "type" from the level
3027  * @param power 抹殺の威力
3028  * @param player_cast プレイヤーの魔法によるものならば TRUE
3029  * @return 効力があった場合TRUEを返す
3030  */
3031 bool symbol_genocide(int power, bool player_cast)
3032 {
3033         int  i;
3034         char typ;
3035         bool result = FALSE;
3036
3037         /* Prevent genocide in quest levels */
3038         if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
3039         {
3040                 return (FALSE);
3041         }
3042
3043         /* Mega-Hack -- Get a monster symbol */
3044         while (!get_com(_("どの種類(文字)のモンスターを抹殺しますか: ", "Choose a monster race (by symbol) to genocide: "), &typ, FALSE)) ;
3045
3046         /* Delete the monsters of that "type" */
3047         for (i = 1; i < m_max; i++)
3048         {
3049                 monster_type *m_ptr = &m_list[i];
3050                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3051
3052                 /* Paranoia -- Skip dead monsters */
3053                 if (!m_ptr->r_idx) continue;
3054
3055                 /* Skip "wrong" monsters */
3056                 if (r_ptr->d_char != typ) continue;
3057
3058                 /* Take note */
3059                 result |= genocide_aux(i, power, player_cast, 4, _("抹殺", "Genocide"));
3060         }
3061
3062         if (result)
3063         {
3064                 chg_virtue(V_VITALITY, -2);
3065                 chg_virtue(V_CHANCE, -1);
3066         }
3067
3068         return result;
3069 }
3070
3071
3072 /*!
3073  * @brief モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) monsters
3074  * @param power 抹殺の威力
3075  * @param player_cast プレイヤーの魔法によるものならば TRUE
3076  * @return 効力があった場合TRUEを返す
3077  */
3078 bool mass_genocide(int power, bool player_cast)
3079 {
3080         int  i;
3081         bool result = FALSE;
3082
3083         /* Prevent mass genocide in quest levels */
3084         if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
3085         {
3086                 return (FALSE);
3087         }
3088
3089         /* Delete the (nearby) monsters */
3090         for (i = 1; i < m_max; i++)
3091         {
3092                 monster_type *m_ptr = &m_list[i];
3093
3094                 /* Paranoia -- Skip dead monsters */
3095                 if (!m_ptr->r_idx) continue;
3096
3097                 /* Skip distant monsters */
3098                 if (m_ptr->cdis > MAX_SIGHT) continue;
3099
3100                 /* Note effect */
3101                 result |= genocide_aux(i, power, player_cast, 3, _("周辺抹殺", "Mass Genocide"));
3102         }
3103
3104         if (result)
3105         {
3106                 chg_virtue(V_VITALITY, -2);
3107                 chg_virtue(V_CHANCE, -1);
3108         }
3109
3110         return result;
3111 }
3112
3113
3114 /*!
3115  * @brief アンデッド・モンスターへの周辺抹殺処理ルーチン / Delete all nearby (non-unique) undead
3116  * @param power 抹殺の威力
3117  * @param player_cast プレイヤーの魔法によるものならば TRUE
3118  * @return 効力があった場合TRUEを返す
3119  */
3120 bool mass_genocide_undead(int power, bool player_cast)
3121 {
3122         int  i;
3123         bool result = FALSE;
3124
3125         /* Prevent mass genocide in quest levels */
3126         if ((p_ptr->inside_quest && !random_quest_number(dun_level)) || p_ptr->inside_arena || p_ptr->inside_battle)
3127         {
3128                 return (FALSE);
3129         }
3130
3131         /* Delete the (nearby) monsters */
3132         for (i = 1; i < m_max; i++)
3133         {
3134                 monster_type *m_ptr = &m_list[i];
3135                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3136
3137                 /* Paranoia -- Skip dead monsters */
3138                 if (!m_ptr->r_idx) continue;
3139
3140                 if (!(r_ptr->flags3 & RF3_UNDEAD)) continue;
3141
3142                 /* Skip distant monsters */
3143                 if (m_ptr->cdis > MAX_SIGHT) continue;
3144
3145                 /* Note effect */
3146                 result |= genocide_aux(i, power, player_cast, 3, _("アンデッド消滅", "Annihilate Undead"));
3147         }
3148
3149         if (result)
3150         {
3151                 chg_virtue(V_UNLIFE, -2);
3152                 chg_virtue(V_CHANCE, -1);
3153         }
3154
3155         return result;
3156 }
3157
3158
3159 /*!
3160  * @brief 周辺モンスターを調査する / Probe nearby monsters
3161  * @return 効力があった場合TRUEを返す
3162  */
3163 bool probing(void)
3164 {
3165         int     i, speed;
3166         int cu, cv;
3167         bool    probe = FALSE;
3168         char buf[256];
3169         cptr align;
3170
3171         cu = Term->scr->cu;
3172         cv = Term->scr->cv;
3173         Term->scr->cu = 0;
3174         Term->scr->cv = 1;
3175
3176         /* Probe all (nearby) monsters */
3177         for (i = 1; i < m_max; i++)
3178         {
3179                 monster_type *m_ptr = &m_list[i];
3180                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3181
3182                 /* Paranoia -- Skip dead monsters */
3183                 if (!m_ptr->r_idx) continue;
3184
3185                 /* Require line of sight */
3186                 if (!player_has_los_bold(m_ptr->fy, m_ptr->fx)) continue;
3187
3188                 /* Probe visible monsters */
3189                 if (m_ptr->ml)
3190                 {
3191                         char m_name[80];
3192
3193                         /* Start the message */
3194                         if (!probe)
3195                         {
3196                                 msg_print(_("調査中...", "Probing..."));
3197                         }
3198
3199                         msg_print(NULL);
3200
3201                         if (!is_original_ap(m_ptr))
3202                         {
3203                                 if (m_ptr->mflag2 & MFLAG2_KAGE)
3204                                         m_ptr->mflag2 &= ~(MFLAG2_KAGE);
3205
3206                                 m_ptr->ap_r_idx = m_ptr->r_idx;
3207                                 lite_spot(m_ptr->fy, m_ptr->fx);
3208                         }
3209                         /* Get "the monster" or "something" */
3210                         monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_INDEF_HIDDEN);
3211
3212                         speed = m_ptr->mspeed - 110;
3213                         if (MON_FAST(m_ptr)) speed += 10;
3214                         if (MON_SLOW(m_ptr)) speed -= 10;
3215
3216                         /* Get the monster's alignment */
3217 #ifdef JP
3218                         if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "善悪";
3219                         else if (r_ptr->flags3 & RF3_EVIL) align = "邪悪";
3220                         else if (r_ptr->flags3 & RF3_GOOD) align = "善良";
3221                         else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "中立(善悪)";
3222                         else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "中立(邪悪)";
3223                         else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "中立(善良)";
3224                         else align = "中立";
3225 #else
3226                         if ((r_ptr->flags3 & (RF3_EVIL | RF3_GOOD)) == (RF3_EVIL | RF3_GOOD)) align = "good&evil";
3227                         else if (r_ptr->flags3 & RF3_EVIL) align = "evil";
3228                         else if (r_ptr->flags3 & RF3_GOOD) align = "good";
3229                         else if ((m_ptr->sub_align & (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) == (SUB_ALIGN_EVIL | SUB_ALIGN_GOOD)) align = "neutral(good&evil)";
3230                         else if (m_ptr->sub_align & SUB_ALIGN_EVIL) align = "neutral(evil)";
3231                         else if (m_ptr->sub_align & SUB_ALIGN_GOOD) align = "neutral(good)";
3232                         else align = "neutral";
3233 #endif
3234
3235                         /* Describe the monster */
3236 #ifdef JP
3237 sprintf(buf,"%s ... 属性:%s HP:%d/%d AC:%d 速度:%s%d 経験:", m_name, align, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
3238 #else
3239 sprintf(buf, "%s ... align:%s HP:%d/%d AC:%d speed:%s%d exp:", m_name, align, m_ptr->hp, m_ptr->maxhp, r_ptr->ac, (speed > 0) ? "+" : "", speed);
3240 #endif
3241                         if (r_ptr->next_r_idx)
3242                         {
3243                                 strcat(buf, format("%d/%d ", m_ptr->exp, r_ptr->next_exp));
3244                         }
3245                         else
3246                         {
3247                                 strcat(buf, "xxx ");
3248                         }
3249
3250 #ifdef JP
3251                         if (MON_CSLEEP(m_ptr)) strcat(buf,"睡眠 ");
3252                         if (MON_STUNNED(m_ptr)) strcat(buf,"朦朧 ");
3253                         if (MON_MONFEAR(m_ptr)) strcat(buf,"恐怖 ");
3254                         if (MON_CONFUSED(m_ptr)) strcat(buf,"混乱 ");
3255                         if (MON_INVULNER(m_ptr)) strcat(buf,"無敵 ");
3256 #else
3257                         if (MON_CSLEEP(m_ptr)) strcat(buf,"sleeping ");
3258                         if (MON_STUNNED(m_ptr)) strcat(buf,"stunned ");
3259                         if (MON_MONFEAR(m_ptr)) strcat(buf,"scared ");
3260                         if (MON_CONFUSED(m_ptr)) strcat(buf,"confused ");
3261                         if (MON_INVULNER(m_ptr)) strcat(buf,"invulnerable ");
3262 #endif
3263                         buf[strlen(buf)-1] = '\0';
3264                         prt(buf,0,0);
3265
3266                         /* HACK : Add the line to message buffer */
3267                         message_add(buf);
3268                         p_ptr->window |= (PW_MESSAGE);
3269                         window_stuff();
3270
3271                         if (m_ptr->ml) move_cursor_relative(m_ptr->fy, m_ptr->fx);
3272                         inkey();
3273
3274                         Term_erase(0, 0, 255);
3275
3276                         /* Learn everything about this monster */
3277                         if (lore_do_probe(m_ptr->r_idx))
3278                         {
3279                                 /* Get base name of monster */
3280                                 strcpy(buf, (r_name + r_ptr->name));
3281
3282 #ifdef JP
3283                                 /* Note that we learnt some new flags  -Mogami- */
3284                                 msg_format("%sについてさらに詳しくなった気がする。", buf);
3285 #else
3286                                 /* Pluralize it */
3287                                 plural_aux(buf);
3288
3289                                 /* Note that we learnt some new flags  -Mogami- */
3290                                 msg_format("You now know more about %s.", buf);
3291 #endif
3292                                 /* Clear -more- prompt */
3293                                 msg_print(NULL);
3294                         }
3295
3296                         /* Probe worked */
3297                         probe = TRUE;
3298                 }
3299         }
3300
3301         Term->scr->cu = cu;
3302         Term->scr->cv = cv;
3303         Term_fresh();
3304
3305         /* Done */
3306         if (probe)
3307         {
3308                 chg_virtue(V_KNOWLEDGE, 1);
3309                 msg_print(_("これで全部です。", "That's all."));
3310         }
3311
3312         /* Result */
3313         return (probe);
3314 }
3315
3316
3317
3318 /*!
3319  * @brief *破壊*処理を行う / The spell of destruction
3320  * @param y1 破壊の中心Y座標
3321  * @param x1 破壊の中心X座標 
3322  * @param r 破壊の半径
3323  * @param in_generate ダンジョンフロア生成中の処理ならばTRUE
3324  * @return 効力があった場合TRUEを返す
3325  * @details
3326  * <pre>
3327  * This spell "deletes" monsters (instead of "killing" them).
3328  *
3329  * Later we may use one function for both "destruction" and
3330  * "earthquake" by using the "full" to select "destruction".
3331  * </pre>
3332  */
3333 bool destroy_area(int y1, int x1, int r, bool in_generate)
3334 {
3335         int       y, x, k, t;
3336         cave_type *c_ptr;
3337         bool      flag = FALSE;
3338
3339         /* Prevent destruction of quest levels and town */
3340         if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
3341         {
3342                 return (FALSE);
3343         }
3344
3345         /* Lose monster light */
3346         if (!in_generate) clear_mon_lite();
3347
3348         /* Big area of affect */
3349         for (y = (y1 - r); y <= (y1 + r); y++)
3350         {
3351                 for (x = (x1 - r); x <= (x1 + r); x++)
3352                 {
3353                         /* Skip illegal grids */
3354                         if (!in_bounds(y, x)) continue;
3355
3356                         /* Extract the distance */
3357                         k = distance(y1, x1, y, x);
3358
3359                         /* Stay in the circle of death */
3360                         if (k > r) continue;
3361
3362                         /* Access the grid */
3363                         c_ptr = &cave[y][x];
3364
3365                         /* Lose room and vault */
3366                         c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY);
3367
3368                         /* Lose light and knowledge */
3369                         c_ptr->info &= ~(CAVE_MARK | CAVE_GLOW | CAVE_KNOWN);
3370
3371                         if (!in_generate) /* Normal */
3372                         {
3373                                 /* Lose unsafety */
3374                                 c_ptr->info &= ~(CAVE_UNSAFE);
3375
3376                                 /* Hack -- Notice player affect */
3377                                 if (player_bold(y, x))
3378                                 {
3379                                         /* Hurt the player later */
3380                                         flag = TRUE;
3381
3382                                         /* Do not hurt this grid */
3383                                         continue;
3384                                 }
3385                         }
3386
3387                         /* Hack -- Skip the epicenter */
3388                         if ((y == y1) && (x == x1)) continue;
3389
3390                         if (c_ptr->m_idx)
3391                         {
3392                                 monster_type *m_ptr = &m_list[c_ptr->m_idx];
3393                                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3394
3395                                 if (in_generate) /* In generation */
3396                                 {
3397                                         /* Delete the monster (if any) */
3398                                         delete_monster(y, x);
3399                                 }
3400                                 else if (r_ptr->flags1 & RF1_QUESTOR)
3401                                 {
3402                                         /* Heal the monster */
3403                                         m_ptr->hp = m_ptr->maxhp;
3404
3405                                         /* Try to teleport away quest monsters */
3406                                         if (!teleport_away(c_ptr->m_idx, (r * 2) + 1, TELEPORT_DEC_VALOUR)) continue;
3407                                 }
3408                                 else
3409                                 {
3410                                         if (record_named_pet && is_pet(m_ptr) && m_ptr->nickname)
3411                                         {
3412                                                 char m_name[80];
3413
3414                                                 monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
3415                                                 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_DESTROY, m_name);
3416                                         }
3417
3418                                         /* Delete the monster (if any) */
3419                                         delete_monster(y, x);
3420                                 }
3421                         }
3422
3423                         /* During generation, destroyed artifacts are "preserved" */
3424                         if (preserve_mode || in_generate)
3425                         {
3426                                 s16b this_o_idx, next_o_idx = 0;
3427
3428                                 /* Scan all objects in the grid */
3429                                 for (this_o_idx = c_ptr->o_idx; this_o_idx; this_o_idx = next_o_idx)
3430                                 {
3431                                         object_type *o_ptr;
3432
3433                                         /* Acquire object */
3434                                         o_ptr = &o_list[this_o_idx];
3435
3436                                         /* Acquire next object */
3437                                         next_o_idx = o_ptr->next_o_idx;
3438
3439                                         /* Hack -- Preserve unknown artifacts */
3440                                         if (object_is_fixed_artifact(o_ptr) && (!object_is_known(o_ptr) || in_generate))
3441                                         {
3442                                                 /* Mega-Hack -- Preserve the artifact */
3443                                                 a_info[o_ptr->name1].cur_num = 0;
3444
3445                                                 if (in_generate && cheat_peek)
3446                                                 {
3447                                                         char o_name[MAX_NLEN];
3448                                                         object_desc(o_name, o_ptr, (OD_NAME_ONLY | OD_STORE));
3449                                                         msg_format(_("伝説のアイテム (%s) は生成中に*破壊*された。", "Artifact (%s) was *destroyed* during generation."), o_name);
3450                                                 }
3451                                         }
3452                                         else if (in_generate && cheat_peek && o_ptr->art_name)
3453                                         {
3454                                                 msg_print(_("ランダム・アーティファクトの1つは生成中に*破壊*された。", 
3455                                                                         "One of the random artifacts was *destroyed* during generation."));
3456                                         }
3457                                 }
3458                         }
3459
3460                         /* Delete objects */
3461                         delete_object(y, x);
3462
3463                         /* Destroy "non-permanent" grids */
3464                         if (!cave_perma_grid(c_ptr))
3465                         {
3466                                 /* Wall (or floor) type */
3467                                 t = randint0(200);
3468
3469                                 if (!in_generate) /* Normal */
3470                                 {
3471                                         if (t < 20)
3472                                         {
3473                                                 /* Create granite wall */
3474                                                 cave_set_feat(y, x, feat_granite);
3475                                         }
3476                                         else if (t < 70)
3477                                         {
3478                                                 /* Create quartz vein */
3479                                                 cave_set_feat(y, x, feat_quartz_vein);
3480                                         }
3481                                         else if (t < 100)
3482                                         {
3483                                                 /* Create magma vein */
3484                                                 cave_set_feat(y, x, feat_magma_vein);
3485                                         }
3486                                         else
3487                                         {
3488                                                 /* Create floor */
3489                                                 cave_set_feat(y, x, floor_type[randint0(100)]);
3490                                         }
3491                                 }
3492                                 else /* In generation */
3493                                 {
3494                                         if (t < 20)
3495                                         {
3496                                                 /* Create granite wall */
3497                                                 place_extra_grid(c_ptr);
3498                                         }
3499                                         else if (t < 70)
3500                                         {
3501                                                 /* Create quartz vein */
3502                                                 c_ptr->feat = feat_quartz_vein;
3503                                         }
3504                                         else if (t < 100)
3505                                         {
3506                                                 /* Create magma vein */
3507                                                 c_ptr->feat = feat_magma_vein;
3508                                         }
3509                                         else
3510                                         {
3511                                                 /* Create floor */
3512                                                 place_floor_grid(c_ptr);
3513                                         }
3514
3515                                         /* Clear garbage of hidden trap or door */
3516                                         c_ptr->mimic = 0;
3517                                 }
3518                         }
3519                 }
3520         }
3521
3522         if (!in_generate)
3523         {
3524                 /* Process "re-glowing" */
3525                 for (y = (y1 - r); y <= (y1 + r); y++)
3526                 {
3527                         for (x = (x1 - r); x <= (x1 + r); x++)
3528                         {
3529                                 /* Skip illegal grids */
3530                                 if (!in_bounds(y, x)) continue;
3531
3532                                 /* Extract the distance */
3533                                 k = distance(y1, x1, y, x);
3534
3535                                 /* Stay in the circle of death */
3536                                 if (k > r) continue;
3537
3538                                 /* Access the grid */
3539                                 c_ptr = &cave[y][x];
3540
3541                                 if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
3542                                 else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
3543                                 {
3544                                         int i, yy, xx;
3545                                         cave_type *cc_ptr;
3546
3547                                         for (i = 0; i < 9; i++)
3548                                         {
3549                                                 yy = y + ddy_ddd[i];
3550                                                 xx = x + ddx_ddd[i];
3551                                                 if (!in_bounds2(yy, xx)) continue;
3552                                                 cc_ptr = &cave[yy][xx];
3553                                                 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
3554                                                 {
3555                                                         c_ptr->info |= CAVE_GLOW;
3556                                                         break;
3557                                                 }
3558                                         }
3559                                 }
3560                         }
3561                 }
3562
3563                 /* Hack -- Affect player */
3564                 if (flag)
3565                 {
3566                         /* Message */
3567                         msg_print(_("燃えるような閃光が発生した!", "There is a searing blast of light!"));
3568
3569                         /* Blind the player */
3570                         if (!p_ptr->resist_blind && !p_ptr->resist_lite)
3571                         {
3572                                 /* Become blind */
3573                                 (void)set_blind(p_ptr->blind + 10 + randint1(10));
3574                         }
3575                 }
3576
3577                 forget_flow();
3578
3579                 /* Mega-Hack -- Forget the view and lite */
3580                 p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
3581
3582                 /* Update stuff */
3583                 p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
3584
3585                 /* Redraw map */
3586                 p_ptr->redraw |= (PR_MAP);
3587
3588                 /* Window stuff */
3589                 p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
3590
3591                 if (p_ptr->special_defense & NINJA_S_STEALTH)
3592                 {
3593                         if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
3594                 }
3595         }
3596
3597         /* Success */
3598         return (TRUE);
3599 }
3600
3601
3602 /*!
3603  * @brief 地震処理(サブルーチン) /
3604  * Induce an "earthquake" of the given radius at the given location.
3605  * @return 効力があった場合TRUEを返す
3606  * @param cy 中心Y座標
3607  * @param cx 中心X座標
3608  * @param r 効果半径
3609  * @param m_idx 地震を起こしたモンスターID(0ならばプレイヤー)
3610  * @details
3611  * <pre>
3612  *
3613  * This will turn some walls into floors and some floors into walls.
3614  *
3615  * The player will take damage and "jump" into a safe grid if possible,
3616  * otherwise, he will "tunnel" through the rubble instantaneously.
3617  *
3618  * Monsters will take damage, and "jump" into a safe grid if possible,
3619  * otherwise they will be "buried" in the rubble, disappearing from
3620  * the level in the same way that they do when genocided.
3621  *
3622  * Note that thus the player and monsters (except eaters of walls and
3623  * passers through walls) will never occupy the same grid as a wall.
3624  * Note that as of now (2.7.8) no monster may occupy a "wall" grid, even
3625  * for a single turn, unless that monster can pass_walls or kill_walls.
3626  * This has allowed massive simplification of the "monster" code.
3627  * </pre>
3628  */
3629 bool earthquake_aux(int cy, int cx, int r, int m_idx)
3630 {
3631         int             i, t, y, x, yy, xx, dy, dx;
3632         int             damage = 0;
3633         int             sn = 0, sy = 0, sx = 0;
3634         bool            hurt = FALSE;
3635         cave_type       *c_ptr;
3636         bool            map[32][32];
3637
3638
3639         /* Prevent destruction of quest levels and town */
3640         if ((p_ptr->inside_quest && is_fixed_quest_idx(p_ptr->inside_quest)) || !dun_level)
3641         {
3642                 return (FALSE);
3643         }
3644
3645         /* Paranoia -- Enforce maximum range */
3646         if (r > 12) r = 12;
3647
3648         /* Clear the "maximal blast" area */
3649         for (y = 0; y < 32; y++)
3650         {
3651                 for (x = 0; x < 32; x++)
3652                 {
3653                         map[y][x] = FALSE;
3654                 }
3655         }
3656
3657         /* Check around the epicenter */
3658         for (dy = -r; dy <= r; dy++)
3659         {
3660                 for (dx = -r; dx <= r; dx++)
3661                 {
3662                         /* Extract the location */
3663                         yy = cy + dy;
3664                         xx = cx + dx;
3665
3666                         /* Skip illegal grids */
3667                         if (!in_bounds(yy, xx)) continue;
3668
3669                         /* Skip distant grids */
3670                         if (distance(cy, cx, yy, xx) > r) continue;
3671
3672                         /* Access the grid */
3673                         c_ptr = &cave[yy][xx];
3674
3675                         /* Lose room and vault */
3676                         c_ptr->info &= ~(CAVE_ROOM | CAVE_ICKY | CAVE_UNSAFE);
3677
3678                         /* Lose light and knowledge */
3679                         c_ptr->info &= ~(CAVE_GLOW | CAVE_MARK | CAVE_KNOWN);
3680
3681                         /* Skip the epicenter */
3682                         if (!dx && !dy) continue;
3683
3684                         /* Skip most grids */
3685                         if (randint0(100) < 85) continue;
3686
3687                         /* Damage this grid */
3688                         map[16+yy-cy][16+xx-cx] = TRUE;
3689
3690                         /* Hack -- Take note of player damage */
3691                         if (player_bold(yy, xx)) hurt = TRUE;
3692                 }
3693         }
3694
3695         /* First, affect the player (if necessary) */
3696         if (hurt && !p_ptr->pass_wall && !p_ptr->kill_wall)
3697         {
3698                 /* Check around the player */
3699                 for (i = 0; i < 8; i++)
3700                 {
3701                         /* Access the location */
3702                         y = p_ptr->y + ddy_ddd[i];
3703                         x = p_ptr->x + ddx_ddd[i];
3704
3705                         /* Skip non-empty grids */
3706                         if (!cave_empty_bold(y, x)) continue;
3707
3708                         /* Important -- Skip "quake" grids */
3709                         if (map[16+y-cy][16+x-cx]) continue;
3710
3711                         if (cave[y][x].m_idx) continue;
3712
3713                         /* Count "safe" grids */
3714                         sn++;
3715
3716                         /* Randomize choice */
3717                         if (randint0(sn) > 0) continue;
3718
3719                         /* Save the safe location */
3720                         sy = y; sx = x;
3721                 }
3722
3723                 /* Random message */
3724                 switch (randint1(3))
3725                 {
3726                         case 1:
3727                         {
3728                                 msg_print(_("ダンジョンの壁が崩れた!", "The cave ceiling collapses!"));
3729                                 break;
3730                         }
3731                         case 2:
3732                         {
3733                                 msg_print(_("ダンジョンの床が不自然にねじ曲がった!", "The cave floor twists in an unnatural way!"));
3734                                 break;
3735                         }
3736                         default:
3737                         {
3738                                 msg_print(_("ダンジョンが揺れた!崩れた岩が頭に降ってきた!", "The cave quakes!  You are pummeled with debris!"));
3739                                 break;
3740                         }
3741                 }
3742
3743                 /* Hurt the player a lot */
3744                 if (!sn)
3745                 {
3746                         /* Message and damage */
3747                         msg_print(_("あなたはひどい怪我を負った!", "You are severely crushed!"));
3748                         damage = 200;
3749                 }
3750
3751                 /* Destroy the grid, and push the player to safety */
3752                 else
3753                 {
3754                         /* Calculate results */
3755                         switch (randint1(3))
3756                         {
3757                                 case 1:
3758                                 {
3759                                         msg_print(_("降り注ぐ岩をうまく避けた!", "You nimbly dodge the blast!"));
3760                                         damage = 0;
3761                                         break;
3762                                 }
3763                                 case 2:
3764                                 {
3765                                         msg_print(_("岩石があなたに直撃した!", "You are bashed by rubble!"));
3766                                         damage = damroll(10, 4);
3767                                         (void)set_stun(p_ptr->stun + randint1(50));
3768                                         break;
3769                                 }
3770                                 case 3:
3771                                 {
3772                                         msg_print(_("あなたは床と壁との間に挟まれてしまった!", "You are crushed between the floor and ceiling!"));
3773                                         damage = damroll(10, 4);
3774                                         (void)set_stun(p_ptr->stun + randint1(50));
3775                                         break;
3776                                 }
3777                         }
3778
3779                         /* Move the player to the safe location */
3780                         (void)move_player_effect(sy, sx, MPE_DONT_PICKUP);
3781                 }
3782
3783                 /* Important -- no wall on player */
3784                 map[16+p_ptr->y-cy][16+p_ptr->x-cx] = FALSE;
3785
3786                 /* Take some damage */
3787                 if (damage)
3788                 {
3789                         cptr killer;
3790
3791                         if (m_idx)
3792                         {
3793                                 char m_name[80];
3794                                 monster_type *m_ptr = &m_list[m_idx];
3795
3796                                 /* Get the monster's real name */
3797                                 monster_desc(m_name, m_ptr, MD_IGNORE_HALLU | MD_ASSUME_VISIBLE | MD_INDEF_VISIBLE);
3798
3799                                 killer = format(_("%sの起こした地震", "an earthquake caused by %s"), m_name);
3800                         }
3801                         else
3802                         {
3803                                 killer = _("地震", "an earthquake");
3804                         }
3805
3806                         take_hit(DAMAGE_ATTACK, damage, killer, -1);
3807                 }
3808         }
3809
3810         /* Examine the quaked region */
3811         for (dy = -r; dy <= r; dy++)
3812         {
3813                 for (dx = -r; dx <= r; dx++)
3814                 {
3815                         /* Extract the location */
3816                         yy = cy + dy;
3817                         xx = cx + dx;
3818
3819                         /* Skip unaffected grids */
3820                         if (!map[16+yy-cy][16+xx-cx]) continue;
3821
3822                         /* Access the grid */
3823                         c_ptr = &cave[yy][xx];
3824
3825                         if (c_ptr->m_idx == p_ptr->riding) continue;
3826
3827                         /* Process monsters */
3828                         if (c_ptr->m_idx)
3829                         {
3830                                 monster_type *m_ptr = &m_list[c_ptr->m_idx];
3831                                 monster_race *r_ptr = &r_info[m_ptr->r_idx];
3832
3833                                 /* Quest monsters */
3834                                 if (r_ptr->flags1 & RF1_QUESTOR)
3835                                 {
3836                                         /* No wall on quest monsters */
3837                                         map[16+yy-cy][16+xx-cx] = FALSE;
3838
3839                                         continue;
3840                                 }
3841
3842                                 /* Most monsters cannot co-exist with rock */
3843                                 if (!(r_ptr->flags2 & (RF2_KILL_WALL)) &&
3844                                     !(r_ptr->flags2 & (RF2_PASS_WALL)))
3845                                 {
3846                                         char m_name[80];
3847
3848                                         /* Assume not safe */
3849                                         sn = 0;
3850
3851                                         /* Monster can move to escape the wall */
3852                                         if (!(r_ptr->flags1 & (RF1_NEVER_MOVE)))
3853                                         {
3854                                                 /* Look for safety */
3855                                                 for (i = 0; i < 8; i++)
3856                                                 {
3857                                                         /* Access the grid */
3858                                                         y = yy + ddy_ddd[i];
3859                                                         x = xx + ddx_ddd[i];
3860
3861                                                         /* Skip non-empty grids */
3862                                                         if (!cave_empty_bold(y, x)) continue;
3863
3864                                                         /* Hack -- no safety on glyph of warding */
3865                                                         if (is_glyph_grid(&cave[y][x])) continue;
3866                                                         if (is_explosive_rune_grid(&cave[y][x])) continue;
3867
3868                                                         /* ... nor on the Pattern */
3869                                                         if (pattern_tile(y, x)) continue;
3870
3871                                                         /* Important -- Skip "quake" grids */
3872                                                         if (map[16+y-cy][16+x-cx]) continue;
3873
3874                                                         if (cave[y][x].m_idx) continue;
3875                                                         if (player_bold(y, x)) continue;
3876
3877                                                         /* Count "safe" grids */
3878                                                         sn++;
3879
3880                                                         /* Randomize choice */
3881                                                         if (randint0(sn) > 0) continue;
3882
3883                                                         /* Save the safe grid */
3884                                                         sy = y; sx = x;
3885                                                 }
3886                                         }
3887
3888                                         /* Describe the monster */
3889                                         monster_desc(m_name, m_ptr, 0);
3890
3891                                         /* Scream in pain */
3892                                         if (!ignore_unview || is_seen(m_ptr)) msg_format(_("%^sは苦痛で泣きわめいた!", "%^s wails out in pain!"), m_name);
3893
3894                                         /* Take damage from the quake */
3895                                         damage = (sn ? damroll(4, 8) : (m_ptr->hp + 1));
3896
3897                                         /* Monster is certainly awake */
3898                                         (void)set_monster_csleep(c_ptr->m_idx, 0);
3899
3900                                         /* Apply damage directly */
3901                                         m_ptr->hp -= damage;
3902
3903                                         /* Delete (not kill) "dead" monsters */
3904                                         if (m_ptr->hp < 0)
3905                                         {
3906                                                 /* Message */
3907                                                 if (!ignore_unview || is_seen(m_ptr)) 
3908                                                         msg_format(_("%^sは岩石に埋もれてしまった!", "%^s is embedded in the rock!"), m_name);
3909
3910                                                 if (c_ptr->m_idx)
3911                                                 {
3912                                                         if (record_named_pet && is_pet(&m_list[c_ptr->m_idx]) && m_list[c_ptr->m_idx].nickname)
3913                                                         {
3914                                                                 char m2_name[80];
3915
3916                                                                 monster_desc(m2_name, m_ptr, MD_INDEF_VISIBLE);
3917                                                                 do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_EARTHQUAKE, m2_name);
3918                                                         }
3919                                                 }
3920
3921                                                 /* Delete the monster */
3922                                                 delete_monster(yy, xx);
3923
3924                                                 /* No longer safe */
3925                                                 sn = 0;
3926                                         }
3927
3928                                         /* Hack -- Escape from the rock */
3929                                         if (sn)
3930                                         {
3931                                                 int m_idx_aux = cave[yy][xx].m_idx;
3932
3933                                                 /* Update the old location */
3934                                                 cave[yy][xx].m_idx = 0;
3935
3936                                                 /* Update the new location */
3937                                                 cave[sy][sx].m_idx = m_idx_aux;
3938
3939                                                 /* Move the monster */
3940                                                 m_ptr->fy = sy;
3941                                                 m_ptr->fx = sx;
3942
3943                                                 /* Update the monster (new location) */
3944                                                 update_mon(m_idx, TRUE);
3945
3946                                                 /* Redraw the old grid */
3947                                                 lite_spot(yy, xx);
3948
3949                                                 /* Redraw the new grid */
3950                                                 lite_spot(sy, sx);
3951                                         }
3952                                 }
3953                         }
3954                 }
3955         }
3956
3957         /* Lose monster light */
3958         clear_mon_lite();
3959
3960         /* Examine the quaked region */
3961         for (dy = -r; dy <= r; dy++)
3962         {
3963                 for (dx = -r; dx <= r; dx++)
3964                 {
3965                         /* Extract the location */
3966                         yy = cy + dy;
3967                         xx = cx + dx;
3968
3969                         /* Skip unaffected grids */
3970                         if (!map[16+yy-cy][16+xx-cx]) continue;
3971
3972                         /* Access the cave grid */
3973                         c_ptr = &cave[yy][xx];
3974
3975                         /* Paranoia -- never affect player */
3976 /*                      if (player_bold(yy, xx)) continue; */
3977
3978                         /* Destroy location (if valid) */
3979                         if (cave_valid_bold(yy, xx))
3980                         {
3981                                 /* Delete objects */
3982                                 delete_object(yy, xx);
3983
3984                                 /* Wall (or floor) type */
3985                                 t = cave_have_flag_bold(yy, xx, FF_PROJECT) ? randint0(100) : 200;
3986
3987                                 /* Granite */
3988                                 if (t < 20)
3989                                 {
3990                                         /* Create granite wall */
3991                                         cave_set_feat(yy, xx, feat_granite);
3992                                 }
3993
3994                                 /* Quartz */
3995                                 else if (t < 70)
3996                                 {
3997                                         /* Create quartz vein */
3998                                         cave_set_feat(yy, xx, feat_quartz_vein);
3999                                 }
4000
4001                                 /* Magma */
4002                                 else if (t < 100)
4003                                 {
4004                                         /* Create magma vein */
4005                                         cave_set_feat(yy, xx, feat_magma_vein);
4006                                 }
4007
4008                                 /* Floor */
4009                                 else
4010                                 {
4011                                         /* Create floor */
4012                                         cave_set_feat(yy, xx, floor_type[randint0(100)]);
4013                                 }
4014                         }
4015                 }
4016         }
4017
4018
4019         /* Process "re-glowing" */
4020         for (dy = -r; dy <= r; dy++)
4021         {
4022                 for (dx = -r; dx <= r; dx++)
4023                 {
4024                         /* Extract the location */
4025                         yy = cy + dy;
4026                         xx = cx + dx;
4027
4028                         /* Skip illegal grids */
4029                         if (!in_bounds(yy, xx)) continue;
4030
4031                         /* Skip distant grids */
4032                         if (distance(cy, cx, yy, xx) > r) continue;
4033
4034                         /* Access the grid */
4035                         c_ptr = &cave[yy][xx];
4036
4037                         if (is_mirror_grid(c_ptr)) c_ptr->info |= CAVE_GLOW;
4038                         else if (!(d_info[dungeon_type].flags1 & DF1_DARKNESS))
4039                         {
4040                                 int ii, yyy, xxx;
4041                                 cave_type *cc_ptr;
4042
4043                                 for (ii = 0; ii < 9; ii++)
4044                                 {
4045                                         yyy = yy + ddy_ddd[ii];
4046                                         xxx = xx + ddx_ddd[ii];
4047                                         if (!in_bounds2(yyy, xxx)) continue;
4048                                         cc_ptr = &cave[yyy][xxx];
4049                                         if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
4050                                         {
4051                                                 c_ptr->info |= CAVE_GLOW;
4052                                                 break;
4053                                         }
4054                                 }
4055                         }
4056                 }
4057         }
4058
4059
4060         /* Mega-Hack -- Forget the view and lite */
4061         p_ptr->update |= (PU_UN_VIEW | PU_UN_LITE);
4062
4063         /* Update stuff */
4064         p_ptr->update |= (PU_VIEW | PU_LITE | PU_FLOW | PU_MON_LITE | PU_MONSTERS);
4065
4066         /* Update the health bar */
4067         p_ptr->redraw |= (PR_HEALTH | PR_UHEALTH);
4068
4069         /* Redraw map */
4070         p_ptr->redraw |= (PR_MAP);
4071
4072         /* Window stuff */
4073         p_ptr->window |= (PW_OVERHEAD | PW_DUNGEON);
4074
4075         if (p_ptr->special_defense & NINJA_S_STEALTH)
4076         {
4077                 if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
4078         }
4079
4080         /* Success */
4081         return (TRUE);
4082 }
4083
4084 /*!
4085  * @brief 地震処理(プレイヤーの中心発動) /
4086  * Induce an "earthquake" of the given radius at the given location.
4087  * @return 効力があった場合TRUEを返す
4088  * @param cy 中心Y座標
4089  * @param cx 中心X座標
4090  * @param r 効果半径
4091  */
4092 bool earthquake(int cy, int cx, int r)
4093 {
4094         return earthquake_aux(cy, cx, r, 0);
4095 }
4096
4097 /*!
4098  * @brief ペット爆破処理 /
4099  * @return なし
4100  */
4101 void discharge_minion(void)
4102 {
4103         int i;
4104         bool okay = TRUE;
4105
4106         for (i = 1; i < m_max; i++)
4107         {
4108                 monster_type *m_ptr = &m_list[i];
4109                 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
4110                 if (m_ptr->nickname) okay = FALSE;
4111         }
4112         if (!okay || p_ptr->riding)
4113         {
4114                 if (!get_check(_("本当に全ペットを爆破しますか?", "You will blast all pets. Are you sure? ")))
4115                         return;
4116         }
4117         for (i = 1; i < m_max; i++)
4118         {
4119                 int dam;
4120                 monster_type *m_ptr = &m_list[i];
4121                 monster_race *r_ptr;
4122
4123                 if (!m_ptr->r_idx || !is_pet(m_ptr)) continue;
4124                 r_ptr = &r_info[m_ptr->r_idx];
4125
4126                 /* Uniques resist discharging */
4127                 if (r_ptr->flags1 & RF1_UNIQUE)
4128                 {
4129                         char m_name[80];
4130                         monster_desc(m_name, m_ptr, 0x00);
4131                         msg_format(_("%sは爆破されるのを嫌がり、勝手に自分の世界へと帰った。", "%^s resists to be blasted, and run away."), m_name);
4132                         delete_monster_idx(i);
4133                         continue;
4134                 }
4135                 dam = m_ptr->maxhp / 2;
4136                 if (dam > 100) dam = (dam-100)/2 + 100;
4137                 if (dam > 400) dam = (dam-400)/2 + 400;
4138                 if (dam > 800) dam = 800;
4139                 project(i, 2+(r_ptr->level/20), m_ptr->fy,
4140                         m_ptr->fx, dam, GF_PLASMA, 
4141                         PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL, -1);
4142
4143                 if (record_named_pet && m_ptr->nickname)
4144                 {
4145                         char m_name[80];
4146
4147                         monster_desc(m_name, m_ptr, MD_INDEF_VISIBLE);
4148                         do_cmd_write_nikki(NIKKI_NAMED_PET, RECORD_NAMED_PET_BLAST, m_name);
4149                 }
4150
4151                 delete_monster_idx(i);
4152         }
4153 }
4154
4155
4156 /*!
4157  * @brief 部屋全体を照らすサブルーチン
4158  * @return なし
4159  * @details
4160  * <pre>
4161  * This routine clears the entire "temp" set.
4162  * This routine will Perma-Lite all "temp" grids.
4163  * This routine is used (only) by "lite_room()"
4164  * Dark grids are illuminated.
4165  * Also, process all affected monsters.
4166  *
4167  * SMART monsters always wake up when illuminated
4168  * NORMAL monsters wake up 1/4 the time when illuminated
4169  * STUPID monsters wake up 1/10 the time when illuminated
4170  * </pre>
4171  */
4172 static void cave_temp_room_lite(void)
4173 {
4174         int i;
4175
4176         /* Clear them all */
4177         for (i = 0; i < temp_n; i++)
4178         {
4179                 int y = temp_y[i];
4180                 int x = temp_x[i];
4181
4182                 cave_type *c_ptr = &cave[y][x];
4183
4184                 /* No longer in the array */
4185                 c_ptr->info &= ~(CAVE_TEMP);
4186
4187                 /* Update only non-CAVE_GLOW grids */
4188                 /* if (c_ptr->info & (CAVE_GLOW)) continue; */
4189
4190                 /* Perma-Lite */
4191                 c_ptr->info |= (CAVE_GLOW);
4192
4193                 /* Process affected monsters */
4194                 if (c_ptr->m_idx)
4195                 {
4196                         int chance = 25;
4197
4198                         monster_type    *m_ptr = &m_list[c_ptr->m_idx];
4199
4200                         monster_race    *r_ptr = &r_info[m_ptr->r_idx];
4201
4202                         /* Update the monster */
4203                         update_mon(c_ptr->m_idx, FALSE);
4204
4205                         /* Stupid monsters rarely wake up */
4206                         if (r_ptr->flags2 & (RF2_STUPID)) chance = 10;
4207
4208                         /* Smart monsters always wake up */
4209                         if (r_ptr->flags2 & (RF2_SMART)) chance = 100;
4210
4211                         /* Sometimes monsters wake up */
4212                         if (MON_CSLEEP(m_ptr) && (randint0(100) < chance))
4213                         {
4214                                 /* Wake up! */
4215                                 (void)set_monster_csleep(c_ptr->m_idx, 0);
4216
4217                                 /* Notice the "waking up" */
4218                                 if (m_ptr->ml)
4219                                 {
4220                                         char m_name[80];
4221
4222                                         /* Acquire the monster name */
4223                                         monster_desc(m_name, m_ptr, 0);
4224
4225                                         /* Dump a message */
4226                                         msg_format(_("%^sが目を覚ました。", "%^s wakes up."), m_name);
4227                                 }
4228                         }
4229                 }
4230
4231                 /* Note */
4232                 note_spot(y, x);
4233
4234                 /* Redraw */
4235                 lite_spot(y, x);
4236
4237                 update_local_illumination(y, x);
4238         }
4239
4240         /* None left */
4241         temp_n = 0;
4242 }
4243
4244
4245
4246 /*!
4247  * @brief 部屋全体を暗くするサブルーチン
4248  * @return なし
4249  * @details
4250  * <pre>
4251  * This routine clears the entire "temp" set.
4252  * This routine will "darken" all "temp" grids.
4253  * In addition, some of these grids will be "unmarked".
4254  * This routine is used (only) by "unlite_room()"
4255  * Also, process all affected monsters
4256  * </pre>
4257  */
4258 static void cave_temp_room_unlite(void)
4259 {
4260         int i;
4261
4262         /* Clear them all */
4263         for (i = 0; i < temp_n; i++)
4264         {
4265                 int y = temp_y[i];
4266                 int x = temp_x[i];
4267                 int j;
4268
4269                 cave_type *c_ptr = &cave[y][x];
4270                 bool do_dark = !is_mirror_grid(c_ptr);
4271
4272                 /* No longer in the array */
4273                 c_ptr->info &= ~(CAVE_TEMP);
4274
4275                 /* Darken the grid */
4276                 if (do_dark)
4277                 {
4278                         if (dun_level || !is_daytime())
4279                         {
4280                                 for (j = 0; j < 9; j++)
4281                                 {
4282                                         int by = y + ddy_ddd[j];
4283                                         int bx = x + ddx_ddd[j];
4284
4285                                         if (in_bounds2(by, bx))
4286                                         {
4287                                                 cave_type *cc_ptr = &cave[by][bx];
4288
4289                                                 if (have_flag(f_info[get_feat_mimic(cc_ptr)].flags, FF_GLOW))
4290                                                 {
4291                                                         do_dark = FALSE;
4292                                                         break;
4293                                                 }
4294                                         }
4295                                 }
4296
4297                                 if (!do_dark) continue;
4298                         }
4299
4300                         c_ptr->info &= ~(CAVE_GLOW);
4301
4302                         /* Hack -- Forget "boring" grids */
4303                         if (!have_flag(f_info[get_feat_mimic(c_ptr)].flags, FF_REMEMBER))
4304                         {
4305                                 /* Forget the grid */
4306                                 if (!view_torch_grids) c_ptr->info &= ~(CAVE_MARK);
4307
4308                                 /* Notice */
4309                                 note_spot(y, x);
4310                         }
4311
4312                         /* Process affected monsters */
4313                         if (c_ptr->m_idx)
4314                         {
4315                                 /* Update the monster */
4316                                 update_mon(c_ptr->m_idx, FALSE);
4317                         }
4318
4319                         /* Redraw */
4320                         lite_spot(y, x);
4321
4322                         update_local_illumination(y, x);
4323                 }
4324         }
4325
4326         /* None left */
4327         temp_n = 0;
4328 }
4329
4330
4331 /*!
4332  * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
4333  * @param cy Y座標
4334  * @param cx X座標
4335  * @param pass_bold 地形条件を返す関数ポインタ
4336  * @return 該当地形の数
4337  */
4338 static int next_to_open(int cy, int cx, bool (*pass_bold)(int, int))
4339 {
4340         int i;
4341
4342         int y, x;
4343
4344         int len = 0;
4345         int blen = 0;
4346
4347         for (i = 0; i < 16; i++)
4348         {
4349                 y = cy + ddy_cdd[i % 8];
4350                 x = cx + ddx_cdd[i % 8];
4351
4352                 /* Found a wall, break the length */
4353                 if (!pass_bold(y, x))
4354                 {
4355                         /* Track best length */
4356                         if (len > blen)
4357                         {
4358                                 blen = len;
4359                         }
4360
4361                         len = 0;
4362                 }
4363                 else
4364                 {
4365                         len++;
4366                 }
4367         }
4368
4369         return (MAX(len, blen));
4370 }
4371
4372 /*!
4373  * @brief 周辺に関数ポインタの条件に該当する地形がいくつあるかを計算する / Determine how much contiguous open space this grid is next to
4374  * @param cy Y座標
4375  * @param cx X座標
4376  * @param pass_bold 地形条件を返す関数ポインタ
4377  * @return 該当地形の数
4378  */
4379 static int next_to_walls_adj(int cy, int cx, bool (*pass_bold)(int, int))
4380 {
4381         int i;
4382
4383         int y, x;
4384
4385         int c = 0;
4386
4387         for (i = 0; i < 8; i++)
4388         {
4389                 y = cy + ddy_ddd[i];
4390                 x = cx + ddx_ddd[i];
4391
4392                 if (!pass_bold(y, x)) c++;
4393         }
4394
4395         return c;
4396 }
4397
4398
4399 /*!
4400  * @brief 部屋内にある一点の周囲に該当する地形数かいくつあるかをグローバル変数temp_nに返す / Aux function -- see below
4401  * @param y 部屋内のy座標1点
4402  * @param x 部屋内のx座標1点
4403  * @param only_room 部屋内地形のみをチェック対象にするならば TRUE
4404  * @param pass_bold 地形条件を返す関数ポインタ
4405  * @return 該当地形の数
4406  */
4407 static void cave_temp_room_aux(int y, int x, bool only_room, bool (*pass_bold)(int, int))
4408 {
4409         cave_type *c_ptr;
4410
4411         /* Get the grid */
4412         c_ptr = &cave[y][x];
4413
4414         /* Avoid infinite recursion */
4415         if (c_ptr->info & (CAVE_TEMP)) return;
4416
4417         /* Do not "leave" the current room */
4418         if (!(c_ptr->info & (CAVE_ROOM)))
4419         {
4420                 if (only_room) return;
4421
4422                 /* Verify */
4423                 if (!in_bounds2(y, x)) return;
4424
4425                 /* Do not exceed the maximum spell range */
4426                 if (distance(p_ptr->y, p_ptr->x, y, x) > MAX_RANGE) return;
4427
4428                 /* Verify this grid */
4429                 /*
4430                  * The reason why it is ==6 instead of >5 is that 8 is impossible
4431                  * due to the check for cave_bold above.
4432                  * 7 lights dead-end corridors (you need to do this for the
4433                  * checkboard interesting rooms, so that the boundary is lit
4434                  * properly.
4435                  * This leaves only a check for 6 bounding walls!
4436                  */
4437                 if (in_bounds(y, x) && pass_bold(y, x) &&
4438                     (next_to_walls_adj(y, x, pass_bold) == 6) && (next_to_open(y, x, pass_bold) <= 1)) return;
4439         }
4440
4441         /* Paranoia -- verify space */
4442         if (temp_n == TEMP_MAX) return;
4443
4444         /* Mark the grid as "seen" */
4445         c_ptr->info |= (CAVE_TEMP);
4446
4447         /* Add it to the "seen" set */
4448         temp_y[temp_n] = y;
4449         temp_x[temp_n] = x;
4450         temp_n++;
4451 }
4452
4453 /*!
4454  * @brief 指定のマスが光を通すか(LOSフラグを持つか)を返す。 / Aux function -- see below
4455  * @param y 指定Y座標
4456  * @param x 指定X座標
4457  * @return 光を通すならばtrueを返す。
4458  */
4459 static bool cave_pass_lite_bold(int y, int x)
4460 {
4461         return cave_los_bold(y, x);
4462 }
4463
4464 /*!
4465  * @brief 部屋内にある一点の周囲がいくつ光を通すかをグローバル変数temp_nに返す / Aux function -- see below
4466  * @param y 指定Y座標
4467  * @param x 指定X座標
4468  * @return なし
4469  */
4470 static void cave_temp_lite_room_aux(int y, int x)
4471 {
4472         cave_temp_room_aux(y, x, FALSE, cave_pass_lite_bold);
4473 }
4474
4475 /*!
4476  * @brief 指定のマスが光を通さず射線のみを通すかを返す。 / Aux function -- see below
4477  * @param y 指定Y座標
4478  * @param x 指定X座標
4479  * @return 射線を通すならばtrueを返す。
4480  */
4481 static bool cave_pass_dark_bold(int y, int x)
4482 {
4483         return cave_have_flag_bold(y, x, FF_PROJECT);
4484 }
4485
4486
4487 /*!
4488  * @brief 部屋内にある一点の周囲がいくつ射線を通すかをグローバル変数temp_nに返す / Aux function -- see below
4489  * @param y 指定Y座標
4490  * @param x 指定X座標
4491  * @return なし
4492  */
4493 static void cave_temp_unlite_room_aux(int y, int x)
4494 {
4495         cave_temp_room_aux(y, x, TRUE, cave_pass_dark_bold);
4496 }
4497
4498
4499 /*!
4500  * @brief 指定された部屋内を照らす / Illuminate any room containing the given location.
4501  * @param y1 指定Y座標
4502  * @param x1 指定X座標
4503  * @return なし
4504  */
4505 void lite_room(int y1, int x1)
4506 {
4507         int i, x, y;
4508
4509         /* Add the initial grid */
4510         cave_temp_lite_room_aux(y1, x1);
4511
4512         /* While grids are in the queue, add their neighbors */
4513         for (i = 0; i < temp_n; i++)
4514         {
4515                 x = temp_x[i], y = temp_y[i];
4516
4517                 /* Walls get lit, but stop light */
4518                 if (!cave_pass_lite_bold(y, x)) continue;
4519
4520                 /* Spread adjacent */
4521                 cave_temp_lite_room_aux(y + 1, x);
4522                 cave_temp_lite_room_aux(y - 1, x);
4523                 cave_temp_lite_room_aux(y, x + 1);
4524                 cave_temp_lite_room_aux(y, x - 1);
4525
4526                 /* Spread diagonal */
4527                 cave_temp_lite_room_aux(y + 1, x + 1);
4528                 cave_temp_lite_room_aux(y - 1, x - 1);
4529                 cave_temp_lite_room_aux(y - 1, x + 1);
4530                 cave_temp_lite_room_aux(y + 1, x - 1);
4531         }
4532
4533         /* Now, lite them all up at once */
4534         cave_temp_room_lite();
4535
4536         if (p_ptr->special_defense & NINJA_S_STEALTH)
4537         {
4538                 if (cave[p_ptr->y][p_ptr->x].info & CAVE_GLOW) set_superstealth(FALSE);
4539         }
4540 }
4541
4542
4543 /*!
4544  * @brief 指定された部屋内を暗くする / Darken all rooms containing the given location
4545  * @param y1 指定Y座標
4546  * @param x1 指定X座標
4547  * @return なし
4548  */
4549 void unlite_room(int y1, int x1)
4550 {
4551         int i, x, y;
4552
4553         /* Add the initial grid */
4554         cave_temp_unlite_room_aux(y1, x1);
4555
4556         /* Spread, breadth first */
4557         for (i = 0; i < temp_n; i++)
4558         {
4559                 x = temp_x[i], y = temp_y[i];
4560
4561                 /* Walls get dark, but stop darkness */
4562                 if (!cave_pass_dark_bold(y, x)) continue;
4563
4564                 /* Spread adjacent */
4565                 cave_temp_unlite_room_aux(y + 1, x);
4566                 cave_temp_unlite_room_aux(y - 1, x);
4567                 cave_temp_unlite_room_aux(y, x + 1);
4568                 cave_temp_unlite_room_aux(y, x - 1);
4569
4570                 /* Spread diagonal */
4571                 cave_temp_unlite_room_aux(y + 1, x + 1);
4572                 cave_temp_unlite_room_aux(y - 1, x - 1);
4573                 cave_temp_unlite_room_aux(y - 1, x + 1);
4574                 cave_temp_unlite_room_aux(y + 1, x - 1);
4575         }
4576
4577         /* Now, darken them all at once */
4578         cave_temp_room_unlite();
4579 }
4580
4581
4582
4583 /*!
4584  * @brief プレイヤー位置を中心にLITE_WEAK属性を通じた照明処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
4585  * @param dam 威力
4586  * @param rad 効果半径
4587  * @return 作用が実際にあった場合TRUEを返す
4588  */
4589 bool lite_area(int dam, int rad)
4590 {
4591         int flg = PROJECT_GRID | PROJECT_KILL;
4592
4593         if (d_info[dungeon_type].flags1 & DF1_DARKNESS)
4594         {
4595                 msg_print(_("ダンジョンが光を吸収した。", "The darkness of this dungeon absorb your light."));
4596                 return FALSE;
4597         }
4598
4599         /* Hack -- Message */
4600         if (!p_ptr->blind)
4601         {
4602                 msg_print(_("白い光が辺りを覆った。", "You are surrounded by a white light."));
4603         }
4604
4605         /* Hook into the "project()" function */
4606         (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_LITE_WEAK, flg, -1);
4607
4608         /* Lite up the room */
4609         lite_room(p_ptr->y, p_ptr->x);
4610
4611         /* Assume seen */
4612         return (TRUE);
4613 }
4614
4615
4616 /*!
4617  * @brief プレイヤー位置を中心にLITE_DARK属性を通じた消灯処理を行う / Hack -- call light around the player Affect all monsters in the projection radius
4618  * @param dam 威力
4619  * @param rad 効果半径
4620  * @return 作用が実際にあった場合TRUEを返す
4621  */
4622 bool unlite_area(int dam, int rad)
4623 {
4624         int flg = PROJECT_GRID | PROJECT_KILL;
4625
4626         /* Hack -- Message */
4627         if (!p_ptr->blind)
4628         {
4629                 msg_print(_("暗闇が辺りを覆った。", "Darkness surrounds you."));
4630         }
4631
4632         /* Hook into the "project()" function */
4633         (void)project(0, rad, p_ptr->y, p_ptr->x, dam, GF_DARK_WEAK, flg, -1);
4634
4635         /* Lite up the room */
4636         unlite_room(p_ptr->y, p_ptr->x);
4637
4638         /* Assume seen */
4639         return (TRUE);
4640 }
4641
4642
4643
4644 /*!
4645  * @brief ボール系スペルの発動 / Cast a ball spell
4646  * @param typ 効果属性
4647  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4648  * @param dam 威力
4649  * @param rad 半径
4650  * @return 作用が実際にあった場合TRUEを返す
4651  * @details
4652  * <pre>
4653  * Stop if we hit a monster, act as a "ball"
4654  * Allow "target" mode to pass over monsters
4655  * Affect grids, objects, and monsters
4656  * </pre>
4657  */
4658 bool fire_ball(int typ, int dir, int dam, int rad)
4659 {
4660         int tx, ty;
4661
4662         int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
4663
4664         if (typ == GF_CONTROL_LIVING) flg|= PROJECT_HIDE;
4665         /* Use the given direction */
4666         tx = p_ptr->x + 99 * ddx[dir];
4667         ty = p_ptr->y + 99 * ddy[dir];
4668
4669         /* Hack -- Use an actual "target" */
4670         if ((dir == 5) && target_okay())
4671         {
4672                 flg &= ~(PROJECT_STOP);
4673                 tx = target_col;
4674                 ty = target_row;
4675         }
4676
4677         /* Analyze the "dir" and the "target".  Hurt items on floor. */
4678         return (project(0, rad, ty, tx, dam, typ, flg, -1));
4679 }
4680
4681
4682
4683 /*!
4684  * @brief ロケット系スペルの発動(詳細な差は確認中) / Cast a ball spell
4685  * @param typ 効果属性
4686  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4687  * @param dam 威力
4688  * @param rad 半径
4689  * @return 作用が実際にあった場合TRUEを返す
4690  * @details
4691  * <pre>
4692  * Stop if we hit a monster, act as a "ball"
4693  * Allow "target" mode to pass over monsters
4694  * Affect grids, objects, and monsters
4695  * </pre>
4696  */
4697 bool fire_rocket(int typ, int dir, int dam, int rad)
4698 {
4699         int tx, ty;
4700
4701         int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
4702
4703         /* Use the given direction */
4704         tx = p_ptr->x + 99 * ddx[dir];
4705         ty = p_ptr->y + 99 * ddy[dir];
4706
4707         /* Hack -- Use an actual "target" */
4708         if ((dir == 5) && target_okay())
4709         {
4710                 tx = target_col;
4711                 ty = target_row;
4712         }
4713
4714         /* Analyze the "dir" and the "target".  Hurt items on floor. */
4715         return (project(0, rad, ty, tx, dam, typ, flg, -1));
4716 }
4717
4718
4719 /*!
4720  * @brief ボール(ハイド)系スペルの発動 / Cast a ball spell
4721  * @param typ 効果属性
4722  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4723  * @param dam 威力
4724  * @param rad 半径
4725  * @return 作用が実際にあった場合TRUEを返す
4726  * @details
4727  * <pre>
4728  * Stop if we hit a monster, act as a "ball"
4729  * Allow "target" mode to pass over monsters
4730  * Affect grids, objects, and monsters
4731  * </pre>
4732  */
4733 bool fire_ball_hide(int typ, int dir, int dam, int rad)
4734 {
4735         int tx, ty;
4736
4737         int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_HIDE;
4738
4739         /* Use the given direction */
4740         tx = p_ptr->x + 99 * ddx[dir];
4741         ty = p_ptr->y + 99 * ddy[dir];
4742
4743         /* Hack -- Use an actual "target" */
4744         if ((dir == 5) && target_okay())
4745         {
4746                 flg &= ~(PROJECT_STOP);
4747                 tx = target_col;
4748                 ty = target_row;
4749         }
4750
4751         /* Analyze the "dir" and the "target".  Hurt items on floor. */
4752         return (project(0, rad, ty, tx, dam, typ, flg, -1));
4753 }
4754
4755
4756 /*!
4757  * @brief メテオ系スペルの発動 / Cast a meteor spell
4758  * @param who スぺル詠唱者のモンスターID(0=プレイヤー)
4759  * @param typ 効果属性
4760  * @param dam 威力
4761  * @param rad 半径
4762  * @param y 中心点Y座標
4763  * @param x 中心点X座標
4764  * @return 作用が実際にあった場合TRUEを返す
4765  * @details
4766  * <pre>
4767  * Cast a meteor spell, defined as a ball spell cast by an arbitary monster, 
4768  * player, or outside source, that starts out at an arbitrary location, and 
4769  * leaving no trail from the "caster" to the target.  This function is 
4770  * especially useful for bombardments and similar. -LM-
4771  * Option to hurt the player.
4772  * </pre>
4773  */
4774 bool fire_meteor(int who, int typ, int y, int x, int dam, int rad)
4775 {
4776         int flg = PROJECT_STOP | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
4777
4778         /* Analyze the "target" and the caster. */
4779         return (project(who, rad, y, x, dam, typ, flg, -1));
4780 }
4781
4782
4783 /*!
4784  * @brief ブラスト系スペルの発動 / Cast a blast spell
4785  * @param typ 効果属性
4786  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4787  * @param dd 威力ダイス数
4788  * @param ds 威力ダイス目
4789  * @param num 基本回数
4790  * @param dev 回数分散
4791  * @return 作用が実際にあった場合TRUEを返す
4792  */
4793 bool fire_blast(int typ, int dir, int dd, int ds, int num, int dev)
4794 {
4795         int ly, lx, ld;
4796         int ty, tx, y, x;
4797         int i;
4798
4799         int flg = PROJECT_FAST | PROJECT_THRU | PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE | PROJECT_GRID;
4800
4801         /* Assume okay */
4802         bool result = TRUE;
4803
4804         /* Use the given direction */
4805         if (dir != 5)
4806         {
4807                 ly = ty = p_ptr->y + 20 * ddy[dir];
4808                 lx = tx = p_ptr->x + 20 * ddx[dir];
4809         }
4810
4811         /* Use an actual "target" */
4812         else /* if (dir == 5) */
4813         {
4814                 tx = target_col;
4815                 ty = target_row;
4816
4817                 lx = 20 * (tx - p_ptr->x) + p_ptr->x;
4818                 ly = 20 * (ty - p_ptr->y) + p_ptr->y;
4819         }
4820
4821         ld = distance(p_ptr->y, p_ptr->x, ly, lx);
4822
4823         /* Blast */
4824         for (i = 0; i < num; i++)
4825         {
4826                 while (1)
4827                 {
4828                         /* Get targets for some bolts */
4829                         y = rand_spread(ly, ld * dev / 20);
4830                         x = rand_spread(lx, ld * dev / 20);
4831
4832                         if (distance(ly, lx, y, x) <= ld * dev / 20) break;
4833                 }
4834
4835                 /* Analyze the "dir" and the "target". */
4836                 if (!project(0, 0, y, x, damroll(dd, ds), typ, flg, -1))
4837                 {
4838                         result = FALSE;
4839                 }
4840         }
4841
4842         return (result);
4843 }
4844
4845
4846 /*!
4847  * @brief モンスターとの位置交換処理 / Switch position with a monster.
4848  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4849  * @return 作用が実際にあった場合TRUEを返す
4850  */
4851 bool teleport_swap(int dir)
4852 {
4853         int tx, ty;
4854         cave_type * c_ptr;
4855         monster_type * m_ptr;
4856         monster_race * r_ptr;
4857
4858         if ((dir == 5) && target_okay())
4859         {
4860                 tx = target_col;
4861                 ty = target_row;
4862         }
4863         else
4864         {
4865                 tx = p_ptr->x + ddx[dir];
4866                 ty = p_ptr->y + ddy[dir];
4867         }
4868         c_ptr = &cave[ty][tx];
4869
4870         if (p_ptr->anti_tele)
4871         {
4872                 msg_print(_("不思議な力がテレポートを防いだ!", "A mysterious force prevents you from teleporting!"));
4873                 return FALSE;
4874         }
4875
4876         if (!c_ptr->m_idx || (c_ptr->m_idx == p_ptr->riding))
4877         {
4878                 msg_print(_("それとは場所を交換できません。", "You can't trade places with that!"));
4879
4880                 /* Failure */
4881                 return FALSE;
4882         }
4883
4884         if ((c_ptr->info & CAVE_ICKY) || (distance(ty, tx, p_ptr->y, p_ptr->x) > p_ptr->lev * 3 / 2 + 10))
4885         {
4886                 msg_print(_("失敗した。", "Failed to swap."));
4887
4888                 /* Failure */
4889                 return FALSE;
4890         }
4891
4892         m_ptr = &m_list[c_ptr->m_idx];
4893         r_ptr = &r_info[m_ptr->r_idx];
4894
4895         (void)set_monster_csleep(c_ptr->m_idx, 0);
4896
4897         if (r_ptr->flagsr & RFR_RES_TELE)
4898         {
4899                 msg_print(_("テレポートを邪魔された!", "Your teleportation is blocked!"));
4900
4901                 if (is_original_ap_and_seen(m_ptr)) r_ptr->r_flagsr |= RFR_RES_TELE;
4902
4903                 /* Failure */
4904                 return FALSE;
4905         }
4906
4907         sound(SOUND_TELEPORT);
4908
4909         /* Swap the player and monster */
4910         (void)move_player_effect(ty, tx, MPE_FORGET_FLOW | MPE_HANDLE_STUFF | MPE_DONT_PICKUP);
4911
4912         /* Success */
4913         return TRUE;
4914 }
4915
4916
4917 /*!
4918  * @brief 指定方向に飛び道具を飛ばす(フラグ任意指定) / Hack -- apply a "projection()" in a direction (or at the target)
4919  * @param typ 効果属性
4920  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4921  * @param dam 威力
4922  * @param flg フラグ
4923  * @return 作用が実際にあった場合TRUEを返す
4924  */
4925 bool project_hook(int typ, int dir, int dam, int flg)
4926 {
4927         int tx, ty;
4928
4929         /* Pass through the target if needed */
4930         flg |= (PROJECT_THRU);
4931
4932         /* Use the given direction */
4933         tx = p_ptr->x + ddx[dir];
4934         ty = p_ptr->y + ddy[dir];
4935
4936         /* Hack -- Use an actual "target" */
4937         if ((dir == 5) && target_okay())
4938         {
4939                 tx = target_col;
4940                 ty = target_row;
4941         }
4942
4943         /* Analyze the "dir" and the "target", do NOT explode */
4944         return (project(0, 0, ty, tx, dam, typ, flg, -1));
4945 }
4946
4947
4948 /*!
4949  * @brief ボルト系スペルの発動 / Cast a bolt spell.
4950  * @param typ 効果属性
4951  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4952  * @param dam 威力
4953  * @return 作用が実際にあった場合TRUEを返す
4954  * @details
4955  * <pre>
4956  * Stop if we hit a monster, as a "bolt".
4957  * Affect monsters and grids (not objects).
4958  * </pre>
4959  */
4960 bool fire_bolt(int typ, int dir, int dam)
4961 {
4962         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_GRID;
4963         if (typ != GF_ARROW) flg |= PROJECT_REFLECTABLE;
4964         return (project_hook(typ, dir, dam, flg));
4965 }
4966
4967
4968 /*!
4969  * @brief ビーム系スペルの発動 / Cast a beam spell.
4970  * @param typ 効果属性
4971  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4972  * @param dam 威力
4973  * @return 作用が実際にあった場合TRUEを返す
4974  * @details
4975  * <pre>
4976  * Pass through monsters, as a "beam".
4977  * Affect monsters, grids and objects.
4978  * </pre>
4979  */
4980 bool fire_beam(int typ, int dir, int dam)
4981 {
4982         int flg = PROJECT_BEAM | PROJECT_KILL | PROJECT_GRID | PROJECT_ITEM;
4983         return (project_hook(typ, dir, dam, flg));
4984 }
4985
4986
4987 /*!
4988  * @brief 確率に応じたボルト系/ビーム系スペルの発動 / Cast a bolt spell, or rarely, a beam spell.
4989  * @param prob ビーム化する確率(%)
4990  * @param typ 効果属性
4991  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
4992  * @param dam 威力
4993  * @return 作用が実際にあった場合TRUEを返す
4994  * @details
4995  * <pre>
4996  * Pass through monsters, as a "beam".
4997  * Affect monsters, grids and objects.
4998  * </pre>
4999  */
5000 bool fire_bolt_or_beam(int prob, int typ, int dir, int dam)
5001 {
5002         if (randint0(100) < prob)
5003         {
5004                 return (fire_beam(typ, dir, dam));
5005         }
5006         else
5007         {
5008                 return (fire_bolt(typ, dir, dam));
5009         }
5010 }
5011
5012 /*!
5013  * @brief LITE_WEAK属性による光源ビーム処理
5014  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5015  * @param dam 威力
5016  * @return 作用が実際にあった場合TRUEを返す
5017  */
5018 bool lite_line(int dir, int dam)
5019 {
5020         int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_KILL;
5021         return (project_hook(GF_LITE_WEAK, dir, dam, flg));
5022 }
5023
5024 /*!
5025  * @brief 吸血ボルト処理
5026  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5027  * @param dam 威力
5028  * @return 作用が実際にあった場合TRUEを返す
5029  */
5030 bool drain_life(int dir, int dam)
5031 {
5032         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5033         return (project_hook(GF_OLD_DRAIN, dir, dam, flg));
5034 }
5035
5036 /*!
5037  * @brief 岩石溶解処理
5038  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5039  * @param dam 威力
5040  * @return 作用が実際にあった場合TRUEを返す
5041  */
5042 bool wall_to_mud(int dir, int dam)
5043 {
5044         int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5045         return (project_hook(GF_KILL_WALL, dir, dam, flg));
5046 }
5047
5048 /*!
5049  * @brief 魔法の施錠処理
5050  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5051  * @return 作用が実際にあった場合TRUEを返す
5052  */
5053 bool wizard_lock(int dir)
5054 {
5055         int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL;
5056         return (project_hook(GF_JAM_DOOR, dir, 20 + randint1(30), flg));
5057 }
5058
5059 /*!
5060  * @brief ドア破壊処理
5061  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5062  * @return 作用が実際にあった場合TRUEを返す
5063  */
5064 bool destroy_door(int dir)
5065 {
5066         int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
5067         return (project_hook(GF_KILL_DOOR, dir, 0, flg));
5068 }
5069
5070 /*!
5071  * @brief トラップ解除処理
5072  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5073  * @return 作用が実際にあった場合TRUEを返す
5074  */
5075 bool disarm_trap(int dir)
5076 {
5077         int flg = PROJECT_BEAM | PROJECT_GRID | PROJECT_ITEM;
5078         return (project_hook(GF_KILL_TRAP, dir, 0, flg));
5079 }
5080
5081 /*!
5082  * @brief モンスター回復処理
5083  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5084  * @param dam 威力
5085  * @return 作用が実際にあった場合TRUEを返す
5086  */
5087 bool heal_monster(int dir, int dam)
5088 {
5089         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5090         return (project_hook(GF_OLD_HEAL, dir, dam, flg));
5091 }
5092
5093 /*!
5094  * @brief モンスター加速処理
5095  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5096  * @param power 効力
5097  * @return 作用が実際にあった場合TRUEを返す
5098  */
5099 bool speed_monster(int dir, int power)
5100 {
5101         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5102         return (project_hook(GF_OLD_SPEED, dir, power, flg));
5103 }
5104
5105 /*!
5106  * @brief モンスター減速処理
5107  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5108  * @param power 効力
5109  * @return 作用が実際にあった場合TRUEを返す
5110  */
5111 bool slow_monster(int dir, int power)
5112 {
5113         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5114         return (project_hook(GF_OLD_SLOW, dir, power, flg));
5115 }
5116
5117 /*!
5118  * @brief モンスター催眠処理
5119  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5120  * @param power 効力
5121  * @return 作用が実際にあった場合TRUEを返す
5122  */
5123 bool sleep_monster(int dir, int power)
5124 {
5125         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5126         return (project_hook(GF_OLD_SLEEP, dir, power, flg));
5127 }
5128
5129 /*!
5130  * @brief モンスター拘束(STASIS)処理
5131  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5132  * @return 作用が実際にあった場合TRUEを返す
5133  * @details 威力はプレイヤーレベル*2に固定
5134  */
5135 bool stasis_monster(int dir)
5136 {
5137         return (fire_ball_hide(GF_STASIS, dir, p_ptr->lev*2, 0));
5138 }
5139
5140 /*!
5141  * @brief 邪悪なモンスター拘束(STASIS)処理
5142  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5143  * @return 作用が実際にあった場合TRUEを返す
5144  * @details 威力はプレイヤーレベル*2に固定
5145  */
5146 bool stasis_evil(int dir)
5147 {
5148         return (fire_ball_hide(GF_STASIS_EVIL, dir, p_ptr->lev*2, 0));
5149 }
5150
5151 /*!
5152  * @brief モンスター混乱処理
5153  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5154  * @param plev プレイヤーレベル(=効力)
5155  * @return 作用が実際にあった場合TRUEを返す
5156  */
5157 bool confuse_monster(int dir, int plev)
5158 {
5159         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5160         return (project_hook(GF_OLD_CONF, dir, plev, flg));
5161 }
5162
5163 /*!
5164  * @brief モンスター朦朧処理
5165  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5166  * @param plev プレイヤーレベル(=効力)
5167  * @return 作用が実際にあった場合TRUEを返す
5168  */
5169 bool stun_monster(int dir, int plev)
5170 {
5171         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5172         return (project_hook(GF_STUN, dir, plev, flg));
5173 }
5174
5175 /*!
5176  * @brief チェンジモンスター処理
5177  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5178  * @param power 効力
5179  * @return 作用が実際にあった場合TRUEを返す
5180  */
5181 bool poly_monster(int dir, int power)
5182 {
5183         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5184         bool tester = (project_hook(GF_OLD_POLY, dir, power, flg));
5185         if (tester)
5186                 chg_virtue(V_CHANCE, 1);
5187         return(tester);
5188 }
5189
5190 /*!
5191  * @brief クローンモンスター処理
5192  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5193  * @return 作用が実際にあった場合TRUEを返す
5194  */
5195 bool clone_monster(int dir)
5196 {
5197         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5198         return (project_hook(GF_OLD_CLONE, dir, 0, flg));
5199 }
5200
5201 /*!
5202  * @brief モンスター恐慌処理
5203  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5204  * @param plev プレイヤーレベル(=効力)
5205  * @return 作用が実際にあった場合TRUEを返す
5206  */
5207 bool fear_monster(int dir, int plev)
5208 {
5209         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5210         return (project_hook(GF_TURN_ALL, dir, plev, flg));
5211 }
5212
5213 /*!
5214  * @brief 死の光線処理
5215  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5216  * @param plev プレイヤーレベル(効力はplev*200)
5217  * @return 作用が実際にあった場合TRUEを返す
5218  */
5219 bool death_ray(int dir, int plev)
5220 {
5221         int flg = PROJECT_STOP | PROJECT_KILL | PROJECT_REFLECTABLE;
5222         return (project_hook(GF_DEATH_RAY, dir, plev * 200, flg));
5223 }
5224
5225 /*!
5226  * @brief モンスター用テレポート処理
5227  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5228  * @param distance 移動距離
5229  * @return 作用が実際にあった場合TRUEを返す
5230  */
5231 bool teleport_monster(int dir, int distance)
5232 {
5233         int flg = PROJECT_BEAM | PROJECT_KILL;
5234         return (project_hook(GF_AWAY_ALL, dir, distance, flg));
5235 }
5236
5237 /*!
5238  * @brief ドア生成処理(プレイヤー中心に周囲1マス) / Hooks -- affect adjacent grids (radius 1 ball attack)
5239  * @return 作用が実際にあった場合TRUEを返す
5240  */
5241 bool door_creation(void)
5242 {
5243         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5244         return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_DOOR, flg, -1));
5245 }
5246
5247 /*!
5248  * @brief トラップ生成処理(起点から周囲1マス)
5249  * @param y 起点Y座標
5250  * @param x 起点X座標
5251  * @return 作用が実際にあった場合TRUEを返す
5252  */
5253 bool trap_creation(int y, int x)
5254 {
5255         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5256         return (project(0, 1, y, x, 0, GF_MAKE_TRAP, flg, -1));
5257 }
5258
5259 /*!
5260  * @brief 森林生成処理(プレイヤー中心に周囲1マス)
5261  * @return 作用が実際にあった場合TRUEを返す
5262  */
5263 bool tree_creation(void)
5264 {
5265         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5266         return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_TREE, flg, -1));
5267 }
5268
5269 /*!
5270  * @brief 魔法のルーン生成処理(プレイヤー中心に周囲1マス)
5271  * @return 作用が実際にあった場合TRUEを返す
5272  */
5273 bool glyph_creation(void)
5274 {
5275         int flg = PROJECT_GRID | PROJECT_ITEM;
5276         return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_MAKE_GLYPH, flg, -1));
5277 }
5278
5279 /*!
5280  * @brief 壁生成処理(プレイヤー中心に周囲1マス)
5281  * @return 作用が実際にあった場合TRUEを返す
5282  */
5283 bool wall_stone(void)
5284 {
5285         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5286
5287         bool dummy = (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_STONE_WALL, flg, -1));
5288
5289         /* Update stuff */
5290         p_ptr->update |= (PU_FLOW);
5291
5292         /* Redraw map */
5293         p_ptr->redraw |= (PR_MAP);
5294
5295         return dummy;
5296 }
5297
5298 /*!
5299  * @brief ドア破壊処理(プレイヤー中心に周囲1マス)
5300  * @return 作用が実際にあった場合TRUEを返す
5301  */
5302 bool destroy_doors_touch(void)
5303 {
5304         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5305         return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_DOOR, flg, -1));
5306 }
5307
5308 /*!
5309  * @brief トラップ解除処理(プレイヤー中心に周囲1マス)
5310  * @return 作用が実際にあった場合TRUEを返す
5311  */
5312 bool disarm_traps_touch(void)
5313 {
5314         int flg = PROJECT_GRID | PROJECT_ITEM | PROJECT_HIDE;
5315         return (project(0, 1, p_ptr->y, p_ptr->x, 0, GF_KILL_TRAP, flg, -1));
5316 }
5317
5318 /*!
5319  * @brief スリープモンスター処理(プレイヤー中心に周囲1マス)
5320  * @return 作用が実際にあった場合TRUEを返す
5321  */
5322 bool sleep_monsters_touch(void)
5323 {
5324         int flg = PROJECT_KILL | PROJECT_HIDE;
5325         return (project(0, 1, p_ptr->y, p_ptr->x, p_ptr->lev, GF_OLD_SLEEP, flg, -1));
5326 }
5327
5328
5329 /*!
5330  * @brief 死者復活処理(起点より周囲5マス)
5331  * @param who 術者モンスターID(0ならばプレイやー)
5332  * @param y 起点Y座標
5333  * @param x 起点X座標
5334  * @return 作用が実際にあった場合TRUEを返す
5335  */
5336 bool animate_dead(int who, int y, int x)
5337 {
5338         int flg = PROJECT_ITEM | PROJECT_HIDE;
5339         return (project(who, 5, y, x, 0, GF_ANIM_DEAD, flg, -1));
5340 }
5341
5342 /*!
5343  * @brief 混沌招来処理
5344  * @return 作用が実際にあった場合TRUEを返す
5345  */
5346 void call_chaos(void)
5347 {
5348         int Chaos_type, dummy, dir;
5349         int plev = p_ptr->lev;
5350         bool line_chaos = FALSE;
5351
5352         int hurt_types[31] =
5353         {
5354                 GF_ELEC,      GF_POIS,    GF_ACID,    GF_COLD,
5355                 GF_FIRE,      GF_MISSILE, GF_ARROW,   GF_PLASMA,
5356                 GF_HOLY_FIRE, GF_WATER,   GF_LITE,    GF_DARK,
5357                 GF_FORCE,     GF_INERTIAL, GF_MANA,    GF_METEOR,
5358                 GF_ICE,       GF_CHAOS,   GF_NETHER,  GF_DISENCHANT,
5359                 GF_SHARDS,    GF_SOUND,   GF_NEXUS,   GF_CONFUSION,
5360                 GF_TIME,      GF_GRAVITY, GF_ROCKET,  GF_NUKE,
5361                 GF_HELL_FIRE, GF_DISINTEGRATE, GF_PSY_SPEAR
5362         };
5363
5364         Chaos_type = hurt_types[randint0(31)];
5365         if (one_in_(4)) line_chaos = TRUE;
5366
5367         if (one_in_(6))
5368         {
5369                 for (dummy = 1; dummy < 10; dummy++)
5370                 {
5371                         if (dummy - 5)
5372                         {
5373                                 if (line_chaos)
5374                                         fire_beam(Chaos_type, dummy, 150);
5375                                 else
5376                                         fire_ball(Chaos_type, dummy, 150, 2);
5377                         }
5378                 }
5379         }
5380         else if (one_in_(3))
5381         {
5382                 fire_ball(Chaos_type, 0, 500, 8);
5383         }
5384         else
5385         {
5386                 if (!get_aim_dir(&dir)) return;
5387                 if (line_chaos)
5388                         fire_beam(Chaos_type, dir, 250);
5389                 else
5390                         fire_ball(Chaos_type, dir, 250, 3 + (plev / 35));
5391         }
5392 }
5393
5394 /*!
5395  * @brief TY_CURSE処理発動 / Activate the evil Topi Ylinen curse
5396  * @param stop_ty 再帰処理停止フラグ
5397  * @param count 発動回数
5398  * @return 作用が実際にあった場合TRUEを返す
5399  * @details
5400  * <pre>
5401  * rr9: Stop the nasty things when a Cyberdemon is summoned
5402  * or the player gets paralyzed.
5403  * </pre>
5404  */
5405 bool activate_ty_curse(bool stop_ty, int *count)
5406 {
5407         int     i = 0;
5408
5409         int flg = (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP);
5410
5411         do
5412         {
5413                 switch (randint1(34))
5414                 {
5415                 case 28: case 29:
5416                         if (!(*count))
5417                         {
5418                                 msg_print(_("地面が揺れた...", "The ground trembles..."));
5419                                 earthquake(p_ptr->y, p_ptr->x, 5 + randint0(10));
5420                                 if (!one_in_(6)) break;
5421                         }
5422                 case 30: case 31:
5423                         if (!(*count))
5424                         {
5425                                 int dam = damroll(10, 10);
5426                                 msg_print(_("純粋な魔力の次元への扉が開いた!", "A portal opens to a plane of raw mana!"));
5427                                 project(0, 8, p_ptr->y, p_ptr->x, dam, GF_MANA, flg, -1);
5428                                 take_hit(DAMAGE_NOESCAPE, dam, _("純粋な魔力の解放", "released pure mana"), -1);
5429                                 if (!one_in_(6)) break;
5430                         }
5431                 case 32: case 33:
5432                         if (!(*count))
5433                         {
5434                                 msg_print(_("周囲の空間が歪んだ!", "Space warps about you!"));
5435                                 teleport_player(damroll(10, 10), TELEPORT_PASSIVE);
5436                                 if (randint0(13)) (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
5437                                 if (!one_in_(6)) break;
5438                         }
5439                 case 34:
5440                         msg_print(_("エネルギーのうねりを感じた!", "You feel a surge of energy!"));
5441                         wall_breaker();
5442                         if (!randint0(7))
5443                         {
5444                                 project(0, 7, p_ptr->y, p_ptr->x, 50, GF_KILL_WALL, flg, -1);
5445                                 take_hit(DAMAGE_NOESCAPE, 50, _("エネルギーのうねり", "surge of energy"), -1);
5446                         }
5447                         if (!one_in_(6)) break;
5448                 case 1: case 2: case 3: case 16: case 17:
5449                         aggravate_monsters(0);
5450                         if (!one_in_(6)) break;
5451                 case 4: case 5: case 6:
5452                         (*count) += activate_hi_summon(p_ptr->y, p_ptr->x, FALSE);
5453                         if (!one_in_(6)) break;
5454                 case 7: case 8: case 9: case 18:
5455                         (*count) += summon_specific(0, p_ptr->y, p_ptr->x, dun_level, 0, (PM_ALLOW_GROUP | PM_ALLOW_UNIQUE | PM_NO_PET));
5456                         if (!one_in_(6)) break;
5457                 case 10: case 11: case 12:
5458                         msg_print(_("経験値が体から吸い取られた気がする!", "You feel your experience draining away..."));
5459                         lose_exp(p_ptr->exp / 16);
5460                         if (!one_in_(6)) break;
5461                 case 13: case 14: case 15: case 19: case 20:
5462                         if (stop_ty || (p_ptr->free_act && (randint1(125) < p_ptr->skill_sav)) || (p_ptr->pclass == CLASS_BERSERKER))
5463                         {
5464                                 /* Do nothing */ ;
5465                         }
5466                         else
5467                         {
5468                                 msg_print(_("彫像になった気分だ!", "You feel like a statue!"));
5469                                 if (p_ptr->free_act)
5470                                         set_paralyzed(p_ptr->paralyzed + randint1(3));
5471                                 else
5472                                         set_paralyzed(p_ptr->paralyzed + randint1(13));
5473                                 stop_ty = TRUE;
5474                         }
5475                         if (!one_in_(6)) break;
5476                 case 21: case 22: case 23:
5477                         (void)do_dec_stat(randint0(6));
5478                         if (!one_in_(6)) break;
5479                 case 24:
5480                         msg_print(_("ほえ?私は誰?ここで何してる?", "Huh? Who am I? What am I doing here?"));
5481                         lose_all_info();
5482                         if (!one_in_(6)) break;
5483                 case 25:
5484                         /*
5485                          * Only summon Cyberdemons deep in the dungeon.
5486                          */
5487                         if ((dun_level > 65) && !stop_ty)
5488                         {
5489                                 (*count) += summon_cyber(-1, p_ptr->y, p_ptr->x);
5490                                 stop_ty = TRUE;
5491                                 break;
5492                         }
5493                         if (!one_in_(6)) break;
5494                 default:
5495                         while (i < 6)
5496                         {
5497                                 do
5498                                 {
5499                                         (void)do_dec_stat(i);
5500                                 }
5501                                 while (one_in_(2));
5502
5503                                 i++;
5504                         }
5505                 }
5506         }
5507         while (one_in_(3) && !stop_ty);
5508
5509         return stop_ty;
5510 }
5511
5512 /*!
5513  * @brief HI_SUMMON(上級召喚)処理発動
5514  * @param y 召喚位置Y座標
5515  * @param x 召喚位置X座標
5516  * @param can_pet プレイヤーのペットとなる可能性があるならばTRUEにする
5517  * @return 作用が実際にあった場合TRUEを返す
5518  */
5519 int activate_hi_summon(int y, int x, bool can_pet)
5520 {
5521         int i;
5522         int count = 0;
5523         int summon_lev;
5524         u32b mode = PM_ALLOW_GROUP;
5525         bool pet = FALSE;
5526
5527         if (can_pet)
5528         {
5529                 if (one_in_(4))
5530                 {
5531                         mode |= PM_FORCE_FRIENDLY;
5532                 }
5533                 else
5534                 {
5535                         mode |= PM_FORCE_PET;
5536                         pet = TRUE;
5537                 }
5538         }
5539
5540         if (!pet) mode |= PM_NO_PET;
5541
5542         summon_lev = (pet ? p_ptr->lev * 2 / 3 + randint1(p_ptr->lev / 2) : dun_level);
5543
5544         for (i = 0; i < (randint1(7) + (dun_level / 40)); i++)
5545         {
5546                 switch (randint1(25) + (dun_level / 20))
5547                 {
5548                         case 1: case 2:
5549                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANT, mode);
5550                                 break;
5551                         case 3: case 4:
5552                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_SPIDER, mode);
5553                                 break;
5554                         case 5: case 6:
5555                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HOUND, mode);
5556                                 break;
5557                         case 7: case 8:
5558                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HYDRA, mode);
5559                                 break;
5560                         case 9: case 10:
5561                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_ANGEL, mode);
5562                                 break;
5563                         case 11: case 12:
5564                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNDEAD, mode);
5565                                 break;
5566                         case 13: case 14:
5567                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DRAGON, mode);
5568                                 break;
5569                         case 15: case 16:
5570                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_DEMON, mode);
5571                                 break;
5572                         case 17:
5573                                 if (can_pet) break;
5574                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_AMBERITES, (mode | PM_ALLOW_UNIQUE));
5575                                 break;
5576                         case 18: case 19:
5577                                 if (can_pet) break;
5578                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_UNIQUE, (mode | PM_ALLOW_UNIQUE));
5579                                 break;
5580                         case 20: case 21:
5581                                 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
5582                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_UNDEAD, mode);
5583                                 break;
5584                         case 22: case 23:
5585                                 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
5586                                 count += summon_specific((pet ? -1 : 0), y, x, summon_lev, SUMMON_HI_DRAGON, mode);
5587                                 break;
5588                         case 24:
5589                                 count += summon_specific((pet ? -1 : 0), y, x, 100, SUMMON_CYBER, mode);
5590                                 break;
5591                         default:
5592                                 if (!can_pet) mode |= PM_ALLOW_UNIQUE;
5593                                 count += summon_specific((pet ? -1 : 0), y, x,pet ? summon_lev : (((summon_lev * 3) / 2) + 5), 0, mode);
5594                 }
5595         }
5596
5597         return count;
5598 }
5599
5600
5601 /*!
5602  * @brief サイバーデーモンの召喚
5603  * @param who 召喚主のモンスターID(0ならばプレイヤー)
5604  * @param y 召喚位置Y座標
5605  * @param x 召喚位置X座標
5606  * @return 作用が実際にあった場合TRUEを返す
5607  */
5608 int summon_cyber(int who, int y, int x)
5609 {
5610         int i;
5611         int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
5612         int count = 0;
5613         u32b mode = PM_ALLOW_GROUP;
5614
5615         /* Summoned by a monster */
5616         if (who > 0)
5617         {
5618                 monster_type *m_ptr = &m_list[who];
5619                 if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
5620         }
5621
5622         if (max_cyber > 4) max_cyber = 4;
5623
5624         for (i = 0; i < max_cyber; i++)
5625         {
5626                 count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode);
5627         }
5628
5629         return count;
5630 }
5631
5632 /*!
5633  * @brief 周辺破壊効果(プレイヤー中心)
5634  * @return 作用が実際にあった場合TRUEを返す
5635  */
5636 void wall_breaker(void)
5637 {
5638         int i;
5639         int y = 0, x = 0;
5640         int attempts = 1000;
5641
5642         if (randint1(80 + p_ptr->lev) < 70)
5643         {
5644                 while (attempts--)
5645                 {
5646                         scatter(&y, &x, p_ptr->y, p_ptr->x, 4, 0);
5647
5648                         if (!cave_have_flag_bold(y, x, FF_PROJECT)) continue;
5649
5650                         if (!player_bold(y, x)) break;
5651                 }
5652
5653                 project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
5654                                   (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
5655         }
5656         else if (randint1(100) > 30)
5657         {
5658                 earthquake(p_ptr->y, p_ptr->x, 1);
5659         }
5660         else
5661         {
5662                 int num = damroll(5, 3);
5663
5664                 for (i = 0; i < num; i++)
5665                 {
5666                         while (1)
5667                         {
5668                                 scatter(&y, &x, p_ptr->y, p_ptr->x, 10, 0);
5669
5670                                 if (!player_bold(y, x)) break;
5671                         }
5672
5673                         project(0, 0, y, x, 20 + randint1(30), GF_KILL_WALL,
5674                                           (PROJECT_BEAM | PROJECT_THRU | PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL), -1);
5675                 }
5676         }
5677 }
5678
5679
5680 /*!
5681  * @brief パニック・モンスター効果(プレイヤー視界範囲内) / Confuse monsters
5682  * @param dam 効力
5683  * @return 作用が実際にあった場合TRUEを返す
5684  */
5685 bool confuse_monsters(int dam)
5686 {
5687         return (project_hack(GF_OLD_CONF, dam));
5688 }
5689
5690
5691 /*!
5692  * @brief チャーム・モンスター効果(プレイヤー視界範囲内) / Charm monsters
5693  * @param dam 効力
5694  * @return 作用が実際にあった場合TRUEを返す
5695  */
5696 bool charm_monsters(int dam)
5697 {
5698         return (project_hack(GF_CHARM, dam));
5699 }
5700
5701
5702 /*!
5703  * @brief 動物魅了効果(プレイヤー視界範囲内) / Charm Animals
5704  * @param dam 効力
5705  * @return 作用が実際にあった場合TRUEを返す
5706  */
5707 bool charm_animals(int dam)
5708 {
5709         return (project_hack(GF_CONTROL_ANIMAL, dam));
5710 }
5711
5712
5713 /*!
5714  * @brief モンスター朦朧効果(プレイヤー視界範囲内) / Stun monsters
5715  * @param dam 効力
5716  * @return 作用が実際にあった場合TRUEを返す
5717  */
5718 bool stun_monsters(int dam)
5719 {
5720         return (project_hack(GF_STUN, dam));
5721 }
5722
5723
5724 /*!
5725  * @brief モンスター停止効果(プレイヤー視界範囲内) / Stasis monsters
5726  * @param dam 効力
5727  * @return 作用が実際にあった場合TRUEを返す
5728  */
5729 bool stasis_monsters(int dam)
5730 {
5731         return (project_hack(GF_STASIS, dam));
5732 }
5733
5734
5735 /*!
5736  * @brief モンスター精神攻撃効果(プレイヤー視界範囲内) / Mindblast monsters
5737  * @param dam 効力
5738  * @return 作用が実際にあった場合TRUEを返す
5739  */
5740 bool mindblast_monsters(int dam)
5741 {
5742         return (project_hack(GF_PSI, dam));
5743 }
5744
5745
5746 /*!
5747  * @brief モンスター追放効果(プレイヤー視界範囲内) / Banish all monsters
5748  * @param dist 効力(距離)
5749  * @return 作用が実際にあった場合TRUEを返す
5750  */
5751 bool banish_monsters(int dist)
5752 {
5753         return (project_hack(GF_AWAY_ALL, dist));
5754 }
5755
5756
5757 /*!
5758  * @brief 邪悪退散効果(プレイヤー視界範囲内) / Turn evil
5759  * @param dam 効力
5760  * @return 作用が実際にあった場合TRUEを返す
5761  */
5762 bool turn_evil(int dam)
5763 {
5764         return (project_hack(GF_TURN_EVIL, dam));
5765 }
5766
5767
5768 /*!
5769  * @brief 全モンスター退散効果(プレイヤー視界範囲内) / Turn everyone
5770  * @param dam 効力
5771  * @return 作用が実際にあった場合TRUEを返す
5772  */
5773 bool turn_monsters(int dam)
5774 {
5775         return (project_hack(GF_TURN_ALL, dam));
5776 }
5777
5778
5779 /*!
5780  * @brief 死の光線(プレイヤー視界範囲内) / Death-ray all monsters (note: OBSCENELY powerful)
5781  * @return 作用が実際にあった場合TRUEを返す
5782  */
5783 bool deathray_monsters(void)
5784 {
5785         return (project_hack(GF_DEATH_RAY, p_ptr->lev * 200));
5786 }
5787
5788 /*!
5789  * @brief チャーム・モンスター(1体)
5790  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5791  * @param plev パワー
5792  * @return 作用が実際にあった場合TRUEを返す
5793  */
5794 bool charm_monster(int dir, int plev)
5795 {
5796         int flg = PROJECT_STOP | PROJECT_KILL;
5797         return (project_hook(GF_CHARM, dir, plev, flg));
5798 }
5799
5800 /*!
5801  * @brief アンデッド支配(1体)
5802  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5803  * @param plev パワー
5804  * @return 作用が実際にあった場合TRUEを返す
5805  */
5806 bool control_one_undead(int dir, int plev)
5807 {
5808         int flg = PROJECT_STOP | PROJECT_KILL;
5809         return (project_hook(GF_CONTROL_UNDEAD, dir, plev, flg));
5810 }
5811
5812 /*!
5813  * @brief 悪魔支配(1体)
5814  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5815  * @param plev パワー
5816  * @return 作用が実際にあった場合TRUEを返す
5817  */
5818 bool control_one_demon(int dir, int plev)
5819 {
5820         int flg = PROJECT_STOP | PROJECT_KILL;
5821         return (project_hook(GF_CONTROL_DEMON, dir, plev, flg));
5822 }
5823
5824 /*!
5825  * @brief 動物支配(1体)
5826  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5827  * @param plev パワー
5828  * @return 作用が実際にあった場合TRUEを返す
5829  */
5830 bool charm_animal(int dir, int plev)
5831 {
5832         int flg = PROJECT_STOP | PROJECT_KILL;
5833         return (project_hook(GF_CONTROL_ANIMAL, dir, plev, flg));
5834 }
5835
5836 /*!
5837  * @brief 生物支配(1体)
5838  * @param dir 方向(5ならばグローバル変数 target_col/target_row の座標を目標にする)
5839  * @param plev パワー
5840  * @return 作用が実際にあった場合TRUEを返す
5841  */
5842 bool charm_living(int dir, int plev)
5843 {
5844         int flg = PROJECT_STOP | PROJECT_KILL;
5845         return (project_hook(GF_CONTROL_LIVING, dir, plev, flg));
5846 }
5847
5848 /*!
5849  * @brief 変わり身処理
5850  * @param success 判定成功上の処理ならばTRUE
5851  * @return 作用が実際にあった場合TRUEを返す
5852  */
5853 bool kawarimi(bool success)
5854 {
5855         object_type forge;
5856         object_type *q_ptr = &forge;
5857         int y, x;
5858
5859         if (p_ptr->is_dead) return FALSE;
5860         if (p_ptr->confused || p_ptr->blind || p_ptr->paralyzed || p_ptr->image) return FALSE;
5861         if (randint0(200) < p_ptr->stun) return FALSE;
5862
5863         if (!success && one_in_(3))
5864         {
5865                 msg_print(_("失敗!逃げられなかった。", "Failed! You couldn't run away."));
5866                 p_ptr->special_defense &= ~(NINJA_KAWARIMI);
5867                 p_ptr->redraw |= (PR_STATUS);
5868                 return FALSE;
5869         }
5870
5871         y = p_ptr->y;
5872         x = p_ptr->x;
5873
5874         teleport_player(10 + randint1(90), 0L);
5875
5876         object_wipe(q_ptr);
5877
5878         object_prep(q_ptr, lookup_kind(TV_STATUE, SV_WOODEN_STATUE));
5879
5880         q_ptr->pval = MON_NINJA;
5881
5882         /* Drop it in the dungeon */
5883         (void)drop_near(q_ptr, -1, y, x);
5884
5885 #ifdef JP
5886         if (success) msg_print("攻撃を受ける前に素早く身をひるがえした。");
5887         else msg_print("失敗!攻撃を受けてしまった。");
5888 #else
5889         if (success) msg_print("You have turned around just before the attack hit you.");
5890         else msg_print("Failed! You are hit by the attack.");
5891 #endif
5892
5893         p_ptr->special_defense &= ~(NINJA_KAWARIMI);
5894         p_ptr->redraw |= (PR_STATUS);
5895
5896         /* Teleported */
5897         return TRUE;
5898 }
5899
5900
5901 /*!
5902  * @brief 入身処理 / "Rush Attack" routine for Samurai or Ninja
5903  * @param mdeath 目標モンスターが死亡したかを返す
5904  * @return 作用が実際にあった場合TRUEを返す /  Return value is for checking "done"
5905  */
5906 bool rush_attack(bool *mdeath)
5907 {
5908         int dir;
5909         int tx, ty;
5910         int tm_idx = 0;
5911         u16b path_g[32];
5912         int path_n, i;
5913         bool tmp_mdeath = FALSE;
5914         bool moved = FALSE;
5915
5916         if (mdeath) *mdeath = FALSE;
5917
5918         project_length = 5;
5919         if (!get_aim_dir(&dir)) return FALSE;
5920
5921         /* Use the given direction */
5922         tx = p_ptr->x + project_length * ddx[dir];
5923         ty = p_ptr->y + project_length * ddy[dir];
5924
5925         /* Hack -- Use an actual "target" */
5926         if ((dir == 5) && target_okay())
5927         {
5928                 tx = target_col;
5929                 ty = target_row;
5930         }
5931
5932         if (in_bounds(ty, tx)) tm_idx = cave[ty][tx].m_idx;
5933
5934         path_n = project_path(path_g, project_length, p_ptr->y, p_ptr->x, ty, tx, PROJECT_STOP | PROJECT_KILL);
5935         project_length = 0;
5936
5937         /* No need to move */
5938         if (!path_n) return TRUE;
5939
5940         /* Use ty and tx as to-move point */
5941         ty = p_ptr->y;
5942         tx = p_ptr->x;
5943
5944         /* Project along the path */
5945         for (i = 0; i < path_n; i++)
5946         {
5947                 monster_type *m_ptr;
5948
5949                 int ny = GRID_Y(path_g[i]);
5950                 int nx = GRID_X(path_g[i]);
5951
5952                 if (cave_empty_bold(ny, nx) && player_can_enter(cave[ny][nx].feat, 0))
5953                 {
5954                         ty = ny;
5955                         tx = nx;
5956
5957                         /* Go to next grid */
5958                         continue;
5959                 }
5960
5961                 if (!cave[ny][nx].m_idx)
5962                 {
5963                         if (tm_idx)
5964                         {
5965                                 msg_print(_("失敗!", "Failed!"));
5966                         }
5967                         else
5968                         {
5969                                 msg_print(_("ここには入身では入れない。", "You can't move to that place."));
5970                         }
5971
5972                         /* Exit loop */
5973                         break;
5974                 }
5975
5976                 /* Move player before updating the monster */
5977                 if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
5978
5979                 /* Update the monster */
5980                 update_mon(cave[ny][nx].m_idx, TRUE);
5981
5982                 /* Found a monster */
5983                 m_ptr = &m_list[cave[ny][nx].m_idx];
5984
5985                 if (tm_idx != cave[ny][nx].m_idx)
5986                 {
5987 #ifdef JP
5988                         msg_format("%s%sが立ちふさがっている!", tm_idx ? "別の" : "",
5989                                    m_ptr->ml ? "モンスター" : "何か");
5990 #else
5991                         msg_format("There is %s in the way!", m_ptr->ml ? (tm_idx ? "another monster" : "a monster") : "someone");
5992 #endif
5993                 }
5994                 else if (!player_bold(ty, tx))
5995                 {
5996                         /* Hold the monster name */
5997                         char m_name[80];
5998
5999                         /* Get the monster name (BEFORE polymorphing) */
6000                         monster_desc(m_name, m_ptr, 0);
6001                         msg_format(_("素早く%sの懐に入り込んだ!", "You quickly jump in and attack %s!"), m_name);
6002                 }
6003
6004                 if (!player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
6005                 moved = TRUE;
6006                 tmp_mdeath = py_attack(ny, nx, HISSATSU_NYUSIN);
6007
6008                 break;
6009         }
6010
6011         if (!moved && !player_bold(ty, tx)) teleport_player_to(ty, tx, TELEPORT_NONMAGICAL);
6012
6013         if (mdeath) *mdeath = tmp_mdeath;
6014         return TRUE;
6015 }
6016
6017
6018 /*!
6019  * @brief 全鏡の消去 / Remove all mirrors in this floor
6020  * @param explode 爆発処理を伴うならばTRUE
6021  * @return なし
6022  */
6023 void remove_all_mirrors(bool explode)
6024 {
6025         int x, y;
6026
6027         for (x = 0; x < cur_wid; x++)
6028         {
6029                 for (y = 0; y < cur_hgt; y++)
6030                 {
6031                         if (is_mirror_grid(&cave[y][x]))
6032                         {
6033                                 remove_mirror(y, x);
6034                                 if (explode)
6035                                         project(0, 2, y, x, p_ptr->lev / 2 + 5, GF_SHARDS,
6036                                                 (PROJECT_GRID | PROJECT_ITEM | PROJECT_KILL | PROJECT_JUMP | PROJECT_NO_HANGEKI), -1);
6037                         }
6038                 }
6039         }
6040 }