summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
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
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')
-rw-r--r--crawl-ref/source/abl-show.cc13
-rw-r--r--crawl-ref/source/acr.cc2
-rw-r--r--crawl-ref/source/dat/descript/ability.txt4
-rw-r--r--crawl-ref/source/debug.cc2
-rw-r--r--crawl-ref/source/delay.cc12
-rw-r--r--crawl-ref/source/effects.cc16
-rw-r--r--crawl-ref/source/enum.h43
-rw-r--r--crawl-ref/source/itemname.cc5
-rw-r--r--crawl-ref/source/monplace.cc1
-rw-r--r--crawl-ref/source/mutation.cc52
-rw-r--r--crawl-ref/source/newgame.cc65
-rw-r--r--crawl-ref/source/ouch.cc14
-rw-r--r--crawl-ref/source/output.cc3
-rw-r--r--crawl-ref/source/player.cc93
-rw-r--r--crawl-ref/source/skills2.cc43
-rw-r--r--crawl-ref/source/spl-book.cc41
-rw-r--r--crawl-ref/source/spl-book.h2
-rw-r--r--crawl-ref/source/spl-cast.cc9
18 files changed, 306 insertions, 114 deletions
diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc
index 9fb013665d..86f4050413 100644
--- a/crawl-ref/source/abl-show.cc
+++ b/crawl-ref/source/abl-show.cc
@@ -203,6 +203,7 @@ static const ability_def Ability_List[] =
{ ABIL_EVOKE_MAPPING, "Evoke Sense Surroundings", 0, 0, 30, 0, ABFLAG_NONE },
{ ABIL_EVOKE_TELEPORTATION, "Evoke Teleportation", 3, 0, 200, 0, ABFLAG_NONE },
{ ABIL_EVOKE_BLINK, "Evoke Blink", 1, 0, 50, 0, ABFLAG_NONE },
+ { ABIL_RECHARGING, "Wand Recharging", 1, 0, 0, 0, ABFLAG_PERMANENT_MP },
{ ABIL_EVOKE_BERSERK, "Evoke Berserk Rage", 0, 0, 0, 0, ABFLAG_NONE },
@@ -530,6 +531,10 @@ static talent _get_talent(ability_type ability, bool check_confused)
case ABIL_TRAN_BAT:
failure = 45 - (2 * you.experience_level);
break;
+
+ case ABIL_RECHARGING: // this is for deep dwarves {1KB}
+ failure = 45 - (2 * you.experience_level);
+ break;
// end species abilties (some mutagenic)
// begin demonic powers {dlb}
@@ -1106,6 +1111,11 @@ static bool _do_ability(const ability_def& abil)
break;
}
+ case ABIL_RECHARGING:
+ if (!recharge_wand(-1))
+ return (false); // fail message is already given
+ break;
+
case ABIL_DELAYED_FIREBALL:
{
// Note: power level of ball calculated at release -- bwr
@@ -2089,6 +2099,9 @@ std::vector<talent> your_talents( bool check_confused )
if (you.species == SP_MUMMY && you.experience_level >= 13)
_add_talent(talents, ABIL_MUMMY_RESTORATION, check_confused);
+ if (you.species == SP_DEEP_DWARF)
+ _add_talent(talents, ABIL_RECHARGING, check_confused);
+
// Spit Poison. Nontransformed nagas can upgrade to Breathe Poison.
// Transformed nagas, or non-nagas, can only get Spit Poison.
if (you.species == SP_NAGA
diff --git a/crawl-ref/source/acr.cc b/crawl-ref/source/acr.cc
index 381003f459..455722b514 100644
--- a/crawl-ref/source/acr.cc
+++ b/crawl-ref/source/acr.cc
@@ -2334,6 +2334,8 @@ static void _decrement_durations()
make_hungry(700, true);
you.hunger = std::max(50, you.hunger);
+ // 1KB: No berserk healing.
+ you.hp = (you.hp + 1) * 2 / 3;
calc_hp();
learned_something_new(TUT_POSTBERSERK);
diff --git a/crawl-ref/source/dat/descript/ability.txt b/crawl-ref/source/dat/descript/ability.txt
index bf600d2070..4b2f070dec 100644
--- a/crawl-ref/source/dat/descript/ability.txt
+++ b/crawl-ref/source/dat/descript/ability.txt
@@ -113,6 +113,10 @@ Self-Restoration
At the permanent loss of one magic point restore your Strength, Dexterity and Intelligence, and heal a large amount of rotted hitpoints.
%%%%
+Wand Recharging
+
+At the permanent loss of one magic point recharge a wand or rod or enchant a weapon of electrocution.
+%%%%
Evoke Sense Surroundings
You can map your vicinity.
diff --git a/crawl-ref/source/debug.cc b/crawl-ref/source/debug.cc
index 357183b227..ab6fd1925a 100644
--- a/crawl-ref/source/debug.cc
+++ b/crawl-ref/source/debug.cc
@@ -3760,6 +3760,7 @@ static const char *mutation_type_names[] =
"cold resistance",
"shock resistance",
"regeneration",
+ "slow healing",
"fast metabolism",
"slow metabolism",
"weak",
@@ -3818,7 +3819,6 @@ static const char *mutation_type_names[] =
"high mp",
"low mp",
"",
- "",
// from here on scales
"red scales",
diff --git a/crawl-ref/source/delay.cc b/crawl-ref/source/delay.cc
index b8caa84917..141874dbd7 100644
--- a/crawl-ref/source/delay.cc
+++ b/crawl-ref/source/delay.cc
@@ -1197,14 +1197,14 @@ static void _finish_delay(const delay_queue_item &delay)
if (god_hates_cannibalism(you.religion)
&& is_player_same_species(item.plus))
{
- simple_god_message(" expects more respect for your departed "
- "relatives.");
+ simple_god_message(" expects more respect for your"
+ " departed relatives.");
}
else if (you.religion == GOD_ZIN
&& mons_class_intel(item.plus) >= I_NORMAL)
{
- simple_god_message(" expects more respect for this departed "
- "soul.");
+ simple_god_message(" expects more respect for this"
+ " departed soul.");
}
if (you.species == SP_VAMPIRE && delay.type == DELAY_BUTCHER
@@ -1241,7 +1241,7 @@ static void _finish_delay(const delay_queue_item &delay)
autopickup();
}
- // If we were interrupted while butchering (by poisonig, for
+ // If we were interrupted while butchering (by poisoning, for
// example) then resumed butchering and finished, swap back from
// butchering tool if appropriate.
if (you.delay_queue.size() == 1)
@@ -1282,7 +1282,7 @@ static void _finish_delay(const delay_queue_item &delay)
offer_corpse(delay.parm1);
StashTrack.update_stash(); // Don't stash-track this corpse anymore.
}
- // If we were interrupted while butchering (by poisonig, for
+ // If we were interrupted while butchering (by poisoning, for
// example) then resumed butchering and finished, swap back from
// butchering tool if appropriate.
if (you.delay_queue.size() == 1)
diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc
index 9220fb12b5..8a770bafd5 100644
--- a/crawl-ref/source/effects.cc
+++ b/crawl-ref/source/effects.cc
@@ -3105,14 +3105,18 @@ void handle_time(long time_delta)
// Adjust the player's stats if s/he's diseased (or recovering).
if (!you.disease)
{
- if (you.strength < you.max_strength && one_chance_in(100))
- restore_stat(STAT_STRENGTH, 0, false, true);
+ // With slow healing 3, you have no stat recovery.
+ if (x_chance_in_y(3 - you.mutation[MUT_SLOW_HEALING], 3))
+ {
+ if (you.strength < you.max_strength && one_chance_in(100))
+ restore_stat(STAT_STRENGTH, 0, false, true);
- if (you.intel < you.max_intel && one_chance_in(100))
- restore_stat(STAT_INTELLIGENCE, 0, false, true);
+ if (you.intel < you.max_intel && one_chance_in(100))
+ restore_stat(STAT_INTELLIGENCE, 0, false, true);
- if (you.dex < you.max_dex && one_chance_in(100))
- restore_stat(STAT_DEXTERITY, 0, false, true);
+ if (you.dex < you.max_dex && one_chance_in(100))
+ restore_stat(STAT_DEXTERITY, 0, false, true);
+ }
}
else
{
diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h
index cc0f2290ba..3c062bebe4 100644
--- a/crawl-ref/source/enum.h
+++ b/crawl-ref/source/enum.h
@@ -45,7 +45,8 @@ enum ability_type
ABIL_EVOKE_MAPPING, // 30
ABIL_EVOKE_TELEPORTATION,
ABIL_EVOKE_BLINK, // 32
- // 33 - 50 unused
+ ABIL_RECHARGING,
+ // 34 - 50 unused
ABIL_EVOKE_TURN_INVISIBLE = 51, // 51
ABIL_EVOKE_TURN_VISIBLE,
ABIL_EVOKE_LEVITATE,
@@ -2246,80 +2247,81 @@ enum mon_spellbook_type
enum mutation_type
{
- MUT_TOUGH_SKIN, // 0
+ MUT_TOUGH_SKIN,
MUT_STRONG,
MUT_CLEVER,
MUT_AGILE,
MUT_GREEN_SCALES,
- MUT_BLACK_SCALES, // 5
+ MUT_BLACK_SCALES,
MUT_GREY_SCALES,
MUT_BONEY_PLATES,
MUT_REPULSION_FIELD,
MUT_POISON_RESISTANCE,
- MUT_CARNIVOROUS, // 10
+ MUT_CARNIVOROUS,
MUT_HERBIVOROUS,
MUT_HEAT_RESISTANCE,
MUT_COLD_RESISTANCE,
MUT_SHOCK_RESISTANCE,
- MUT_REGENERATION, // 15
+ MUT_REGENERATION,
+ MUT_SLOW_HEALING,
MUT_FAST_METABOLISM,
MUT_SLOW_METABOLISM,
MUT_WEAK,
MUT_DOPEY,
- MUT_CLUMSY, // 20
+ MUT_CLUMSY,
MUT_TELEPORT_CONTROL,
MUT_TELEPORT,
MUT_MAGIC_RESISTANCE,
MUT_FAST,
- MUT_ACUTE_VISION, // 25
+ MUT_ACUTE_VISION,
MUT_DEFORMED,
MUT_TELEPORT_AT_WILL,
MUT_SPIT_POISON,
MUT_MAPPING,
- MUT_BREATHE_FLAMES, // 30
+ MUT_BREATHE_FLAMES,
MUT_BLINK,
MUT_HORNS,
MUT_BEAK,
MUT_STRONG_STIFF,
- MUT_FLEXIBLE_WEAK, // 35
+ MUT_FLEXIBLE_WEAK,
MUT_SCREAM,
MUT_CLARITY,
MUT_BERSERK,
MUT_DETERIORATION,
- MUT_BLURRY_VISION, // 40
+ MUT_BLURRY_VISION,
MUT_MUTATION_RESISTANCE,
MUT_FRAIL,
MUT_ROBUST,
MUT_TORMENT_RESISTANCE,
- MUT_NEGATIVE_ENERGY_RESISTANCE, // 45
+ MUT_NEGATIVE_ENERGY_RESISTANCE,
MUT_SUMMON_MINOR_DEMONS,
MUT_SUMMON_DEMONS,
MUT_HURL_HELLFIRE,
MUT_CALL_TORMENT,
- MUT_RAISE_DEAD, // 50
+ MUT_RAISE_DEAD,
MUT_CONTROL_DEMONS,
MUT_PANDEMONIUM,
MUT_DEATH_STRENGTH,
MUT_CHANNEL_HELL,
- MUT_DRAIN_LIFE, // 55
+ MUT_DRAIN_LIFE,
MUT_THROW_FLAMES,
MUT_THROW_FROST,
MUT_SMITE,
MUT_CLAWS,
- MUT_FANGS, // new in 0.3 -- 60
+ MUT_FANGS,
// hooves and talons can replace feet
MUT_HOOVES,
- MUT_TALONS, // new in 0.4
+ MUT_TALONS,
MUT_BREATHE_POISON,
MUT_STINGER,
- MUT_BIG_WINGS, // 65
+ MUT_BIG_WINGS,
MUT_BLUE_MARKS, // decorative, as in "mark of the devil"
MUT_GREEN_MARKS,
MUT_SAPROVOROUS,
MUT_GOURMAND,
- MUT_SHAGGY_FUR, // new in 0.4 -- 70
- MUT_HIGH_MAGIC, // new in 0.4
- MUT_LOW_MAGIC, // new in 0.4
+ MUT_SHAGGY_FUR,
+ MUT_HIGH_MAGIC,
+ MUT_LOW_MAGIC,
// several types of scales (affect AC and sometimes more)
MUT_RED_SCALES = 75, // 75
@@ -2346,7 +2348,7 @@ enum mutation_type
RANDOM_BAD_MUTATION = 103
};
-enum object_class_type // (unsigned char) mitm[].base_type
+enum object_class_type // mitm[].base_type
{
OBJ_WEAPONS, // 0
OBJ_MISSILES,
@@ -2620,6 +2622,7 @@ enum species_type
SP_KENKU,
SP_MERFOLK,
SP_VAMPIRE,
+ SP_DEEP_DWARF,
SP_ELF, // (placeholder)
SP_HILL_DWARF, // (placeholder)
SP_OGRE_MAGE, // (placeholder)
diff --git a/crawl-ref/source/itemname.cc b/crawl-ref/source/itemname.cc
index bf8ac98924..7b32d44b99 100644
--- a/crawl-ref/source/itemname.cc
+++ b/crawl-ref/source/itemname.cc
@@ -2579,8 +2579,9 @@ bool is_useless_item(const item_def &item, bool temp)
&& you.hunger_state == HS_STARVING);
case RING_REGENERATION:
- return (temp && you.species == SP_VAMPIRE
- && you.hunger_state == HS_STARVING);
+ return ((you.mutation[MUT_SLOW_HEALING] == 3)
+ || temp && you.species == SP_VAMPIRE
+ && you.hunger_state == HS_STARVING);
case RING_SEE_INVISIBLE:
return (player_mutation_level(MUT_ACUTE_VISION));
diff --git a/crawl-ref/source/monplace.cc b/crawl-ref/source/monplace.cc
index 33ee9a13b1..bd117cf5d2 100644
--- a/crawl-ref/source/monplace.cc
+++ b/crawl-ref/source/monplace.cc
@@ -1134,6 +1134,7 @@ static int _place_monster_aux(const mgen_data &mg,
{
menv[id].destroy_inventory();
menv[id].reset();
+ mgrd(fpos) = NON_MONSTER;
return (-1);
}
else
diff --git a/crawl-ref/source/mutation.cc b/crawl-ref/source/mutation.cc
index 6aa07adc27..9dc7982799 100644
--- a/crawl-ref/source/mutation.cc
+++ b/crawl-ref/source/mutation.cc
@@ -82,7 +82,7 @@ const char *naga_deformed_descrip[3] = {
"Armour fits poorly on your badly deformed serpentine body."
};
-const char *mutation_descrip[][3] = {
+const char *mutation_descrip[NUM_MUTATIONS][3] = {
{"You have tough skin (AC +1).", "You have very tough skin (AC +2).",
"You have extremely tough skin (AC +3)."},
@@ -112,7 +112,6 @@ const char *mutation_descrip[][3] = {
{"Your system is immune to poisons.", "", ""},
-// 10
{"Your digestive system is specialised to digest meat.",
"Your digestive system is highly specialised to digest meat.",
"You are carnivorous and can eat meat at any time."},
@@ -132,6 +131,8 @@ const char *mutation_descrip[][3] = {
"You heal very quickly.",
"You regenerate."},
+ {"You heal slowly.", "You heal very slowly.", "You do not heal naturally."},
+
{"You have a fast metabolism.", "You have a very fast metabolism.",
"Your metabolism is lightning-fast."},
@@ -141,7 +142,6 @@ const char *mutation_descrip[][3] = {
{"You are weak (Str -", "", ""},
{"You are dopey (Int -", "", ""},
-// 20
{"You are clumsy (Dex -", "", ""},
{"You can control translocations.", "You can control translocations.",
@@ -174,7 +174,6 @@ const char *mutation_descrip[][3] = {
"You can sense your surroundings.",
"You can sense a large area of your surroundings."},
-// 30
{"You can breathe flames.", "You can breathe fire.",
"You can breathe blasts of fire."},
@@ -211,7 +210,6 @@ const char *mutation_descrip[][3] = {
{"Your body is slowly deteriorating.", "Your body is deteriorating.",
"Your body is rapidly deteriorating."},
-// 40
{"Your vision is a little blurry.", "Your vision is quite blurry.",
"Your vision is extremely blurry."},
@@ -240,7 +238,6 @@ const char *mutation_descrip[][3] = {
{"You can call on the torments of Hell.", "", ""},
// Not summoners/necromancers/worshippers of Yredelemnul
-// 50
{"You can raise the dead to walk for you.", "", ""},
{"You can control demons.", "", ""},
{"You can travel to (but not from) Pandemonium at will.", "", ""},
@@ -261,7 +258,6 @@ const char *mutation_descrip[][3] = {
{"You have sharp fingernails.", "You have very sharp fingernails.",
"You have claws for hands."},
-// 60
{"You have very sharp teeth.", "You have extremely sharp teeth.",
"You have razor-sharp teeth."},
@@ -294,7 +290,6 @@ const char *mutation_descrip[][3] = {
{"You like to eat raw meat.", "", ""},
-// 70
{"You are covered in fur.",
"You are covered in thick fur.",
"Your thick and shaggy fur keeps you warm."},
@@ -308,10 +303,7 @@ const char *mutation_descrip[][3] = {
"Your magical capacity is extremely low (-30 percent mp)."},
{"", "", ""},
- {"", "", ""},
- {"", "", ""},
-// 75
{"You are partially covered in red scales (AC + 1).",
"You are mostly covered in red scales (AC + 2).",
"You are covered in red scales (AC + 4)."},
@@ -352,7 +344,6 @@ const char *mutation_descrip[][3] = {
"You are mostly covered in purple scales (AC + 4).",
"You are completely covered in purple scales (AC + 6)."},
-// 85
{"You are partially covered in speckled scales (AC + 1).",
"You are mostly covered in speckled scales (AC + 2).",
"You are covered in speckled scales (AC + 3)."},
@@ -381,7 +372,7 @@ const char *mutation_descrip[][3] = {
// If giving a mutation which must succeed (eg demonspawn), must add
// exception to the "resist mutation" mutation thing.
-const char *gain_mutation[][3] = {
+const char *gain_mutation[NUM_MUTATIONS][3] = {
{"Your skin toughens.", "Your skin toughens.", "Your skin toughens."},
{"", "", ""}, // replaced with player::modify_stat() handling {dlb}
@@ -429,6 +420,10 @@ const char *gain_mutation[][3] = {
"You begin to heal more quickly.",
"You begin to regenerate."},
+ {"You begin to heal more slowly.",
+ "You begin to heal more slowly.",
+ "You stop healing."},
+
{"You feel a little hungry.", "You feel a little hungry.",
"You feel a little hungry."},
@@ -572,8 +567,6 @@ const char *gain_mutation[][3] = {
"You feel less energetic."},
{"", "", ""},
- {"", "", ""},
- {"", "", ""},
// 75
{"Red scales grow over part of your body.",
@@ -628,7 +621,7 @@ const char *gain_mutation[][3] = {
"Patterned scales cover you completely."}
};
-const char *lose_mutation[][3] = {
+const char *lose_mutation[NUM_MUTATIONS][3] = {
{"Your skin feels delicate.", "Your skin feels delicate.",
"Your skin feels delicate."},
@@ -677,6 +670,9 @@ const char *lose_mutation[][3] = {
{"Your rate of healing slows.", "Your rate of healing slows.",
"Your rate of healing slows."},
+ {"Your rate of healing increases.", "Your rate of healing increases.",
+ "Your rate of healing increases."},
+
{"Your metabolism slows.", "Your metabolism slows.",
"Your metabolism slows."},
@@ -804,8 +800,6 @@ const char *lose_mutation[][3] = {
"You feel more energetic."},
{"", "", ""},
- {"", "", ""},
- {"", "", ""},
// 75
{"Your red scales disappear.", "Your red scales recede somewhat.",
@@ -882,18 +876,17 @@ static mutation_def mutation_defs[] = {
{ MUT_BONEY_PLATES, 1, 3, false, true },
{ MUT_REPULSION_FIELD, 1, 3, false, false },
{ MUT_POISON_RESISTANCE, 4, 1, false, false },
-// 10
{ MUT_CARNIVOROUS, 5, 3, false, false },
{ MUT_HERBIVOROUS, 5, 3, true, false },
{ MUT_HEAT_RESISTANCE, 4, 3, false, false },
{ MUT_COLD_RESISTANCE, 4, 3, false, false },
{ MUT_SHOCK_RESISTANCE, 2, 1, false, false },
{ MUT_REGENERATION, 3, 3, false, false },
+ { MUT_SLOW_HEALING, 0, 3, true, false },
{ MUT_FAST_METABOLISM, 10, 3, true, false },
{ MUT_SLOW_METABOLISM, 7, 3, false, false },
{ MUT_WEAK, 10, 14, true, true },
{ MUT_DOPEY, 10, 14, true, true },
-// 20
{ MUT_CLUMSY, 10, 14, true, true },
{ MUT_TELEPORT_CONTROL, 2, 1, false, false },
{ MUT_TELEPORT, 3, 3, true, false },
@@ -904,7 +897,6 @@ static mutation_def mutation_defs[] = {
{ MUT_TELEPORT_AT_WILL, 2, 3, false, false },
{ MUT_SPIT_POISON, 8, 3, false, false },
{ MUT_MAPPING, 3, 3, false, false },
-// 30
{ MUT_BREATHE_FLAMES, 4, 3, false, false },
{ MUT_BLINK, 3, 3, false, false },
{ MUT_HORNS, 7, 3, false, true },
@@ -915,7 +907,6 @@ static mutation_def mutation_defs[] = {
{ MUT_CLARITY, 6, 1, false, false },
{ MUT_BERSERK, 7, 3, true, false },
{ MUT_DETERIORATION, 10, 3, true, false },
-// 40
{ MUT_BLURRY_VISION, 10, 3, true, false },
{ MUT_MUTATION_RESISTANCE, 4, 3, false, false },
{ MUT_FRAIL, 10, 3, true, true },
@@ -928,7 +919,6 @@ static mutation_def mutation_defs[] = {
{ MUT_SUMMON_DEMONS, 0, 1, false, false },
{ MUT_HURL_HELLFIRE, 0, 1, false, false },
{ MUT_CALL_TORMENT, 0, 1, false, false },
-// 50
{ MUT_RAISE_DEAD, 0, 1, false, false },
{ MUT_CONTROL_DEMONS, 0, 1, false, false },
{ MUT_PANDEMONIUM, 0, 1, false, false },
@@ -941,7 +931,6 @@ static mutation_def mutation_defs[] = {
// end of demonic powers
{ MUT_CLAWS, 2, 3, false, true },
-// 60
{ MUT_FANGS, 1, 3, false, true },
{ MUT_HOOVES, 1, 1, false, true },
{ MUT_TALONS, 1, 1, false, true },
@@ -951,7 +940,6 @@ static mutation_def mutation_defs[] = {
// Naga and Draconian only
{ MUT_STINGER, 0, 3, false, true },
-// 65
// Draconian only
{ MUT_BIG_WINGS, 0, 1, false, true },
// used by evil gods to mark followers (currently UNUSED)
@@ -962,15 +950,13 @@ static mutation_def mutation_defs[] = {
{ MUT_SAPROVOROUS, 0, 3, false, false },
{ MUT_GOURMAND, 0, 1, false, false },
-// 70
{ MUT_SHAGGY_FUR, 2, 3, false, true },
{ MUT_HIGH_MAGIC, 1, 3, false, false },
{ MUT_LOW_MAGIC, 9, 3, true, false },
{ RANDOM_MUTATION, 0, 3, false, false },
- { RANDOM_MUTATION, 0, 3, false, false },
-// 75 -- scales of various colours and effects
+// Scales of various colours and effects
{ MUT_RED_SCALES, 2, 3, false, true },
{ MUT_NACREOUS_SCALES, 1, 3, false, true },
{ MUT_GREY2_SCALES, 2, 3, false, true },
@@ -981,7 +967,6 @@ static mutation_def mutation_defs[] = {
{ MUT_BROWN_SCALES, 2, 3, false, true },
{ MUT_BLUE_SCALES, 2, 3, false, true },
{ MUT_PURPLE_SCALES, 2, 3, false, true },
-// 85
{ MUT_SPECKLED_SCALES, 2, 3, false, true },
{ MUT_ORANGE_SCALES, 2, 3, false, true },
{ MUT_INDIGO_SCALES, 2, 3, false, true },
@@ -1242,6 +1227,11 @@ formatted_string describe_mutations()
}
break;
+ case SP_DEEP_DWARF:
+ result += "You are resistant to damage." EOL;
+ have_any = true;
+ break;
+
default:
break;
} //end switch - innate abilities
@@ -1994,6 +1984,10 @@ bool mutate(mutation_type which_mutation, bool failMsg,
if (mutat == MUT_SLOW_METABOLISM && you.mutation[MUT_REGENERATION] > 0)
return (false);
+ // If you have slow healing, no regeneration.
+ if (mutat == MUT_REGENERATION && you.mutation[MUT_SLOW_HEALING] > 0)
+ return (false);
+
// This one can be forced by demonspawn or god gifts.
if (mutat == MUT_ACUTE_VISION
&& you.mutation[MUT_BLURRY_VISION] > 0 && !god_gift
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index f3626662a0..e32dc30201 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -128,7 +128,8 @@ static species_type old_species_order[] = {
SP_DEMIGOD, SP_SPRIGGAN,
SP_MINOTAUR, SP_DEMONSPAWN,
SP_GHOUL, SP_KENKU,
- SP_MERFOLK, SP_VAMPIRE
+ SP_MERFOLK, SP_VAMPIRE,
+ SP_DEEP_DWARF
};
// Fantasy staples and humanoid creatures come first, then diminutive and
@@ -139,7 +140,8 @@ static species_type new_species_order[] = {
SP_HUMAN, SP_HIGH_ELF,
SP_GREY_ELF, SP_DEEP_ELF,
SP_SLUDGE_ELF, SP_MOUNTAIN_DWARF,
- SP_HILL_ORC, SP_MERFOLK,
+ SP_DEEP_DWARF, SP_HILL_ORC,
+ SP_MERFOLK,
// small species
SP_HALFLING, SP_GNOME,
SP_KOBOLD, SP_SPRIGGAN,
@@ -229,7 +231,7 @@ static const char * Species_Abbrev_List[ NUM_SPECIES ] =
"HO", "Ko", "Mu", "Na", "Gn", "Og", "Tr",
// the draconians
"Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr", "Dr",
- "Ce", "DG", "Sp", "Mi", "DS", "Gh", "Ke", "Mf", "Vp",
+ "Ce", "DG", "Sp", "Mi", "DS", "Gh", "Ke", "Mf", "Vp", "DD",
// placeholders
"El", "HD", "OM" };
@@ -1367,6 +1369,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_RED_DRACONIAN:
case SP_MUMMY:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1386,6 +1389,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_CENTAUR:
case SP_RED_DRACONIAN:
case SP_MUMMY:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1411,6 +1415,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_DEMIGOD:
case SP_DEMONSPAWN:
case SP_MUMMY:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1460,6 +1465,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_NAGA:
case SP_TROLL:
case SP_KENKU:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1482,6 +1488,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_KENKU:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1581,6 +1588,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1601,6 +1609,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_OGRE:
case SP_MINOTAUR:
case SP_GHOUL:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1619,6 +1628,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MINOTAUR:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1639,6 +1649,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_RED_DRACONIAN:
case SP_GHOUL:
case SP_MUMMY:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1662,6 +1673,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_DEMIGOD:
case SP_DEMONSPAWN:
case SP_GHOUL:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1709,6 +1721,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1735,6 +1748,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1752,6 +1766,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MINOTAUR:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1770,6 +1785,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MINOTAUR:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1788,6 +1804,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1810,6 +1827,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_RED_DRACONIAN:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1829,6 +1847,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MINOTAUR:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1848,6 +1867,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1869,6 +1889,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_TROLL:
case SP_MINOTAUR:
case SP_RED_DRACONIAN:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -1887,6 +1908,7 @@ static char_choice_restriction _class_allowed(species_type speci,
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_RESTRICTED);
default:
return (CC_UNRESTRICTED);
@@ -2273,6 +2295,7 @@ static char_choice_restriction _weapon_restriction(weapon_type wpn)
case SP_DEMIGOD:
case SP_DEMONSPAWN:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_UNRESTRICTED);
default:
@@ -2583,6 +2606,7 @@ static char_choice_restriction _religion_restriction(god_type god)
case SP_MUMMY:
case SP_GHOUL:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (CC_UNRESTRICTED);
default:
if (player_genus(GENPC_DRACONIAN))
@@ -2676,6 +2700,7 @@ static bool _necromancy_okay()
case SP_KENKU:
case SP_MUMMY:
case SP_VAMPIRE:
+ case SP_DEEP_DWARF:
return (true);
default:
@@ -2741,6 +2766,7 @@ static void _species_stat_init(species_type which_species)
case SP_SLUDGE_ELF: sb = 6; ib = 7; db = 7; break; // 20
case SP_MOUNTAIN_DWARF: sb = 9; ib = 4; db = 5; break; // 18
+ case SP_DEEP_DWARF: sb = 9; ib = 6; db = 6; break; // 21
case SP_TROLL: sb = 13; ib = 2; db = 3; break; // 18
case SP_OGRE: sb = 10; ib = 5; db = 3; break; // 18
@@ -2879,6 +2905,10 @@ void give_basic_mutations(species_type speci)
case SP_GNOME:
you.mutation[MUT_MAPPING] = 2;
break;
+ case SP_DEEP_DWARF:
+ you.mutation[MUT_SLOW_HEALING] = 3;
+ you.mutation[MUT_MAPPING] = 2;
+ break;
case SP_GHOUL:
you.mutation[MUT_TORMENT_RESISTANCE] = 1;
you.mutation[MUT_POISON_RESISTANCE] = 1;
@@ -2922,6 +2952,11 @@ static void _give_basic_knowledge(job_type which_job)
set_ident_type( OBJ_POTIONS, POT_BLOOD, ID_KNOWN_TYPE );
set_ident_type( OBJ_POTIONS, POT_BLOOD_COAGULATED, ID_KNOWN_TYPE );
}
+ else if (you.species == SP_DEEP_DWARF)
+ {
+ set_ident_type( OBJ_POTIONS, POT_HEALING, ID_KNOWN_TYPE );
+ set_ident_type( OBJ_POTIONS, POT_HEAL_WOUNDS, ID_KNOWN_TYPE );
+ }
switch (which_job)
{
@@ -3468,6 +3503,19 @@ static void _newgame_make_item(int slot, equipment_type eqslot,
{
if (slot == -1)
{
+ // If another of the item type is already there, add to the
+ // stack instead.
+ for (int i = 0; i < ENDOFPACK; ++i)
+ {
+ item_def& item = you.inv[i];
+ if (item.base_type == base && item.sub_type == sub_type
+ && is_stackable_item(item))
+ {
+ item.quantity += qty;
+ return;
+ }
+ }
+
for (int i = 0; i < ENDOFPACK; ++i)
{
if (!is_valid_item(you.inv[i]))
@@ -5582,6 +5630,7 @@ bool _give_items_skills()
break;
case SP_MOUNTAIN_DWARF:
+ case SP_DEEP_DWARF:
_newgame_make_item(1, EQ_NONE, OBJ_WEAPONS, WPN_CROSSBOW);
_newgame_make_item(2, EQ_NONE, OBJ_MISSILES, MI_BOLT, -1,
15 + random2avg(21, 5));
@@ -5650,9 +5699,17 @@ bool _give_items_skills()
break;
}
+ // Deep Dwarves get healing potions and wand of healing (3).
+ if (you.species == SP_DEEP_DWARF)
+ {
+ _newgame_make_item(-1, EQ_NONE, OBJ_POTIONS, POT_HEALING, -1, 2);
+ _newgame_make_item(-1, EQ_NONE, OBJ_POTIONS, POT_HEAL_WOUNDS, -1, 2);
+ _newgame_make_item(-1, EQ_NONE, OBJ_WANDS, WAND_HEALING, -1, 1, 3);
+ }
+
if (weap_skill)
{
- if (you.equip[EQ_WEAPON] == -1)
+ if (!you.weapon())
you.skills[SK_UNARMED_COMBAT] = weap_skill;
else
{
diff --git a/crawl-ref/source/ouch.cc b/crawl-ref/source/ouch.cc
index ea31b2e37c..56367fede5 100644
--- a/crawl-ref/source/ouch.cc
+++ b/crawl-ref/source/ouch.cc
@@ -844,6 +844,18 @@ void ouch(int dam, int death_source, kill_method_type death_type,
{
ASSERT(!crawl_state.arena);
+ if (dam != INSTANT_DEATH && you.species == SP_DEEP_DWARF)
+ {
+ // Deep Dwarves get to shave _any_ hp loss.
+ int shave = 1 + random2(2 + random2(1 + you.experience_level / 3));
+#ifdef DEBUG_DIAGNOSTICS
+ mprf(MSGCH_DIAGNOSTICS, "HP shaved: %d.", shave);
+#endif
+ dam -= shave;
+ if (dam <= 0)
+ return;
+ }
+
ait_hp_loss hpl(dam, death_type);
interrupt_activity(AI_HP_LOSS, &hpl);
@@ -856,7 +868,7 @@ void ouch(int dam, int death_source, kill_method_type death_type,
return;
}
- if (dam != INSTANT_DEATH) // that is, a "death" caused by hp loss {dlb}
+ if (dam != INSTANT_DEATH)
{
if (dam >= you.hp)
{
diff --git a/crawl-ref/source/output.cc b/crawl-ref/source/output.cc
index 9257b0a9e6..6d7e7afce3 100644
--- a/crawl-ref/source/output.cc
+++ b/crawl-ref/source/output.cc
@@ -2255,7 +2255,8 @@ std::string _status_mut_abilities()
status.push_back("praying");
if (you.disease && !you.duration[DUR_REGENERATION]
- || you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING)
+ || you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING
+ || you.mutation[MUT_SLOW_HEALING] == 3)
{
status.push_back("non-regenerating");
}
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index d9d84c9d10..7855a5ae1b 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -452,6 +452,7 @@ bool player_genus(genus_type which_genus, species_type species)
return (which_genus == GENPC_ELVEN);
case SP_MOUNTAIN_DWARF:
+ case SP_DEEP_DWARF:
return (which_genus == GENPC_DWARVEN);
case SP_OGRE:
@@ -1028,7 +1029,7 @@ int player_teleport(bool calc_unid)
return tp;
}
-int player_regen(void)
+int player_regen()
{
int rr = you.hp_max / 3;
@@ -1036,7 +1037,7 @@ int player_regen(void)
rr = 20 + ((rr - 20) / 2);
// rings
- rr += 40 * player_equip( EQ_RINGS, RING_REGENERATION );
+ rr += 40 * player_equip(EQ_RINGS, RING_REGENERATION);
// spell
if (you.duration[DUR_REGENERATION])
@@ -1063,29 +1064,53 @@ int player_regen(void)
rr /= 2;
}
+ // Before applying other effects, make sure that there's
+ // something to heal.
+ if (rr < 1)
+ rr = 1;
+
// Healing depending on satiation.
+ // The better-fed you are, the faster you heal.
if (you.species == SP_VAMPIRE)
{
switch (you.hunger_state)
{
case HS_STARVING:
- return (0); // No regeneration for starving vampires!
+ // No regeneration for starving vampires!
+ rr = 0;
+ break;
+
case HS_NEAR_STARVING:
case HS_VERY_HUNGRY:
case HS_HUNGRY:
- return (rr / 2);
+ // Halved if hungry.
+ rr /= 2;
+ break;
+
case HS_SATIATED:
- return (rr);
+ // No effect at standard hunger.
+ break;
+
case HS_FULL:
case HS_VERY_FULL:
- return (rr + 10);
+ // Bonus for being full.
+ rr += 10;
+ break;
+
case HS_ENGORGED:
- return (rr + 20);
+ // Bigger bonus for being engorged.
+ rr += 20;
+ break;
}
}
- if (rr < 1)
- rr = 1;
+ // Slow heal mutation. Applied last.
+ // Each level reduces your natural heaing by one third.
+ if (you.mutation[MUT_SLOW_HEALING])
+ {
+ rr *= 3 - you.mutation[MUT_SLOW_HEALING];
+ rr /= 3;
+ }
return (rr);
}
@@ -1254,6 +1279,7 @@ int player_res_magic(void)
break;
case SP_PURPLE_DRACONIAN:
case SP_GNOME:
+ case SP_DEEP_DWARF:
rm = you.experience_level * 6;
break;
case SP_SPRIGGAN:
@@ -3174,6 +3200,23 @@ void level_change(bool skip_attribute_increase)
modify_stat(STAT_STRENGTH, 1, false, "level gain");
break;
+ case SP_DEEP_DWARF:
+ hp_adjust++;
+
+ if (you.experience_level == 14)
+ {
+ mpr("You feel somewhat more resistant.",
+ MSGCH_INTRINSIC_GAIN);
+ perma_mutate(MUT_NEGATIVE_ENERGY_RESISTANCE, 1);
+ }
+ if (!(you.experience_level % 4))
+ {
+ modify_stat(coinflip() ? STAT_STRENGTH
+ : STAT_INTELLIGENCE, 1, false,
+ "level gain");
+ }
+ break;
+
case SP_HALFLING:
if (!(you.experience_level % 5))
modify_stat(STAT_DEXTERITY, 1, false, "level gain");
@@ -3940,7 +3983,7 @@ void display_char_status()
if (you.duration[DUR_TRANSFORMATION] > 0)
{
- std::string text = "";
+ std::string text;
if ((you.species != SP_VAMPIRE
|| you.attribute[ATTR_TRANSFORMATION] != TRAN_BAT)
@@ -4035,18 +4078,25 @@ void display_char_status()
if (you.duration[DUR_PRAYER])
mpr("You are praying.");
- if (you.disease && !you.duration[DUR_REGENERATION]
- && (you.species != SP_VAMPIRE || you.hunger_state != HS_STARVING))
+ // Disease and regen influence each other.
+ if (you.disease)
{
- mpr("You do not heal.");
+ if (!you.duration[DUR_REGENERATION])
+ mpr("You are sick.");
+ else
+ {
+ _output_expiring_message(DUR_REGENERATION,
+ "recuperating from your illness");
+ }
}
-
- if (you.duration[DUR_REGENERATION]
- && (you.species != SP_VAMPIRE || you.hunger_state != HS_STARVING))
+ else
{
- _output_expiring_message(DUR_REGENERATION,
- you.disease ? "recuperating from your illness"
- : "regenerating");
+ bool no_heal =
+ (you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING)
+ || (you.mutation[MUT_SLOW_HEALING] == 3);
+
+ if (!no_heal)
+ _output_expiring_message(DUR_REGENERATION, "regenerating");
}
_output_expiring_message(DUR_SWIFTNESS, "You can move swiftly.");
@@ -4342,6 +4392,7 @@ std::string species_name(species_type speci, int level, bool genus, bool adj)
switch (speci)
{
case SP_MOUNTAIN_DWARF: res = "Mountain Dwarf"; break;
+ case SP_DEEP_DWARF: res = "Deep Dwarf"; break;
default: res = "Dwarf"; break;
}
}
@@ -5336,8 +5387,10 @@ void dec_poison_player()
adj = "very ";
}
+ int oldhp = you.hp;
ouch(hurted, NON_MONSTER, KILLED_BY_POISON);
- mprf(channel, "You feel %ssick.", adj);
+ if (you.hp < oldhp)
+ mprf(channel, "You feel %ssick.", adj);
if ((you.hp == 1 && one_chance_in(3)) || one_chance_in(8))
reduce_poison_player(1);
diff --git a/crawl-ref/source/skills2.cc b/crawl-ref/source/skills2.cc
index 3be089eb18..19e924b15d 100644
--- a/crawl-ref/source/skills2.cc
+++ b/crawl-ref/source/skills2.cc
@@ -1571,6 +1571,49 @@ const int spec_skills[ NUM_SPECIES ][40] =
(120 * 75)/100, // SK_EVOCATIONS
},
+ { // SP_DEEP_DWARF (39)
+ 110, // SK_FIGHTING
+ 120, // SK_SHORT_BLADES
+ 100, // SK_LONG_BLADES
+ 130, // SK_UNUSED_1
+ 90, // SK_AXES
+ 110, // SK_MACES_FLAILS
+ 120, // SK_POLEARMS
+ 110, // SK_STAVES
+ 90, // SK_SLINGS
+ 180, // SK_BOWS
+ 90, // SK_CROSSBOWS
+ 120, // SK_DARTS
+ 120, // SK_THROWING
+ 90, // SK_ARMOUR
+ 90, // SK_DODGING
+ 70, // SK_STEALTH
+ 110, // SK_STABBING
+ 90, // SK_SHIELDS
+ 80, // SK_TRAPS_DOORS
+ 120, // SK_UNARMED_COMBAT
+ 100, // undefined
+ 100, // undefined
+ 100, // undefined
+ 100, // undefined
+ 100, // undefined
+ (120 * 130) / 100, // SK_SPELLCASTING
+ 120, // SK_CONJURATIONS
+ 120, // SK_ENCHANTMENTS
+ 110, // SK_SUMMONINGS
+ 80, // SK_NECROMANCY
+ 85, // SK_TRANSLOCATIONS
+ 120, // SK_TRANSMUTATION
+ 120, // SK_DIVINATIONS
+ 110, // SK_FIRE_MAGIC
+ 110, // SK_ICE_MAGIC
+ 170, // SK_AIR_MAGIC
+ 60, // SK_EARTH_MAGIC
+ 130, // SK_POISON_MAGIC
+ (80 * 75) / 100, // SK_INVOCATIONS
+ (60 * 75) / 100, // SK_EVOCATIONS
+ },
+
// SP_HILL_DWARF placeholder.
{
},
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;
diff --git a/crawl-ref/source/spl-book.h b/crawl-ref/source/spl-book.h
index 53aaef2f49..07d69e7d9c 100644
--- a/crawl-ref/source/spl-book.h
+++ b/crawl-ref/source/spl-book.h
@@ -61,7 +61,7 @@ spell_type which_spell_in_book(int sbook_type, int spl);
int staff_spell( int zap_device_2 );
bool is_memorised(spell_type spell);
-bool undead_cannot_memorise(spell_type spell, char being);
+bool you_cannot_memorise(spell_type spell);
int spellbook_contents( item_def &book, read_book_action_type action,
formatted_string *fs = NULL );
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 69e88ec5c0..dc3026862c 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -870,8 +870,7 @@ static bool _spell_is_uncastable(spell_type spell)
// Normally undead can't memorise these spells, so this check is
// to catch those in Lich form. As such, we allow the Lich form
// to be extended here. -- bwr
- if (spell != SPELL_NECROMUTATION
- && undead_cannot_memorise( spell, you.is_undead ))
+ if (spell != SPELL_NECROMUTATION && you_cannot_memorise(spell))
{
mpr( "You cannot cast that spell in your current form!" );
return (true);
@@ -883,7 +882,7 @@ static bool _spell_is_uncastable(spell_type spell)
return (true);
}
- if (_vampire_cannot_cast( spell ))
+ if (_vampire_cannot_cast(spell))
{
mpr("Your current blood level is not sufficient to cast that spell.");
return (true);
@@ -1217,7 +1216,9 @@ spret_type your_spells(spell_type spell, int powc, bool allow_fail)
case SPELL_PAIN:
if (!zapping(ZAP_PAIN, powc, beam, true))
return (SPRET_ABORT);
- dec_hp(1, false);
+ // Deep Dwarves' damage reduction always blocks at least 1 hp.
+ if (you.species != SP_DEEP_DWARF)
+ dec_hp(1, false);
break;
case SPELL_FLAME_TONGUE: