update u.uhpmax or u.mhmax and values of other things that depend upon whichever of them is relevant */
| 1154 | /* update u.uhpmax or u.mhmax and values of other things that depend upon |
| 1155 | whichever of them is relevant */ |
| 1156 | void |
| 1157 | setuhpmax(int newmax, boolean even_when_polyd) |
| 1158 | { |
| 1159 | if (!Upolyd || even_when_polyd) { |
| 1160 | if (newmax != u.uhpmax) { |
| 1161 | u.uhpmax = newmax; |
| 1162 | if (u.uhpmax > u.uhppeak) |
| 1163 | u.uhppeak = u.uhpmax; |
| 1164 | disp.botl = TRUE; |
| 1165 | } |
| 1166 | if (u.uhp > u.uhpmax) |
| 1167 | u.uhp = u.uhpmax, disp.botl = TRUE; |
| 1168 | } else { /* Upolyd */ |
| 1169 | if (newmax != u.mhmax) { |
| 1170 | u.mhmax = newmax; |
| 1171 | disp.botl = TRUE; |
| 1172 | } |
| 1173 | if (u.mh > u.mhmax) |
| 1174 | u.mh = u.mhmax, disp.botl = TRUE; |
| 1175 | } |
| 1176 | } |
| 1177 | |
| 1178 | /* called after setuhpmax() when damage is pending; |
| 1179 | if uhpmax (or mhmax) has been reduced, it might have caused uhp (or mh) |
no outgoing calls
no test coverage detected