called after setuhpmax() when damage is pending; if uhpmax (or mhmax) has been reduced, it might have caused uhp (or mh) to be reduced too; if so, recalculate pending loss to account for that */
| 1179 | if uhpmax (or mhmax) has been reduced, it might have caused uhp (or mh) |
| 1180 | to be reduced too; if so, recalculate pending loss to account for that */ |
| 1181 | int |
| 1182 | adjuhploss( |
| 1183 | int loss, /* pending hp loss */ |
| 1184 | int olduhp) /* does double duty as oldmh when Upolyd */ |
| 1185 | { |
| 1186 | if (!Upolyd) { |
| 1187 | if (u.uhp < olduhp) |
| 1188 | loss -= (olduhp - u.uhp); |
| 1189 | } else { |
| 1190 | if (u.mh < olduhp) |
| 1191 | loss -= (olduhp - u.mh); |
| 1192 | } |
| 1193 | return max(loss, 1); |
| 1194 | } |
| 1195 | |
| 1196 | /* return the current effective value of a specific characteristic |
| 1197 | (the 'a' in 'acurr()' comes from outdated use of "attribute" for the |
no outgoing calls
no test coverage detected