summaryrefslogtreecommitdiffstats
path: root/crawl-ref
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 19:37:10 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-09 19:37:10 +0000
commite15cb03057e1f57801e01fdc3c6271e0736f4c79 (patch)
treec3834256e29774453a04233d853c66eb3f0960c4 /crawl-ref
parent4515a730159654ea04151f11841bd47c60940b0e (diff)
downloadcrawl-ref-e15cb03057e1f57801e01fdc3c6271e0736f4c79.tar.gz
crawl-ref-e15cb03057e1f57801e01fdc3c6271e0736f4c79.zip
Convert the shadow- and spatial vortex-summoning routines to use power
values, in case they're ever used elsewhere. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5670 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref')
-rw-r--r--crawl-ref/source/it_use3.cc2
-rw-r--r--crawl-ref/source/spells2.cc5
-rw-r--r--crawl-ref/source/spells2.h2
-rw-r--r--crawl-ref/source/spells3.cc6
-rw-r--r--crawl-ref/source/spells3.h3
-rw-r--r--crawl-ref/source/spl-cast.cc13
6 files changed, 19 insertions, 12 deletions
diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc
index 27f69159c3..17edf91884 100644
--- a/crawl-ref/source/it_use3.cc
+++ b/crawl-ref/source/it_use3.cc
@@ -225,7 +225,7 @@ void special_wielded()
case SPWLD_SHADOW:
if (random2(8) <= player_spec_death())
{
- summon_shadows(1);
+ summon_shadows(0);
did_god_conduct(DID_NECROMANCY, 1);
}
diff --git a/crawl-ref/source/spells2.cc b/crawl-ref/source/spells2.cc
index 2d404b801d..0d0b71872b 100644
--- a/crawl-ref/source/spells2.cc
+++ b/crawl-ref/source/spells2.cc
@@ -971,12 +971,15 @@ char burn_freeze(int pow, beam_type flavour)
return 1;
}
-bool summon_spatial_vortices(int how_many, bool god_gift)
+bool summon_spatial_vortices(int pow, bool god_gift)
{
bool success = false;
mpr("Space twists in upon itself!");
+ // Maximum power is 300.
+ const int how_many = (pow / 75 + 1);
+
for (int i = 0; i < how_many; ++i)
{
if (create_monster(
diff --git a/crawl-ref/source/spells2.h b/crawl-ref/source/spells2.h
index eea2a1e549..5716d35098 100644
--- a/crawl-ref/source/spells2.h
+++ b/crawl-ref/source/spells2.h
@@ -152,7 +152,7 @@ bool summon_daeva(int pow, bool god_gift = false);
/* ***********************************************************************
* called from: spell
* *********************************************************************** */
-bool summon_spatial_vortices(int how_many, bool god_gift = false);
+bool summon_spatial_vortices(int pow, bool god_gift = false);
bool summon_animals(int pow);
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 7750320fdf..2e5528651f 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -413,11 +413,13 @@ bool cast_sublimation_of_blood(int pow)
return (success);
}
-bool summon_shadows(int how_many, bool god_gift,
- bool force_hostile)
+bool summon_shadows(int pow, bool god_gift, bool force_hostile)
{
bool success = false;
+ // Maximum power is 300.
+ const int how_many = (pow / 75 + 1);
+
mpr(how_many > 1 ? "Flickering shadows surround you."
: "A nearby shadow flickers.");
diff --git a/crawl-ref/source/spells3.h b/crawl-ref/source/spells3.h
index 3eefd5dcd3..11593c8db8 100644
--- a/crawl-ref/source/spells3.h
+++ b/crawl-ref/source/spells3.h
@@ -113,8 +113,7 @@ bool remove_curse(bool suppress_msg);
* *********************************************************************** */
bool cast_sublimation_of_blood(int pow);
-bool summon_shadows(int how_many, bool god_gift = false,
- bool force_hostile = false);
+bool summon_shadows(int pow, bool god_gift = false, bool force_hostile = false);
bool cast_call_imp(int pow, bool god_gift = false);
bool summon_lesser_demon(int pow, bool god_gift = false);
bool summon_common_demon(int pow, bool god_gift = false);
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 0f46d389f3..08de88d5a0 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -2369,7 +2369,7 @@ static void _miscast_translocation(int severity, const char* cause)
ouch(4 + random2avg(7, 2), 0, KILLED_BY_WILD_MAGIC, cause);
break;
case 5:
- summon_spatial_vortices(1);
+ summon_spatial_vortices(0);
break;
}
break;
@@ -2396,7 +2396,8 @@ static void _miscast_translocation(int severity, const char* cause)
potion_effect(POT_CONFUSION, 40);
break;
case 5:
- summon_spatial_vortices(2 + random2(3));
+ // Summon 2-5 spatial vortices.
+ summon_spatial_vortices(75 + random2(151));
break;
case 6:
_send_abyss(cause);
@@ -2483,7 +2484,7 @@ static void _miscast_summoning(int severity, const char* cause)
ouch(5 + random2avg(9, 2), 0, KILLED_BY_WILD_MAGIC, cause);
break;
case 3:
- summon_spatial_vortices(1);
+ summon_spatial_vortices(0);
break;
case 4:
case 5:
@@ -2501,7 +2502,8 @@ static void _miscast_summoning(int severity, const char* cause)
switch (random2(6))
{
case 0:
- summon_spatial_vortices(2 + random2(3));
+ // Summon 2-5 spatial vortices.
+ summon_spatial_vortices(75 + random2(151));
break;
case 1:
@@ -2790,7 +2792,8 @@ static void _miscast_necromancy(int severity, const char* cause)
switch (random2(3))
{
case 0:
- summon_shadows(random2(3) + 1, false, true);
+ // Summon 1-3 shadows.
+ summon_shadows(random2(151), false, true);
break;
case 1: