Skip to content

Commit

Permalink
Vampiric hunger and regeneration tweaks.
Browse files Browse the repository at this point in the history
Okay, this is another mechanic that's been through the idea bin many times, but I think we are finally converging on a good setup. Instead of the HP gain while feeding thing, we are ditching that and going with good 'ol Regeneration from XP 1. However, we are also introducing Hunger at XP 1. Similar to the giant race, vampires do not gain extra hunger from regeneration, so I think this is necessary to give the player an incentive to play fast and aggressively, truly utilizing their regeneration to its full effect.

Vampires are also not punished for being satiated all the time, so you can have a feeding frenzy and hopefully make it last for a while, allowing you to search for more victims.

I moved the acquisition of sleep resistance up to XP 9. This is a bit unusual because the only variant generous enough to grant it is dNetHack. I believe it is essential though, given that vampires cannot eat for intrinsics, but it shouldn't be available at XP 1. Vampires already have Unbreathing, allowing them to bypass sleep traps with ease. By the time you are close to XP 9, you will truly need it to deal with threats like kamadan and random wands of sleep.
  • Loading branch information
elunna committed Sep 21, 2023
1 parent 2d8fa32 commit e4bc2f4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 22 deletions.
5 changes: 0 additions & 5 deletions src/allmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -944,11 +944,6 @@ int wtcap;
&& (!uarmc || (uarmc && uarmc->otyp != POISONOUS_CLOAK))
&& (encumbrance_ok || U_CAN_REGEN()) && !Is_valley(&u.uz)
&& !infidel_no_amulet) {

if (Race_if(PM_VAMPIRIC) && rn2(3))
return; /* Vampires have regeneration penalty, they only
* regenerate on 1/3rd of valid turns, so must rely
* more on draining life. */
/*
* KMH, balance patch -- New regeneration code
* Healthstones have been added, which alter your effective
Expand Down
9 changes: 5 additions & 4 deletions src/attrib.c
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ static const struct innate {
{ 0, 0, 0, 0 } },

vam_abil[] = { { 1, &(HPoison_resistance), "", "" },
{ 1, &(HSleep_resistance), "", "" },
{ 1, &(HDrain_resistance), "", "" },
{ 1, &(HBreathless), "breathless", "full of air" },
/*{ 10, &(HHunger), "ravenous", "more content" },*/
{ 10, &(HRegeneration), "resilient", "less resilient" },
{ 1, &(HRegeneration), "resilient", "less resilient" },
{ 1, &(HHunger), "", "" },
{ 9, &(HSleep_resistance), "", "" },
/*{ 1, &(HFlying), "lighter than air", "gravity's pull" },*/
{ 0, 0, 0, 0 } },

Expand Down Expand Up @@ -610,7 +610,8 @@ exerper()
debugpline0("exerper: Hunger checks");
switch (hs) {
case SATIATED:
if (!Race_if(PM_VAMPIRIC)) /* undead */
/* Don't punish vampires for eating too much */
if (maybe_polyd(!is_vampire(youmonst.data), !Race_if(PM_VAMPIRE)))
exercise(A_DEX, FALSE);
if (Role_if(PM_MONK))
exercise(A_WIS, FALSE);
Expand Down
2 changes: 1 addition & 1 deletion src/eat.c
Original file line number Diff line number Diff line change
Expand Up @@ -3478,7 +3478,7 @@ gethungry()
accessorytime = rn2(20); /* rn2(20) replaces (int) (moves % 20L) */
if (accessorytime % 2) { /* odd */
/* Regeneration uses up food when injured, unless due to an artifact
* or playing as a Giant */
* or playing as a race that has it intrinsically */
if ((HRegeneration & ~(FROMFORM | FROMRACE))
|| ((ERegeneration & ~(W_ARTI | W_WEP | W_ARMOR)) &&
(uhp() < uhpmax())))
Expand Down
15 changes: 3 additions & 12 deletions src/uhitm.c
Original file line number Diff line number Diff line change
Expand Up @@ -3342,12 +3342,12 @@ int specialdmg; /* blessed and/or silver bonus against various things */
tmp = 0;
break;
case AD_DRLI:
if (!negated && rnd(3)
if (!negated && !rn2(3)
&& !(resists_drli(mdef) || defended(mdef, AD_DRLI))) {
int xtmp = d(2, 6);

if (mdef->mhp < xtmp)
xtmp = mdef->mhp;

/* Player vampires are smart enough not to feed while
* biting if they might have trouble getting it down
*/
Expand All @@ -3357,20 +3357,11 @@ int specialdmg; /* blessed and/or silver bonus against various things */
/* For the life of a creature is in the blood (Lev 17:11) */
if (flags.verbose)
You("feed on the lifeblood.");

/* [ALI] Biting monsters does not count against eating
* conducts. The draining of life is considered to be
* primarily a non-physical effect */
lesshungry(xtmp * 6);
/* Feeding increases HP */
if (Upolyd) {
u.mh += xtmp * 2;
if (u.mh > u.mhmax)
u.mh = u.mhmax;
} else {
u.uhp += xtmp * 2;
if (u.uhp > u.uhpmax)
u.uhp = u.uhpmax;
}
}

if (canseemon(mdef))
Expand Down

0 comments on commit e4bc2f4

Please sign in to comment.