| 486 | #define AVAL 50 /* tune value for exercise gains */ |
| 487 | |
| 488 | void |
| 489 | exercise(int i, boolean inc_or_dec) |
| 490 | { |
| 491 | debugpline0("Exercise:"); |
| 492 | if (i == A_INT || i == A_CHA) |
| 493 | return; /* can't exercise these */ |
| 494 | |
| 495 | /* no physical exercise while polymorphed; the body's temporary */ |
| 496 | if (Upolyd && i != A_WIS) |
| 497 | return; |
| 498 | |
| 499 | if (abs(AEXE(i)) < AVAL) { |
| 500 | /* |
| 501 | * Law of diminishing returns (Part I): |
| 502 | * |
| 503 | * Gain is harder at higher attribute values. |
| 504 | * 79% at "3" --> 0% at "18" |
| 505 | * Loss is even at all levels (50%). |
| 506 | * |
| 507 | * Note: *YES* ACURR is the right one to use. |
| 508 | */ |
| 509 | AEXE(i) += (inc_or_dec) ? (rn2(19) > ACURR(i)) : -rn2(2); |
| 510 | debugpline3("%s, %s AEXE = %d", |
| 511 | (i == A_STR) ? "Str" : (i == A_WIS) ? "Wis" : (i == A_DEX) |
| 512 | ? "Dex" |
| 513 | : "Con", |
| 514 | (inc_or_dec) ? "inc" : "dec", AEXE(i)); |
| 515 | } |
| 516 | if (svm.moves > 0 && (i == A_STR || i == A_CON)) |
| 517 | encumber_msg(); |
| 518 | } |
| 519 | |
| 520 | staticfn void |
| 521 | exerper(void) |