summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--crawl-ref/source/butcher.cc3
-rw-r--r--crawl-ref/source/dat/clua/wield.lua12
-rw-r--r--crawl-ref/source/dat/descript/spells.txt7
-rw-r--r--crawl-ref/source/food.cc18
-rw-r--r--crawl-ref/source/item_use.cc8
-rw-r--r--crawl-ref/source/itemname.cc10
-rw-r--r--crawl-ref/source/player.cc14
-rw-r--r--crawl-ref/source/spl-book.cc36
-rw-r--r--crawl-ref/source/spl-other.cc113
-rw-r--r--crawl-ref/source/tilereg-inv.cc13
-rw-r--r--crawl-ref/source/transform.cc8
-rw-r--r--crawl-ref/source/transform.h1
12 files changed, 85 insertions, 158 deletions
diff --git a/crawl-ref/source/butcher.cc b/crawl-ref/source/butcher.cc
index 4528ca62d7..1cd6197d3d 100644
--- a/crawl-ref/source/butcher.cc
+++ b/crawl-ref/source/butcher.cc
@@ -131,10 +131,9 @@ void turn_corpse_into_chunks(item_def &item, bool bloodspatter,
item.quantity = 1 + random2(max_chunks);
item.quantity = stepdown_value(item.quantity, 4, 4, 12, 12);
- bool wants_for_spells = you.has_spell(SPELL_SUBLIMATION_OF_BLOOD);
// Don't mark it as dropped if we are forcing autopickup of chunks.
if (you.force_autopickup[OBJ_FOOD][FOOD_CHUNK] <= 0
- && is_bad_food(item) && !wants_for_spells)
+ && is_bad_food(item))
{
item.flags |= ISFLAG_DROPPED;
}
diff --git a/crawl-ref/source/dat/clua/wield.lua b/crawl-ref/source/dat/clua/wield.lua
index d78d125751..85beff0c0e 100644
--- a/crawl-ref/source/dat/clua/wield.lua
+++ b/crawl-ref/source/dat/clua/wield.lua
@@ -16,18 +16,6 @@ function ch_item_wieldable(it)
-- by Crawl itself.
local spells = make_hash(you.spells())
- if spells["Sublimation of Blood"] and food.ischunk(it)
- then
- return true
- end
-
- if spells["Sublimation of Blood"]
- and (string.find(it.name("a"), " potions? of blood") or
- string.find(it.name("a"), " potions? of coagulated blood"))
- then
- return true
- end
-
if spells["Sandblast"]
and it.class(true) == "missile"
and (string.find(it.name("a"), " stones?")
diff --git a/crawl-ref/source/dat/descript/spells.txt b/crawl-ref/source/dat/descript/spells.txt
index 43327dd6b9..2b34153162 100644
--- a/crawl-ref/source/dat/descript/spells.txt
+++ b/crawl-ref/source/dat/descript/spells.txt
@@ -1206,10 +1206,9 @@ or her more vulnerable to hexes and similar spells.
%%%%
Sublimation of Blood spell
-This spell converts flesh, blood and other bodily fluids into magical energy.
-Casters may focus this spell on their own bodies (which can be dangerous but
-never directly lethal), or can wield freshly butchered flesh in order to draw a
-smaller amount of power into themselves.
+This spell converts some of the caster's blood into magical energy. The process
+is painful but never directly lethal. The efficiency of the conversion
+increases with the spell's power.
%%%%
Summon Air Elementals spell
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index da59fd12f8..f8e542a0e2 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -300,8 +300,7 @@ static bool _corpse_butchery(int corpse_id,
return true;
}
-static int _corpse_badness(corpse_effect_type ce, const item_def &item,
- bool wants_any)
+static int _corpse_badness(corpse_effect_type ce, const item_def &item)
{
// Not counting poisonous chunks as useless here, caller must do that
// themself.
@@ -315,10 +314,6 @@ static int _corpse_badness(corpse_effect_type ce, const item_def &item,
if (ce == CE_POISONOUS)
contam = contam * 3 / 2;
- // Have uses that care about age but not quality?
- if (wants_any)
- contam /= 2;
-
dprf("%s: to rot %d, contam %d -> badness %d",
item.name(DESC_PLAIN).c_str(),
item.special - ROTTING_CORPSE, contam,
@@ -350,8 +345,6 @@ bool butchery(int which_corpse, bool bottle_blood)
return false;
}
- bool wants_any = you.has_spell(SPELL_SUBLIMATION_OF_BLOOD);
-
// First determine how many things there are to butcher.
int num_corpses = 0;
int corpse_id = -1;
@@ -378,7 +371,7 @@ bool butchery(int which_corpse, bool bottle_blood)
corpse_effect_type ce = _determine_chunk_effect(mons_corpse_effect(
si->mon_type),
food_is_rotten(*si));
- int badness = _corpse_badness(ce, *si, wants_any);
+ int badness = _corpse_badness(ce, *si);
if (ce == CE_POISONOUS)
badness += 600;
else if (ce == CE_MUTAGEN)
@@ -2192,8 +2185,6 @@ string hunger_cost_string(const int hunger)
return "None";
}
-// Simulacrum and Sublimation of Blood are handled elsewhere, as they ignore
-// chunk edibility.
static int _chunks_needed()
{
if (you.form == TRAN_LICH)
@@ -2245,7 +2236,6 @@ bool drop_spoiled_chunks()
if (Options.auto_drop_chunks == ADC_NEVER)
return false;
- bool wants_any = you.has_spell(SPELL_SUBLIMATION_OF_BLOOD);
int nchunks = 0;
vector<pair<int, int> > chunk_slots;
for (int slot = 0; slot < ENDOFPACK; slot++)
@@ -2260,7 +2250,7 @@ bool drop_spoiled_chunks()
}
bool rotten = food_is_rotten(item);
- if (rotten && !you.mutation[MUT_SAPROVOROUS] && !wants_any)
+ if (rotten && !you.mutation[MUT_SAPROVOROUS])
return drop_item(slot, item.quantity);
corpse_effect_type ce = _determine_chunk_effect(mons_corpse_effect(
@@ -2270,7 +2260,7 @@ bool drop_spoiled_chunks()
continue; // no nutrition from those
// We assume that carrying poisonous chunks means you can swap rPois in.
- int badness = _corpse_badness(ce, item, wants_any);
+ int badness = _corpse_badness(ce, item);
nchunks += item.quantity;
chunk_slots.push_back(pair<int,int>(slot, badness));
}
diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc
index 59404f6dfc..d3949b4924 100644
--- a/crawl-ref/source/item_use.cc
+++ b/crawl-ref/source/item_use.cc
@@ -224,14 +224,6 @@ static bool _valid_weapon_swap(const item_def &item)
if (item_is_snakable(item) && you.has_spell(SPELL_STICKS_TO_SNAKES))
return true;
- if (you.has_spell(SPELL_SUBLIMATION_OF_BLOOD))
- {
- if (item.base_type == OBJ_FOOD && item.sub_type == FOOD_CHUNK)
- return true;
- if (is_blood_potion(item))
- return true;
- }
-
return false;
}
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index 707a0d83c3..392ac6d5ee 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -3332,10 +3332,6 @@ bool is_useless_item(const item_def &item, bool temp)
case OBJ_POTIONS:
{
- // Not useless, even if you can't quaff it.
- if (you.has_spell(SPELL_SUBLIMATION_OF_BLOOD) && is_blood_potion(item))
- return false;
-
// Mummies can't use potions.
if (you.species == SP_MUMMY)
return true;
@@ -3497,8 +3493,7 @@ bool is_useless_item(const item_def &item, bool temp)
return false;
if (item.sub_type == FOOD_CHUNK
- && (you.has_spell(SPELL_SUBLIMATION_OF_BLOOD)
- || !temp && you.form == TRAN_LICH))
+ && !temp && you.form == TRAN_LICH)
{
return false;
}
@@ -3521,9 +3516,6 @@ bool is_useless_item(const item_def &item, bool temp)
return false;
}
- if (you.has_spell(SPELL_SUBLIMATION_OF_BLOOD))
- return false;
-
return true;
case OBJ_MISCELLANY:
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index 83d9fd8fbf..849f7b46f7 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -7670,17 +7670,9 @@ bool player::can_polymorph() const
bool player::can_bleed(bool allow_tran) const
{
- if (allow_tran)
- {
- // These transformations don't bleed. Lichform is handled as undead.
- if (form == TRAN_STATUE || form == TRAN_ICE_BEAST
- || form == TRAN_SPIDER || form == TRAN_TREE
- || form == TRAN_FUNGUS || form == TRAN_PORCUPINE
- || form == TRAN_SHADOW)
- {
- return false;
- }
- }
+ // XXX: Lich and statue forms are still caught by the holiness checks below.
+ if (allow_tran && !form_can_bleed(form))
+ return false;
if (is_lifeless_undead()
#if TAG_MAJOR_VERSION == 34
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index d7f69b3007..aa7df0b978 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -589,6 +589,24 @@ bool you_cannot_memorise(spell_type spell, bool &form)
rc = true, form = false;
}
+ if (spell == SPELL_SUBLIMATION_OF_BLOOD)
+ {
+ // XXX: Using player::cannot_bleed will incorrectly
+ // catch statue- or lich-formed players.
+ if (you.species == SP_GARGOYLE
+ || you.species == SP_GHOUL
+ || you.species == SP_MUMMY)
+ {
+ rc = true;
+ form = false;
+ }
+ else if (!form_can_bleed(you.form))
+ {
+ rc = true;
+ form = true;
+ }
+ }
+
return rc;
}
@@ -2451,14 +2469,22 @@ void make_book_Kiku_gift(item_def &book, bool first)
if (first)
{
- chosen_spells[0] = coinflip() ? SPELL_PAIN : SPELL_ANIMATE_SKELETON;
+ bool can_bleed = you.species != SP_GARGOYLE
+ && you.species != SP_GHOUL
+ && you.species != SP_MUMMY;
+ bool can_regen = you.species != SP_DEEP_DWARF
+ && you.species != SP_MUMMY;
+ bool pain = coinflip();
+
+ chosen_spells[0] = pain ? SPELL_PAIN : SPELL_ANIMATE_SKELETON;
chosen_spells[1] = SPELL_CORPSE_ROT;
- chosen_spells[2] = SPELL_SUBLIMATION_OF_BLOOD;
- chosen_spells[3] = (you.species == SP_DEEP_DWARF
- || you.species == SP_MUMMY
- || coinflip())
+ chosen_spells[2] = (can_bleed ? SPELL_SUBLIMATION_OF_BLOOD
+ : pain ? SPELL_ANIMATE_SKELETON
+ : SPELL_PAIN);
+ chosen_spells[3] = (!can_regen || coinflip())
? SPELL_VAMPIRIC_DRAINING : SPELL_REGENERATION;
chosen_spells[4] = SPELL_CONTROL_UNDEAD;
+
}
else
{
diff --git a/crawl-ref/source/spl-other.cc b/crawl-ref/source/spl-other.cc
index 85886dc579..713b1909ab 100644
--- a/crawl-ref/source/spl-other.cc
+++ b/crawl-ref/source/spl-other.cc
@@ -58,99 +58,52 @@ spret_type cast_sublimation_of_blood(int pow, bool fail)
{
bool success = false;
- int wielded = you.equip[EQ_WEAPON];
-
- if (wielded != -1)
+ if (you.duration[DUR_DEATHS_DOOR])
{
- if (you.inv[wielded].base_type == OBJ_FOOD
- && you.inv[wielded].sub_type == FOOD_CHUNK)
- {
- fail_check();
- success = true;
-
- mpr("The chunk of flesh you are holding crumbles to dust.");
-
- mpr("A flood of magical energy pours into your mind!");
-
- inc_mp(5 + random2(2 + pow / 15));
-
- dec_inv_item_quantity(wielded, 1);
+ mpr("A conflicting enchantment prevents the spell from coming into "
+ "effect.");
+ }
+ else if (!you.can_bleed())
+ {
+ if (you.species == SP_VAMPIRE)
+ mpr("You don't have enough blood to draw power from your own body.");
+ else
+ mpr("Your body is bloodless.");
+ }
+ else if (!enough_hp(2, true))
+ mpr("Your attempt to draw power from your own body fails.");
+ else
+ {
+ int food = 0;
+ // Take at most 90% of currhp.
+ const int minhp = max(div_rand_round(you.hp, 10), 1);
- if (mons_genus(you.inv[wielded].mon_type) == MONS_ORC)
- did_god_conduct(DID_DESECRATE_ORCISH_REMAINS, 2);
- if (mons_class_holiness(you.inv[wielded].mon_type) == MH_HOLY)
- did_god_conduct(DID_DESECRATE_HOLY_REMAINS, 2);
- }
- else if (is_blood_potion(you.inv[wielded])
- && item_type_known(you.inv[wielded]))
+ while (you.magic_points < you.max_magic_points && you.hp > minhp
+ && (you.is_undead != US_SEMI_UNDEAD
+ || you.hunger - food >= HUNGER_SATIATED))
{
fail_check();
success = true;
- mprf("The blood within %s froths and boils.",
- you.inv[wielded].quantity > 1 ? "one of your flasks"
- : "the flask you are holding");
+ inc_mp(1);
+ dec_hp(1, false);
- mpr("A flood of magical energy pours into your mind!");
+ if (you.is_undead == US_SEMI_UNDEAD)
+ food += 15;
- inc_mp(5 + random2(2 + pow / 15));
+ for (int loopy = 0; loopy < (you.hp > minhp ? 3 : 0); ++loopy)
+ if (x_chance_in_y(6, pow))
+ dec_hp(1, false);
- remove_oldest_blood_potion(you.inv[wielded]);
- dec_inv_item_quantity(wielded, 1);
+ if (x_chance_in_y(6, pow))
+ break;
}
+ if (success)
+ mpr("You draw magical energy from your own body!");
else
- wielded = -1;
- }
-
- if (wielded == -1)
- {
- if (you.duration[DUR_DEATHS_DOOR])
- {
- mpr("A conflicting enchantment prevents the spell from "
- "coming into effect.");
- }
- else if (!you.can_bleed())
- {
- if (you.species == SP_VAMPIRE)
- mpr("You don't have enough blood to draw power from your own body.");
- else
- mpr("Your body is bloodless.");
- }
- else if (!enough_hp(2, true))
mpr("Your attempt to draw power from your own body fails.");
- else
- {
- int food = 0;
- // Take at most 90% of currhp.
- const int minhp = max(div_rand_round(you.hp, 10), 1);
- while (you.magic_points < you.max_magic_points && you.hp > minhp
- && (you.is_undead != US_SEMI_UNDEAD
- || you.hunger - food >= HUNGER_SATIATED))
- {
- fail_check();
- success = true;
-
- inc_mp(1);
- dec_hp(1, false);
-
- if (you.is_undead == US_SEMI_UNDEAD)
- food += 15;
-
- for (int loopy = 0; loopy < (you.hp > minhp ? 3 : 0); ++loopy)
- if (x_chance_in_y(6, pow))
- dec_hp(1, false);
-
- if (x_chance_in_y(6, pow))
- break;
- }
- if (success)
- mpr("You draw magical energy from your own body!");
- else
- mpr("Your attempt to draw power from your own body fails.");
-
- make_hungry(food, false);
- }
+ make_hungry(food, false);
}
return success ? SPRET_SUCCESS : SPRET_ABORT;
diff --git a/crawl-ref/source/tilereg-inv.cc b/crawl-ref/source/tilereg-inv.cc
index c4fff33b3d..d34c279cb4 100644
--- a/crawl-ref/source/tilereg-inv.cc
+++ b/crawl-ref/source/tilereg-inv.cc
@@ -529,27 +529,14 @@ bool InventoryRegion::update_tip_text(string& tip)
case OBJ_POTIONS:
tmp += "Quaff (%)";
cmd.push_back(CMD_QUAFF);
- // For Sublimation of Blood.
if (wielded)
_handle_wield_tip(tmp, cmd, "\n[Ctrl + L-Click] ", true);
- else if (item_type_known(item)
- && is_blood_potion(item)
- && you.has_spell(SPELL_SUBLIMATION_OF_BLOOD))
- {
- _handle_wield_tip(tmp, cmd, "\n[Ctrl + L-Click] ");
- }
break;
case OBJ_FOOD:
tmp += "Eat (%)";
cmd.push_back(CMD_EAT);
- // For Sublimation of Blood.
if (wielded)
_handle_wield_tip(tmp, cmd, "\n[Ctrl + L-Click] ", true);
- else if (item.sub_type == FOOD_CHUNK
- && you.has_spell(SPELL_SUBLIMATION_OF_BLOOD))
- {
- _handle_wield_tip(tmp, cmd, "\n[Ctrl + L-Click] ");
- }
break;
case OBJ_CORPSES:
if (you.species == SP_VAMPIRE)
diff --git a/crawl-ref/source/transform.cc b/crawl-ref/source/transform.cc
index 2a4eb7e091..f1f1417c31 100644
--- a/crawl-ref/source/transform.cc
+++ b/crawl-ref/source/transform.cc
@@ -150,6 +150,14 @@ bool form_changed_physiology(transformation_type form)
&& form != TRAN_BLADE_HANDS;
}
+bool form_can_bleed(transformation_type form)
+{
+ return form != TRAN_STATUE && form != TRAN_ICE_BEAST
+ && form != TRAN_SPIDER && form != TRAN_TREE
+ && form != TRAN_FUNGUS && form != TRAN_PORCUPINE
+ && form != TRAN_SHADOW && form != TRAN_LICH;
+}
+
bool form_can_use_wand(transformation_type form)
{
return form_can_wield(form) || form == TRAN_DRAGON;
diff --git a/crawl-ref/source/transform.h b/crawl-ref/source/transform.h
index 3669a54fdf..8503742eac 100644
--- a/crawl-ref/source/transform.h
+++ b/crawl-ref/source/transform.h
@@ -18,6 +18,7 @@ bool form_can_swim(transformation_type form = you.form);
bool form_likes_water(transformation_type form = you.form);
bool form_likes_lava(transformation_type form = you.form);
bool form_changed_physiology(transformation_type form = you.form);
+bool form_can_bleed(transformation_type form = you.form);
bool form_can_use_wand(transformation_type form = you.form);
bool form_can_wear_item(const item_def& item,
transformation_type form = you.form);