summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spells3.cc
diff options
context:
space:
mode:
authordolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 16:56:49 +0000
committerdolorous <dolorous@c06c8d41-db1a-0410-9941-cceddc491573>2008-06-08 16:56:49 +0000
commit1ae58f4e6c97657d8777457da0a78adaa19c6b17 (patch)
tree9743c27e0835aa801219a38095ae21122da3df10 /crawl-ref/source/spells3.cc
parent073c543794a6c722916775207213877500167327 (diff)
downloadcrawl-ref-1ae58f4e6c97657d8777457da0a78adaa19c6b17.tar.gz
crawl-ref-1ae58f4e6c97657d8777457da0a78adaa19c6b17.zip
Clean up "Sublimation of Blood" and "Death Channel".
git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@5599 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spells3.cc')
-rw-r--r--crawl-ref/source/spells3.cc91
1 files changed, 49 insertions, 42 deletions
diff --git a/crawl-ref/source/spells3.cc b/crawl-ref/source/spells3.cc
index 028fced8e3..231bb6ad8a 100644
--- a/crawl-ref/source/spells3.cc
+++ b/crawl-ref/source/spells3.cc
@@ -328,33 +328,38 @@ bool cast_bone_shards(int power, bolt &beam)
return (success);
}
-void sublimation(int power)
+bool cast_sublimation_of_blood(int pow)
{
+ bool success = false;
+
int wielded = you.equip[EQ_WEAPON];
+
if (wielded != -1)
{
if (you.inv[wielded].base_type == OBJ_FOOD
&& you.inv[wielded].sub_type == FOOD_CHUNK)
{
mpr("The chunk of flesh you are holding crumbles to dust.");
+
mpr("A flood of magical energy pours into your mind!");
- inc_mp( 7 + random2(7), false );
+ inc_mp(7 + random2(7), false);
- dec_inv_item_quantity( wielded, 1 );
+ dec_inv_item_quantity(wielded, 1);
}
else if (is_blood_potion(you.inv[wielded]))
{
mprf("The blood within %s frothes and boils.",
- you.inv[wielded].quantity == 1 ? "the flask you are holding"
- : "one of your flasks");
-
- split_potions_into_decay( wielded, 1, false );
+ you.inv[wielded].quantity > 1 ? "one of your flasks"
+ : "the flask you are holding");
mpr("A flood of magical energy pours into your mind!");
- inc_mp( 7 + random2(7), false );
+
+ inc_mp(7 + random2(7), false);
+
+ split_potions_into_decay(wielded, 1, false);
}
- else // no appropriate item wielded
+ else
wielded = -1;
}
@@ -370,38 +375,42 @@ void sublimation(int power)
mpr("You don't have enough blood to draw power from your "
"own body.");
}
- else if (!enough_hp( 2, true ))
- {
+ else if (!enough_hp(2, true))
mpr("Your attempt to draw power from your own body fails.");
- }
else
{
+ // For vampires.
+ int food = 0;
+
mpr("You draw magical energy from your own body!");
- unsigned char loopy = 0; // general purpose loop variable {dlb}
- int food = 0; // for Vampires
while (you.magic_points < you.max_magic_points && you.hp > 1
&& (you.species != SP_VAMPIRE || you.hunger - food >= 7000))
{
+ success = true;
+
inc_mp(1, false);
dec_hp(1, false);
if (you.species == SP_VAMPIRE)
food += 15;
- for (loopy = 0; loopy < (you.hp > 1 ? 3 : 0); loopy++)
- if (random2(power) < 6)
+ for (int loopy = 0; loopy < (you.hp > 1 ? 3 : 0); ++loopy)
+ {
+ if (random2(pow) < 6)
dec_hp(1, false);
+ }
- if (random2(power) < 6)
+ if (random2(pow) < 6)
break;
}
+
make_hungry(food, false);
}
}
- return;
-} // end sublimation()
+ return (success);
+}
// Simulacrum
//
@@ -469,6 +478,27 @@ bool simulacrum(int pow, bool god_gift)
return (false);
}
+bool cast_death_channel(int pow)
+{
+ bool success = false;
+
+ if (you.duration[DUR_DEATH_CHANNEL] < 30)
+ {
+ mpr("Malign forces permeate your being, awaiting release.");
+
+ you.duration[DUR_DEATH_CHANNEL] += 15 + random2(1 + (pow / 3));
+
+ if (you.duration[DUR_DEATH_CHANNEL] > 100)
+ you.duration[DUR_DEATH_CHANNEL] = 100;
+
+ success = true;
+ }
+ else
+ canned_msg(MSG_NOTHING_HAPPENS);
+
+ return (success);
+}
+
// This function returns true if the player can use controlled teleport
// here.
bool allow_control_teleport(bool quiet)
@@ -1203,26 +1233,3 @@ int portal()
return (1);
}
-
-bool cast_death_channel(int power)
-{
- bool success = false;
-
- if (you.duration[DUR_DEATH_CHANNEL] < 30)
- {
- mpr("Malign forces permeate your being, awaiting release.");
-
- you.duration[DUR_DEATH_CHANNEL] += 15 + random2(1 + (power / 3));
-
- if (you.duration[DUR_DEATH_CHANNEL] > 100)
- you.duration[DUR_DEATH_CHANNEL] = 100;
-
- success = true;
- }
- else
- {
- canned_msg(MSG_NOTHING_HAPPENS);
- }
-
- return (success);
-} // end cast_death_channel()