From c1bcbec614c07a816debe3a6e1a67baeb84712e0 Mon Sep 17 00:00:00 2001 From: dolorous Date: Mon, 9 Jun 2008 18:22:35 +0000 Subject: Consolidate the (single) spatial vortex-summoning routines, and add more minor cleanups. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5667 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/spells2.cc | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'crawl-ref/source/spells2.cc') diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc index 205683c47c..3a0bffba35 100644 --- a/crawl-ref/source/spells2.cc +++ b/crawl-ref/source/spells2.cc @@ -971,8 +971,20 @@ char burn_freeze(int pow, beam_type flavour) return 1; } -void summon_animals(int pow) +bool summon_spatial_vortex(bool god_gift) { + mpr("Space twists in upon itself!"); + + return (create_monster( + mgen_data(MONS_SPATIAL_VORTEX, BEH_HOSTILE, + 3, you.pos(), + MHITYOU, (god_gift ? MG_GOD_GIFT : 0))) != -1); +} + +bool summon_animals(int pow) +{ + bool success = false; + // Maybe we should just generate a Lair monster instead (and // guarantee that it is mobile)? const monster_type animals[] = { @@ -1010,12 +1022,17 @@ void summon_animals(int pow) const bool friendly = (random2(pow) > 4); - create_monster( - mgen_data(mon, - friendly ? BEH_FRIENDLY : BEH_HOSTILE, - 4, you.pos(), - friendly ? you.pet_target : MHITYOU)); + if (create_monster( + mgen_data(mon, + friendly ? BEH_FRIENDLY : BEH_HOSTILE, + 4, you.pos(), + friendly ? you.pet_target : MHITYOU)) != -1) + { + success = true; + } } + + return (success); } bool cast_summon_butterflies(int pow, bool god_gift) -- cgit v1.2.3-54-g00ecf