aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-18 07:14:39 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-18 07:14:39 -0500
commit15534e8f7da91de858ebe5ce01ee4759687653ad (patch)
treeb409c7b69ec43d2541f06868a6791d21af231659
parenta4aa2f69497d453f7ea314a6baa43fbefa22df71 (diff)
downloadtaipan-15534e8f7da91de858ebe5ce01ee4759687653ad.tar.gz
put McHenry back the way he was
-rw-r--r--taipan.c60
1 files changed, 27 insertions, 33 deletions
diff --git a/taipan.c b/taipan.c
index 9c2386d..611f39e 100644
--- a/taipan.c
+++ b/taipan.c
@@ -1624,8 +1624,6 @@ void port_stats(void)
}
void mchenry(void) {
- // static char choice;
-
compradores_report();
cprint_taipan_comma();
cputs("Mc Henry from the Hong Kong\r\n"
@@ -1633,56 +1631,52 @@ void mchenry(void) {
"ye've a wee bit of damage to yer ship.'\r\n"
"Will ye be wanting repairs? ");
- // choice = yngetc('y');
-
- if(yngetc('y') == 'y') {
+ if(yngetc('y') == 'y') {
static int percent, time;
static unsigned long br, repair_price, amount;
- // int percent = ((float) damage / capacity) * 100,
percent = (damage * 100L / capacity);
- // time = ((year - 1860) * 12) + month;
time = get_time();
/*
- long br = ((((60 * (time + 3) / 4) * (float) randi() / RAND_MAX) +
- 25 * (time + 3) / 4) * capacity / 50),
- repair_price = (br * damage) + 1,
- amount;
- */
+ long br = ((((60 * (time + 3) / 4) * (float) randi() / RAND_MAX) +
+ 25 * (time + 3) / 4) * capacity / 50),
+ repair_price = (br * damage) + 1,
+ amount;
+ */
br = ((randclamp(60 * (time + 3) / 4) + 25 * (time + 3) / 4) * capacity / 50);
repair_price = (br * damage) + 1;
clear_msg_window();
- cputs("Och, 'tis a pity to be ");
+ cputs("Och, 'tis a pity to be ");
cprintulong(percent);
- cputs("% damaged. We\r\ncan fix yer whole ship for ");
- cprintfancy(repair_price);
- cputs("\r\nor make partial repairs if you wish.\r\n");
+ cputs("% damaged.\r\nWe can fix yer whole ship for ");
+ cprintulong(repair_price);
+ cputs(",\r\nor make partial repairs if you wish.\r\n");
how_much();
- cputs("will ye spend? ");
+ cputs("will ye spend? ");
- for (;;) {
- gotoxy(24, 21);
- amount = get_num();
- if(amount == UINT32_MAX) {
+ for (;;) {
+ gotoxy(24, 21);
+ amount = get_num();
+ if(amount == UINT32_MAX) {
if(cash > repair_price)
amount = repair_price;
else
amount = cash;
- }
- if(amount <= cash) {
- cash -= amount;
- // damage -= (int)((amount / br) + .5);
- damage -= (int)(amount / br);
- damage = (damage < 0) ? 0 : damage;
- port_stats();
- break;
- }
- }
- }
+ }
+ if(amount <= cash) {
+ cash -= amount;
+ // damage -= (int)((amount / br) + .5);
+ damage -= (int)(amount / br);
+ damage = (damage < 0) ? 0 : damage;
+ port_stats();
+ break;
+ }
+ }
+ }
- return;
+ return;
}
/*