| 166 | } |
| 167 | |
| 168 | void |
| 169 | more_experienced(int exper, int rexp) |
| 170 | { |
| 171 | long oldexp = u.uexp, |
| 172 | oldrexp = u.urexp, |
| 173 | newexp = oldexp + exper, |
| 174 | rexpincr = 4 * exper + rexp, |
| 175 | newrexp = oldrexp + rexpincr; |
| 176 | |
| 177 | /* cap experience and score on wraparound */ |
| 178 | if (newexp < 0 && exper > 0) |
| 179 | newexp = LONG_MAX; |
| 180 | if (newrexp < 0 && rexpincr > 0) |
| 181 | newrexp = LONG_MAX; |
| 182 | |
| 183 | if (newexp != oldexp) { |
| 184 | u.uexp = newexp; |
| 185 | if (flags.showexp) |
| 186 | disp.botl = TRUE; |
| 187 | /* even when experience points aren't being shown, experience level |
| 188 | might be highlighted with a percentage highlight rule and that |
| 189 | percentage depends upon experience points */ |
| 190 | if (!disp.botl && exp_percent_changing()) |
| 191 | disp.botl = TRUE; |
| 192 | } |
| 193 | /* newrexp will always differ from oldrexp unless they're LONG_MAX */ |
| 194 | if (newrexp != oldrexp) { |
| 195 | u.urexp = newrexp; |
| 196 | #ifdef SCORE_ON_BOTL |
| 197 | if (flags.showscore) |
| 198 | disp.botl = TRUE; |
| 199 | #endif |
| 200 | } |
| 201 | if (u.urexp >= (Role_if(PM_WIZARD) ? 1000 : 2000)) |
| 202 | flags.beginner = FALSE; |
| 203 | } |
| 204 | |
| 205 | /* e.g., hit by drain life attack */ |
| 206 | void |
no test coverage detected