summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 19:47:40 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 19:47:40 +0000
commita8d638664c1066411b026ca06838b169984e078d (patch)
tree30fc8a958e2d63be10030c9685fb946c8f0a502a /crawl-ref/source/spells3.cc
parent95e59f96be707defda5bc535d5e72b2f96fc0b21 (diff)
downloadcrawl-ref-a8d638664c1066411b026ca06838b169984e078d.tar.gz
crawl-ref-a8d638664c1066411b026ca06838b169984e078d.zip
Reorganize again, and move cast_summon_wraiths() to spells3.cc, since
it's a necromantic spell. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5604 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc143
1 files changed, 91 insertions, 52 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index b4291f5f3b..3c630071b7 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -412,6 +412,70 @@ bool cast_sublimation_of_blood(int pow)
return (success);
}
+bool cast_summon_horrible_things(int pow, bool god_gift)
+{
+ if (one_chance_in(3)
+ && !lose_stat(STAT_INTELLIGENCE, 1, true, "summoning horrible things"))
+ {
+ mpr("Your call goes unanswered.");
+ return (false);
+ }
+
+ int how_many_small =
+ stepdown_value(2 + (random2(pow) / 10) + (random2(pow) / 10),
+ 2, 2, 6, -1);
+ int how_many_big = 0;
+
+ // No more than 2 tentacled monstrosities.
+ while (how_many_small > 2 && how_many_big < 2 && one_chance_in(3))
+ {
+ how_many_small -= 2;
+ how_many_big++;
+ }
+
+ // No more than 8 summons.
+ how_many_small = std::min(8, how_many_small);
+ how_many_big = std::min(8, how_many_big);
+
+ int count = 0;
+
+ while (how_many_big > 0)
+ {
+ if (create_monster(
+ mgen_data(MONS_TENTACLED_MONSTROSITY, BEH_FRIENDLY, 6,
+ you.pos(), you.pet_target,
+ god_gift ? MF_GOD_GIFT : 0)) != -1)
+ {
+ count++;
+ }
+
+ how_many_big--;
+ }
+
+ while (how_many_small > 0)
+ {
+ if (create_monster(
+ mgen_data(MONS_ABOMINATION_LARGE, BEH_FRIENDLY, 6,
+ you.pos(), you.pet_target,
+ god_gift ? MF_GOD_GIFT : 0)) != -1)
+ {
+ count++;
+ }
+
+ how_many_small--;
+ }
+
+ if (count > 0)
+ {
+ mprf("Some Thing%s answered your call!",
+ (count > 1) ? "s" : "");
+ return (true);
+ }
+
+ mpr("Your call goes unanswered.");
+ return (false);
+}
+
// Simulacrum
//
// This spell extends creating undead to Ice mages, as such it's high
@@ -427,7 +491,7 @@ bool cast_sublimation_of_blood(int pow)
// Hides and other "animal part" items are intentionally left out, it's
// unrequired complexity, and fresh flesh makes more "sense" for a spell
// reforming the original monster out of ice anyways.
-bool simulacrum(int pow, bool god_gift)
+bool cast_simulacrum(int pow, bool god_gift)
{
int how_many_max = std::min(8, 4 + random2(pow) / 20);
@@ -478,68 +542,43 @@ bool simulacrum(int pow, bool god_gift)
return (false);
}
-bool summon_horrible_things(int pow, bool god_gift)
+bool cast_summon_wraiths(int pow, bool god_gift)
{
- if (one_chance_in(3)
- && !lose_stat(STAT_INTELLIGENCE, 1, true, "summoning horrible things"))
- {
- mpr("Your call goes unanswered.");
- return (false);
- }
-
- int how_many_small =
- stepdown_value(2 + (random2(pow) / 10) + (random2(pow) / 10),
- 2, 2, 6, -1);
- int how_many_big = 0;
+ bool success = false;
- // No more than 2 tentacled monstrosities.
- while (how_many_small > 2 && how_many_big < 2 && one_chance_in(3))
- {
- how_many_small -= 2;
- how_many_big++;
- }
+ const int chance = random2(25);
+ monster_type mon = ((chance > 8) ? MONS_WRAITH : // 64%
+ (chance > 3) ? MONS_FREEZING_WRAITH // 20%
+ : MONS_SPECTRAL_WARRIOR); // 16%
- // No more than 8 summons.
- how_many_small = std::min(8, how_many_small);
- how_many_big = std::min(8, how_many_big);
-
- int count = 0;
+ const bool friendly = (random2(pow) > 5);
- while (how_many_big > 0)
+ if (create_monster(
+ mgen_data(mon,
+ friendly ? BEH_FRIENDLY : BEH_HOSTILE,
+ 5, you.pos(),
+ friendly ? you.pet_target : MHITYOU,
+ god_gift ? MF_GOD_GIFT : 0)) != -1)
{
- if (create_monster(
- mgen_data(MONS_TENTACLED_MONSTROSITY, BEH_FRIENDLY, 6,
- you.pos(), you.pet_target,
- god_gift ? MF_GOD_GIFT : 0)) != -1)
- {
- count++;
- }
-
- how_many_big--;
- }
-
- while (how_many_small > 0)
- {
- if (create_monster(
- mgen_data(MONS_ABOMINATION_LARGE, BEH_FRIENDLY, 6,
- you.pos(), you.pet_target,
- god_gift ? MF_GOD_GIFT : 0)) != -1)
- {
- count++;
- }
+ success = true;
- how_many_small--;
+ mprf("%s",
+ friendly ? "An insubstantial figure forms in the air."
+ : "You sense a hostile presence.");
}
+ else
+ canned_msg(MSG_NOTHING_HAPPENS);
- if (count > 0)
+ //jmf: Kiku sometimes deflects this
+ if (!(you.religion == GOD_KIKUBAAQUDGHA
+ && (!player_under_penance()
+ && you.piety >= piety_breakpoint(3)
+ && you.piety > random2(MAX_PIETY))))
{
- mprf("Some Thing%s answered your call!",
- (count > 1) ? "s" : "");
- return (true);
+ disease_player(25 + random2(50));
}
- mpr("Your call goes unanswered.");
- return (false);
+ return (success);
}
bool cast_death_channel(int pow, bool god_gift)