| 8570 | } |
| 8571 | |
| 8572 | ItemType alchemyCookResult(int player, Item* potion1Item, Item* potion2Item, int& outCreateCount, Status& statusOut, |
| 8573 | int& outMissingPotion1Count, int& outMissingPotion2Count) |
| 8574 | { |
| 8575 | ItemType result = POTION_EMPTY; |
| 8576 | outCreateCount = 1; |
| 8577 | outMissingPotion1Count = 0; |
| 8578 | outMissingPotion2Count = 0; |
| 8579 | statusOut = SERVICABLE; |
| 8580 | if ( !potion1Item || !potion2Item ) |
| 8581 | { |
| 8582 | return result; |
| 8583 | } |
| 8584 | |
| 8585 | ItemType potion1 = potion1Item->type; |
| 8586 | ItemType potion2 = potion2Item->type; |
| 8587 | |
| 8588 | if ( (potion1 == TOOL_TOWEL && potion2 == FOOD_RATION) |
| 8589 | || (potion2 == TOOL_TOWEL && potion1 == FOOD_RATION) ) |
| 8590 | { |
| 8591 | result = GREASE_BALL; |
| 8592 | |
| 8593 | if ( potion1 == TOOL_TOWEL ) |
| 8594 | { |
| 8595 | outCreateCount = 4 * (int)(potion1Item->status); |
| 8596 | } |
| 8597 | else if ( potion2 == TOOL_TOWEL ) |
| 8598 | { |
| 8599 | outCreateCount = 4 * (int)(potion2Item->status); |
| 8600 | } |
| 8601 | if ( potion1 == FOOD_RATION ) |
| 8602 | { |
| 8603 | if ( potion1Item->count < 4 ) |
| 8604 | { |
| 8605 | outMissingPotion1Count = 4 - potion1Item->count; |
| 8606 | } |
| 8607 | } |
| 8608 | else if ( potion2 == FOOD_RATION ) |
| 8609 | { |
| 8610 | if ( potion2Item->count < 4 ) |
| 8611 | { |
| 8612 | outMissingPotion2Count = 4 - potion2Item->count; |
| 8613 | } |
| 8614 | } |
| 8615 | statusOut = WORN; |
| 8616 | } |
| 8617 | else if ( (potion1 == POTION_WATER && potion2 == FOOD_RATION) |
| 8618 | || (potion2 == POTION_WATER && potion1 == FOOD_RATION) ) |
| 8619 | { |
| 8620 | result = SLOP_BALL; |
| 8621 | if ( potion1 == FOOD_RATION ) |
| 8622 | { |
| 8623 | if ( potion1Item->count < 4 ) |
| 8624 | { |
| 8625 | outMissingPotion1Count = 4 - potion1Item->count; |
| 8626 | } |
| 8627 | } |
| 8628 | else if ( potion2 == FOOD_RATION ) |
| 8629 | { |
no test coverage detected