summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/fight.cc
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/fight.cc
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/fight.cc')
-rw-r--r--crawl-ref/source/fight.cc35
1 files changed, 28 insertions, 7 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