2 #include "spells-summon.h"
5 * @brief トランプ魔法独自の召喚処理を行う / Handle summoning and failure of trump spells
6 * @param num summon_specific()関数を呼び出す回数
7 * @param pet ペット化として召喚されるか否か
12 * @param mode モンスター生成条件フラグ
13 * @return モンスターが(敵対も含めて)召還されたならばTRUEを返す。
15 bool trump_summoning(int num, bool pet, POSITION y, POSITION x, DEPTH lev, int type, BIT_FLAGS mode)
17 PLAYER_LEVEL plev = p_ptr->lev;
24 if (!lev) lev = plev * 2 / 3 + randint1(plev / 2);
31 /* Only sometimes allow unique monster */
32 if (mode & PM_ALLOW_UNIQUE)
35 if (randint1(50 + plev) >= plev / 10)
36 mode &= ~PM_ALLOW_UNIQUE;
39 /* Player is who summons */
44 /* Prevent taming, allow unique monster */
47 /* Behave as if they appear by themselfs */
51 for (i = 0; i < num; i++)
53 if (summon_specific(who, y, x, lev, type, mode, '\0'))
59 msg_print(_("誰もあなたのカードの呼び声に答えない。", "Nobody answers to your Trump call."));
66 bool cast_summon_demon(int power)
69 bool pet = !one_in_(3);
71 if (pet) flg |= PM_FORCE_PET;
72 else flg |= PM_NO_PET;
73 if (!(pet && (p_ptr->lev < 50))) flg |= PM_ALLOW_GROUP;
75 if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, power, SUMMON_DEMON, flg, '\0'))
77 msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
80 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
84 msg_print(_("「卑しき者よ、我は汝の下僕にあらず! お前の魂を頂くぞ!」",
85 "'NON SERVIAM! Wretch! I shall feast on thy mortal soul!'"));
93 * @brief 悪魔領域のグレーターデーモン召喚に利用可能な死体かどうかを返す。 / An "item_tester_hook" for offer
94 * @param o_ptr オブジェクト構造体の参照ポインタ
95 * @return 生贄に使用可能な死体ならばTRUEを返す。
97 bool item_tester_offer(object_type *o_ptr)
99 /* Flasks of oil are okay */
100 if (o_ptr->tval != TV_CORPSE) return (FALSE);
101 if (o_ptr->sval != SV_CORPSE) return (FALSE);
103 if (my_strchr("pht", r_info[o_ptr->pval].d_char)) return (TRUE);
105 /* Assume not okay */
110 * @brief 悪魔領域のグレーターデーモン召喚を処理する / Daemon spell Summon Greater Demon
111 * @return 処理を実行したならばTRUEを返す。
113 bool cast_summon_greater_demon(void)
115 PLAYER_LEVEL plev = p_ptr->lev;
121 item_tester_hook = item_tester_offer;
122 q = _("どの死体を捧げますか? ", "Sacrifice which corpse? ");
123 s = _("捧げられる死体を持っていない。", "You have nothing to scrifice.");
124 o_ptr = choose_object(&item, q, s, (USE_INVEN | USE_FLOOR));
125 if (!o_ptr) return FALSE;
127 summon_lev = plev * 2 / 3 + r_info[o_ptr->pval].level;
129 if (summon_specific(-1, p_ptr->y, p_ptr->x, summon_lev, SUMMON_HI_DEMON, (PM_ALLOW_GROUP | PM_FORCE_PET), '\0'))
131 msg_print(_("硫黄の悪臭が充満した。", "The area fills with a stench of sulphur and brimstone."));
132 msg_print(_("「ご用でございますか、ご主人様」", "'What is thy bidding... Master?'"));
134 /* Decrease the item (from the pack) */
137 inven_item_increase(item, -1);
138 inven_item_describe(item);
139 inven_item_optimize(item);
142 /* Decrease the item (from the floor) */
145 floor_item_increase(0 - item, -1);
146 floor_item_describe(0 - item);
147 floor_item_optimize(0 - item);
152 msg_print(_("悪魔は現れなかった。", "No Greater Demon arrive."));
160 * @param level 召喚基準レベル
163 * @param mode 召喚オプション
164 * @return ターンを消費した場合TRUEを返す
166 bool summon_kin_player(DEPTH level, POSITION y, POSITION x, BIT_FLAGS mode)
168 bool pet = (bool)(mode & PM_FORCE_PET);
169 SYMBOL_CODE symbol = '\0';
170 if (!pet) mode |= PM_NO_PET;
172 switch (p_ptr->mimic_form)
175 switch (p_ptr->prace)
192 case RACE_MIND_FLAYER:
200 case RACE_HALF_TROLL:
206 case RACE_HALF_GIANT:
207 case RACE_HALF_TITAN:
221 if (one_in_(13)) symbol = 'U';
232 if (one_in_(13)) symbol = 'L';
262 if (one_in_(13)) symbol = 'U';
265 case MIMIC_DEMON_LORD:
272 return summon_specific((pet ? -1 : 0), y, x, level, SUMMON_KIN, mode, symbol);
277 * @param who 召喚主のモンスターID(0ならばプレイヤー)
280 * @return 作用が実際にあった場合TRUEを返す
282 int summon_cyber(MONSTER_IDX who, POSITION y, POSITION x)
285 int max_cyber = (easy_band ? 1 : (dun_level / 50) + randint1(2));
287 BIT_FLAGS mode = PM_ALLOW_GROUP;
289 /* Summoned by a monster */
292 monster_type *m_ptr = &m_list[who];
293 if (is_pet(m_ptr)) mode |= PM_FORCE_PET;
296 if (max_cyber > 4) max_cyber = 4;
298 for (i = 0; i < max_cyber; i++)
300 count += summon_specific(who, y, x, 100, SUMMON_CYBER, mode, '\0');