]>
git.cameronkatri.com Git - bsdgames-darwin.git/blob - larn/store.c
1 /* $NetBSD: store.c,v 1.5 1997/07/13 20:21:41 christos Exp $ */
4 * Copyright (c) 1988 The Regents of the University of California.
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement:
17 * This product includes software developed by the University of
18 * California, Berkeley and its contributors.
19 * 4. Neither the name of the University nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
23 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
38 static char sccsid
[] = "@(#)store.c 5.4 (Berkeley) 5/13/91";
40 static char rcsid
[] = "$NetBSD: store.c,v 1.5 1997/07/13 20:21:41 christos Exp $";
44 /* store.c Larn is copyrighted 1986 by Noah Morgan. */
46 static int dndcount
=0,dnditm
=0;
48 /* this is the data for the stuff in the dnd store */
49 int maxitm
=83; /* number of items in the dnd inventory table */
50 struct _itm itm
[90] = {
51 /*cost iven name iven arg how
52 gp iven[] ivenarg[] many */
54 { 2, OLEATHER
, 0, 3 },
55 { 10, OSTUDLEATHER
, 0, 2 },
58 { 220, OSPLINT
, 0, 1 },
59 { 400, OPLATE
, 0, 1 },
60 { 900, OPLATEARMOR
, 0, 1 },
61 { 2600, OSSPLATE
, 0, 1 },
62 { 150, OSHIELD
, 0, 1 },
64 /*cost iven name iven arg how
65 gp iven[] ivenarg[] many */
70 { 150, OBATTLEAXE
, 0, 2 },
71 { 450, OLONGSWORD
, 0, 2 },
72 { 1000, O2SWORD
, 0, 2 },
73 { 5000, OSWORD
, 0, 1 },
74 { 16500, OLANCE
, 0, 1 },
75 { 6000, OSWORDofSLASHING
, 0, 0 },
76 { 10000, OHAMMER
, 0, 0 },
78 /*cost iven name iven arg how
79 gp iven[] ivenarg[] many */
81 { 150, OPROTRING
, 1, 1 },
82 { 85, OSTRRING
, 1, 1 },
83 { 120, ODEXRING
, 1, 1 },
84 { 120, OCLEVERRING
, 1, 1 },
85 { 180, OENERGYRING
, 0, 1 },
86 { 125, ODAMRING
, 0, 1 },
87 { 220, OREGENRING
, 0, 1 },
88 { 1000, ORINGOFEXTRA
, 0, 1 },
92 { 400, OAMULET
, 0, 1 },
94 { 6500, OORBOFDRAGON
, 0, 0 },
95 { 5500, OSPIRITSCARAB
, 0, 0 },
96 { 5000, OCUBEofUNDEAD
, 0, 0 },
97 { 6000, ONOTHEFT
, 0, 0 },
99 { 590, OCHEST
, 6, 1 },
100 { 200, OBOOK
, 8, 1 },
101 { 10, OCOOKIE
, 0, 3 },
103 /*cost iven name iven arg how
104 gp iven[] ivenarg[] many */
106 { 20, OPOTION
, 0, 6 },
107 { 90, OPOTION
, 1, 5 },
108 { 520, OPOTION
, 2, 1 },
109 { 100, OPOTION
, 3, 2 },
110 { 50, OPOTION
, 4, 2 },
111 { 150, OPOTION
, 5, 2 },
112 { 70, OPOTION
, 6, 1 },
113 { 30, OPOTION
, 7, 7 },
114 { 200, OPOTION
, 8, 1 },
115 { 50, OPOTION
, 9, 1 },
116 { 80, OPOTION
, 10, 1 },
118 /*cost iven name iven arg how
119 gp iven[] ivenarg[] many */
121 { 30, OPOTION
, 11, 3 },
122 { 20, OPOTION
, 12, 5 },
123 { 40, OPOTION
, 13, 3 },
124 { 35, OPOTION
, 14, 2 },
125 { 520, OPOTION
, 15, 1 },
126 { 90, OPOTION
, 16, 2 },
127 { 200, OPOTION
, 17, 2 },
128 { 220, OPOTION
, 18, 4 },
129 { 80, OPOTION
, 19, 6 },
130 { 370, OPOTION
, 20, 3 },
131 { 50, OPOTION
, 22, 1 },
132 { 150, OPOTION
, 23, 3 },
134 /*cost iven name iven arg how
135 gp iven[] ivenarg[] many */
137 { 100, OSCROLL
, 0, 2 },
138 { 125, OSCROLL
, 1, 2 },
139 { 60, OSCROLL
, 2, 4 },
140 { 10, OSCROLL
, 3, 4 },
141 { 100, OSCROLL
, 4, 3 },
142 { 200, OSCROLL
, 5, 2 },
143 { 110, OSCROLL
, 6, 1 },
144 { 500, OSCROLL
, 7, 2 },
145 { 200, OSCROLL
, 8, 2 },
146 { 250, OSCROLL
, 9, 4 },
147 { 20, OSCROLL
, 10, 5 },
148 { 30, OSCROLL
, 11, 3 },
150 /*cost iven name iven arg how
151 gp iven[] ivenarg[] many */
153 { 340, OSCROLL
, 12, 1 },
154 { 340, OSCROLL
, 13, 1 },
155 { 300, OSCROLL
, 14, 2 },
156 { 400, OSCROLL
, 15, 2 },
157 { 500, OSCROLL
, 16, 2 },
158 { 1000, OSCROLL
, 17, 1 },
159 { 500, OSCROLL
, 18, 1 },
160 { 340, OSCROLL
, 19, 2 },
161 { 220, OSCROLL
, 20, 3 },
162 { 3900, OSCROLL
, 21, 0 },
163 { 610, OSCROLL
, 22, 1 },
164 { 3000, OSCROLL
, 23, 0 }
168 function for the dnd store
172 lprcat("Welcome to the Larn Thrift Shoppe. We stock many items explorers find useful\n");
173 lprcat(" in their adventures. Feel free to browse to your hearts content.\n");
174 lprcat("Also be advised, if you break 'em, you pay for 'em.");
177 static void dnditem();
182 for (i
=dnditm
; i
<26+dnditm
; i
++) dnditem(i
);
183 cursor(50,18); lprcat("You have ");
189 lprcat("\nYou can't carry anything more!");
197 lprcat("\nSorry, but we are out of that item.");
204 lprcat("\nYou don't have enough gold to pay for that!");
213 nosignal
= 1; /* disable signals */
215 if (outstanding_taxes
>0)
217 lprcat("\n\nThe Larn Revenue Service has ordered us to not do business with tax evaders.\n"); beep();
218 lprintf("They have also told us that you owe %d gp in back taxes, and as we must\n",(long)outstanding_taxes
);
219 lprcat("comply with the law, we cannot serve you at this time. Soo Sorry.\n");
221 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
223 while (i
!='\33') i
=getchar();
224 drawscreen(); nosignal
= 0; /* enable signals */ return;
230 cursor(59,18); lprintf("%d gold pieces",(long)c
[GOLD
]);
231 cltoeoln(); cl_dn(1,20); /* erase to eod */
232 lprcat("\nEnter your transaction ["); standout("space");
233 lprcat(" for more, "); standout("escape");
234 lprcat(" to leave]? ");
236 while ((i
<'a' || i
>'z') && (i
!=' ') && (i
!='\33') && (i
!=12)) i
=getchar();
237 if (i
==12) { clear(); dnd_2hed(); dnd_hed(); }
239 { drawscreen(); nosignal
= 0; /* enable signals */ return; }
243 if ((dnditm
+= 26) >= maxitm
) dnditm
=0; dnd_hed();
246 { /* buy something */
247 lprc(i
); /* echo the byte */
249 if (i
>=maxitm
) outofstock(); else
250 if (itm
[i
].qty
<= 0) outofstock(); else
251 if (pocketfull()) handsfull(); else
252 if (c
[GOLD
] < itm
[i
].price
*10) nogold(); else
254 if (itm
[i
].obj
== OPOTION
)
255 { potionname
[itm
[i
].arg
] = potionhide
[itm
[i
].arg
]; }
256 else if (itm
[i
].obj
== OSCROLL
)
257 { scrollname
[itm
[i
].arg
] = scrollhide
[itm
[i
].arg
]; }
258 c
[GOLD
] -= itm
[i
].price
*10;
259 itm
[i
].qty
--; take(itm
[i
].obj
,itm
[i
].arg
);
260 if (itm
[i
].qty
==0) dnditem(i
); nap(1001);
270 to print the item list; used in dndstore() enter with the index into itm
277 if (i
>= maxitm
) return;
278 cursor( (j
=(i
&1)*40+1) , (k
=((i%26
)>>1)+5) );
279 if (itm
[i
].qty
== 0) { lprintf("%39s",""); return; }
280 lprintf("%c) ",(i%26
)+'a');
281 if (itm
[i
].obj
== OPOTION
)
282 { lprintf("potion of%s", potionhide
[itm
[i
].arg
]); }
283 else if (itm
[i
].obj
== OSCROLL
)
284 { lprintf("scroll of%s", scrollhide
[itm
[i
].arg
]); }
285 else lprintf("%s",objectname
[itm
[i
].obj
]);
286 cursor( j
+31,k
); lprintf("%6d",(long)(itm
[i
].price
*10));
291 for the college of larn
293 char course
[26]={0}; /* the list of courses taken */
294 char coursetime
[] = { 10, 15, 10, 20, 10, 10, 10, 5 };
296 function to display the header info for the school
301 lprcat("The College of Larn offers the exciting opportunity of higher education to\n");
302 lprcat("all inhabitants of the caves. Here is a list of the class schedule:\n\n\n");
303 lprcat("\t\t Course Name \t Time Needed\n\n");
305 if (course
[0]==0) lprcat("\t\ta) Fighters Training I 10 mobuls"); /*line 7 of crt*/
307 if (course
[1]==0) lprcat("\t\tb) Fighters Training II 15 mobuls");
309 if (course
[2]==0) lprcat("\t\tc) Introduction to Wizardry 10 mobuls");
311 if (course
[3]==0) lprcat("\t\td) Applied Wizardry 20 mobuls");
313 if (course
[4]==0) lprcat("\t\te) Behavioral Psychology 10 mobuls");
315 if (course
[5]==0) lprcat("\t\tf) Faith for Today 10 mobuls");
317 if (course
[6]==0) lprcat("\t\tg) Contemporary Dance 10 mobuls");
319 if (course
[7]==0) lprcat("\t\th) History of Larn 5 mobuls");
321 lprcat("\n\n\t\tAll courses cost 250 gold pieces.");
323 lprcat("You are presently carrying ");
330 nosignal
= 1; /* disable signals */
334 cursor(57,18); lprintf("%d gold pieces. ",(long)c
[GOLD
]); cursors();
335 lprcat("\nWhat is your choice ["); standout("escape");
336 lprcat(" to leave] ? "); yrepcount
=0;
337 i
=0; while ((i
<'a' || i
>'h') && (i
!='\33') && (i
!=12)) i
=getchar();
338 if (i
==12) { sch_hed(); continue; }
340 { nosignal
= 0; drawscreen(); /* enable signals */ return; }
342 if (c
[GOLD
] < 250) nogold(); else
344 { lprcat("\nSorry, but that class is filled."); nap(1000); }
348 c
[GOLD
] -= 250; time_used
=0;
351 case 'a': c
[STRENGTH
] += 2; c
[CONSTITUTION
]++;
352 lprcat("\nYou feel stronger!");
356 case 'b': if (course
[0]==0)
358 lprcat("\nSorry, but this class has a prerequisite of Fighters Training I");
359 c
[GOLD
]+=250; time_used
= -10000; break;
361 lprcat("\nYou feel much stronger!");
363 c
[STRENGTH
] += 2; c
[CONSTITUTION
] += 2; break;
365 case 'c': c
[INTELLIGENCE
] += 2;
366 lprcat("\nThe task before you now seems more attainable!");
367 cl_line(16,9); break;
369 case 'd': if (course
[2]==0)
371 lprcat("\nSorry, but this class has a prerequisite of Introduction to Wizardry");
372 c
[GOLD
]+=250; time_used
= -10000; break;
374 lprcat("\nThe task before you now seems very attainable!");
376 c
[INTELLIGENCE
] += 2; break;
378 case 'e': c
[CHARISMA
] += 3;
379 lprcat("\nYou now feel like a born leader!");
380 cl_line(16,11); break;
382 case 'f': c
[WISDOM
] += 2;
383 lprcat("\nYou now feel more confident that you can find the potion in time!");
384 cl_line(16,12); break;
386 case 'g': c
[DEXTERITY
] += 3;
387 lprcat("\nYou feel like dancing!");
388 cl_line(16,13); break;
390 case 'h': c
[INTELLIGENCE
]++;
391 lprcat("\nYour instructor told you that the Eye of Larn is rumored to be guarded\n");
392 lprcat("by a platinum dragon who possesses psionic abilities. ");
393 cl_line(16,14); break;
395 time_used
+= coursetime
[i
-'a']*100;
399 course
[i
-'a']++; /* remember that he has taken that course */
400 c
[HP
] = c
[HPMAX
]; c
[SPELLS
] = c
[SPELLMAX
]; /* he regenerated */
402 if (c
[BLINDCOUNT
]) c
[BLINDCOUNT
]=1; /* cure blindness too! */
403 if (c
[CONFUSE
]) c
[CONFUSE
]=1; /* end confusion */
404 adjtime((long)time_used
); /* adjust parameters for time change */
412 * for the first national bank of Larn
414 int lasttime
=0; /* last time he was in bank */
415 static void banktitle();
419 banktitle(" Welcome to the First National Bank of Larn.");
423 banktitle("Welcome to the 5th level branch office of the First National Bank of Larn.");
429 nosignal
= 1; /* disable signals */
430 clear(); lprcat(str
);
431 if (outstanding_taxes
>0)
434 lprcat("\n\nThe Larn Revenue Service has ordered that your account be frozen until all\n"); beep();
435 lprintf("levied taxes have been paid. They have also told us that you owe %d gp in\n",(long)outstanding_taxes
);
436 lprcat("taxes, and we must comply with them. We cannot serve you at this time. Sorry.\n");
437 lprcat("We suggest you go to the LRS office and pay your taxes.\n");
439 lprcat("\nPress "); standout("escape"); lprcat(" to leave: "); lflush();
441 while (i
!='\33') i
=getchar();
442 drawscreen(); nosignal
= 0; /* enable signals */ return;
444 lprcat("\n\n\tGemstone\t Appraisal\t\tGemstone\t Appraisal");
445 obanksub(); nosignal
= 0; /* enable signals */
450 * function to put interest on your bank account
455 if (c
[BANKACCOUNT
]<0) c
[BANKACCOUNT
] = 0;
456 else if ((c
[BANKACCOUNT
]>0) && (c
[BANKACCOUNT
]<500000))
458 i
= (gltime
-lasttime
)/100; /* # mobuls elapsed */
459 while ((i
-- > 0) && (c
[BANKACCOUNT
]<500000))
460 c
[BANKACCOUNT
] += c
[BANKACCOUNT
]/250;
461 if (c
[BANKACCOUNT
]>500000) c
[BANKACCOUNT
]=500000; /* interest limit */
463 lasttime
= (gltime
/100)*100;
466 static short gemorder
[26]={0}; /* the reference to screen location for each */
467 static long gemvalue
[26]={0}; /* the appraisal of the gems */
472 ointerest(); /* credit any needed interest */
474 for (k
=i
=0; i
<26; i
++)
477 case OLARNEYE
: case ODIAMOND
: case OEMERALD
:
478 case ORUBY
: case OSAPPHIRE
:
480 if (iven
[i
]==OLARNEYE
)
482 gemvalue
[i
]=250000-((gltime
*7)/100)*100;
483 if (gemvalue
[i
]<50000) gemvalue
[i
]=50000;
485 else gemvalue
[i
] = (255&ivenarg
[i
])*100;
487 cursor( (k%2
)*40+1 , (k
>>1)+4 );
488 lprintf("%c) %s",i
+'a',objectname
[iven
[i
]]);
489 cursor( (k%2
)*40+33 , (k
>>1)+4 );
490 lprintf("%5d",(long)gemvalue
[i
]); k
++;
492 cursor(31,17); lprintf("You have %8d gold pieces in the bank.",(long)c
[BANKACCOUNT
]);
493 cursor(40,18); lprintf("You have %8d gold pieces",(long)c
[GOLD
]);
494 if (c
[BANKACCOUNT
]+c
[GOLD
] >= 500000)
495 lprcat("\nNote: Larndom law states that only deposits under 500,000gp can earn interest.");
499 lprcat("\nYour wish? [("); standout("d"); lprcat(") deposit, (");
500 standout("w"); lprcat(") withdraw, ("); standout("s");
501 lprcat(") sell a stone, or "); standout("escape"); lprcat("] ");
503 i
=0; while (i
!='d' && i
!='w' && i
!='s' && i
!='\33') i
=getchar();
506 case 'd': lprcat("deposit\nHow much? "); amt
= readnum((long)c
[GOLD
]);
507 if (amt
<0) { lprcat("\nSorry, but we can't take negative gold!"); nap(2000); amt
=0; } else
509 { lprcat(" You don't have that much."); nap(2000); }
510 else { c
[GOLD
] -= amt
; c
[BANKACCOUNT
] += amt
; }
513 case 'w': lprcat("withdraw\nHow much? "); amt
= readnum((long)c
[BANKACCOUNT
]);
514 if (amt
<0) { lprcat("\nSorry, but we don't have any negative gold!"); nap(2000); amt
=0; }
515 else if (amt
> c
[BANKACCOUNT
])
516 { lprcat("\nYou don't have that much in the bank!"); nap(2000); }
517 else { c
[GOLD
] += amt
; c
[BANKACCOUNT
] -= amt
; }
520 case 's': lprcat("\nWhich stone would you like to sell? ");
521 i
=0; while ((i
<'a' || i
>'z') && i
!='*') i
=getchar();
527 c
[GOLD
]+=gemvalue
[i
]; iven
[i
]=0;
528 gemvalue
[i
]=0; k
= gemorder
[i
];
529 cursor( (k%2
)*40+1 , (k
>>1)+4 );
535 if (gemvalue
[i
=i
-'a']==0)
537 lprintf("\nItem %c is not a gemstone!",i
+'a');
540 c
[GOLD
]+=gemvalue
[i
]; iven
[i
]=0;
541 gemvalue
[i
]=0; k
= gemorder
[i
];
542 cursor( (k%2
)*40+1 , (k
>>1)+4 ); lprintf("%39s","");
548 cursor(40,17); lprintf("%8d",(long)c
[BANKACCOUNT
]);
549 cursor(49,18); lprintf("%8d",(long)c
[GOLD
]);
554 subroutine to appraise any stone for the bank
557 register int gemstone
;
561 if (iven
[j
]==gemstone
)
563 lprintf("\nI see you have %s",objectname
[gemstone
]);
564 if (gemstone
==OLARNEYE
) lprcat(" I must commend you. I didn't think\nyou could get it.");
565 lprcat(" Shall I appraise it for you? "); yrepcount
=0;
568 lprcat("yes.\n Just one moment please \n"); nap(1000);
569 if (gemstone
==OLARNEYE
)
571 amt
= 250000-((gltime
*7)/100)*100;
572 if (amt
<50000) amt
=50000;
574 else amt
= (255 & ivenarg
[j
]) * 100;
575 lprintf("\nI can see this is an excellent stone, It is worth %d",(long)amt
);
576 lprcat("\nWould you like to sell it to us? "); yrepcount
=0;
577 if (getyn()=='y') { lprcat("yes\n"); c
[GOLD
]+=amt
; iven
[j
]=0; }
578 else lprcat("no thank you.\n");
579 if (gemstone
==OLARNEYE
) lprcat("It is, of course, your privilege to keep the stone\n");
581 else lprcat("no\nO. K.\n");
585 function for the trading post
590 lprcat("Welcome to the Larn Trading Post. We buy items that explorers no longer find\n");
591 lprcat("useful. Since the condition of the items you bring in is not certain,\n");
592 lprcat("and we incur great expense in reconditioning the items, we usually pay\n");
593 lprcat("only 20% of their value were they to be new. If the items are badly\n");
594 lprcat("damaged, we will pay only 10% of their new value.\n\n");
599 register int i
,j
,value
,isub
,izarg
;
600 dnditm
= dndcount
= 0;
601 nosignal
= 1; /* disable signals */
602 resetscroll(); otradhead();
605 lprcat("\nWhat item do you want to sell to us ["); standout("*");
606 lprcat(" for list, or "); standout("escape"); lprcat("] ? ");
607 i
=0; while (i
>'z' || (i
<'a' && i
!='*' && i
!='\33' && i
!='.')) i
=getchar();
609 { setscroll(); recalc(); drawscreen(); nosignal
=0; /* enable signals */ return; }
611 if (iven
[isub
]==OSCROLL
) if (scrollname
[ivenarg
[isub
]][0]==0)
612 { j
=1; cnsitm(); } /* can't sell unidentified item */
613 if (iven
[isub
]==OPOTION
) if (potionname
[ivenarg
[isub
]][0]==0)
614 { j
=1; cnsitm(); } /* can't sell unidentified item */
616 if (i
=='*') { clear(); qshowstr(); otradhead(); }
617 else if (iven
[isub
]==0) lprintf("\nYou don't have item %c!",isub
+'a');
620 for (j
=0; j
<maxitm
; j
++)
621 if ((itm
[j
].obj
== iven
[isub
]) || (iven
[isub
] == ODIAMOND
) || (iven
[isub
] == ORUBY
) || (iven
[isub
] == OEMERALD
) || (iven
[isub
] == OSAPPHIRE
))
623 srcount
=0; show3(isub
); /* show what the item was */
624 if ((iven
[isub
] == ODIAMOND
) || (iven
[isub
] == ORUBY
)
625 || (iven
[isub
] == OEMERALD
) || (iven
[isub
] == OSAPPHIRE
))
626 value
= 20*ivenarg
[isub
];
628 if ((itm
[j
].obj
== OSCROLL
) || (itm
[j
].obj
== OPOTION
)) value
= 2*itm
[j
+ivenarg
[isub
]].price
;
631 izarg
=ivenarg
[isub
]; value
= itm
[j
].price
; /* appreciate if a +n object */
632 if (izarg
>= 0) value
*= 2;
633 while ((izarg
-- > 0) && ((value
=14*(67+value
)/10) < 500000));
635 lprintf("\nItem (%c) is worth %d gold pieces to us. Do you want to sell it? ",i
,(long)value
);
639 lprcat("yes\n"); c
[GOLD
]+=value
;
640 if (c
[WEAR
] == isub
) c
[WEAR
] = -1;
641 if (c
[WIELD
] == isub
) c
[WIELD
] = -1;
642 if (c
[SHIELD
] == isub
) c
[SHIELD
] = -1;
643 adjustcvalues(iven
[isub
],ivenarg
[isub
]);
646 else lprcat("no thanks.\n");
647 j
= maxitm
+100; /* get out of the inner loop */
649 if (j
<= maxitm
+2) lprcat("\nSo sorry, but we are not authorized to accept that item.");
655 { lprcat("\nSorry, we can't accept unidentified objects."); }
658 * for the Larn Revenue Service
662 register int i
,first
;
664 first
= nosignal
= 1; /* disable signals */
665 clear(); resetscroll(); cursor(1,4);
666 lprcat("Welcome to the Larn Revenue Service district office. How can we help you?");
669 if (first
) { first
=0; goto nxt
; }
671 lprcat("\n\nYour wish? [(");
673 lprcat(") pay taxes, or ");
675 lprcat("] "); yrepcount
=0;
676 i
=0; while (i
!='p' && i
!='\33') i
=getchar();
679 case 'p': lprcat("pay taxes\nHow much? "); amt
= readnum((long)c
[GOLD
]);
680 if (amt
<0) { lprcat("\nSorry, but we can't take negative gold\n"); amt
=0; } else
681 if (amt
>c
[GOLD
]) lprcat(" You don't have that much.\n");
682 else c
[GOLD
] -= paytaxes((long)amt
);
685 case '\33': nosignal
= 0; /* enable signals */
686 setscroll(); drawscreen(); return;
690 if (outstanding_taxes
>0)
691 lprintf("You presently owe %d gp in taxes. ",(long)outstanding_taxes
);
693 lprcat("You do not owe us any taxes. ");
696 lprintf("You have %6d gp. ",(long)c
[GOLD
]);
698 lprcat("You have no gold pieces. ");