| 694 | } |
| 695 | |
| 696 | void S_StartSRepair() |
| 697 | { |
| 698 | BOOL repairok; |
| 699 | int i; |
| 700 | |
| 701 | stextsize = 1; |
| 702 | repairok = FALSE; |
| 703 | storenumh = 0; |
| 704 | for (i = 0; i < 48; i++) |
| 705 | storehold[i]._itype = ITYPE_NONE; |
| 706 | if (plr[myplr].InvBody[INVLOC_HEAD]._itype != ITYPE_NONE && plr[myplr].InvBody[INVLOC_HEAD]._iDurability != plr[myplr].InvBody[INVLOC_HEAD]._iMaxDur) { |
| 707 | repairok = TRUE; |
| 708 | AddStoreHoldRepair(plr[myplr].InvBody, -1); |
| 709 | } |
| 710 | if (plr[myplr].InvBody[INVLOC_CHEST]._itype != ITYPE_NONE && plr[myplr].InvBody[INVLOC_CHEST]._iDurability != plr[myplr].InvBody[INVLOC_CHEST]._iMaxDur) { |
| 711 | repairok = TRUE; |
| 712 | AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_CHEST], -2); |
| 713 | } |
| 714 | if (plr[myplr].InvBody[INVLOC_HAND_LEFT]._itype != ITYPE_NONE && plr[myplr].InvBody[INVLOC_HAND_LEFT]._iDurability != plr[myplr].InvBody[INVLOC_HAND_LEFT]._iMaxDur) { |
| 715 | repairok = TRUE; |
| 716 | AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_HAND_LEFT], -3); |
| 717 | } |
| 718 | if (plr[myplr].InvBody[INVLOC_HAND_RIGHT]._itype != ITYPE_NONE && plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iDurability != plr[myplr].InvBody[INVLOC_HAND_RIGHT]._iMaxDur) { |
| 719 | repairok = TRUE; |
| 720 | AddStoreHoldRepair(&plr[myplr].InvBody[INVLOC_HAND_RIGHT], -4); |
| 721 | } |
| 722 | for (i = 0; i < plr[myplr]._pNumInv; i++) { |
| 723 | if (SmithRepairOk(i)) { |
| 724 | repairok = TRUE; |
| 725 | AddStoreHoldRepair(&plr[myplr].InvList[i], i); |
| 726 | } |
| 727 | } |
| 728 | if (!repairok) { |
| 729 | stextscrl = FALSE; |
| 730 | sprintf(tempstr, "You have nothing to repair. Your gold : %i", plr[myplr]._pGold); |
| 731 | AddSText(0, 1, 1, tempstr, 3, 0); |
| 732 | AddSLine(3); |
| 733 | AddSLine(21); |
| 734 | AddSText(0, 22, 1, "Back", 0, 1); |
| 735 | OffsetSTextY(22, 6); |
| 736 | return; |
| 737 | } |
| 738 | |
| 739 | stextscrl = TRUE; |
| 740 | stextsval = 0; |
| 741 | stextsmax = plr[myplr]._pNumInv; |
| 742 | sprintf(tempstr, "Repair which item? Your gold : %i", plr[myplr]._pGold); |
| 743 | AddSText(0, 1, 1, tempstr, 3, 0); |
| 744 | AddSLine(3); |
| 745 | AddSLine(21); |
| 746 | S_ScrollSSell(stextsval); |
| 747 | AddSText(0, 22, 1, "Back", 0, 1); |
| 748 | OffsetSTextY(22, 6); |
| 749 | } |
| 750 | |
| 751 | void AddStoreHoldRepair(ItemStruct *itm, int i) |
| 752 | { |
no test coverage detected