decide whether there are more blessed luckstones (plus luck-conferring artifacts) than cursed ones; optionally combine uncursed with blessed */
| 420 | /* decide whether there are more blessed luckstones (plus luck-conferring |
| 421 | artifacts) than cursed ones; optionally combine uncursed with blessed */ |
| 422 | int |
| 423 | stone_luck(boolean include_uncursed) |
| 424 | { |
| 425 | struct obj *otmp; |
| 426 | long bonchance = 0; |
| 427 | |
| 428 | for (otmp = gi.invent; otmp; otmp = otmp->nobj) |
| 429 | if (confers_luck(otmp)) { |
| 430 | if (otmp->cursed) |
| 431 | bonchance -= otmp->quan; |
| 432 | else if (otmp->blessed || include_uncursed) |
| 433 | bonchance += otmp->quan; |
| 434 | } |
| 435 | |
| 436 | return sgn((int) bonchance); |
| 437 | } |
| 438 | |
| 439 | /* there has just been an inventory change affecting a luck-granting item */ |
| 440 | void |
no test coverage detected