similar to count_buc(), but tallies all states at once rather than looking for a specific type */
| 3577 | /* similar to count_buc(), but tallies all states at once |
| 3578 | rather than looking for a specific type */ |
| 3579 | void |
| 3580 | tally_BUCX( |
| 3581 | struct obj *list, |
| 3582 | boolean by_nexthere, |
| 3583 | int *bcp, int *ucp, int *ccp, int *xcp, int *ocp, int *jcp) |
| 3584 | { |
| 3585 | /* Future extensions: |
| 3586 | * Skip current_container when list is invent, uchain when |
| 3587 | * first object of list is located on the floor. 'ocp' will then |
| 3588 | * have a function again (it was a counter for having skipped gold, |
| 3589 | * but that's not skipped anymore). |
| 3590 | */ |
| 3591 | *bcp = *ucp = *ccp = *xcp = *ocp = *jcp = 0; |
| 3592 | for ( ; list; list = (by_nexthere ? list->nexthere : list->nobj)) { |
| 3593 | /* priests always know bless/curse state */ |
| 3594 | if (Role_if(PM_CLERIC)) |
| 3595 | list->bknown = (list->oclass != COIN_CLASS); |
| 3596 | if (list->pickup_prev) |
| 3597 | ++(*jcp); |
| 3598 | /* coins are either uncursed or unknown based upon option setting */ |
| 3599 | if (list->oclass == COIN_CLASS) { |
| 3600 | if (flags.goldX) |
| 3601 | ++(*xcp); |
| 3602 | else |
| 3603 | ++(*ucp); |
| 3604 | continue; |
| 3605 | } |
| 3606 | /* ordinary items */ |
| 3607 | if (!list->bknown) |
| 3608 | ++(*xcp); |
| 3609 | else if (list->blessed) |
| 3610 | ++(*bcp); |
| 3611 | else if (list->cursed) |
| 3612 | ++(*ccp); |
| 3613 | else /* neither blessed nor cursed => uncursed */ |
| 3614 | ++(*ucp); |
| 3615 | } |
| 3616 | } |
| 3617 | |
| 3618 | /* count everything inside a container, or just shop-owned items inside */ |
| 3619 | long |
no outgoing calls
no test coverage detected