-+-+-+-+-+-+-+-+ START OF PART 72 -+-+-+-+-+-+-+-+ X 105 : begin `7B Inventory `7D X if (inven_command('i',0,0)) then X display_store(store_num,cur_top); X end; X 109 : begin `7B Make an item `7D X if (store_num = 7) then X prt('Command not implemented yet.',1,1) X else X prt('Invalid Command.',1,1); X end; X 116 : begin `7B Take off `7D X if (inven_command('t',0,0)) then X display_store(store_num,cur_top); X end; X 119 : begin `7B Wear `7D X if (inven_command('w',0,0)) then X display_store(store_num,cur_top); X end; X 120 : begin `7B Switch weapon `7D X if (inven_command('x',0,0)) then X display_store(store_num,cur_top); X end; X 112 : begin X`09`09`09 coupon := false; X `09 exit_flag := store_purchase(store_num,coupon,dummy,cur_top); X`09`09`09`09end; X 117 : Begin X`09`09`09`09if get_coupon(store_num,coup_val,cur_top) then X`09`09`09`09 begin X`09`09`09`09 coupon := true; X`09 exit_flag := store_purchase(store_num,coupon,coup_val,cur_top); X`09`09`09 end; X`09`09`09`09End; X 115 : exit_flag := store_sell(store_num,cur_top); X otherwise prt('Invalid Command.',1,1); X end; X end X else X exit_flag := true; X until(exit_flag); X draw_cave; X End X END; X X`7B Entering a hotel`7D X`5Bpsect(store$code)`5D procedure enter_inn; X X var`20 X i5,com_val,oa,ob,oc,od,oe`09: integer; X`09option,command`09`09`09: char; X exit_flag : boolean; X`09hungry`09`09`09`09: vtype; XBEGIN X exit_flag := false; X hungry := 'You are too hungry to sleep right now.'; X clear(1,1); X i5 := turn; X oa := trunc(5 + 5*chr_padj); ob := trunc(2 + 1*chr_padj); X oc := trunc(20 + 20*chr_padj); od := trunc(50 + 50*chr_padj); X oe := trunc(500 + 500*chr_padj); X`7BDisplay Hotel Options`7D X begin X prt('Max Footroom (Proprieter) Paradise Hotel',3,10); X prt(' Options:',5,1); prt(' Set Price:',5,61); X prt(' a) Light Meal',7,1); prt_num('',oa,7,66); X prt(' b) Short Nap',8,1); prt_num('',ob,8,66); X prt(' c) Overnight Stay',9,1); prt_num('',oc,9,66); X prt(' d) Executive Suite',10,1); prt_num('',od,10,66); X prt(' e) Mud Bath',11,1);`09 prt_num('',oe,11,66); X store_prt_gold; X prt('You may:',21,1); Xprt(' p) Pay for Option. c) Catch a bus.',22,1); Xprt(' `5EZ) Exit from Building. j) Apply for a Job.',23,1); X end; X repeat X if (get_com('',command)) then X begin X`09 msg_flag := false; X`09 com_val := ord(command); X`09 case com_val of X `09 106 : begin X`09`09 if (py.flags.food < 1000) then X`09`09 msg_print('You are too hungry to work') X`09`09 else if ((turn > 4320) and (turn < 12960)) then X`09`09 get_job `7Bprocedure in train.inc`7D X`09`09 else`09`09 `20 X`09`09 msg_print('We are not hiring right now.'); X`09`09 msg_print(''); X`09`09 exit_flag := true; X`09`09 end; X`09 99`09 : begin X`09`09 if (town_num = max_towns) then X`09`09 msg_print('The bus station has been destroyed.') X`09`09 else if (not(defeated_badguy)) then X`09`09 begin X msg_print('You can''t seem to find a bus.'); X msg_print('Try again after you have defeated the mob boss of this city.' V); X`09`09 end X`09`09 else if (payment_count > 10) then X`09`09 begin X`09`09 msg_print('Danny''s goons throw you off the bus!'); X`09`09`09 msg_print('"Pay off your loan!!"'); X`09`09 end X`09`09 else if (py.flags.food < 2200) then X`09`09 begin X`09`09 msg_print('Your stomach is growling.'); X`09`09`09 msg_print('You''d better eat before you leave.'); X`09`09 end X`09`09 else if (py.misc.au < 50) then X`09`09 msg_print('The bus fare is $50, which you don''t have.') X`09`09 else X`09`09 begin X`09`09 turn := turn + 10000; X`09`09`09 py.flags.food := py.flags.food - 2000; X`09`09`09 py.misc.au := py.misc.au - 50; X`09`09`09 town_num := town_num + 1; X`09`09`09 draw_the_bus; `7Bcode located in misc.inc`7D X`09`09`09 town_seed := get_seed; X`09`09`09 store_init; X`09`09`09 defeated_badguy := false; X`09`09`09 py.misc.max_lev := 0; X`09`09`09 moria_flag := true; `7Bwill draw new cave on exit`7D X`09`09`09 office_char_row := -1; X`09`09`09 office_char_col := -1; X`09`09`09 exit_flag := true; X`09`09 end; X`09`09 end; X`09 112 : begin X`09`09 prt('What would you like?',1,1); X`09`09 exit_flag := get_com('',option); X`09`09 end; X`09 otherwise prt('Invalid Command.',1,1);`09 X`09 end; X`09end X else X exit_flag := true; X until(exit_flag); X com_val := ord(option); X case com_val of X 97:if (py.misc.au < oa) then`20 X`09 msg_print('What! You don''t have enough money!') X`09else X`09 begin X `09 msg_print('You eat a light meal at the hotel.'); X`09 py.misc.au := py.misc.au - oa; X`09 py.flags.food := py.flags.food + 3000; X`09 turn := turn + 360; X `09 zero_pyflag; X`09 end; X 98:if (py.misc.au < ob) then`20 X msg_print('You can''t even afford to sleep on the lobby couch!') X`09else if (py.flags.food < 300) then X`09 msg_print(hungry) X`09else X`09 begin X `09 msg_print('You take a short nap at the hotel.'); X`09 py.misc.au := py.misc.au - ob; X`09 py.flags.food := py.flags.food - 300; X`09 py.misc.chp := py.misc.chp + (py.misc.mhp - py.misc.chp) / 3; X`09 turn := turn + 720; X`09 zero_pyflag; X`09 end; X 99:If (py.misc.au < oc) then X msg_print('You can''t afford a room, sorry.') X`09else if (py.flags.food < 700) then X`09 msg_print(hungry) X`09else X`09 begin X`09 msg_print('You spend the night at the hotel.'); X`09 py.misc.au := py.misc.au - oc; X`09 py.flags.food := 1100 + randint(20); `7Bsmall breakfast`7D X`09 midnight; X`09 turn := 5800; X`09 end; X 100:If (py.misc.au < od) then`20 X`09 msg_print('You cannot afford our luxury suite. Begone, vermin!') X`09else if (py.flags.food < 700) then X`09 msg_print(hungry) X`09else X`09 begin X`09 msg_print('You purchase a night in the finest suite of the hotel.'); X`09 py.misc.au := py.misc.au - od; X`09 py.flags.food := 7500; `7B large breakfast... --jeb`7D X`09 midnight; X`09 turn := 5800 + randint(1000); X end; X 101:If (py.misc.au < oe) then`20 X`09 msg_print('Our mud baths are for paying customers only!') X`09else if (py.flags.food < 400) then X`09 msg_print('You are too hungry to think about mud.') X`09else X`09 Begin X`09 msg_print('You relax in a soothing vat of mud.'); X`09 py.flags.food := py.flags.food - 360; X`09 turn := turn + 720; X`09 zero_pyflag; X`09 with py.stat do X`09 begin X`09 cstr := str; cint := int; cwis := wis; X`09 cdex := dex; ccon := con; cchr := chr; X`09 end; X`09 with py.misc do X`09 begin X`09 au := au - oe; X`09 chp := mhp; `20 X`09 cmana := mana; X`09 end; X`09 End;`09 `09 `09 `20 X otherwise`20 X turn := turn + 12; X End; X `09 `7BIf option makes a day go by, then...`7D X if ((com_val in `5B99,100`5D) and (turn <> i5)) then X begin X`09zero_pyflag; X py.misc.chp := py.misc.mhp; X`09py.misc.cmana := py.misc.mana; X end; X `7BSafe-check effects of all options:`7D X if (py.misc.au < 0) then py.misc.au := 0; X if (py.flags.food < 10) then py.flags.food := 10; X if ((i5 < 4320) and (turn > 4320)) then moria_flag := true; X if ((i5 < 12960) and (turn > 12960)) then moria_flag := true; X if ((i5 < 8640) and (turn > 8640)) then store_maint; X if (turn > 17280) then`20 X midnight; X msg_print(''); X draw_cave; XEND; X X X`7B Entering the bank`7D`09 X`5Bpsect(store$code)`5D procedure enter_bank; X X var`20 X i1,com_val,loan_max : integer; X`09option,command`09`09`09 : char; X exit_flag,good_val,exit_bank,payoff : boolean; X`09tmp_str`09`09`09`09 : tentype; X XBEGIN X if (payment_count > 10) then X begin X iod_val := 0.060 - (0.002 * payment_count); X iol_val := 0.100 + (0.005 * payment_count); X danny_cut := 0.080 + (0.002 * payment_count); X`09if (payment_count > 15) then X`09 begin X`09 principal := principal - act_bal; X`09 act_bal := 0; X`09 if (principal < 0) then principal := 0; X`09 end;`09 X end X else X begin X iod_val := 0.060; `7Bdefaults`7D X iol_val := 0.100; X danny_cut := 0.080; X end; X with py.misc do X loan_max := lev * 1000; X X `7Bloan_max := trunc((player_exp`5Blev`5D*expfact)*(-99.0*lev/42.0+102.41 V4634));`7D X `7Bnote: this is engineered to be around $1000 at first level, and X decreases to player_exp`5Blev`5D*expfact at 42nd level. -jeb`7D X X exit_bank := false; X exit_flag := false; X payoff := false; X X`7BDisplay Bank Options`7D X repeat `7Bexit bank loop`7D X clear(1,1); X prt('Danny Dollar (Bookie) '+townlist`5Btown_num`5D.town_name+' V Savings and Loan',3,10); X prt_num('Account Balance : ',act_bal,7,20); X prt_num('Interest on Deposit : ',trunc(100.0*iod_val),8,20); X prt_num('Loan Principal : ',principal,9,20); X prt_num('Interest on Loans : ',trunc(100.0*iol_val),10,20); X prt_num('Danny''s Cut : ',trunc(100.0*danny_cut),11,20); X prt('%',8,46); X prt('%',10,46); X prt('%',11,46); X store_prt_gold; X prt('You may:',21,1); Xprt('d) Deposit l) Ask for a loan `5EZ) Exit Danny''s S&L',22, V1); Xprt('w) Withdraw p) Make a loan payment ',23,1) V; X X if (payment_count > 10) then`20 X prt('Better get to paying off that loan of yours...',1,10); X X repeat X if (get_com('',command)) then X begin X`09 msg_flag := false; X`09 com_val := ord(command); X`09 case com_val of X `09 100 : begin `7Bdeposit`7D X`09 exit_flag := true; X`09`09 repeat X`09`09 good_val := true; X prt('How much would you like to deposit?',1,10); X`09`09 get_string(tmp_str,1,47,10); X`09`09 i1 := -1; X`09`09 readv(tmp_str,i1,error:=continue); X`09`09 if (i1 > py.misc.au) then X`09`09 begin X`09`09 good_val := false; X msg_print('What, you want I should take the diffe Vrence out of your gold fillings?'); X`09`09`09 msg_print(''); X`09`09 end; X`09 if (i1 < 0) then X`09`09 begin X`09`09 good_val := false; X`09`09 msg_print('Look, friend, if you want I should give you mone Vy then ask for a loan!'); X`09`09`09 msg_print(''); X`09`09 end; X`09`09 until (good_val); X`09`09 if (py.misc.au = 0) then X`09`09 begin X`09`09`09 exit_bank := true; X `09`09 msg_print('Come back when you have some cash'); X`09`09`09 msg_print(''); X`09`09 end X`09`09 else X`09`09 if (i1 <> 0) then X`09`09 begin X`09`09 act_bal := act_bal + trunc((1.0-danny_cut)*i1); X`09`09 py.misc.au := py.misc.au - i1; X`09`09 msg_print('Your money is safe with me.'); X`09`09`09 msg_print(''); X`09`09 end; X`09`09 end; X`09 119`09 : if (act_bal = 0) then `7Bwithdraw`7D X`09`09 begin X`09`09 msg_print('You have no money in your account.'); X`09`09 msg_print(''); X`09`09 end X`09`09 else X`09`09 begin X`09`09 exit_flag := true; X`09`09 repeat X`09`09 prt('How much would you like to withdraw?',1,10); X`09`09 good_val := true; X`09`09 get_string(tmp_str,1,48,10); X`09`09 i1 := -1; X`09`09 readv(tmp_str,i1,error:=continue); X`09`09`09 if ((i1 < 0) or (i1 > act_bal)) then X`09`09`09 begin X`09`09`09 msg_print('Surely you jest.'); X`09`09`09 msg_print(''); X`09`09`09 good_val := false; X`09`09 end; X`09`09 until(good_val); X`09`09 if (i1 <> 0) then X`09`09 begin X`09`09 py.misc.au := py.misc.au + i1; X`09`09`09 act_bal := act_bal - i1; X`09`09`09 msg_print('Now don''t spend it all in one place.'); X`09`09`09 msg_print(''); X`09`09 end X`09`09 else X`09`09 msg_print('Come back if you change your mind.'); X`09`09 end; X`09`09 `20 X`09 108 : begin `7Bloan`7D X`09`09 repeat X`09`09 good_val := true; X`09`09 prt('How much do you need?',1,10); X`09`09 get_string(tmp_str,1,32,10); X`09`09 i1 := -1; X`09`09 readv(tmp_str,i1,error:=continue); X`09`09 if (i1 < 0) then good_val := false; X`09`09 until(good_val); X`09`09 if (i1 + principal > loan_max) then X`09`09 msg_print('I don''t think you''re good for that much.') X`09`09 else if (i1 = 0) then X`09`09 msg_print('What, you just like to fill out paperwork?') X`09`09 else X`09`09 begin X`09`09 py.misc.au := py.misc.au + i1; X`09`09 principal := principal + i1; X`09`09 exit_flag := true; X`09`09 end; X`09`09 end; X X`09 112: begin `7Bpay off loan`7D X`09`09 repeat X`09`09 good_val := true; X`09 prt('How much would you like to pay?',1,10); X`09`09 get_string(tmp_str,1,43,10); +-+-+-+-+-+-+-+- END OF PART 72 +-+-+-+-+-+-+-+-