summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source
diff options
context:
space:
mode:
authorj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-17 16:30:41 +0000
committerj-p-e-g <j-p-e-g@c06c8d41-db1a-0410-9941-cceddc491573>2007-07-17 16:30:41 +0000
commit7ecb5a3d3c6153a073477452679943612ee25d61 (patch)
treef47dedee5986df56b25e4c2a419af8137a4d8c0f /crawl-ref/source
parenteaf527f9e3087d3093b6acb2cc18c3636bb9b6b2 (diff)
downloadcrawl-ref-7ecb5a3d3c6153a073477452679943612ee25d61.tar.gz
crawl-ref-7ecb5a3d3c6153a073477452679943612ee25d61.zip
More vampire tweaks, mostly concerning fighting and
feeding issues. Oh, and they're poison resistant now. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@1886 c06c8d41-db1a-0410-9941-cceddc491573
Diffstat (limited to 'crawl-ref/source')
-rw-r--r--crawl-ref/source/fight.cc35
-rw-r--r--crawl-ref/source/food.cc50
-rw-r--r--crawl-ref/source/it_use2.cc2
-rw-r--r--crawl-ref/source/newgame.cc6
-rw-r--r--crawl-ref/source/player.cc2
5 files changed, 73 insertions, 22 deletions
diff --git a/crawl-ref/source/fight.cc b/crawl-ref/source/fight.cc
index a49b3846b8..047fe5035b 100644
--- a/crawl-ref/source/fight.cc
+++ b/crawl-ref/source/fight.cc
@@ -582,7 +582,7 @@ bool melee_attack::player_aux_unarmed()
if (coinflip())
uattack = UNAT_PUNCH;
- if (you.species == SP_VAMPIRE && coinflip())
+ if (you.species == SP_VAMPIRE && !one_chance_in(3))
uattack = UNAT_BITE;
}
@@ -762,7 +762,7 @@ bool melee_attack::player_aux_unarmed()
{
continue;
}
- if (!you.mutation[MUT_FANGS] || !one_chance_in(5))
+ if (!you.mutation[MUT_FANGS] || one_chance_in(5))
{
continue;
}
@@ -1390,25 +1390,46 @@ bool melee_attack::player_monattk_hit_effects(bool mondied)
if (you.species == SP_VAMPIRE && damage_brand == SPWPN_VAMPIRICISM)
{
if (mons_holiness(def) == MH_NATURAL
- && damage_done > 0 && you.hp < you.hp_max
- && !one_chance_in(5))
+ && damage_done > 0 && !one_chance_in(5))
{
- mpr("You feel better.");
+ const int chunk_type = mons_corpse_effect( def->type );
+ // don't drink poisonous or mutagenic blood
+ if (chunk_type == CE_CLEAN || chunk_type == CE_CONTAMINATED)
+ {
+ mprf( "You draw %s's blood!",
+ def->name(DESC_NOCAP_THE, true).c_str() );
+
+ if (you.hp < you.hp_max)
+ {
int heal = 1 + random2(damage_done);
if (heal > you.experience_level)
heal = you.experience_level;
+ if (chunk_type == CE_CLEAN)
heal += 1 + random2(damage_done);
+
inc_hp(heal, false);
+ mpr("You feel better.");
+ }
- if (you.hunger_state < HS_ENGORGED)
+ if (you.hunger_state < HS_ENGORGED) // always the case
{
- lessen_hunger(45 + random2avg(59, 2), true);
+ int food_value = 0;
+ if (chunk_type == CE_CLEAN)
+ food_value = 45 + random2avg(59, 2);
+ else if (chunk_type == CE_CONTAMINATED)
+ food_value = 22 + random2avg(29, 2);
+
+ if (you.attribute[ATTR_TRANSFORMATION] == TRAN_BAT)
+ food_value -= 5 + random2(16);
+
+ lessen_hunger(food_value, true);
}
did_god_conduct(DID_DRINK_BLOOD, 5 + random2(4));
}
}
+ }
else if (mondied && damage_brand == SPWPN_VAMPIRICISM)
{
if (mons_holiness(def) == MH_NATURAL
diff --git a/crawl-ref/source/food.cc b/crawl-ref/source/food.cc
index 17e47e0f25..d2d5e1750a 100644
--- a/crawl-ref/source/food.cc
+++ b/crawl-ref/source/food.cc
@@ -617,10 +617,12 @@ void eat_from_inventory(int which_inventory_slot)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type )) {
+ if (!mons_skeleton( mons_type ))
+ {
dec_inv_item_quantity( which_inventory_slot, 1 );
}
- else {
+ else
+ {
you.inv[which_inventory_slot].sub_type = CORPSE_SKELETON;
you.inv[which_inventory_slot].special = 90;
you.inv[which_inventory_slot].colour = LIGHTGREY;
@@ -660,10 +662,12 @@ void eat_floor_item(int item_link)
if (!vampire_consume_corpse(mons_type, mass, chunk_type, rotten))
return;
- if (!mons_skeleton( mons_type )) {
+ if (!mons_skeleton( mons_type ))
+ {
dec_mitm_item_quantity( item_link, 1 );
}
- else {
+ else
+ {
mitm[item_link].sub_type = CORPSE_SKELETON;
mitm[item_link].special = 90;
mitm[item_link].colour = LIGHTGREY;
@@ -1386,7 +1390,7 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
case CE_POISONOUS:
if (you.species == SP_GHOUL
|| you.attribute[ATTR_TRANSFORMATION] == TRAN_LICH
- || poison_resistance_level > 0)
+ || poison_resistance_level > 0 && you.species != SP_VAMPIRE)
{
this_chunk_effect = CE_CLEAN;
}
@@ -1496,17 +1500,21 @@ static int determine_chunk_effect(int which_chunk_type, bool rotten_chunk)
} // end determine_chunk_effect()
bool vampire_consume_corpse(int mons_type, int mass,
- int chunk_type, bool rotten) {
+ int chunk_type, bool rotten)
+{
int food_value = 0;
- if (chunk_type == CE_HCL) {
+ if (chunk_type == CE_HCL)
+ {
mpr( "There is no blood in this body!" );
return false;
}
- else if (!rotten) {
+ else if (!rotten)
+ {
inc_hp(1, false);
- switch (mons_type) {
+ switch (mons_type)
+ {
case MONS_HUMAN:
food_value = mass + random2avg(you.experience_level * 10, 2);
mpr( "This warm blood tastes really delicious!" );
@@ -1520,18 +1528,38 @@ bool vampire_consume_corpse(int mons_type, int mass,
break;
default:
+ switch (chunk_type)
+ {
+ case CE_CLEAN:
food_value = mass;
mpr( "This warm blood tastes delicious!" );
break;
+ case CE_CONTAMINATED:
+ food_value = mass / (random2(3) + 1);
+ mpr( "Somehow that blood was not very filling!" );
+ break;
+ case CE_POISONOUS:
+ food_value = random2(mass) - mass/2;
+ mpr( "Blech - that blood tastes nasty!" );
+ break;
+ case CE_MUTAGEN_RANDOM:
+ food_value = random2(mass);
+ mpr( "That blood tastes really weird!" );
+ mutate(RANDOM_MUTATION);
+ xom_is_stimulated(100);
+ break;
+ }
}
did_god_conduct(DID_DRINK_BLOOD, 8);
}
- else if (wearing_amulet(AMU_THE_GOURMAND)){
+ else if (wearing_amulet(AMU_THE_GOURMAND))
+ {
food_value = mass/3 + random2(you.experience_level * 5);
mpr("Slurps.");
did_god_conduct(DID_DRINK_BLOOD, 8);
}
- else {
+ else
+ {
mpr("It's not fresh enough.");
return false;
}
diff --git a/crawl-ref/source/it_use2.cc b/crawl-ref/source/it_use2.cc
index 5fe6cb1c96..e74aa0fd2b 100644
--- a/crawl-ref/source/it_use2.cc
+++ b/crawl-ref/source/it_use2.cc
@@ -81,7 +81,7 @@ bool potion_effect( potion_type pot_eff, int pow )
break;
case POT_HEAL_WOUNDS:
- if (you.species == SP_VAMPIRE /*&& you.hunger_state */)
+ if (you.species == SP_VAMPIRE)
{
inc_hp((10 + random2avg(28, 3)) / 2, false);
mpr("You feel better.");
diff --git a/crawl-ref/source/newgame.cc b/crawl-ref/source/newgame.cc
index 11bc3fee5e..dff0bae75a 100644
--- a/crawl-ref/source/newgame.cc
+++ b/crawl-ref/source/newgame.cc
@@ -1919,7 +1919,7 @@ 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_POISON_RESISTANCE] = 1;
+ you.mutation[MUT_POISON_RESISTANCE] = 1;
break;
default:
break;
@@ -3518,9 +3518,11 @@ bool give_items_skills()
you.skills[(player_light_armour()? SK_DODGING : SK_ARMOUR)] = 2;
+ if (you.species != SP_VAMPIRE)
you.skills[SK_SHIELDS] = 2;
you.skills[SK_RANGED_COMBAT] = 2;
- you.skills[(coinflip() ? SK_STABBING : SK_SHIELDS)]++;
+ you.skills[((coinflip() || you.species == SP_VAMPIRE)?
+ SK_STABBING : SK_SHIELDS)]++;
}
break;
diff --git a/crawl-ref/source/player.cc b/crawl-ref/source/player.cc
index c323ae53ac..e02d3630fd 100644
--- a/crawl-ref/source/player.cc
+++ b/crawl-ref/source/player.cc
@@ -5043,7 +5043,7 @@ int player::damage_brand(int)
break;
case TRAN_BAT:
- if (you.species == SP_VAMPIRE)
+ if (you.species == SP_VAMPIRE && one_chance_in(3))
{
ret = SPWPN_VAMPIRICISM;
} // else fall through