| 693 | } |
| 694 | |
| 695 | int |
| 696 | doconsult(struct monst *oracl) |
| 697 | { |
| 698 | long umoney; |
| 699 | int u_pay, minor_cost = 50, major_cost = 500 + 50 * u.ulevel; |
| 700 | int add_xpts; |
| 701 | char qbuf[QBUFSZ]; |
| 702 | |
| 703 | gm.multi = 0; |
| 704 | umoney = money_cnt(gi.invent); |
| 705 | |
| 706 | if (!oracl) { |
| 707 | There("is no one here to consult."); |
| 708 | return ECMD_OK; |
| 709 | } else if (!oracl->mpeaceful) { |
| 710 | pline("%s is in no mood for consultations.", Monnam(oracl)); |
| 711 | return ECMD_OK; |
| 712 | } else if (!umoney) { |
| 713 | You("have no gold."); |
| 714 | return ECMD_OK; |
| 715 | } |
| 716 | |
| 717 | Sprintf(qbuf, "\"Wilt thou settle for a minor consultation?\" (%d %s)", |
| 718 | minor_cost, currency((long) minor_cost)); |
| 719 | switch (ynq(qbuf)) { |
| 720 | default: |
| 721 | case 'q': |
| 722 | return ECMD_OK; |
| 723 | case 'y': |
| 724 | if (umoney < (long) minor_cost) { |
| 725 | You("don't even have enough gold for that!"); |
| 726 | return ECMD_OK; |
| 727 | } |
| 728 | u_pay = minor_cost; |
| 729 | break; |
| 730 | case 'n': |
| 731 | if (umoney <= (long) minor_cost /* don't even ask */ |
| 732 | || (svo.oracle_cnt == 1 || go.oracle_flg < 0)) |
| 733 | return ECMD_OK; |
| 734 | Sprintf(qbuf, "\"Then dost thou desire a major one?\" (%d %s)", |
| 735 | major_cost, currency((long) major_cost)); |
| 736 | if (y_n(qbuf) != 'y') |
| 737 | return ECMD_OK; |
| 738 | u_pay = (umoney < (long) major_cost) ? (int) umoney : major_cost; |
| 739 | break; |
| 740 | } |
| 741 | money2mon(oracl, (long) u_pay); |
| 742 | disp.botl = TRUE; |
| 743 | if (!u.uevent.major_oracle && !u.uevent.minor_oracle) |
| 744 | record_achievement(ACH_ORCL); |
| 745 | add_xpts = 0; /* first oracle of each type gives experience points */ |
| 746 | if (u_pay == minor_cost) { |
| 747 | outrumor(1, BY_ORACLE); |
| 748 | if (!u.uevent.minor_oracle) |
| 749 | add_xpts = u_pay / (u.uevent.major_oracle ? 25 : 10); |
| 750 | /* 5 pts if very 1st, or 2 pts if major already done */ |
| 751 | u.uevent.minor_oracle = TRUE; |
| 752 | } else { |
no test coverage detected