summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/spl-book.cc
diff options
context:
space:
mode:
authorharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-23 13:22:17 +0000
committerharanp <haranp@c06c8d41-db1a-0410-9941-cceddc491573>2009-02-23 13:22:17 +0000
commit4e381e6a083d562fabe8c1d7a2be60720be59238 (patch)
tree5804617aa72b3cead3fa0222d0d976a9538c23bd /crawl-ref/source/spl-book.cc
parent4f849c43a3add816fd41f0e3c89e387558015419 (diff)
downloadcrawl-ref-4e381e6a083d562fabe8c1d7a2be60720be59238.tar.gz
crawl-ref-4e381e6a083d562fabe8c1d7a2be60720be59238.zip
Add Deep Dwarves patch, with some minor changes.
Add a new mutation, MUT_SLOW_HEALING, which at level 3 blocks all healing; it can't be acquired randomly, but deep dwarves start with it at level 3. This overrides regeneration, including the god-given kind (Trog's Hand.) Fix mutation listings (hopefully I got this right.) There are still some cases where DD HP shaving is not applied: ability HP costs, Staff of Dispater effect, vampiric draining backlash, Sublimation of Blood spell. Fix dancing weapons leaving mgrd incorrect if their weapon can't be generated. Breaks saves. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@9173 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source/spl-book.cc')
-rw-r--r--crawl-ref/source/spl-book.cc41
1 files changed, 22 insertions, 19 deletions
diff --git a/crawl-ref/source/spl-book.cc b/crawl-ref/source/spl-book.cc
index 65052132b5..48db8369c7 100644
--- a/crawl-ref/source/spl-book.cc
+++ b/crawl-ref/source/spl-book.cc
@@ -1199,16 +1199,10 @@ int read_book( item_def &book, read_book_action_type action )
return (keyin);
}
-// Recoded to answer whether an UNDEAD_STATE is
-// barred from a particular spell passed to the
-// function. Note that the function can be expanded
-// to prevent memorisation of certain spells by
-// the living by setting up an US_ALIVE case returning
-// a value of false for a set of spells ... might be
-// an idea worth further consideration. - 12mar2000 {dlb}
-bool undead_cannot_memorise(spell_type spell, char being)
+bool you_cannot_memorise(spell_type spell)
{
- switch (being)
+ bool rc = false;
+ switch (you.is_undead)
{
case US_HUNGRY_DEAD: // Ghouls
switch (spell)
@@ -1229,9 +1223,10 @@ bool undead_cannot_memorise(spell_type spell, char being)
case SPELL_STONESKIN:
case SPELL_SYMBOL_OF_TORMENT:
case SPELL_TAME_BEASTS:
- return (true);
+ rc = true;
+ break;
default:
- return (false);
+ break;
}
break;
@@ -1241,11 +1236,12 @@ bool undead_cannot_memorise(spell_type spell, char being)
case SPELL_BORGNJORS_REVIVIFICATION:
case SPELL_DEATHS_DOOR:
case SPELL_NECROMUTATION:
- return (true);
- default:
// In addition, the above US_HUNGRY_DEAD spells are not castable
// when satiated or worse.
- return (false);
+ rc = true;
+ break;
+ default:
+ break;
}
break;
@@ -1272,14 +1268,21 @@ bool undead_cannot_memorise(spell_type spell, char being)
case SPELL_SUMMON_HORRIBLE_THINGS:
case SPELL_SYMBOL_OF_TORMENT:
case SPELL_TAME_BEASTS:
- return (true);
+ rc = true;
+ break;
default:
- return (false);
+ break;
}
break;
+
+ case US_ALIVE:
+ break;
}
- return (false);
+ if (you.species == SP_DEEP_DWARF && spell == SPELL_REGENERATION)
+ rc = true;
+
+ return (rc);
}
bool player_can_memorise(const item_def &book)
@@ -1397,7 +1400,7 @@ bool learn_spell(int book)
return (false);
}
- if (undead_cannot_memorise(specspell, you.is_undead))
+ if (you_cannot_memorise(specspell))
{
mpr("You cannot use this spell.");
return (false);
@@ -1772,7 +1775,7 @@ static void _get_spell_list(std::vector<spell_type> &spell_list, int level,
#endif
}
- if (avoid_uncastable && undead_cannot_memorise(spell, you.is_undead))
+ if (avoid_uncastable && you_cannot_memorise(spell))
{
uncastable_discard++;
continue;