[ LiYuen; ! Pay off Li Yuen fitos(real3,32766); fitos(real4,random(32767)-1); fdiv(real1,real4,real3); if(time>12) { fitos(real4,random(time)+time-1); fitos(real3,1000); fmul(real2,real4,real3); fmul(real4,real1,cash); fadd(real3,real4,real2); frnd(real1,real3); } else { finit(real3,"1.8"); fdiv(real4,real1,real3); fmul(real2,real4,cash); frnd(real1,real2); } print "Li Yuen asks ", (fpword) real1, " in donation to the temple of Tin Hau, the Sea Goddess. Will you pay? "; if (YorN()) { li=1; fsub(real2,cash,real1); fcpy(cash,real2); if(fpclassify(cash) & (FP_NORMALM | FP_SUBNORMALM)) { ! Uh oh, not enough cash LowerWindowSetup(0); print "Taipan, you do not have enough cash!!^^"; StdBeep(); print "Do you want Elder Brother Wu to make up the difference for you? "; if(YorN()) { fsub(real1,debt,cash); fcpy(debt,real1); fitos(cash,0); LowerWindowSetup(0); print "Elder Brother has given Li Yuen the difference between what he wanted and your cash on hand and added the same amount to your debt."; MedPause(); } else { fitos(cash,0); li=0; LowerWindowSetup(0); print "Very well, Elder Brother Wu will not pay Li Yuen the difference. I would be very wary of pirates if I were you, Taipan."; Beep2518(); MedPause(); } } } DrawTopWindow(); ]; [ McHenry i j; ! McHenry and his absurd prices LowerWindowSetup(0); print "Taipan, Mc Henry from the Hong Kong Shipyards has arrived! He says, 'I see ye've a wee bit of damage to yer ship. Will ye be wanting repairs?'"; if (YorN()) { fitos(real1,random(15*(time+3))-1); fitos(real2,time+3); fitos(real3,25); fmul(real4,real2,real3); fitos(real3,4); fdiv(real2,real4,real3); fadd(real3,real1,real2); fitos(real2,shipsize); fmul(real4,real3,real2); fitos(real2,50); fdiv(real3,real4,real2); frnd(real1,real3); i=(dam2*10+shipsize/10)/(shipsize/5); fitos(real2,dam2); fitos(real3,2); fdiv(real4,real2,real3); fmul(real2,real4,real1); fitos(real4,1); fadd(real3,real2,real4); .mchenrynocash; j=1; do { if (~~j) StdBeep(); LowerWindowSetup(0); print "Och, 'tis a pity to be ", i, "% damaged.^^"; print "We can fix the whole ship for ", (fpword) real3 ,", or make partial repairs if you wish. How much will ye spend?"; fmin(real4,real3,cash); j=ReadFP(real6,real4); if(flt(cash,real6)) { print "Taipan, you do not have enough cash!!"; j=-1; ShortPause(); } } until (j==1); fdiv(real2,real6,real1); finit(real3,"0.5"); fadd(real1,real2,real3); frnd(real3,real1); dam2=dam2-2*fstoi(real3,FE_DOWNWARD); if (dam2<0) dam2=0; fsub(real1,cash,real6); fcpy(cash,real1); DrawTopWindow(); } ]; [ ElderBrother i; fitos(real1,10000); if ((~~wuwisdom) && fge(debt,real1)) { ! Go visit Wu for a pep talk LowerWindowSetup(0); print "Elder Brother Wu has sent ",random(100)+49," braves to escort you to the Wu mansion, Taipan."; MedPause(); wuwisdom = 1; LowerWindowSetup(0); print "Elder Brother Wu reminds you of the Confucian ideal of personal worthiness, and how this applies to paying one's debts."; LongPause(); LowerWindowSetup(0); print "He is reminded of a fabled barbarian who came to a bad end, after not caring for his obligations.^^He hopes no such fate awaits you, his friend, Taipan."; LongPause(); } LowerWindowSetup(0); print "Do you have business with Elder Brother Wu, the moneylender? "; if (YorN()) { fitos(real1,0); for(i=0:i<4:i++) { fadd(real2,real1,cargo+2*i); fitos(real3,whcargo-->i); fadd(real1,real2,real3); } frnd(real2,real1); if (guns==0 && (fpclassify(cash) & FP_ZERO) && (fpclassify(bank) & FP_ZERO) && (fpclassify(real2) & FP_ZERO)) { ! Completely fucking destitute LowerWindowSetup(0); destitution++; i=random(1500)+499; fitos(real1,random(2000)-1); fitos(real2,destitution); fmul(real3,real1,real2); fitos(real2,1500); fadd(real1,real3,real2); print "Elder Brother Wu is aware of your plight, Taipan. He is willing to loan you an additional ", i, " if you will pay back ", (fp) real1, ". Are you willing, Taipan? "; fitos(real2,i); if (YorN()) { fadd(real3,debt,real1); frnd(debt,real3); fadd(real3,cash,real2); frnd(cash,real3); LowerWindowSetup(0); print "Very well, Taipan. Good joss!!"; DrawTopWindow(); ShortPause(); } else { LowerWindowSetup(0); print "^^Very well, Taipan, the game is over!"; Beep2512(); return -1; } } else { if (~~((fpclassify(debt) & FP_ZERO) || (fpclassify(cash) & FP_ZERO))) { i=1; do { if(~~i) StdBeep(); LowerWindowSetup(0); print "How much do you wish to repay him? "; fmin(real4,cash,debt); i=ReadFP(real6,real4); if(i && fgt(real6,cash)) { print "^^Taipan, you have only ", (fp) cash, " in cash."; i=-1; Beep2518(); MedPause(); } } until(i>0); if(nobrothercheat && fgt(real6,debt)) fcpy(real6,debt); fsub(real1,cash,real6); frnd(cash,real1); fsub(real1,debt,real6); frnd(debt,real1); DrawTopWindow(); } i=1; do { if(~~i) StdBeep(); LowerWindowSetup(0); print "How much do you wish to borrow? "; fitos(real1,2); fmul(real2,cash,real1); i=ReadFP(real6,real2); if(i && fgt(real6,real2)) { print "^^He won't loan you so much, Taipan!"; i=-1; Beep2518(); MedPause(); } } until(i>0); fadd(real1,cash,real6); frnd(cash,real1); fadd(real1,debt,real6); frnd(debt,real1); DrawTopWindow(); fitos(real1,20000); if(random(5)>1 && fgt(debt,real1)) { LowerWindowSetup(0); print "Bad joss!!^", random(3)+2, " of your bodyguards have been killed by cutthroats and you have been robbed of all your cash, Taipan!!"; fitos(cash,0); Beep2512(); DrawTopWindow(); MedPause(); } } } ]; [ VisitBank i; do { LowerWindowSetup(0); print "How much will you deposit? "; i=ReadFP(real6,cash); if(i && fgt(real6,cash)) { i=0; print "^^Taipan, you have only ", (fp) cash, " in cash."; Beep2518(); MedPause(); } } until(i); fadd(real5,bank,real6); frnd(bank,real5); fsub(real5,cash,real6); frnd(cash,real5); DrawTopWindow(); do { LowerWindowSetup(0); print "How much will you withdraw? "; i=ReadFP(real6,bank); if(i && fgt(real6,bank)) { i=0; print "^^Taipan, you have only ", (fp) bank, " in the bank."; Beep2518(); MedPause(); } } until(i); fadd(real5,cash,real6); frnd(cash,real5); fsub(real5,bank,real6); frnd(bank,real5); DrawTopWindow(); RobberCheck(); ]; [ TransferCargo i j option; i=1; for(j=0:j<4:j++) i=i && (fpclassify(cargo+4*j) & FP_ZERO) && (whcargo-->j==0); if(i) { print "You have no cargo, Taipan."; Beep2518(); MedPause(); return; } for(j=0:j<4:j++) { if(~~(fpclassify(cargo+4*j) & FP_ZERO)) { do { LowerWindowSetup(0); print "How much ", (string) cargonames-->j, " shall I move to the warehouse, Taipan? "; option=ReadFP(real6,cargo+4*j); if(option) { fitos(real2,WAREHOUSE_CAPACITY+1); if(fgt(real6,real2)) fcpy(real6,real2); i=fstoi(real6); if(i>0 && whvacancy ==0) { option=0; print "^^Your warehouse is full, Taipan!"; Beep2518(); MedPause(); } else if(i>whvacancy) { option=0; print "^^Your warehouse will only hold an additional ", whvacancy,", Taipan!"; Beep2518(); MedPause(); } else if(fgt(real6,cargo+4*j)) { option=0; print "^^You have only ",(fp) cargo+4*j,", Taipan."; Beep2518(); MedPause(); } } else StdBeep(); } until(option); fsub(real4,cargo+4*j,real6); frnd(cargo+4*j,real4); fadd(real4,holdfree,real6); frnd(holdfree,real4); whcargo-->j=whcargo-->j+i; whvacancy=whvacancy-i; DrawTopWindow(); } if(whcargo-->j~=0) { do { LowerWindowSetup(0); print "How much ", (string) cargonames-->j, " shall I move aboard ship, Taipan? "; fitos(real1,whcargo-->j); option=ReadFP(real6,real1); if(option) { if(fgt(real6,real1)) { option=0; print "^^You have only ",whcargo-->j,", Taipan."; Beep2518(); MedPause(); } } else StdBeep(); } until(option); i=fstoi(real6); fadd(real4,cargo+4*j,real6); frnd(cargo+4*j,real4); fsub(real4,holdfree,real6); frnd(holdfree,real4); whcargo-->j=whcargo-->j-i; whvacancy=whvacancy+i; DrawTopWindow(); } } ];