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
33 * @(#)store.c 5.4 (Berkeley) 5/13/91
34 * $FreeBSD: src/games/larn/store.c,v 1.5 1999/11/30 03:49:00 billf Exp $
35 * $DragonFly: src/games/larn/store.c,v 1.2 2003/06/17 04:25:24 dillon Exp $
38 /* store.c Larn is copyrighted 1986 by Noah Morgan. */
40 static int dndcount=0,dnditm=0;
42 /* this is the data for the stuff in the dnd store */
43 int maxitm=83; /* number of items in the dnd inventory table */
44 struct _itm itm[90] = {
45 /*cost memory iven name iven arg how
46 gp pointer iven[] ivenarg[] many */
48 { 2, 0, OLEATHER, 0, 3 },
49 { 10, 0, OSTUDLEATHER, 0, 2 },
50 { 40, 0, ORING, 0, 2 },
51 { 85, 0, OCHAIN, 0, 2 },
52 { 220, 0, OSPLINT, 0, 1 },
53 { 400, 0, OPLATE, 0, 1 },
54 { 900, 0, OPLATEARMOR, 0, 1 },
55 { 2600, 0, OSSPLATE, 0, 1 },
56 { 150, 0, OSHIELD, 0, 1 },
58 /*cost memory iven name iven arg how
59 gp pointer iven[] ivenarg[] many */
61 { 2, 0, ODAGGER, 0, 3 },
62 { 20, 0, OSPEAR, 0, 3 },
63 { 80, 0, OFLAIL, 0, 2 },
64 { 150, 0, OBATTLEAXE, 0, 2 },
65 { 450, 0, OLONGSWORD, 0, 2 },
66 { 1000, 0, O2SWORD, 0, 2 },
67 { 5000, 0, OSWORD, 0, 1 },
68 { 16500, 0, OLANCE, 0, 1 },
69 { 6000, 0, OSWORDofSLASHING, 0, 0 },
70 { 10000, 0, OHAMMER, 0, 0 },
72 /*cost memory iven name iven arg how
73 gp pointer iven[] ivenarg[] many */
75 { 150, 0, OPROTRING, 1, 1 },
76 { 85, 0, OSTRRING, 1, 1 },
77 { 120, 0, ODEXRING, 1, 1 },
78 { 120, 0, OCLEVERRING, 1, 1 },
79 { 180, 0, OENERGYRING, 0, 1 },
80 { 125, 0, ODAMRING, 0, 1 },
81 { 220, 0, OREGENRING, 0, 1 },
82 { 1000, 0, ORINGOFEXTRA, 0, 1 },
84 { 280, 0, OBELT, 0, 1 },
86 { 400, 0, OAMULET, 0, 1 },
88 { 6500, 0, OORBOFDRAGON, 0, 0 },
89 { 5500, 0, OSPIRITSCARAB, 0, 0 },
90 { 5000, 0, OCUBEofUNDEAD, 0, 0 },
91 { 6000, 0, ONOTHEFT, 0, 0 },
93 { 590, 0, OCHEST, 6, 1 },
94 { 200, 0, OBOOK, 8, 1 },
95 { 10, 0, OCOOKIE, 0, 3 },
97 /*cost memory iven name iven arg how
98 gp pointer iven[] ivenarg[] many */
100 { 20, potionname, OPOTION, 0, 6 },
101 { 90, potionname, OPOTION, 1, 5 },
102 { 520, potionname, OPOTION, 2, 1 },
103 { 100, potionname, OPOTION, 3, 2 },
104 { 50, potionname, OPOTION, 4, 2 },
105 { 150, potionname, OPOTION, 5, 2 },
106 { 70, potionname, OPOTION, 6, 1 },
107 { 30, potionname, OPOTION, 7, 7 },
108 { 200, potionname, OPOTION, 8, 1 },
109 { 50, potionname, OPOTION, 9, 1 },
110 { 80, potionname, OPOTION, 10, 1 },
112 /*cost memory iven name iven arg how
113 gp pointer iven[] ivenarg[] many */
115 { 30, potionname, OPOTION, 11, 3 },
116 { 20, potionname, OPOTION, 12, 5 },
117 { 40, potionname, OPOTION, 13, 3 },
118 { 35, potionname, OPOTION, 14, 2 },
119 { 520, potionname, OPOTION, 15, 1 },
120 { 90, potionname, OPOTION, 16, 2 },
121 { 200, potionname, OPOTION, 17, 2 },
122 { 220, potionname, OPOTION, 18, 4 },
123 { 80, potionname, OPOTION, 19, 6 },
124 { 370, potionname, OPOTION, 20, 3 },
125 { 50, potionname, OPOTION, 22, 1 },
126 { 150, potionname, OPOTION, 23, 3 },
128 /*cost memory iven name iven arg how
129 gp pointer iven[] ivenarg[] many */
131 { 100, scrollname, OSCROLL, 0, 2 },
132 { 125, scrollname, OSCROLL, 1, 2 },
133 { 60, scrollname, OSCROLL, 2, 4 },
134 { 10, scrollname, OSCROLL, 3, 4 },
135 { 100, scrollname, OSCROLL, 4, 3 },
136 { 200, scrollname, OSCROLL, 5, 2 },
137 { 110, scrollname, OSCROLL, 6, 1 },
138 { 500, scrollname, OSCROLL, 7, 2 },
139 { 200, scrollname, OSCROLL, 8, 2 },
140 { 250, scrollname, OSCROLL, 9, 4 },
141 { 20, scrollname, OSCROLL, 10, 5 },
142 { 30, scrollname, OSCROLL, 11, 3 },
144 /*cost memory iven name iven arg how
145 gp pointer iven[] ivenarg[] many */
147 { 340, scrollname, OSCROLL, 12, 1 },
148 { 340, scrollname, OSCROLL, 13, 1 },
149 { 300, scrollname, OSCROLL, 14, 2 },
150 { 400, scrollname, OSCROLL, 15, 2 },
151 { 500, scrollname, OSCROLL, 16, 2 },
152 { 1000, scrollname, OSCROLL, 17, 1 },
153 { 500, scrollname, OSCROLL, 18, 1 },
154 { 340, scrollname, OSCROLL, 19, 2 },
155 { 220, scrollname, OSCROLL, 20, 3 },
156 { 3900, scrollname, OSCROLL, 21, 0 },
157 { 610, scrollname, OSCROLL, 22, 1 },
158 { 3000, scrollname, OSCROLL, 23, 0 }
162 function for the dnd store
166 lprcat("Welcome to the Larn Thrift Shoppe. We stock many items explorers find useful\n");
167 lprcat(" in their adventures. Feel free to browse to your hearts content.\n");
168 lprcat("Also be advised, if you break 'em, you pay for 'em.");
171 static void dnditem();
176 for (i=dnditm; i<26+dnditm; i++) dnditem(i);
177 cursor(50,18); lprcat("You have ");
183 lprcat("\nYou can't carry anything more!");
191 lprcat("\nSorry, but we are out of that item.");
198 lprcat("\nYou don't have enough gold to pay for that!");
207 nosignal = 1; /* disable signals */
209 if (outstanding_taxes>0)
211 lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep();
212 lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes);
213 lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n");
215 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
217 while (i!='\33') i=getchar();
218 drawscreen(); nosignal = 0; /* enable signals */ return;
224 cursor(59,18); lprintf("%d gold pieces",(long)c[GOLD]);
225 cltoeoln(); cl_dn(1,20); /* erase to eod */
226 lprcat("\nEnter your transaction ["); standout("space");
227 lprcat(" for more, "); standout("escape");
228 lprcat(" to leave]? ");
230 while ((i<'a' || i>'z') && (i!=' ') && (i!='\33') && (i!=12)) i=getchar();
231 if (i==12) { clear(); dnd_2hed(); dnd_hed(); }
233 { drawscreen(); nosignal = 0; /* enable signals */ return; }
237 if ((dnditm += 26) >= maxitm) dnditm=0; dnd_hed();
240 { /* buy something */
241 lprc(i); /* echo the byte */
243 if (i>=maxitm) outofstock(); else
244 if (itm[i].qty <= 0) outofstock(); else
245 if (pocketfull()) handsfull(); else
246 if (c[GOLD] < itm[i].price*10) nogold(); else
248 if (itm[i].mem != 0) *itm[i].mem[itm[i].arg] = ' ';
249 c[GOLD] -= itm[i].price*10;
250 itm[i].qty--; take(itm[i].obj,itm[i].arg);
251 if (itm[i].qty==0) dnditem(i); nap(1001);
261 to print the item list; used in dndstore() enter with the index into itm
268 if (i >= maxitm) return;
269 cursor( (j=(i&1)*40+1) , (k=((i%26)>>1)+5) );
270 if (itm[i].qty == 0) { lprintf("%39s",""); return; }
271 lprintf("%c) ",(i%26)+'a');
272 if (itm[i].obj == OPOTION)
273 { lprcat("potion of "); lprintf("%s",&potionname[itm[i].arg][1]); }
274 else if (itm[i].obj == OSCROLL)
275 { lprcat("scroll of "); lprintf("%s",&scrollname[itm[i].arg][1]); }
276 else lprintf("%s",objectname[itm[i].obj]);
277 cursor( j+31,k ); lprintf("%6d",(long)(itm[i].price*10));
282 for the college of larn
284 char course[26]={0}; /* the list of courses taken */
285 char coursetime[] = { 10, 15, 10, 20, 10, 10, 10, 5 };
287 function to display the header info for the school
292 lprcat("The College of Larn offers the exciting opportunity of higher education to\n");
293 lprcat("all inhabitants of the caves. Here is a list of the class schedule:\n\n\n");
294 lprcat("\t\t Course Name \t Time Needed\n\n");
296 if (course[0]==0) lprcat("\t\ta) Fighters Training I 10 mobuls"); /*line 7 of crt*/
298 if (course[1]==0) lprcat("\t\tb) Fighters Training II 15 mobuls");
300 if (course[2]==0) lprcat("\t\tc) Introduction to Wizardry 10 mobuls");
302 if (course[3]==0) lprcat("\t\td) Applied Wizardry 20 mobuls");
304 if (course[4]==0) lprcat("\t\te) Behavioral Psychology 10 mobuls");
306 if (course[5]==0) lprcat("\t\tf) Faith for Today 10 mobuls");
308 if (course[6]==0) lprcat("\t\tg) Contemporary Dance 10 mobuls");
310 if (course[7]==0) lprcat("\t\th) History of Larn 5 mobuls");
312 lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
314 lprcat("You are presently carrying ");
321 nosignal = 1; /* disable signals */
325 cursor(57,18); lprintf("%d gold pieces. ",(long)c[GOLD]); cursors();
326 lprcat("\nWhat is your choice ["); standout("escape");
327 lprcat(" to leave] ? "); yrepcount=0;
328 i=0; while ((i<'a' || i>'h') && (i!='\33') && (i!=12)) i=getchar();
329 if (i==12) { sch_hed(); continue; }
331 { nosignal = 0; drawscreen(); /* enable signals */ return; }
333 if (c[GOLD] < 250) nogold(); else
335 { lprcat("\nSorry, but that class is filled."); nap(1000); }
339 c[GOLD] -= 250; time_used=0;
342 case 'a': c[STRENGTH] += 2; c[CONSTITUTION]++;
343 lprcat("\nYou feel stronger!");
347 case 'b': if (course[0]==0)
349 lprcat("\nSorry, but this class has a prerequisite of Fighters Training I");
350 c[GOLD]+=250; time_used= -10000; break;
352 lprcat("\nYou feel much stronger!");
354 c[STRENGTH] += 2; c[CONSTITUTION] += 2; break;
356 case 'c': c[INTELLIGENCE] += 2;
357 lprcat("\nThe task before you now seems more attainable!");
358 cl_line(16,9); break;
360 case 'd': if (course[2]==0)
362 lprcat("\nSorry, but this class has a prerequisite of Introduction to Wizardry");
363 c[GOLD]+=250; time_used= -10000; break;
365 lprcat("\nThe task before you now seems very attainable!");
367 c[INTELLIGENCE] += 2; break;
369 case 'e': c[CHARISMA] += 3;
370 lprcat("\nYou now feel like a born leader!");
371 cl_line(16,11); break;
373 case 'f': c[WISDOM] += 2;
374 lprcat("\nYou now feel more confident that you can find the potion in time!");
375 cl_line(16,12); break;
377 case 'g': c[DEXTERITY] += 3;
378 lprcat("\nYou feel like dancing!");
379 cl_line(16,13); break;
381 case 'h': c[INTELLIGENCE]++;
382 lprcat("\nYour instructor told you that the Eye of Larn is rumored to be guarded\n");
383 lprcat("by a platinum dragon who possesses psionic abilities. ");
384 cl_line(16,14); break;
386 time_used += coursetime[i-'a']*100;
390 course[i-'a']++; /* remember that he has taken that course */
391 c[HP] = c[HPMAX]; c[SPELLS] = c[SPELLMAX]; /* he regenerated */
393 if (c[BLINDCOUNT]) c[BLINDCOUNT]=1; /* cure blindness too! */
394 if (c[CONFUSE]) c[CONFUSE]=1; /* end confusion */
395 adjtime((long)time_used); /* adjust parameters for time change */
403 * for the first national bank of Larn
405 int lasttime=0; /* last time he was in bank */
406 static void banktitle();
410 banktitle(" Welcome to the First National Bank of Larn.");
414 banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
420 nosignal = 1; /* disable signals */
421 clear(); lprcat(str);
422 if (outstanding_taxes>0)
425 lprcat("\n\nThe Larn Revenue Service has ordered that your account be frozen until all\n"); beep();
426 lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes);
427 lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n");
428 lprcat("We suggest you go to the LRS office and pay your taxes.\n");
430 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
432 while (i!='\33') i=getchar();
433 drawscreen(); nosignal = 0; /* enable signals */ return;
435 lprcat("\n\n\tGemstone\t Appraisal\t\tGemstone\t Appraisal");
436 obanksub(); nosignal = 0; /* enable signals */
441 * function to put interest on your bank account
446 if (c[BANKACCOUNT]<0) c[BANKACCOUNT] = 0;
447 else if ((c[BANKACCOUNT]>0) && (c[BANKACCOUNT]<500000))
449 i = (gtime-lasttime)/100; /* # mobuls elapsed */
450 while ((i-- > 0) && (c[BANKACCOUNT]<500000))
451 c[BANKACCOUNT] += c[BANKACCOUNT]/250;
452 if (c[BANKACCOUNT]>500000) c[BANKACCOUNT]=500000; /* interest limit */
454 lasttime = (gtime/100)*100;
457 static short gemorder[26]={0}; /* the reference to screen location for each */
458 static long gemvalue[26]={0}; /* the appraisal of the gems */
463 ointerest(); /* credit any needed interest */
465 for (k=i=0; i<26; i++)
468 case OLARNEYE: case ODIAMOND: case OEMERALD:
469 case ORUBY: case OSAPPHIRE:
471 if (iven[i]==OLARNEYE)
473 gemvalue[i]=250000-((gtime*7)/100)*100;
474 if (gemvalue[i]<50000) gemvalue[i]=50000;
476 else gemvalue[i] = (255&ivenarg[i])*100;
478 cursor( (k%2)*40+1 , (k>>1)+4 );
479 lprintf("%c) %s",i+'a',objectname[iven[i]]);
480 cursor( (k%2)*40+33 , (k>>1)+4 );
481 lprintf("%5d",(long)gemvalue[i]); k++;
483 cursor(31,17); lprintf("You have %8d gold pieces in the bank.",(long)c[BANKACCOUNT]);
484 cursor(40,18); lprintf("You have %8d gold pieces",(long)c[GOLD]);
485 if (c[BANKACCOUNT]+c[GOLD] >= 500000)
486 lprcat("\nNote: Larndom law states that only deposits under 500,000gp can earn interest.");
490 lprcat("\nYour wish? [("); standout("d"); lprcat(") deposit, (");
491 standout("w"); lprcat(") withdraw, ("); standout("s");
492 lprcat(") sell a stone, or "); standout("escape"); lprcat("] ");
494 i=0; while (i!='d' && i!='w' && i!='s' && i!='\33') i=getchar();
497 case 'd': lprcat("deposit\nHow much? "); amt = readnum((long)c[GOLD]);
498 if (amt<0) { lprcat("\nSorry, but we can't take negative gold!"); nap(2000); amt=0; } else
500 { lprcat(" You don't have that much."); nap(2000); }
501 else { c[GOLD] -= amt; c[BANKACCOUNT] += amt; }
504 case 'w': lprcat("withdraw\nHow much? "); amt = readnum((long)c[BANKACCOUNT]);
505 if (amt<0) { lprcat("\nSorry, but we don't have any negative gold!"); nap(2000); amt=0; }
506 else if (amt > c[BANKACCOUNT])
507 { lprcat("\nYou don't have that much in the bank!"); nap(2000); }
508 else { c[GOLD] += amt; c[BANKACCOUNT] -= amt; }
511 case 's': lprcat("\nWhich stone would you like to sell? ");
512 i=0; while ((i<'a' || i>'z') && i!='*') i=getchar();
518 c[GOLD]+=gemvalue[i]; iven[i]=0;
519 gemvalue[i]=0; k = gemorder[i];
520 cursor( (k%2)*40+1 , (k>>1)+4 );
526 if (gemvalue[i=i-'a']==0)
528 lprintf("\nItem %c is not a gemstone!",i+'a');
531 c[GOLD]+=gemvalue[i]; iven[i]=0;
532 gemvalue[i]=0; k = gemorder[i];
533 cursor( (k%2)*40+1 , (k>>1)+4 ); lprintf("%39s","");
539 cursor(40,17); lprintf("%8d",(long)c[BANKACCOUNT]);
540 cursor(49,18); lprintf("%8d",(long)c[GOLD]);
545 subroutine to appraise any stone for the bank
552 if (iven[j]==gemstone)
554 lprintf("\nI see you have %s",objectname[gemstone]);
555 if (gemstone==OLARNEYE) lprcat(" I must commend you. I didn't think\nyou could get it.");
556 lprcat(" Shall I appraise it for you? "); yrepcount=0;
559 lprcat("yes.\n Just one moment please \n"); nap(1000);
560 if (gemstone==OLARNEYE)
562 amt = 250000-((gtime*7)/100)*100;
563 if (amt<50000) amt=50000;
565 else amt = (255 & ivenarg[j]) * 100;
566 lprintf("\nI can see this is an excellent stone, It is worth %d",(long)amt);
567 lprcat("\nWould you like to sell it to us? "); yrepcount=0;
568 if (getyn()=='y') { lprcat("yes\n"); c[GOLD]+=amt; iven[j]=0; }
569 else lprcat("no thank you.\n");
570 if (gemstone==OLARNEYE) lprcat("It is, of course, your privilege to keep the stone\n");
572 else lprcat("no\nO. K.\n");
576 function for the trading post
581 lprcat("Welcome to the Larn Trading Post. We buy items that explorers no longer find\n");
582 lprcat("useful. Since the condition of the items you bring in is not certain,\n");
583 lprcat("and we incur great expense in reconditioning the items, we usually pay\n");
584 lprcat("only 20% of their value were they to be new. If the items are badly\n");
585 lprcat("damaged, we will pay only 10% of their new value.\n\n");
590 int i,j,value,isub,izarg;
591 dnditm = dndcount = 0;
592 nosignal = 1; /* disable signals */
593 resetscroll(); otradhead();
596 lprcat("\nWhat item do you want to sell to us ["); standout("*");
597 lprcat(" for list, or "); standout("escape"); lprcat("] ? ");
598 i=0; while (i>'z' || (i<'a' && i!='*' && i!='\33' && i!='.')) i=getchar();
600 { setscroll(); recalc(); drawscreen(); nosignal=0; /* enable signals */ return; }
602 if (iven[isub]==OSCROLL) if (scrollname[ivenarg[isub]][0]==0)
603 { j=1; cnsitm(); } /* can't sell unidentified item */
604 if (iven[isub]==OPOTION) if (potionname[ivenarg[isub]][0]==0)
605 { j=1; cnsitm(); } /* can't sell unidentified item */
607 if (i=='*') { clear(); qshowstr(); otradhead(); }
608 else if (iven[isub]==0) lprintf("\nYou don't have item %c!",isub+'a');
611 for (j=0; j<maxitm; j++)
612 if ((itm[j].obj == iven[isub]) || (iven[isub] == ODIAMOND) || (iven[isub] == ORUBY) || (iven[isub] == OEMERALD) || (iven[isub] == OSAPPHIRE))
614 srcount=0; show3(isub); /* show what the item was */
615 if ((iven[isub] == ODIAMOND) || (iven[isub] == ORUBY)
616 || (iven[isub] == OEMERALD) || (iven[isub] == OSAPPHIRE))
617 value = 20*ivenarg[isub];
619 if ((itm[j].obj == OSCROLL) || (itm[j].obj == OPOTION)) value = 2*itm[j+ivenarg[isub]].price;
622 izarg=ivenarg[isub]; value = itm[j].price; /* appreciate if a +n object */
623 if (izarg >= 0) value *= 2;
624 while ((izarg-- > 0) && ((value=14*(67+value)/10) < 500000));
626 lprintf("\nItem (%c) is worth %d gold pieces to us. Do you want to sell it? ",i,(long)value);
630 lprcat("yes\n"); c[GOLD]+=value;
631 if (c[WEAR] == isub) c[WEAR] = -1;
632 if (c[WIELD] == isub) c[WIELD] = -1;
633 if (c[SHIELD] == isub) c[SHIELD] = -1;
634 adjustcvalues(iven[isub],ivenarg[isub]);
637 else lprcat("no thanks.\n");
638 j = maxitm+100; /* get out of the inner loop */
640 if (j <= maxitm+2) lprcat("\nSo sorry, but we are not authorized to accept that item.");
646 { lprcat("\nSorry, we can't accept unidentified objects."); }
649 * for the Larn Revenue Service
655 first = nosignal = 1; /* disable signals */
656 clear(); resetscroll(); cursor(1,4);
657 lprcat("Welcome to the Larn Revenue Service district office. How can we help you?");
660 if (first) { first=0; goto nxt; }
662 lprcat("\n\nYour wish? [(");
664 lprcat(") pay taxes, or ");
666 lprcat("] "); yrepcount=0;
667 i=0; while (i!='p' && i!='\33') i=getchar();
670 case 'p': lprcat("pay taxes\nHow much? "); amt = readnum((long)c[GOLD]);
671 if (amt<0) { lprcat("\nSorry, but we can't take negative gold\n"); amt=0; } else
672 if (amt>c[GOLD]) lprcat(" You don't have that much.\n");
673 else c[GOLD] -= paytaxes((long)amt);
676 case '\33': nosignal = 0; /* enable signals */
677 setscroll(); drawscreen(); return;
681 if (outstanding_taxes>0)
682 lprintf("You presently owe %d gp in taxes. ",(long)outstanding_taxes);
684 lprcat("You do not owe us any taxes. ");
687 lprintf("You have %6d gp. ",(long)c[GOLD]);
689 lprcat("You have no gold pieces. ");