Skip to content

Commit

Permalink
Updated sleep resistance in some spots where the partial needed check…
Browse files Browse the repository at this point in the history
…ing.
  • Loading branch information
elunna committed Oct 5, 2023
1 parent 3632ae8 commit 3978375
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/eat.c
Original file line number Diff line number Diff line change
Expand Up @@ -2567,11 +2567,12 @@ eatpill()
exercise(A_WIS, TRUE);
break;
case 5:
if (Sleep_resistance) {
if (how_resistant(SLEEP_RES) == 100) {
pline("Hmm. Nothing happens.");
} else {
You_feel("drowsy...");
nomul(-rn2(50));

nomul(-resist_reduce(rnd(50), SLEEP_RES));
u.usleep = 1;
nomovemsg = "You wake up.";
}
Expand Down
4 changes: 2 additions & 2 deletions src/muse.c
Original file line number Diff line number Diff line change
Expand Up @@ -2637,12 +2637,12 @@ struct monst *mtmp;
if (!Deaf) {
/* No effects on you if you can't hear the music, but the monster
* doesn't know that so it won't be prevented from trying. */
if (Sleep_resistance)
if (how_resistant(SLEEP_RES) > 90)
You("yawn.");
else {
You("fall asleep.");
/* sleep time is same as put_monsters_to_sleep */
fall_asleep(-d(10, 10), TRUE);
fall_asleep(-resist_reduce(d(10, 10), SLEEP_RES), TRUE);
}
}
otmp->spe--;
Expand Down
3 changes: 2 additions & 1 deletion src/spell.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,8 @@ register struct obj *spellbook;
boolean too_hard = FALSE;

/* attempting to read dull book may make hero fall asleep */
if (!confused && !Sleep_resistance && objdescr_is(spellbook, "dull")) {
if (!confused && (how_resistant(SLEEP_RES) < 50)
&& objdescr_is(spellbook, "dull")) {
const char *eyes;
int dullbook = rnd(25) - ACURR(A_WIS);

Expand Down

0 comments on commit 3978375

Please sign in to comment.