4 #include "spells-summon.h"
5 #include "player-inventory.h"
6 #include "monster-status.h"
8 #include "effect/spells-effect-util.h"
9 #include "spell/spells2.h"
12 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
13 * @param num summon_specific()関数を呼び出す回数
14 * @param pet ペット化として召喚されるか否か
19 * @param mode モンスター生成条件フラグ
20 * @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。
22 bool trump_summoning(player_type *caster_ptr, int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode)
25 PLAYER_LEVEL plev = caster_ptr->lev;
26 if (!lev) lev = plev * 2 / 3 + randint1(plev / 2);
34 /* Only sometimes allow unique monster */
35 if (mode & PM_ALLOW_UNIQUE)
38 if (randint1(50 + plev) >= plev / 10)
39 mode &= ~PM_ALLOW_UNIQUE;
42 /* Player is who summons */
47 /* Prevent taming, allow unique monster */
50 /* Behave as if they appear by themselfs */
55 for (int i = 0; i < num; i++)
57 if (summon_specific(caster_ptr, who, y, x, lev, type, mode))
63 msg_print(_("誰もあなたのカードの呼び声に答えない。", "Nobody answers to your Trump call."));
70 bool cast_summon_demon(player_type *caster_ptr, int power)
73 bool pet = !one_in_(3);
74 if (pet) flg |= PM_FORCE_PET;
75 else flg |= PM_NO_PET;
76 if (!(pet && (caster_ptr->lev < 50))) flg |= PM_ALLOW_GROUP;
78 if (!summon_specific(caster_ptr, (pet ? -1 : 0), caster_ptr->y, caster_ptr->x, power, SUMMON_DEMON, flg))
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);
98 int type = (creature_ptr->lev > 47 ? SUMMON_HI_UNDEAD : SUMMON_UNDEAD);
101 if (!pet || ((creature_ptr->lev > 24) && one_in_(3))) mode |= PM_ALLOW_GROUP;
102 if (pet) mode |= PM_FORCE_PET;
103 else mode |= (PM_ALLOW_UNIQUE | PM_NO_PET);
105 if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, type, mode))
107 msg_print(_("冷たい風があなたの周りに吹き始めた。それは腐敗臭を運んでいる...",
108 "Cold winds begin to blow around you, carrying with them the stench of decay..."));
110 msg_print(_("古えの死せる者共があなたに仕えるため土から甦った!",
111 "Ancient, long-dead forms arise from the ground to serve you!"));
113 msg_print(_("死者が甦った。眠りを妨げるあなたを罰するために!",
114 "'The dead arise... to punish you for disturbing them!'"));
120 bool cast_summon_hound(player_type *creature_ptr, int power)
122 BIT_FLAGS mode = PM_ALLOW_GROUP;
123 bool pet = !one_in_(5);
124 if (pet) mode |= PM_FORCE_PET;
125 else mode |= PM_NO_PET;
127 if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_HOUND, mode))
130 msg_print(_("ハウンドがあなたの下僕として出現した。", "A group of hounds appear as your servant."));
132 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);
143 if (!(pet && (creature_ptr->lev < 50))) mode |= PM_ALLOW_GROUP;
144 if (pet) mode |= PM_FORCE_PET;
145 else mode |= PM_NO_PET;
147 if (summon_specific(creature_ptr, (pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode))
149 msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
151 msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
153 msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
160 bool cast_summon_octopus(player_type *creature_ptr)
162 BIT_FLAGS mode = PM_ALLOW_GROUP;
163 bool pet = !one_in_(5);
164 if (pet) mode |= PM_FORCE_PET;
165 if (summon_named_creature(creature_ptr, 0, creature_ptr->y, creature_ptr->x, MON_JIZOTAKO, mode))
168 msg_print(_("蛸があなたの下僕として出現した。", "A group of octopuses appear as your servant."));
170 msg_print(_("蛸はあなたを睨んでいる!", "A group of octopuses appear as your enemy!"));
178 * @brief 悪魔領域のグレーターデーモン召喚に利用可能な死体かどうかを返す。 / An "item_tester_hook" for offer
179 * @param o_ptr オブジェクト構造体の参照ポインタ
180 * @return 生贄に使用可能な死体ならばTRUEを返す。
182 bool item_tester_offer(object_type *o_ptr)
184 if (o_ptr->tval != TV_CORPSE) return FALSE;
185 if (o_ptr->sval != SV_CORPSE) return FALSE;
186 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return TRUE;
192 * @brief 悪魔領域のグレーターデーモン召喚を処理する / Daemon spell Summon Greater Demon
193 * @return 処理を実行したならばTRUEを返す。
195 bool cast_summon_greater_demon(player_type *caster_ptr)
197 item_tester_hook = item_tester_offer;
198 concptr q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");
199 concptr s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
202 o_ptr = choose_object(caster_ptr, &item, q, s, (USE_INVEN | USE_FLOOR), 0);
203 if (!o_ptr) return FALSE;
205 PLAYER_LEVEL plev = caster_ptr->lev;
206 int summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
208 if (summon_specific(caster_ptr, -1, caster_ptr->y, caster_ptr->x, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET)))
210 msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
211 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
212 vary_item(caster_ptr, item, -1);
216 msg_print(_("悪魔は現れなかった。", "No Greater Demon arrives."));
225 * @param player_ptr プレーヤーへの参照ポインタ
226 * @param level 召喚基準レベル
229 * @param mode 召喚オプション
230 * @return ターンを消費した場合TRUEを返す
232 bool summon_kin_player(player_type *creature_ptr, DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
234 bool pet = (bool)(mode & PM_FORCE_PET);
235 if (!pet) mode |= PM_NO_PET;
236 return summon_specific(creature_ptr, (pet ? -1 : 0), y, x, level, SUMMON_KIN, mode);
242 * @param player_ptr プレーヤーへの参照ポインタ
243 * @param who 召喚主のモンスターID(0ならばプレイヤー)
246 * @return 作用が実際にあった場合TRUEを返す
248 int summon_cyber(player_type *creature_ptr, MONSTER_IDX who, POSITION y, POSITION x)
250 /* Summoned by a monster */
251 BIT_FLAGS mode = PM_ALLOW_GROUP;
252 floor_type *floor_ptr = creature_ptr->current_floor_ptr;
255 monster_type *m_ptr = &floor_ptr->m_list[who];
256 if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
259 int max_cyber = (easy_band ? 1 : (floor_ptr->dun_level / 50) + randint1(2));
260 if (max_cyber > 4) max_cyber = 4;
263 for (int i = 0; i < max_cyber; i++)
265 count += summon_specific(creature_ptr, who, y, x, 100, SUMMON_CYBER, mode);
272 void mitokohmon(player_type *kohmon_ptr)
275 concptr sukekakusan = "";
276 if (summon_named_creature(kohmon_ptr, 0, kohmon_ptr->y, kohmon_ptr->x, MON_SUKE, PM_FORCE_PET))
278 msg_print(_("『助さん』が現れた。", "Suke-san apperars."));
279 sukekakusan = "Suke-san";
283 if (summon_named_creature(kohmon_ptr, 0, kohmon_ptr->y, kohmon_ptr->x, MON_KAKU, PM_FORCE_PET))
285 msg_print(_("『格さん』が現れた。", "Kaku-san appears."));
286 sukekakusan = "Kaku-san";
292 for (int i = kohmon_ptr->current_floor_ptr->m_max - 1; i > 0; i--)
295 m_ptr = &kohmon_ptr->current_floor_ptr->m_list[i];
296 if (!monster_is_valid(m_ptr)) continue;
297 if (!((m_ptr->r_idx == MON_SUKE) || (m_ptr->r_idx == MON_KAKU))) continue;
298 if (!los(kohmon_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
299 if (!projectable(kohmon_ptr, m_ptr->fy, m_ptr->fx, kohmon_ptr->y, kohmon_ptr->x)) continue;
307 msg_print(_("しかし、何も起きなかった。", "Nothing happens."));
311 msg_format(_("「者ども、ひかえおろう!!!このお方をどなたとこころえる。」",
312 "%^s says 'WHO do you think this person is! Bow your head, down to your knees!'"), sukekakusan);
314 stun_monsters(kohmon_ptr, 120);
315 confuse_monsters(kohmon_ptr, 120);
316 turn_monsters(kohmon_ptr, 120);
317 stasis_monsters(kohmon_ptr, 120);