summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-06 17:16:58 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2008-03-06 17:16:58 +0000
commit07dc1fd248de5cf9f29683cb76c70277d6c7e156 (patch)
treef62952f5749df637ee34662e1994473ed1080a2b /crawl-ref/source
parent4e14b2dc2f1ebcc6971995f013d81db61cfb17e7 (diff)
downloadcrawl-ref-07dc1fd248de5cf9f29683cb76c70277d6c7e156.tar.gz
crawl-ref-07dc1fd248de5cf9f29683cb76c70277d6c7e156.zip
Further improvements of vampires:
1) Quaffing and eating * They now get full effect of potions unless hungry (er, thirsty) or worse, in which case the effect gets halved as before. * Potions of blood heal on the level of heal wounds or healing, depending on hunger state. Healing always heals rotting and removes confusion - the chances involved were just frustrating to players. * Draining corpses has the same nutrition value as eating the (random) amount of chunks you get out of dissecting, but takes longer (and all at once, so draining your corpses in the middle of a battle is extremely risky). I guess this is still too good (when do you ever get to eat all chunks you get out of, say, an ogre or centaur?) so will have to be nerfed. 2) Resistances Resistances depend more strongly on hunger states now. Vampires are always poison resistant and can always see invisible. Additionally, they gain * rCold 1 at Hungry or worse, and rCold 2 at Near Starving or worse (The latter comes with susceptibility to fire.) * life protection 1 when satiated, 2 when hungry or worse, and 3 when near starving or worse * At starving they also get torment res. * Hungry vampires and vampires in bat form are stealthier, and starving vampires are even more stealthy. As before, they get the Necromancy boost (like Mummies do) at xl 13 and 26. Also, vampires can now cast spells while starving, but suffer a failure increase akin to that of Blade Hands. (I've no idea what these numbers actually mean, so this will most likely have to be changed as well.) Updated tables.txt. Still TODO: * Add special biting attack for successful stabbing. * Add distilling blood ability, and possibly distinguish between old and new potions (new food type, maybe). * Allow vampires to mutate, but these mutations to only take effect when Full, Very Full or Engorged. * Update manual. Apart from that, they are ready for playtesting once again. As always, feedback would be much appreciated. :) git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3528 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/food.cc108
-rw-r--r--crawl-ref/source/invent.cc6
-rw-r--r--crawl-ref/source/invent.h3
-rw-r--r--crawl-ref/source/it_use2.cc141
-rw-r--r--crawl-ref/source/misc.cc16
-rw-r--r--crawl-ref/source/newgame.cc1
-rw-r--r--crawl-ref/source/player.cc61
-rw-r--r--crawl-ref/source/spl-cast.cc6
-rw-r--r--crawl-ref/source/transfor.cc2
9 files changed, 203 insertions, 141 deletions
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 294eb27e45..79969268a5 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -503,13 +503,23 @@ bool prompt_eat_from_inventory(int slot)
return (false);
}
+ if (slot == -1 && you.species == SP_VAMPIRE)
+ {
+ slot = prompt_invent_item( "Drain what?",
+ MT_INVLIST,
+ OSEL_VAMP_EAT,
+ true, true, true, 0, NULL,
+ OPER_EAT );
+ }
+
int which_inventory_slot = (slot != -1)? slot:
prompt_invent_item(
"Eat which item?",
MT_INVLIST,
- you.species == SP_VAMPIRE ? OBJ_CORPSES : OBJ_FOOD,
+ OBJ_FOOD,
true, true, true, 0, NULL,
OPER_EAT );
+
if (which_inventory_slot == PROMPT_ABORT)
{
canned_msg( MSG_OK );
@@ -708,10 +718,13 @@ void eat_from_inventory(int which_inventory_slot)
item_def& food(you.inv[which_inventory_slot]);
if (food.base_type == OBJ_CORPSES && food.sub_type == CORPSE_BODY)
{
- const int mons_type = food.plus;
+ if (you.species != SP_VAMPIRE)
+ return;
+
+ const int mons_type = food.plus;
const int chunk_type = mons_corpse_effect( mons_type );
- const bool rotten = food_is_rotten(food);
- const int mass = item_mass( food );
+ const bool rotten = food_is_rotten(food);
+ const int mass = mons_weight(food.plus)/150;
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
@@ -726,16 +739,15 @@ void eat_from_inventory(int which_inventory_slot)
food.special = 90;
food.colour = LIGHTGREY;
}
- // dec_inv_item_quantity( which_inventory_slot, 1 );
return;
}
else if (food.sub_type == FOOD_CHUNK)
{
- const int mons_type = food.plus;
- const bool cannibal = is_player_same_species(mons_type);
- const int intel = mons_intel(mons_type) - I_ANIMAL;
+ const int mons_type = food.plus;
+ const bool cannibal = is_player_same_species(mons_type);
+ const int intel = mons_intel(mons_type) - I_ANIMAL;
const int chunk_type = mons_corpse_effect( mons_type );
- const bool rotten = food_is_rotten(food);
+ const bool rotten = food_is_rotten(food);
if (!prompt_eat_chunk(food, rotten))
return;
@@ -753,10 +765,10 @@ void eat_floor_item(int item_link)
item_def& food(mitm[item_link]);
if (food.base_type == OBJ_CORPSES && food.sub_type == CORPSE_BODY)
{
- const int mons_type = food.plus;
+ const int mons_type = food.plus;
const int chunk_type = mons_corpse_effect( mons_type );
- const bool rotten = food_is_rotten(food);
- const int mass = item_mass( food );
+ const bool rotten = food_is_rotten(food);
+ const int mass = mons_weight(food.plus)/150;
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
@@ -768,8 +780,8 @@ void eat_floor_item(int item_link)
else
{
food.sub_type = CORPSE_SKELETON;
- food.special = 90;
- food.colour = LIGHTGREY;
+ food.special = 90;
+ food.colour = LIGHTGREY;
}
// dec_mitm_item_quantity( item_link, 1 );
@@ -779,11 +791,13 @@ void eat_floor_item(int item_link)
else if (food.sub_type == FOOD_CHUNK)
{
const int chunk_type = mons_corpse_effect( food.plus );
- const int intel = mons_intel( food.plus ) - I_ANIMAL;
- const bool cannibal = is_player_same_species( food.plus );
- const bool rotten = food_is_rotten(food);
+ const int intel = mons_intel( food.plus ) - I_ANIMAL;
+ const bool cannibal = is_player_same_species( food.plus );
+ const bool rotten = food_is_rotten(food);
+
if (!prompt_eat_chunk(food, rotten))
return;
+
eat_chunk(determine_chunk_effect(chunk_type, rotten), cannibal, intel);
}
else
@@ -883,18 +897,18 @@ static int chunk_nutrition(bool likes_chunks)
int nutrition = CHUNK_BASE_NUTRITION;
if (likes_chunks || you.hunger_state < HS_SATIATED)
+ {
return (likes_chunks? nutrition
: apply_herbivore_chunk_effects(nutrition));
+ }
const int gourmand =
- wearing_amulet(AMU_THE_GOURMAND)?
- you.duration[DUR_GOURMAND]
- : 0;
+ wearing_amulet(AMU_THE_GOURMAND)? you.duration[DUR_GOURMAND] : 0;
int effective_nutrition =
- nutrition * (gourmand + GOURMAND_NUTRITION_BASE)
- / (GOURMAND_MAX + GOURMAND_NUTRITION_BASE);
-
+ nutrition * (gourmand + GOURMAND_NUTRITION_BASE)
+ / (GOURMAND_MAX + GOURMAND_NUTRITION_BASE);
+
#ifdef DEBUG_DIAGNOSTICS
const int epercent = effective_nutrition * 100 / nutrition;
mprf(MSGCH_DIAGNOSTICS,
@@ -920,10 +934,10 @@ static void eat_chunk( int chunk_effect, bool cannibal, int mon_intel )
bool likes_chunks = (you.omnivorous() ||
you.mutation[MUT_CARNIVOROUS]);
- int nutrition = chunk_nutrition(likes_chunks);
- int hp_amt = 0;
+ int nutrition = chunk_nutrition(likes_chunks);
+ int hp_amt = 0;
bool suppress_msg = false; // do we display the chunk nutrition message?
- bool do_eat = false;
+ bool do_eat = false;
if (you.species == SP_GHOUL)
{
@@ -1578,8 +1592,8 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
return (this_chunk_effect);
} // end determine_chunk_effect()
-static bool vampire_consume_corpse(int mons_type, int mass,
- int chunk_type, bool rotten)
+static bool vampire_consume_corpse(const int mons_type, int max_chunks,
+ const int chunk_type, const bool rotten)
{
if (chunk_type == CE_HCL)
{
@@ -1587,10 +1601,27 @@ static bool vampire_consume_corpse(int mons_type, int mass,
return false;
}
+ // This is the exact formula of corpse nutrition for chunk lovers
+ max_chunks = 1 + random2(max_chunks);
+ int mass = CHUNK_BASE_NUTRITION * max_chunks;
int food_value = 0, hp_amt = 0, mp_amt = 0;
- if (!rotten)
+ if (rotten)
{
+ if (wearing_amulet(AMU_THE_GOURMAND))
+ {
+ food_value = mass/2 + random2(you.experience_level * 5);
+ mpr("Slurp.");
+ did_god_conduct(DID_DRINK_BLOOD, 8);
+ }
+ else
+ {
+ mpr("It's not fresh enough.");
+ return false;
+ }
+ }
+ else
+ {
hp_amt++;
switch (mons_type)
@@ -1632,26 +1663,17 @@ static bool vampire_consume_corpse(int mons_type, int mass,
}
did_god_conduct(DID_DRINK_BLOOD, 8);
}
- else if (wearing_amulet(AMU_THE_GOURMAND))
- {
- food_value = mass/3 + random2(you.experience_level * 5);
- mpr("Slurp.");
- did_god_conduct(DID_DRINK_BLOOD, 8);
- }
- else
- {
- mpr("It's not fresh enough.");
- return false;
- }
heal_from_food(hp_amt, mp_amt,
- !rotten && one_chance_in(4), one_chance_in(3));
+ !rotten && one_chance_in(4), one_chance_in(3));
lessen_hunger( food_value, true );
describe_food_change(food_value);
-// start_delay( DELAY_EAT, 3 );
- start_delay( DELAY_EAT, 1 + mass/300 );
+ // The delay for eating a chunk (mass 1000) is 2
+ // Here the base nutrition value equals that of chunks,
+ // but the delay should be greater.
+ start_delay( DELAY_EAT, mass / 400 );
return true;
} // end vampire_consume_corpse()
diff --git a/crawl-ref/source/invent.cc b/crawl-ref/source/invent.cc
index 68340be502..bda888740b 100644
--- a/crawl-ref/source/invent.cc
+++ b/crawl-ref/source/invent.cc
@@ -763,6 +763,9 @@ static bool item_class_selected(const item_def &i, int selector)
return (item_is_rechargable(i), true);
case OSEL_ENCH_ARM:
return (is_enchantable_armour(i, true));
+ case OSEL_VAMP_EAT:
+ return (itype == OBJ_CORPSES && i.sub_type == CORPSE_BODY
+ && !food_is_rotten(i));
case OSEL_EQUIP:
for (int eq = 0; eq < NUM_EQUIP; eq++)
{
@@ -1115,7 +1118,8 @@ static std::string operation_verb(operation_types oper)
case OPER_WIELD: return "wield";
case OPER_QUAFF: return "quaff";
case OPER_DROP: return "drop";
- case OPER_EAT: return "eat";
+ case OPER_EAT: return (you.species == SP_VAMPIRE ?
+ "drain" : "eat");
case OPER_TAKEOFF: return "take off";
case OPER_WEAR: return "wear";
case OPER_PUTON: return "put on";
diff --git a/crawl-ref/source/invent.h b/crawl-ref/source/invent.h
index df77475a8b..8bcbb5ab39 100644
--- a/crawl-ref/source/invent.h
+++ b/crawl-ref/source/invent.h
@@ -28,7 +28,8 @@ enum object_selector
OSEL_EQUIP = -4,
OSEL_MEMORISE = -5,
OSEL_RECHARGE = -6,
- OSEL_ENCH_ARM = -7
+ OSEL_ENCH_ARM = -7,
+ OSEL_VAMP_EAT = -8
};
#define PROMPT_ABORT -1
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 754f3f436e..36a4b8caba 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -53,7 +53,8 @@ bool potion_effect( potion_type pot_eff, int pow )
if (pow > 150)
pow = 150;
- const int factor = (you.species == SP_VAMPIRE ? 2 : 1);
+ const int factor
+ = (you.species == SP_VAMPIRE && you.hunger_state <= HS_HUNGRY? 2 : 1);
switch (pot_eff)
{
@@ -62,41 +63,77 @@ bool potion_effect( potion_type pot_eff, int pow )
inc_hp( (5 + random2(7)) / factor, false);
mpr("You feel better.");
- if (you.species == SP_VAMPIRE)
- {
- if (!one_chance_in(3))
- you.rotting = 0;
- if (!one_chance_in(3))
- you.duration[DUR_CONF] = 0;
- }
- else
+ // only fix rot when healed to full
+ if (you.hp == you.hp_max)
{
- // only fix rot when healed to full
- if (you.hp == you.hp_max)
- {
- unrot_hp(1);
- set_hp(you.hp_max, false);
- }
-
- you.duration[DUR_POISONING] = 0;
- you.rotting = 0;
- you.disease = 0;
- you.duration[DUR_CONF] = 0;
+ unrot_hp(1);
+ set_hp(you.hp_max, false);
}
+
+ you.duration[DUR_POISONING] = 0;
+ you.rotting = 0;
+ you.disease = 0;
+ you.duration[DUR_CONF] = 0;
break;
case POT_HEAL_WOUNDS:
inc_hp((10 + random2avg(28, 3)) / factor, false);
mpr("You feel much better.");
- // only fix rot when healed to full
- if ( you.species != SP_VAMPIRE && you.hp == you.hp_max )
+ // only fix rot when healed to full
+ if ( you.hp == you.hp_max)
{
- unrot_hp( 2 + random2avg(5, 2) );
+ unrot_hp( (2 + random2avg(5, 2)) / factor );
set_hp(you.hp_max, false);
}
break;
+ case POT_BLOOD:
+ if (you.species == SP_VAMPIRE)
+ {
+ const char* names[] = { "human", "rat", "goblin",
+ "elf", "goat", "sheep",
+ "sheep", "gnoll", "yak" };
+
+ mprf("Yummy - fresh %s blood!", RANDOM_ELEMENT(names));
+ lessen_hunger(1000, true);
+
+ // healing depends on hunger
+ if (you.hunger_state <= HS_HUNGRY) // !heal wounds
+ {
+ inc_hp((10 + random2avg(30,2)) / factor, false);
+ mpr("You feel much better.");
+ }
+ else
+ {
+ if (you.hunger_state <= HS_FULL)
+ inc_hp(5 + random2(10), false); // !healing
+ else
+ inc_hp(2 + random2(5), false);
+ mpr("You feel better.");
+ }
+ }
+ else
+ {
+ if (you.omnivorous() || you.mutation[MUT_CARNIVOROUS])
+ {
+ // Likes it
+ mpr("This tastes like blood.");
+ lessen_hunger(200, true);
+ }
+ else
+ {
+ mpr("Blech - this tastes like blood!");
+ if (!you.mutation[MUT_HERBIVOROUS] && one_chance_in(3))
+ lessen_hunger(100, true);
+ else
+ disease_player( 50 + random2(100) );
+ xom_is_stimulated(32);
+ }
+ }
+ did_god_conduct(DID_DRINK_BLOOD, 1 + random2(3), was_known);
+ break;
+
case POT_SPEED:
haste_player( (40 + random2(pow)) / factor );
break;
@@ -114,7 +151,7 @@ bool potion_effect( potion_type pot_eff, int pow )
modify_stat(STAT_STRENGTH, 5, true, "");
// conceivable max gain of +184 {dlb}
- you.duration[DUR_MIGHT] += 35 + random2(pow);
+ you.duration[DUR_MIGHT] += (35 + random2(pow)) / factor;
// files.cc permits values up to 215, but ... {dlb}
if (you.duration[DUR_MIGHT] > 80)
@@ -175,8 +212,8 @@ bool potion_effect( potion_type pot_eff, int pow )
break;
case POT_PARALYSIS:
- you.paralyse(2 + random2( 6 + you.duration[DUR_PARALYSIS] ));
- xom_is_stimulated(64);
+ you.paralyse((2 + random2( 6 + you.duration[DUR_PARALYSIS] )) / factor);
+ xom_is_stimulated(64 / factor);
break;
case POT_CONFUSION:
@@ -218,22 +255,20 @@ bool potion_effect( potion_type pot_eff, int pow )
case POT_DEGENERATION:
if ( pow == 40 )
mpr("There was something very wrong with that liquid!");
- if (lose_stat(STAT_RANDOM, 1 + random2avg(4, 2), false,
+ if (lose_stat(STAT_RANDOM, (1 + random2avg(4, 2)) / factor, false,
"drinking a potion of degeneration"))
- xom_is_stimulated(64);
+ xom_is_stimulated(64 / factor);
break;
// Don't generate randomly - should be rare and interesting
case POT_DECAY:
- if (rot_player(10 + random2(10)))
- xom_is_stimulated(64);
+ if (rot_player((10 + random2(10)) / factor))
+ xom_is_stimulated(64 / factor);
break;
case POT_WATER:
if (you.species == SP_VAMPIRE)
- {
mpr("Blech - this tastes like water.");
- }
else
{
mpr("This tastes like water.");
@@ -316,45 +351,13 @@ bool potion_effect( potion_type pot_eff, int pow )
did_god_conduct(DID_STIMULANTS, 4 + random2(4), was_known);
break;
- case POT_BLOOD:
- if (you.species == SP_VAMPIRE)
- {
- const char* names[] = { "human", "rat", "goblin",
- "elf", "goat", "sheep",
- "sheep", "gnoll", "yak" };
-
- mprf("Yummy - fresh %s blood!", RANDOM_ELEMENT(names));
- lessen_hunger(1000, true);
- mpr("You feel better.");
- inc_hp(1 + random2(10), false);
- }
- else
- {
- if (you.omnivorous() || you.mutation[MUT_CARNIVOROUS])
- {
- // Likes it
- mpr("This tastes like blood.");
- lessen_hunger(200, true);
- }
- else
- {
- mpr("Blech - this tastes like blood!");
- if (!you.mutation[MUT_HERBIVOROUS] && one_chance_in(3))
- lessen_hunger(100, true);
- else
- disease_player( 50 + random2(100) );
- xom_is_stimulated(32);
- }
- }
- did_god_conduct(DID_DRINK_BLOOD, 1 + random2(3), was_known);
- break;
-
case POT_RESISTANCE:
mpr("You feel protected.");
- you.duration[DUR_RESIST_FIRE] += random2(pow) + 10;
- you.duration[DUR_RESIST_COLD] += random2(pow) + 10;
- you.duration[DUR_RESIST_POISON] += random2(pow) + 10;
- you.duration[DUR_INSULATION] += random2(pow) + 10;
+ you.duration[DUR_RESIST_FIRE] += (random2(pow) + 10) / factor;
+ you.duration[DUR_RESIST_COLD] += (random2(pow) + 10) / factor;
+ you.duration[DUR_RESIST_POISON] += (random2(pow) + 10) / factor;
+ you.duration[DUR_INSULATION] += (random2(pow) + 10) / factor;
+
// Just one point of contamination. These potions are really rare,
// and contamination is nastier.
contaminate_player(1);
diff --git a/crawl-ref/source/misc.cc b/crawl-ref/source/misc.cc
index f2ef0b10e1..fc0447b74f 100644
--- a/crawl-ref/source/misc.cc
+++ b/crawl-ref/source/misc.cc
@@ -94,9 +94,9 @@ void turn_corpse_into_chunks( item_def &item )
bleed_onto_floor(you.x_pos, you.y_pos, mons_class, max_chunks, true);
item.base_type = OBJ_FOOD;
- item.sub_type = FOOD_CHUNK;
- item.quantity = 1 + random2( max_chunks );
- item.flags &= ~(ISFLAG_THROWN | ISFLAG_DROPPED);
+ item.sub_type = FOOD_CHUNK;
+ item.quantity = 1 + random2( max_chunks );
+ item.flags &= ~(ISFLAG_THROWN | ISFLAG_DROPPED);
item.quantity = stepdown_value( item.quantity, 4, 4, 12, 12 );
@@ -112,11 +112,11 @@ void turn_corpse_into_chunks( item_def &item )
// these values are common to all: {dlb}
mitm[o].base_type = OBJ_ARMOUR;
- mitm[o].plus = 0;
- mitm[o].plus2 = 0;
- mitm[o].special = 0;
- mitm[o].flags = 0;
- mitm[o].colour = mons_class_colour( mons_class );
+ mitm[o].plus = 0;
+ mitm[o].plus2 = 0;
+ mitm[o].special = 0;
+ mitm[o].flags = 0;
+ mitm[o].colour = mons_class_colour( mons_class );
// these values cannot be set by a reasonable formula: {dlb}
switch (mons_class)
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index f4fc30c287..a64d25eca1 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -2296,7 +2296,6 @@ static void give_basic_mutations(species_type speci)
case SP_VAMPIRE:
you.mutation[MUT_FANGS] = 3;
you.mutation[MUT_SLOW_METABOLISM] = 1;
- you.mutation[MUT_TORMENT_RESISTANCE] = 1;
you.mutation[MUT_POISON_RESISTANCE] = 1;
break;
default:
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index ef449f2227..aebac973fe 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -1134,8 +1134,11 @@ int player_res_fire(bool calc_unid)
rf += scan_randarts(RAP_FIRE, calc_unid);
// species:
- if (you.species == SP_MUMMY)
+ if (you.species == SP_MUMMY
+ || you.species == SP_VAMPIRE && you.hunger_state <= HS_NEAR_STARVING)
+ {
rf--;
+ }
// spells:
if (you.duration[DUR_RESIST_FIRE] > 0)
@@ -1176,6 +1179,16 @@ int player_res_cold(bool calc_unid)
{
int rc = 0;
+ if (you.species == SP_VAMPIRE)
+ {
+ if (you.hunger_state <= HS_NEAR_STARVING)
+ rc += 2;
+ else if (you.hunger_state <= HS_HUNGRY)
+ rc++;
+ }
+
+
+
/* rings of fire resistance/fire */
rc += player_equip( EQ_RINGS, RING_PROTECTION_FROM_COLD, calc_unid );
rc += player_equip( EQ_RINGS, RING_ICE, calc_unid );
@@ -1342,7 +1355,8 @@ bool player_control_teleport(bool calc_unid) {
int player_res_torment(bool)
{
return (you.mutation[MUT_TORMENT_RESISTANCE] ||
- you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH);
+ you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH ||
+ you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING);
}
// funny that no races are susceptible to poisons {dlb}
@@ -1363,7 +1377,7 @@ int player_res_poison(bool calc_unid)
{
rp++;
}
-
+
// ego armour:
rp += player_equip_ego_type( EQ_ALL_ARMOUR, SPARM_POISON_RESISTANCE );
@@ -1572,6 +1586,24 @@ int player_prot_life(bool calc_unid)
{
int pl = 0;
+ if (you.species == SP_VAMPIRE)
+ {
+ switch (you.hunger_state)
+ {
+ case HS_STARVING:
+ case HS_NEAR_STARVING:
+ pl = 3;
+ case HS_VERY_HUNGRY:
+ case HS_HUNGRY:
+ pl = 2;
+ case HS_SATIATED:
+ pl = 1;
+ default:
+ break;
+ }
+ }
+
+
if (wearing_amulet(AMU_WARDING, calc_unid))
++pl;
@@ -1581,11 +1613,6 @@ int player_prot_life(bool calc_unid)
// armour: (checks body armour only)
pl += player_equip_ego_type( EQ_ALL_ARMOUR, SPARM_POSITIVE_ENERGY );
- if (you.species == SP_VAMPIRE && you.hunger_state > HS_HUNGRY)
- {
- pl += 2;
- }
-
switch (you.attribute[ATTR_TRANSFORMATION])
{
case TRAN_STATUE:
@@ -2368,15 +2395,15 @@ int player_see_invis(bool calc_unid)
{
int si = 0;
+ /* Vampires can see invisible */
+ if (you.species == SP_VAMPIRE)
+ si++;
+
si += player_equip( EQ_RINGS, RING_SEE_INVISIBLE, calc_unid );
/* armour: (checks head armour only) */
si += player_equip_ego_type( EQ_HELMET, SPARM_SEE_INVISIBLE );
- /* Vampires can see invisible if not weakened by hunger */
- if (you.species == SP_VAMPIRE && you.hunger_state > HS_HUNGRY)
- si++;
-
if (you.mutation[MUT_ACUTE_VISION] > 0)
si += you.mutation[MUT_ACUTE_VISION];
@@ -3337,11 +3364,13 @@ int check_stealth(void)
stealth += (you.skills[SK_STEALTH] * 12);
break;
case SP_VAMPIRE:
- if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT
- || you.hunger_state <= HS_HUNGRY)
+ // Hungry/bat-form vampires are (much) more stealthy
+ if (you.hunger_state <= HS_STARVING)
+ stealth += (you.skills[SK_STEALTH] * 21);
+ else if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT
+ || you.hunger_state <= HS_HUNGRY)
{
- // Hungry/batty vampires are more stealthy
- stealth += (you.skills[SK_STEALTH] * 19);
+ stealth += (you.skills[SK_STEALTH] * 20);
}
else
stealth += (you.skills[SK_STEALTH] * 18);
diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc
index 5da89bd99c..062bc0fced 100644
--- a/crawl-ref/source/spl-cast.cc
+++ b/crawl-ref/source/spl-cast.cc
@@ -450,6 +450,10 @@ int spell_fail(spell_type spell)
break;
}
}
+
+ // vampires can cast while starving, but with increased difficulty
+ if (you.species == SP_VAMPIRE && you.hunger_state == HS_STARVING)
+ chance2 += 20;
// Apply the effects of Vehumet prayer and items of wizardry.
chance2 = apply_spellcasting_success_boosts(spell, chance2);
@@ -661,7 +665,7 @@ bool cast_a_spell()
return (false);
}
- if (you.is_undead != US_UNDEAD
+ if (you.is_undead != US_UNDEAD && you.species != SP_VAMPIRE
&& (you.hunger_state <= HS_STARVING
|| you.hunger <= spell_hunger( spell )))
{
diff --git a/crawl-ref/source/transfor.cc b/crawl-ref/source/transfor.cc
index 80314c20c5..e2802498ae 100644
--- a/crawl-ref/source/transfor.cc
+++ b/crawl-ref/source/transfor.cc
@@ -233,7 +233,7 @@ bool transform(int pow, transformation_type which_trans)
"gaining the bat transformation" );
you.symbol = 'b';
- you.colour = DARKGREY;
+ you.colour = (you.species == SP_VAMPIRE ? DARKGREY : LIGHTGREY);
return (true);
case TRAN_ICE_BEAST: // also AC +3, cold +3, fire -1, pois +1