summaryrefslogtreecommitdiffstats
path: root/crawl-ref/source/it_use2.cc
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/it_use2.cc
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/it_use2.cc')
-rw-r--r--crawl-ref/source/it_use2.cc141
1 files changed, 72 insertions, 69 deletions
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);