4 #include "spells-summon.h"
5 #include "monster-status.h"
9 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
10 * @param num summon_specific()関数を呼び出す回数
11 * @param pet ペット化として召喚されるか否か
16 * @param mode モンスター生成条件フラグ
17 * @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。
19 bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode)
21 PLAYER_LEVEL plev = p_ptr->lev;
28 if (!lev) lev = plev * 2 / 3 + randint1(plev / 2);
35 /* Only sometimes allow unique monster */
36 if (mode & PM_ALLOW_UNIQUE)
39 if (randint1(50 + plev) >= plev / 10)
40 mode &= ~PM_ALLOW_UNIQUE;
43 /* Player is who summons */
48 /* Prevent taming, allow unique monster */
51 /* Behave as if they appear by themselfs */
55 for (i = 0; i < num; i++)
57 if (summon_specific(who, y, x, lev, type, mode, '\0'))
63 msg_print(_("誰もあなたのカードの呼び声に答えない。", "Nobody answers to your Trump call."));
70 bool cast_summon_demon(int power)
73 bool pet = !one_in_(3);
75 if (pet) flg |= PM_FORCE_PET;
76 else flg |= PM_NO_PET;
77 if (!(pet && (p_ptr->lev < 50))) flg |= PM_ALLOW_GROUP;
79 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, power, SUMMON_DEMON, flg, '\0'))
81 msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
84 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
88 msg_print(_("「卑しき者よ、我は汝の下僕にあらず! お前の魂を頂くぞ!」",
89 "'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'"));
95 bool cast_summon_undead(player_type *creature_ptr, int power)
97 bool pet = one_in_(3);
101 type = (creature_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
103 if (!pet || ((creature_ptr->lev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
104 if (pet) mode |= PM_FORCE_PET;
105 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
107 if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, type, mode, '\0'))
109 msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
110 "Cold winds begin to blow around you, carrying with them the stench of decay..."));
112 msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
113 "Ancient, long-dead forms arise from the ground to serve you!"));
115 msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
116 "'The dead arise... to punish you for disturbing them!'"));
122 bool cast_summon_hound(player_type *creature_ptr, int power)
124 BIT_FLAGS mode = PM_ALLOW_GROUP;
125 bool pet = !one_in_(5);
126 if (pet) mode |= PM_FORCE_PET;
127 else mode |= PM_NO_PET;
129 if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_HOUND, mode, '\0'))
132 msg_print(_("ハウンドがあなたの下僕として出現した。", "A group of hounds appear as your servant."));
134 msg_print(_("ハウンドはあなたに牙を向けている!", "A group of hounds appear as your enemy!"));
139 bool cast_summon_elemental(player_type *creature_ptr, int power)
141 bool pet = one_in_(3);
144 if (!(pet && (creature_ptr->lev < 50))) mode |= PM_ALLOW_GROUP;
145 if (pet) mode |= PM_FORCE_PET;
146 else mode |= PM_NO_PET;
148 if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode, '\0'))
150 msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
152 msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
154 msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
161 bool cast_summon_octopus(player_type *creature_ptr)
163 BIT_FLAGS mode = PM_ALLOW_GROUP;
164 bool pet = !one_in_(5);
165 if (pet) mode |= PM_FORCE_PET;
167 if (summon_named_creature(0, creature_ptr->y, creature_ptr->x, MON_JIZOTAKO, mode))
170 msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
172 msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
179 * @brief 悪魔領域のグレーターデーモン召喚に利用可能な死体かどうかを返す。 / An "item_tester_hook" for offer
180 * @param o_ptr オブジェクト構造体の参照ポインタ
181 * @return 生贄に使用可能な死体ならばTRUEを返す。
183 bool item_tester_offer(object_type *o_ptr)
185 /* Flasks of oil are okay */
186 if (o_ptr->tval != TV_CORPSE) return (FALSE);
187 if (o_ptr->sval != SV_CORPSE) return (FALSE);
189 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
191 /* Assume not okay */
196 * @brief 悪魔領域のグレーターデーモン召喚を処理する / Daemon spell Summon Greater Demon
197 * @return 処理を実行したならばTRUEを返す。
199 bool cast_summon_greater_demon(void)
201 PLAYER_LEVEL plev = p_ptr->lev;
207 item_tester_hook = item_tester_offer;
208 q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");
209 s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
210 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
211 if (!o_ptr) return FALSE;
213 summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
215 if (summon_specific(-1, p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
217 msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
218 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
220 /* Decrease the item (from the pack) */
223 inven_item_increase(item, -1);
224 inven_item_describe(item);
225 inven_item_optimize(item);
228 /* Decrease the item (from the floor) */
231 floor_item_increase(0 - item, -1);
232 floor_item_describe(0 - item);
233 floor_item_optimize(0 - item);
238 msg_print(_("悪魔は現れなかった。", "No Greater Demon arrive."));
246 * @param level 召喚基準レベル
249 * @param mode 召喚オプション
250 * @return ターンを消費した場合TRUEを返す
252 bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
254 bool pet = (bool)(mode & PM_FORCE_PET);
255 SYMBOL_CODE symbol = '\0';
256 if (!pet) mode |= PM_NO_PET;
258 switch (p_ptr->mimic_form)
261 switch (p_ptr->prace)
278 case RACE_MIND_FLAYER:
286 case RACE_HALF_TROLL:
292 case RACE_HALF_GIANT:
293 case RACE_HALF_TITAN:
307 if (one_in_(13)) symbol = 'U';
318 if (one_in_(13)) symbol = 'L';
348 if (one_in_(13)) symbol = 'U';
351 case MIMIC_DEMON_LORD:
358 return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode, symbol);
363 * @param who 召喚主のモンスターID(0ならばプレイヤー)
366 * @return 作用が実際にあった場合TRUEを返す
368 int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
371 int max_cyber = (easy_band ? 1 : (current_floor_ptr->dun_level / 50) + randint1(2));
373 BIT_FLAGS mode = PM_ALLOW_GROUP;
375 /* Summoned by a monster */
378 monster_type *m_ptr = ¤t_floor_ptr->m_list[who];
379 if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
382 if (max_cyber > 4) max_cyber = 4;
384 for (i = 0; i < max_cyber; i++)
386 count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');
393 void mitokohmon(void)
397 concptr kakusan = "";
399 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_SUKE, PM_FORCE_PET))
401 msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
402 kakusan = "Suke-san";
405 if (summon_named_creature(0, p_ptr->y, p_ptr->x, MON_KAKU, PM_FORCE_PET))
407 msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
408 kakusan = "Kaku-san";
413 for (i = current_floor_ptr->m_max - 1; i > 0; i--)
415 m_ptr = ¤t_floor_ptr->m_list[i];
416 if (!monster_is_valid(m_ptr)) continue;
417 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
418 if (!los(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
419 if (!projectable(m_ptr->fy, m_ptr->fx, p_ptr->y, p_ptr->x)) continue;
427 msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
428 "%^s says 'WHO do you think this person is! Bow your head, down your knees!'"), kakusan);
431 confuse_monsters(120);
433 stasis_monsters(120);
438 msg_print(_("しかし、何も起きなかった。", "Nothing happen."));