when wearing (or taking off) an unID'd item, this routine is used to distinguish between observable +0 result and no-visible-effect due to an attribute not being able to exceed maximum or minimum */
| 1265 | to distinguish between observable +0 result and no-visible-effect |
| 1266 | due to an attribute not being able to exceed maximum or minimum */ |
| 1267 | boolean |
| 1268 | extremeattr( |
| 1269 | int attrindx) /* does attrindx's value match its max or min? */ |
| 1270 | { |
| 1271 | /* Fixed_abil and racial MINATTR/MAXATTR aren't relevant here */ |
| 1272 | int lolimit = 3, hilimit = 25, curval = ACURR(attrindx); |
| 1273 | |
| 1274 | /* upper limit for Str is 25 but its value is encoded differently */ |
| 1275 | if (attrindx == A_STR) { |
| 1276 | hilimit = STR19(25); /* 125 */ |
| 1277 | /* lower limit for Str can also be 25 */ |
| 1278 | if (uarmg && uarmg->otyp == GAUNTLETS_OF_POWER) |
| 1279 | lolimit = hilimit; |
| 1280 | } else if (attrindx == A_CON) { |
| 1281 | if (u_wield_art(ART_OGRESMASHER)) |
| 1282 | lolimit = hilimit; |
| 1283 | } |
| 1284 | /* this exception is hypothetical; the only other worn item affecting |
| 1285 | Int or Wis is another helmet so can't be in use at the same time */ |
| 1286 | if (attrindx == A_INT || attrindx == A_WIS) { |
| 1287 | if (uarmh && uarmh->otyp == DUNCE_CAP) |
| 1288 | hilimit = lolimit = 6; |
| 1289 | } |
| 1290 | |
| 1291 | /* are we currently at either limit? */ |
| 1292 | return (curval == lolimit || curval == hilimit) ? TRUE : FALSE; |
| 1293 | } |
| 1294 | |
| 1295 | /* avoid possible problems with alignment overflow, and provide a centralized |
| 1296 | location for any future alignment limits */ |