2 * Copyright (c) 1988 The Regents of the University of California.
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution.
13 * 3. All advertising materials mentioning features or use of this software
14 * must display the following acknowledgement:
15 * This product includes software developed by the University of
16 * California, Berkeley and its contributors.
17 * 4. Neither the name of the University nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36 static char sccsid[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
38 static const char rcsid[] =
39 "$FreeBSD: src/games/larn/store.c,v 1.5 1999/11/30 03:49:00 billf Exp $";
42 /* store.c Larn is copyrighted 1986 by Noah Morgan. */
44 static int dndcount=0,dnditm=0;
46 /* this is the data for the stuff in the dnd store */
47 int maxitm=83; /* number of items in the dnd inventory table */
48 struct _itm itm[90] = {
49 /*cost memory iven name iven arg how
50 gp pointer iven[] ivenarg[] many */
52 { 2, 0, OLEATHER, 0, 3 },
53 { 10, 0, OSTUDLEATHER, 0, 2 },
54 { 40, 0, ORING, 0, 2 },
55 { 85, 0, OCHAIN, 0, 2 },
56 { 220, 0, OSPLINT, 0, 1 },
57 { 400, 0, OPLATE, 0, 1 },
58 { 900, 0, OPLATEARMOR, 0, 1 },
59 { 2600, 0, OSSPLATE, 0, 1 },
60 { 150, 0, OSHIELD, 0, 1 },
62 /*cost memory iven name iven arg how
63 gp pointer iven[] ivenarg[] many */
65 { 2, 0, ODAGGER, 0, 3 },
66 { 20, 0, OSPEAR, 0, 3 },
67 { 80, 0, OFLAIL, 0, 2 },
68 { 150, 0, OBATTLEAXE, 0, 2 },
69 { 450, 0, OLONGSWORD, 0, 2 },
70 { 1000, 0, O2SWORD, 0, 2 },
71 { 5000, 0, OSWORD, 0, 1 },
72 { 16500, 0, OLANCE, 0, 1 },
73 { 6000, 0, OSWORDofSLASHING, 0, 0 },
74 { 10000, 0, OHAMMER, 0, 0 },
76 /*cost memory iven name iven arg how
77 gp pointer iven[] ivenarg[] many */
79 { 150, 0, OPROTRING, 1, 1 },
80 { 85, 0, OSTRRING, 1, 1 },
81 { 120, 0, ODEXRING, 1, 1 },
82 { 120, 0, OCLEVERRING, 1, 1 },
83 { 180, 0, OENERGYRING, 0, 1 },
84 { 125, 0, ODAMRING, 0, 1 },
85 { 220, 0, OREGENRING, 0, 1 },
86 { 1000, 0, ORINGOFEXTRA, 0, 1 },
88 { 280, 0, OBELT, 0, 1 },
90 { 400, 0, OAMULET, 0, 1 },
92 { 6500, 0, OORBOFDRAGON, 0, 0 },
93 { 5500, 0, OSPIRITSCARAB, 0, 0 },
94 { 5000, 0, OCUBEofUNDEAD, 0, 0 },
95 { 6000, 0, ONOTHEFT, 0, 0 },
97 { 590, 0, OCHEST, 6, 1 },
98 { 200, 0, OBOOK, 8, 1 },
99 { 10, 0, OCOOKIE, 0, 3 },
101 /*cost memory iven name iven arg how
102 gp pointer iven[] ivenarg[] many */
104 { 20, potionname, OPOTION, 0, 6 },
105 { 90, potionname, OPOTION, 1, 5 },
106 { 520, potionname, OPOTION, 2, 1 },
107 { 100, potionname, OPOTION, 3, 2 },
108 { 50, potionname, OPOTION, 4, 2 },
109 { 150, potionname, OPOTION, 5, 2 },
110 { 70, potionname, OPOTION, 6, 1 },
111 { 30, potionname, OPOTION, 7, 7 },
112 { 200, potionname, OPOTION, 8, 1 },
113 { 50, potionname, OPOTION, 9, 1 },
114 { 80, potionname, OPOTION, 10, 1 },
116 /*cost memory iven name iven arg how
117 gp pointer iven[] ivenarg[] many */
119 { 30, potionname, OPOTION, 11, 3 },
120 { 20, potionname, OPOTION, 12, 5 },
121 { 40, potionname, OPOTION, 13, 3 },
122 { 35, potionname, OPOTION, 14, 2 },
123 { 520, potionname, OPOTION, 15, 1 },
124 { 90, potionname, OPOTION, 16, 2 },
125 { 200, potionname, OPOTION, 17, 2 },
126 { 220, potionname, OPOTION, 18, 4 },
127 { 80, potionname, OPOTION, 19, 6 },
128 { 370, potionname, OPOTION, 20, 3 },
129 { 50, potionname, OPOTION, 22, 1 },
130 { 150, potionname, OPOTION, 23, 3 },
132 /*cost memory iven name iven arg how
133 gp pointer iven[] ivenarg[] many */
135 { 100, scrollname, OSCROLL, 0, 2 },
136 { 125, scrollname, OSCROLL, 1, 2 },
137 { 60, scrollname, OSCROLL, 2, 4 },
138 { 10, scrollname, OSCROLL, 3, 4 },
139 { 100, scrollname, OSCROLL, 4, 3 },
140 { 200, scrollname, OSCROLL, 5, 2 },
141 { 110, scrollname, OSCROLL, 6, 1 },
142 { 500, scrollname, OSCROLL, 7, 2 },
143 { 200, scrollname, OSCROLL, 8, 2 },
144 { 250, scrollname, OSCROLL, 9, 4 },
145 { 20, scrollname, OSCROLL, 10, 5 },
146 { 30, scrollname, OSCROLL, 11, 3 },
148 /*cost memory iven name iven arg how
149 gp pointer iven[] ivenarg[] many */
151 { 340, scrollname, OSCROLL, 12, 1 },
152 { 340, scrollname, OSCROLL, 13, 1 },
153 { 300, scrollname, OSCROLL, 14, 2 },
154 { 400, scrollname, OSCROLL, 15, 2 },
155 { 500, scrollname, OSCROLL, 16, 2 },
156 { 1000, scrollname, OSCROLL, 17, 1 },
157 { 500, scrollname, OSCROLL, 18, 1 },
158 { 340, scrollname, OSCROLL, 19, 2 },
159 { 220, scrollname, OSCROLL, 20, 3 },
160 { 3900, scrollname, OSCROLL, 21, 0 },
161 { 610, scrollname, OSCROLL, 22, 1 },
162 { 3000, scrollname, OSCROLL, 23, 0 }
166 function for the dnd store
170 lprcat("Welcome to the Larn Thrift Shoppe. We stock many items explorers find useful\n");
171 lprcat(" in their adventures. Feel free to browse to your hearts content.\n");
172 lprcat("Also be advised, if you break 'em, you pay for 'em.");
175 static void dnditem();
180 for (i=dnditm; i<26+dnditm; i++) dnditem(i);
181 cursor(50,18); lprcat("You have ");
187 lprcat("\nYou can't carry anything more!");
195 lprcat("\nSorry, but we are out of that item.");
202 lprcat("\nYou don't have enough gold to pay for that!");
211 nosignal = 1; /* disable signals */
213 if (outstanding_taxes>0)
215 lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep();
216 lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes);
217 lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n");
219 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
221 while (i!='\33') i=getchar();
222 drawscreen(); nosignal = 0; /* enable signals */ return;
228 cursor(59,18); lprintf("%d gold pieces",(long)c[GOLD]);
229 cltoeoln(); cl_dn(1,20); /* erase to eod */
230 lprcat("\nEnter your transaction ["); standout("space");
231 lprcat(" for more, "); standout("escape");
232 lprcat(" to leave]? ");
234 while ((i<'a' || i>'z') && (i!=' ') && (i!='\33') && (i!=12)) i=getchar();
235 if (i==12) { clear(); dnd_2hed(); dnd_hed(); }
237 { drawscreen(); nosignal = 0; /* enable signals */ return; }
241 if ((dnditm += 26) >= maxitm) dnditm=0; dnd_hed();
244 { /* buy something */
245 lprc(i); /* echo the byte */
247 if (i>=maxitm) outofstock(); else
248 if (itm[i].qty <= 0) outofstock(); else
249 if (pocketfull()) handsfull(); else
250 if (c[GOLD] < itm[i].price*10) nogold(); else
252 if (itm[i].mem != 0) *itm[i].mem[itm[i].arg] = ' ';
253 c[GOLD] -= itm[i].price*10;
254 itm[i].qty--; take(itm[i].obj,itm[i].arg);
255 if (itm[i].qty==0) dnditem(i); nap(1001);
265 to print the item list; used in dndstore() enter with the index into itm
272 if (i >= maxitm) return;
273 cursor( (j=(i&1)*40+1) , (k=((i%26)>>1)+5) );
274 if (itm[i].qty == 0) { lprintf("%39s",""); return; }
275 lprintf("%c) ",(i%26)+'a');
276 if (itm[i].obj == OPOTION)
277 { lprcat("potion of "); lprintf("%s",&potionname[itm[i].arg][1]); }
278 else if (itm[i].obj == OSCROLL)
279 { lprcat("scroll of "); lprintf("%s",&scrollname[itm[i].arg][1]); }
280 else lprintf("%s",objectname[itm[i].obj]);
281 cursor( j+31,k ); lprintf("%6d",(long)(itm[i].price*10));
286 for the college of larn
288 char course[26]={0}; /* the list of courses taken */
289 char coursetime[] = { 10, 15, 10, 20, 10, 10, 10, 5 };
291 function to display the header info for the school
296 lprcat("The College of Larn offers the exciting opportunity of higher education to\n");
297 lprcat("all inhabitants of the caves. Here is a list of the class schedule:\n\n\n");
298 lprcat("\t\t Course Name \t Time Needed\n\n");
300 if (course[0]==0) lprcat("\t\ta) Fighters Training I 10 mobuls"); /*line 7 of crt*/
302 if (course[1]==0) lprcat("\t\tb) Fighters Training II 15 mobuls");
304 if (course[2]==0) lprcat("\t\tc) Introduction to Wizardry 10 mobuls");
306 if (course[3]==0) lprcat("\t\td) Applied Wizardry 20 mobuls");
308 if (course[4]==0) lprcat("\t\te) Behavioral Psychology 10 mobuls");
310 if (course[5]==0) lprcat("\t\tf) Faith for Today 10 mobuls");
312 if (course[6]==0) lprcat("\t\tg) Contemporary Dance 10 mobuls");
314 if (course[7]==0) lprcat("\t\th) History of Larn 5 mobuls");
316 lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
318 lprcat("You are presently carrying ");
325 nosignal = 1; /* disable signals */
329 cursor(57,18); lprintf("%d gold pieces. ",(long)c[GOLD]); cursors();
330 lprcat("\nWhat is your choice ["); standout("escape");
331 lprcat(" to leave] ? "); yrepcount=0;
332 i=0; while ((i<'a' || i>'h') && (i!='\33') && (i!=12)) i=getchar();
333 if (i==12) { sch_hed(); continue; }
335 { nosignal = 0; drawscreen(); /* enable signals */ return; }
337 if (c[GOLD] < 250) nogold(); else
339 { lprcat("\nSorry, but that class is filled."); nap(1000); }
343 c[GOLD] -= 250; time_used=0;
346 case 'a': c[STRENGTH] += 2; c[CONSTITUTION]++;
347 lprcat("\nYou feel stronger!");
351 case 'b': if (course[0]==0)
353 lprcat("\nSorry, but this class has a prerequisite of Fighters Training I");
354 c[GOLD]+=250; time_used= -10000; break;
356 lprcat("\nYou feel much stronger!");
358 c[STRENGTH] += 2; c[CONSTITUTION] += 2; break;
360 case 'c': c[INTELLIGENCE] += 2;
361 lprcat("\nThe task before you now seems more attainable!");
362 cl_line(16,9); break;
364 case 'd': if (course[2]==0)
366 lprcat("\nSorry, but this class has a prerequisite of Introduction to Wizardry");
367 c[GOLD]+=250; time_used= -10000; break;
369 lprcat("\nThe task before you now seems very attainable!");
371 c[INTELLIGENCE] += 2; break;
373 case 'e': c[CHARISMA] += 3;
374 lprcat("\nYou now feel like a born leader!");
375 cl_line(16,11); break;
377 case 'f': c[WISDOM] += 2;
378 lprcat("\nYou now feel more confident that you can find the potion in time!");
379 cl_line(16,12); break;
381 case 'g': c[DEXTERITY] += 3;
382 lprcat("\nYou feel like dancing!");
383 cl_line(16,13); break;
385 case 'h': c[INTELLIGENCE]++;
386 lprcat("\nYour instructor told you that the Eye of Larn is rumored to be guarded\n");
387 lprcat("by a platinum dragon who possesses psionic abilities. ");
388 cl_line(16,14); break;
390 time_used += coursetime[i-'a']*100;
394 course[i-'a']++; /* remember that he has taken that course */
395 c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */
397 if (c[BLINDCOUNT]) c[BLINDCOUNT]=1; /* cure blindness too! */
398 if (c[CONFUSE]) c[CONFUSE]=1; /* end confusion */
399 adjtime((long)time_used); /* adjust parameters for time change */
407 * for the first national bank of Larn
409 int lasttime=0; /* last time he was in bank */
410 static void banktitle();
414 banktitle(" Welcome to the First National Bank of Larn.");
418 banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
424 nosignal = 1; /* disable signals */
425 clear(); lprcat(str);
426 if (outstanding_taxes>0)
429 lprcat("\n\nThe Larn Revenue Service has ordered that your account be frozen until all\n"); beep();
430 lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes);
431 lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n");
432 lprcat("We suggest you go to the LRS office and pay your taxes.\n");
434 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
436 while (i!='\33') i=getchar();
437 drawscreen(); nosignal = 0; /* enable signals */ return;
439 lprcat("\n\n\tGemstone\t Appraisal\t\tGemstone\t Appraisal");
440 obanksub(); nosignal = 0; /* enable signals */
445 * function to put interest on your bank account
450 if (c[BANKACCOUNT]<0) c[BANKACCOUNT] = 0;
451 else if ((c[BANKACCOUNT]>0) && (c[BANKACCOUNT]<500000))
453 i = (gtime-lasttime)/100; /* # mobuls elapsed */
454 while ((i-- > 0) && (c[BANKACCOUNT]<500000))
455 c[BANKACCOUNT] += c[BANKACCOUNT]/250;
456 if (c[BANKACCOUNT]>500000) c[BANKACCOUNT]=500000; /* interest limit */
458 lasttime = (gtime/100)*100;
461 static short gemorder[26]={0}; /* the reference to screen location for each */
462 static long gemvalue[26]={0}; /* the appraisal of the gems */
467 ointerest(); /* credit any needed interest */
469 for (k=i=0; i<26; i++)
472 case OLARNEYE: case ODIAMOND: case OEMERALD:
473 case ORUBY: case OSAPPHIRE:
475 if (iven[i]==OLARNEYE)
477 gemvalue[i]=250000-((gtime*7)/100)*100;
478 if (gemvalue[i]<50000) gemvalue[i]=50000;
480 else gemvalue[i] = (255&ivenarg[i])*100;
482 cursor( (k%2)*40+1 , (k>>1)+4 );
483 lprintf("%c) %s",i+'a',objectname[iven[i]]);
484 cursor( (k%2)*40+33 , (k>>1)+4 );
485 lprintf("%5d",(long)gemvalue[i]); k++;
487 cursor(31,17); lprintf("You have %8d gold pieces in the bank.",(long)c[BANKACCOUNT]);
488 cursor(40,18); lprintf("You have %8d gold pieces",(long)c[GOLD]);
489 if (c[BANKACCOUNT]+c[GOLD] >= 500000)
490 lprcat("\nNote: Larndom law states that only deposits under 500,000gp can earn interest.");
494 lprcat("\nYour wish? [("); standout("d"); lprcat(") deposit, (");
495 standout("w"); lprcat(") withdraw, ("); standout("s");
496 lprcat(") sell a stone, or "); standout("escape"); lprcat("] ");
498 i=0; while (i!='d' && i!='w' && i!='s' && i!='\33') i=getchar();
501 case 'd': lprcat("deposit\nHow much? "); amt = readnum((long)c[GOLD]);
502 if (amt<0) { lprcat("\nSorry, but we can't take negative gold!"); nap(2000); amt=0; } else
504 { lprcat(" You don't have that much."); nap(2000); }
505 else { c[GOLD] -= amt; c[BANKACCOUNT] += amt; }
508 case 'w': lprcat("withdraw\nHow much? "); amt = readnum((long)c[BANKACCOUNT]);
509 if (amt<0) { lprcat("\nSorry, but we don't have any negative gold!"); nap(2000); amt=0; }
510 else if (amt > c[BANKACCOUNT])
511 { lprcat("\nYou don't have that much in the bank!"); nap(2000); }
512 else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; }
515 case 's': lprcat("\nWhich stone would you like to sell? ");
516 i=0; while ((i<'a' || i>'z') && i!='*') i=getchar();
522 c[GOLD]+=gemvalue[i]; iven[i]=0;
523 gemvalue[i]=0; k = gemorder[i];
524 cursor( (k%2)*40+1 , (k>>1)+4 );
530 if (gemvalue[i=i-'a']==0)
532 lprintf("\nItem %c is not a gemstone!",i+'a');
535 c[GOLD]+=gemvalue[i]; iven[i]=0;
536 gemvalue[i]=0; k = gemorder[i];
537 cursor( (k%2)*40+1 , (k>>1)+4 ); lprintf("%39s","");
543 cursor(40,17); lprintf("%8d",(long)c[BANKACCOUNT]);
544 cursor(49,18); lprintf("%8d",(long)c[GOLD]);
549 subroutine to appraise any stone for the bank
556 if (iven[j]==gemstone)
558 lprintf("\nI see you have %s",objectname[gemstone]);
559 if (gemstone==OLARNEYE) lprcat(" I must commend you. I didn't think\nyou could get it.");
560 lprcat(" Shall I appraise it for you? "); yrepcount=0;
563 lprcat("yes.\n Just one moment please \n"); nap(1000);
564 if (gemstone==OLARNEYE)
566 amt = 250000-((gtime*7)/100)*100;
567 if (amt<50000) amt=50000;
569 else amt = (255 & ivenarg[j]) * 100;
570 lprintf("\nI can see this is an excellent stone, It is worth %d",(long)amt);
571 lprcat("\nWould you like to sell it to us? "); yrepcount=0;
572 if (getyn()=='y') { lprcat("yes\n"); c[GOLD]+=amt; iven[j]=0; }
573 else lprcat("no thank you.\n");
574 if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n");
576 else lprcat("no\nO. K.\n");
580 function for the trading post
585 lprcat("Welcome to the Larn Trading Post. We buy items that explorers no longer find\n");
586 lprcat("useful. Since the condition of the items you bring in is not certain,\n");
587 lprcat("and we incur great expense in reconditioning the items, we usually pay\n");
588 lprcat("only 20% of their value were they to be new. If the items are badly\n");
589 lprcat("damaged, we will pay only 10% of their new value.\n\n");
594 int i,j,value,isub,izarg;
595 dnditm = dndcount = 0;
596 nosignal = 1; /* disable signals */
597 resetscroll(); otradhead();
600 lprcat("\nWhat item do you want to sell to us ["); standout("*");
601 lprcat(" for list, or "); standout("escape"); lprcat("] ? ");
602 i=0; while (i>'z' || (i<'a' && i!='*' && i!='\33' && i!='.')) i=getchar();
604 { setscroll(); recalc(); drawscreen(); nosignal=0; /* enable signals */ return; }
606 if (iven[isub]==OSCROLL) if (scrollname[ivenarg[isub]][0]==0)
607 { j=1; cnsitm(); } /* can't sell unidentified item */
608 if (iven[isub]==OPOTION) if (potionname[ivenarg[isub]][0]==0)
609 { j=1; cnsitm(); } /* can't sell unidentified item */
611 if (i=='*') { clear(); qshowstr(); otradhead(); }
612 else if (iven[isub]==0) lprintf("\nYou don't have item %c!",isub+'a');
615 for (j=0; j<maxitm; j++)
616 if ((itm[j].obj == iven[isub]) || (iven[isub] == ODIAMOND) || (iven[isub] == ORUBY) || (iven[isub] == OEMERALD) || (iven[isub] == OSAPPHIRE))
618 srcount=0; show3(isub); /* show what the item was */
619 if ((iven[isub] == ODIAMOND) || (iven[isub] == ORUBY)
620 || (iven[isub] == OEMERALD) || (iven[isub] == OSAPPHIRE))
621 value = 20*ivenarg[isub];
623 if ((itm[j].obj == OSCROLL) || (itm[j].obj == OPOTION)) value = 2*itm[j+ivenarg[isub]].price;
626 izarg=ivenarg[isub]; value = itm[j].price; /* appreciate if a +n object */
627 if (izarg >= 0) value *= 2;
628 while ((izarg-- > 0) && ((value=14*(67+value)/10) < 500000));
630 lprintf("\nItem (%c) is worth %d gold pieces to us. Do you want to sell it? ",i,(long)value);
634 lprcat("yes\n"); c[GOLD]+=value;
635 if (c[WEAR] == isub) c[WEAR] = -1;
636 if (c[WIELD] == isub) c[WIELD] = -1;
637 if (c[SHIELD] == isub) c[SHIELD] = -1;
638 adjustcvalues(iven[isub],ivenarg[isub]);
641 else lprcat("no thanks.\n");
642 j = maxitm+100; /* get out of the inner loop */
644 if (j <= maxitm+2) lprcat("\nSo sorry, but we are not authorized to accept that item.");
650 { lprcat("\nSorry, we can't accept unidentified objects."); }
653 * for the Larn Revenue Service
659 first = nosignal = 1; /* disable signals */
660 clear(); resetscroll(); cursor(1,4);
661 lprcat("Welcome to the Larn Revenue Service district office. How can we help you?");
664 if (first) { first=0; goto nxt; }
666 lprcat("\n\nYour wish? [(");
668 lprcat(") pay taxes, or ");
670 lprcat("] "); yrepcount=0;
671 i=0; while (i!='p' && i!='\33') i=getchar();
674 case 'p': lprcat("pay taxes\nHow much? "); amt = readnum((long)c[GOLD]);
675 if (amt<0) { lprcat("\nSorry, but we can't take negative gold\n"); amt=0; } else
676 if (amt>c[GOLD]) lprcat(" You don't have that much.\n");
677 else c[GOLD] -= paytaxes((long)amt);
680 case '\33': nosignal = 0; /* enable signals */
681 setscroll(); drawscreen(); return;
685 if (outstanding_taxes>0)
686 lprintf("You presently owe %d gp in taxes. ",(long)outstanding_taxes);
688 lprcat("You do not owe us any taxes. ");
691 lprintf("You have %6d gp. ",(long)c[GOLD]);
693 lprcat("You have no gold pieces. ");