3 /* regen.c Larn is copyrighted 1986 by Noah Morgan. */
17 subroutine to regenerate player hp and spells
29 if (--d
[TIMESTOP
] <= 0)
32 } /* for stop time spell */
35 if (d
[STRENGTH
] < 3) {
39 if ((d
[HASTESELF
] == 0) || ((d
[HASTESELF
] & 1) == 0))
42 if (d
[HP
] != d
[HPMAX
])
43 if (d
[REGENCOUNTER
]-- <= 0) { /* regenerate hit points */
44 d
[REGENCOUNTER
] = 22 + (d
[HARDGAME
] << 1) - d
[LEVEL
];
45 if ((d
[HP
] += d
[REGEN
]) > d
[HPMAX
])
49 if (d
[SPELLS
] < d
[SPELLMAX
]) /* regenerate spells */
50 if (d
[ECOUNTER
]-- <= 0) {
51 d
[ECOUNTER
] = 100 + 4 * (d
[HARDGAME
] - d
[LEVEL
] - d
[ENERGY
]);
57 for (i
= 0; i
< 6; i
++)
62 if (--d
[ALTPRO
] <= 0) {
66 if (d
[PROTECTIONTIME
])
67 if (--d
[PROTECTIONTIME
] <= 0) {
72 if (--d
[DEXCOUNT
] <= 0) {
77 if (--d
[STRCOUNT
] <= 0) {
82 if (--d
[BLINDCOUNT
] <= 0) {
84 lprcat("\nThe blindness lifts ");
88 if (--d
[CONFUSE
] <= 0) {
90 lprcat("\nYou regain your senses");
94 if (--d
[GIANTSTR
] <= 0) {
99 if ((--d
[CHARMCOUNT
]) <= 0)
102 if ((--d
[INVISIBILITY
]) <= 0)
105 if ((--d
[CANCELLATION
]) <= 0)
111 if ((--d
[HASTESELF
]) <= 0)
116 if ((--d
[SCAREMONST
]) <= 0)
119 if ((--d
[STEALTH
]) <= 0)
124 if ((--d
[HOLDMONST
]) <= 0)
128 if (d
[FIRERESISTANCE
])
129 if ((--d
[FIRERESISTANCE
]) <= 0)
132 if (--d
[GLOBE
] <= 0) {
133 d
[MOREDEFENSES
] -= 10;
137 if (--d
[SPIRITPRO
] <= 0)
140 if (--d
[UNDEADPRO
] <= 0)
143 if (--d
[HALFDAM
] <= 0) {
145 lprcat("\nYou now feel better ");
149 if (--d
[SEEINVISIBLE
] <= 0) {
150 monstnamelist
[INVISIBLESTALKER
] = ' ';
152 lprcat("\nYou feel your vision return to normal");
157 if ((d
[WEAR
] != -1) || (d
[SHIELD
] != -1))
159 d
[WEAR
] = d
[SHIELD
] = -1;
161 lprcat("\nThe hysteria of itching forces you to remove your armor!");
166 if (--d
[ITCHING
] <= 0) {
168 lprcat("\nYou now feel the irritation subside!");
174 if (d
[CLUMSINESS
] > 1)
175 if (item
[playerx
][playery
] == 0) /* only if nothing there */
176 if (rnd(100) < 33) /* drop your weapon due
178 drop_object((int) d
[WIELD
]);
179 if (--d
[CLUMSINESS
] <= 0) {
181 lprcat("\nYou now feel less awkward!");