}
case ACT_SUMMON_ELEMENTAL:
- {
- bool pet = one_in_(3);
- BIT_FLAGS mode = 0L;
-
- if (!(pet && (plev < 50))) mode |= PM_ALLOW_GROUP;
- if (pet) mode |= PM_FORCE_PET;
- else mode |= PM_NO_PET;
-
- if (summon_specific((pet ? -1 : 0), p_ptr->y, p_ptr->x, ((plev * 3) / 2), SUMMON_ELEMENTAL, mode, '\0'))
- {
- msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
- if (pet)
- msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
- else
- msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
- }
-
+ if (!cast_summon_elemental(p_ptr, (plev * 3) / 2)) return FALSE;
break;
- }
case ACT_SUMMON_DEMON:
{
case 25:
if (name) return _("エレメンタル召喚", "Conjure Elemental");
if (desc) return _("1体のエレメンタルを召喚する。", "Summons an elemental.");
-
{
if (cast)
{
return TRUE;
}
+bool cast_summon_elemental(player_type *creature_ptr, int power)
+{
+ bool pet = one_in_(3);
+ BIT_FLAGS mode = 0L;
+
+ if (!(pet && (creature_ptr->lev < 50))) mode |= PM_ALLOW_GROUP;
+ if (pet) mode |= PM_FORCE_PET;
+ else mode |= PM_NO_PET;
+
+ if (summon_specific((pet ? -1 : 0), creature_ptr->y, creature_ptr->x, power, SUMMON_ELEMENTAL, mode, '\0'))
+ {
+ msg_print(_("エレメンタルが現れた...", "An elemental materializes..."));
+ if (pet)
+ msg_print(_("あなたに服従しているようだ。", "It seems obedient to you."));
+ else
+ msg_print(_("それをコントロールできなかった!", "You fail to control it!"));
+ }
+
+ return TRUE;
+}
+
bool cast_summon_octopus(player_type *creature_ptr)
{
extern bool cast_summon_demon(int power);
extern bool cast_summon_undead(player_type *creature_ptr, int power);
extern bool cast_summon_hound(player_type *creature_ptr, int power);
+extern bool cast_summon_elemental(player_type *creature_ptr, int power);
extern bool cast_summon_octopus(player_type *creature_ptr);
extern bool item_tester_offer(object_type *o_ptr);
extern bool cast_summon_greater_demon(void);