diff options
author | Bardur Arantsson <bardur@scientician.net> | 2013-07-15 17:30:16 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2013-08-08 16:33:29 +0200 |
commit | 3dfea8f553013c251a60e2f99d5fa3f0ef65fec8 (patch) | |
tree | 0f326556c2d384ba279f75cbf67402dcfe2f66ad /src/xtra2.c | |
parent | 13503952c8aef44cebd3289a15b9ad2767a3937c (diff) |
Rework paralysis to avoid insta-death
Paralysis would mean instant death (even when hit by a lowly
floating eye), but this is not really an interesting mechanic.
It has been reworked to not be cumulative, such that it isn't
a death sentence, but is still very dangerous if the paralyzer
is faster than the player.
Diffstat (limited to 'src/xtra2.c')
-rw-r--r-- | src/xtra2.c | 35 |
1 files changed, 32 insertions, 3 deletions
diff --git a/src/xtra2.c b/src/xtra2.c index 6f86b5f7..a0d500f2 100644 --- a/src/xtra2.c +++ b/src/xtra2.c @@ -676,11 +676,14 @@ bool_ set_afraid(int v) /* - * Set "p_ptr->paralyzed", notice observable changes + * Mechanics for setting the "paralyzed" field. */ -bool_ set_paralyzed(int v) +static bool_ set_paralyzed_aux(int v) { - bool_ notice = set_simple_field( + bool_ notice; + + /* Normal processing */ + notice = set_simple_field( &p_ptr->paralyzed, v, TERM_WHITE, "You are paralyzed!", TERM_WHITE, "You can move again."); @@ -698,6 +701,32 @@ bool_ set_paralyzed(int v) return notice; } +/* + * Set "p_ptr->paralyzed", notice observable changes + */ +bool_ set_paralyzed(int v) +{ + /* Paralysis effects do not accumulate -- this is to + prevent the uninteresting insta-death effect, but + still leave paralyzers highly dangerous if they're + faster than the player. */ + + if (p_ptr->paralyzed > 0) { + return FALSE; + } + + /* Normal processing */ + return set_paralyzed_aux(v); +} + +/* + * Decrement "p_ptr->paralyzed", notice observable changes + */ +void dec_paralyzed() +{ + set_paralyzed_aux(p_ptr->paralyzed - 1); +} + /* * Set "p_ptr->image", notice observable changes |