Keep track of unfixable troubles for purposes of messages saying you feel * great. */
| 4428 | * great. |
| 4429 | */ |
| 4430 | int |
| 4431 | unfixable_trouble_count(boolean is_horn) |
| 4432 | { |
| 4433 | int unfixable_trbl = 0; |
| 4434 | |
| 4435 | if (Stoned) |
| 4436 | unfixable_trbl++; |
| 4437 | if (Slimed) |
| 4438 | unfixable_trbl++; |
| 4439 | if (Strangled) |
| 4440 | unfixable_trbl++; |
| 4441 | if (ATEMP(A_DEX) < 0 && Wounded_legs) |
| 4442 | unfixable_trbl++; |
| 4443 | if (ATEMP(A_STR) < 0 && u.uhs >= WEAK) |
| 4444 | unfixable_trbl++; |
| 4445 | /* lycanthropy is undesirable, but it doesn't actually make you feel bad |
| 4446 | so don't count it as a trouble which can't be fixed */ |
| 4447 | |
| 4448 | /* |
| 4449 | * Unicorn horn can fix these when they're timed but not when |
| 4450 | * they aren't. Potion of restore ability doesn't touch them, |
| 4451 | * so they're always unfixable for the not-unihorn case. |
| 4452 | * [Most of these are timed only, so always curable via horn. |
| 4453 | * An exception is Stunned, which can be forced On by certain |
| 4454 | * polymorph forms (stalker, bats).] |
| 4455 | */ |
| 4456 | if (Sick && (!is_horn || (Sick & ~TIMEOUT) != 0L)) |
| 4457 | unfixable_trbl++; |
| 4458 | if (Stunned && (!is_horn || (HStun & ~TIMEOUT) != 0L)) |
| 4459 | unfixable_trbl++; |
| 4460 | if (Confusion && (!is_horn || (HConfusion & ~TIMEOUT) != 0L)) |
| 4461 | unfixable_trbl++; |
| 4462 | if (Hallucination && (!is_horn || (HHallucination & ~TIMEOUT) != 0L)) |
| 4463 | unfixable_trbl++; |
| 4464 | if (Vomiting && (!is_horn || (Vomiting & ~TIMEOUT) != 0L)) |
| 4465 | unfixable_trbl++; |
| 4466 | if (Deaf && (!is_horn || (HDeaf & ~TIMEOUT) != 0L)) |
| 4467 | unfixable_trbl++; |
| 4468 | |
| 4469 | return unfixable_trbl; |
| 4470 | } |
| 4471 | |
| 4472 | staticfn int |
| 4473 | flip_through_book(struct obj *obj) |
no outgoing calls
no test coverage detected