aboutsummaryrefslogtreecommitdiff
path: root/taipan.c
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2016-02-21 18:53:49 -0500
committerB. Watson <yalhcru@gmail.com>2016-02-21 18:53:49 -0500
commita4a884600888e5e2e6b5231c2840c01b44eae644 (patch)
treebd7b2ce9c4208c7e7674312968d0a7f61456f1dd /taipan.c
parent6f5bc5adbc21865093ff24af6dbf0c24ea4cfe9c (diff)
downloadtaipan-a4a884600888e5e2e6b5231c2840c01b44eae644.tar.gz
text compression. 7017 bytes free.
Diffstat (limited to 'taipan.c')
-rw-r--r--taipan.c469
1 files changed, 299 insertions, 170 deletions
diff --git a/taipan.c b/taipan.c
index ce9d5c1..03ba095 100644
--- a/taipan.c
+++ b/taipan.c
@@ -162,6 +162,10 @@ void atari_text_setup() {
/**** End of atari-specific stuff. Supposed to be, anyway. */
+#include "messages.c"
+
+extern void __fastcall__ print_msg(const char *msg);
+
/* old version of this used to just 'return randl()%clamp'.
If clamp were 0, the return value would be the unclamped
result from randl() (x % 0 == x, in cc65). If it were 1,
@@ -404,24 +408,29 @@ long damage = 0, capacity = 60, newdamage;
might or might not be worth turning into a function. */
void how_much(void) {
- cputs("How much ");
+ // cputs("How much ");
+ print_msg(M_how_much_spc);
}
void how_much_will_you(void) {
how_much();
- cputs("will you ");
+ // cputs("will you ");
+ print_msg(M_will_you);
}
void cprint_bad_joss() {
- cputs("Bad Joss!!\r\n");
+ // cputs("Bad Joss!!\r\n");
+ print_msg(M_bad_joss);
}
void crlf(void) {
- cputs("\r\n");
+ // cputs("\r\n");
+ print_msg(M_crlf);
}
void cprint_taipan(void) {
- cputs("Taipan");
+ // cputs("Taipan");
+ print_msg(M_taipan);
}
void comma_space(void) {
@@ -474,25 +483,30 @@ void cprint_taipan_prompt(void) {
}
void do_you_wish(void) {
- cputs("do you wish ");
+ // cputs("do you wish ");
+ print_msg(M_do_you_wish);
}
void cprint_elder_brother_wu(void) {
- cputs("Elder Brother Wu ");
+ // cputs("Elder Brother Wu ");
+ print_msg(M_elder_brother_wu);
}
/* This one only saves space when Li Yuen occurs at the start
of a string, not in the middle */
void cprint_li_yuen(void) {
- cputs("Li Yuen");
+ // cputs("Li Yuen");
+ print_msg(M_li_yuen);
}
void cprint_Do_you_want(void) {
- cputs("Do you want ");
+ // cputs("Do you want ");
+ print_msg(M_do_you_want);
}
void cprint_firm_colon(void) {
- cputs("Firm:");
+ // cputs("Firm:");
+ print_msg(M_firm_colon);
}
/* making this a function saved 52 bytes */
@@ -604,12 +618,14 @@ void prepare_report(void) {
void compradores_report(void) {
prepare_report();
- cputs("Comprador's Report\r\n\n");
+ // cputs("Comprador's Report\r\n\n");
+ print_msg(M_compradors_report);
}
void captains_report(void) {
prepare_report();
- cputs(" Captain's Report\r\n\n");
+ // cputs(" Captain's Report\r\n\n");
+ print_msg(M_captains_report);
}
void clear_msg_window(void) {
@@ -619,7 +635,8 @@ void clear_msg_window(void) {
void overload(void) {
compradores_report();
- cputs("Your ship is overloaded");
+ // cputs("Your ship is overloaded");
+ print_msg(M_overloaded);
cprint_taipan_bangbang();
good_joss_sound();
timed_getch();
@@ -640,13 +657,17 @@ void new_ship(void) {
}
compradores_report();
- cputs("Do you wish to trade in your ");
+ // cputs("Do you wish to trade in your ");
+ print_msg(M_wish_to_trade);
if(damage > 0) {
cputs("\xe4\xe1\xed\xe1\xe7\xe5\xe4"); // inverse "damaged"
} else {
cputs("fine");
}
- cputs("\r\nship for one with 50 more capacity by\r\npaying an additional ");
+ // cputs("\r\nship for one with 50 more capacity by\r\npaying an additional ");
+ print_msg(M_ship_for_one);
+ cprintulong(50);
+ print_msg(M_more_capacity);
cprintfancy(amount);
cprint_taipan_prompt();
@@ -676,7 +697,8 @@ void new_gun(void) {
}
compradores_report();
- cputs("Do you wish to buy a ship's gun\r\nfor ");
+ // cputs("Do you wish to buy a ship's gun\r\nfor ");
+ print_msg(M_gun_offer);
cprintfancy(amount);
cprint_taipan_prompt();
@@ -807,14 +829,17 @@ void fight_stats(int ships, int orders) {
gotoxy(0, 0);
justify_int(ships);
- cputs(" ship");
+ // cputs(" ship");
+ print_msg(M_space_ship);
if(ships != 1) cputc_s();
- cputs(" attacking");
+ // cputs(" attacking");
+ print_msg(M_space_attacking);
cprint_taipan_bang();
cspace();
crlf();
- cputs("Your orders are: ");
+ // cputs("Your orders are: ");
+ print_msg(M_your_orders_are);
cblank(11);
switch(orders) {
case 1: cputs("Fight"); break;
@@ -895,7 +920,8 @@ char sea_battle(char id, int num_ships) {
updates are smoother-looking. Maybe. */
rvs_on();
gotoxy(30, 0);
- cputs(" We have");
+ // cputs(" We have");
+ print_msg(M_we_have);
gotoxy(30, 1);
cspaces(6);
cputs("guns");
@@ -919,7 +945,8 @@ char sea_battle(char id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
- cputs("Current seaworthiness: ");
+ // cputs("Current seaworthiness: ");
+ print_msg(M_cur_seaworth);
cputs(st[status / 20]);
cputs(" (");
cprintulong(status);
@@ -972,13 +999,15 @@ char sea_battle(char id, int num_ships) {
ik = 1;
gotoxy(0, 3);
clrtoeol();
- cputs("Aye, we'll fight 'em");
+ // cputs("Aye, we'll fight 'em");
+ print_msg(M_aye_fight);
cprint_taipan_period();
set_orders();
gotoxy(0, 3);
clrtoeol();
- cputs("We're firing on 'em");
+ // cputs("We're firing on 'em");
+ print_msg(M_were_firing);
cprint_taipan_bang();
set_orders();
@@ -1047,11 +1076,13 @@ char sea_battle(char id, int num_ships) {
if(sk > 0) {
cputs("Sunk ");
cprintulong(sk);
- cputs(" of the buggers");
+ // cputs(" of the buggers");
+ print_msg(M_of_the_buggers);
cprint_taipan_bang();
bad_joss_sound();
} else {
- cputs("Hit 'em, but didn't sink 'em");
+ // cputs("Hit 'em, but didn't sink 'em");
+ print_msg(M_didnt_sink);
cprint_taipan_bang();
}
set_orders();
@@ -1067,7 +1098,8 @@ char sea_battle(char id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
cprintulong(ran);
- cputs(" ran away");
+ // cputs(" ran away");
+ print_msg(M_ran_away);
cprint_taipan_bang();
bad_joss_sound();
@@ -1093,7 +1125,8 @@ char sea_battle(char id, int num_ships) {
} else if ((orders == 1) && (guns == 0)) {
gotoxy(0, 3);
clrtoeol();
- cputs("We have no guns");
+ // cputs("We have no guns");
+ print_msg(M_we_have_no_guns);
cprint_taipan_bangbang();
set_orders();
} else if (orders == 3) {
@@ -1102,7 +1135,8 @@ char sea_battle(char id, int num_ships) {
total = 0;
gotoxy(0, 3);
- cputs("You have the following on board");
+ // cputs("You have the following on board");
+ print_msg(M_you_have_on_board);
cprint_taipan_colon();
gotoxy(4, 4);
cputs(item[0]);
@@ -1123,7 +1157,8 @@ char sea_battle(char id, int num_ships) {
gotoxy(0, 6);
clrtoeol();
- cputs("What shall I throw overboard");
+ // cputs("What shall I throw overboard");
+ print_msg(M_what_shall_i_throw);
cprint_taipan_prompt();
choice = get_item(1);
@@ -1131,7 +1166,8 @@ char sea_battle(char id, int num_ships) {
if(choice < 4) {
gotoxy(0, 6);
clrtoeol();
- cputs("How much");
+ // cputs("How much");
+ print_msg(M_how_much);
cprint_taipan_prompt();
amount = get_num();
@@ -1154,7 +1190,8 @@ char sea_battle(char id, int num_ships) {
if(total > 0) {
gotoxy(0, 3);
clrtoeol();
- cputs("Let's hope we lose 'em");
+ // cputs("Let's hope we lose 'em");
+ print_msg(M_hope_we_lose_em);
cprint_taipan_bang();
bad_joss_sound();
if (choice < 4) {
@@ -1174,7 +1211,8 @@ char sea_battle(char id, int num_ships) {
} else {
gotoxy(0, 3);
clrtoeol();
- cputs("There's nothing there");
+ // cputs("There's nothing there");
+ print_msg(M_nothing_there);
cprint_taipan_bang();
good_joss_sound();
@@ -1186,7 +1224,8 @@ char sea_battle(char id, int num_ships) {
if(orders == 2) {
gotoxy(0, 3);
clrtoeol();
- cputs("Aye, we'll run");
+ // cputs("Aye, we'll run");
+ print_msg(M_aye_run);
cprint_taipan_period();
set_orders();
}
@@ -1195,7 +1234,8 @@ char sea_battle(char id, int num_ships) {
if(randi()%ok > randi()%num_ships) {
gotoxy(0, 3);
clrtoeol();
- cputs("We got away from 'em");
+ // cputs("We got away from 'em");
+ print_msg(M_we_got_away);
cprint_taipan_bang();
good_joss_sound();
set_orders();
@@ -1203,7 +1243,8 @@ char sea_battle(char id, int num_ships) {
} else {
gotoxy(0, 3);
clrtoeol();
- cputs("Couldn't lose 'em.");
+ // cputs("Couldn't lose 'em.");
+ print_msg(M_couldnt_lose_em);
set_orders();
if((num_ships > 2) && (one_chance_in(5))) {
@@ -1214,9 +1255,11 @@ char sea_battle(char id, int num_ships) {
fight_stats(num_ships, orders);
gotoxy(0, 3);
clrtoeol();
- cputs("But we escaped from ");
+ // cputs("But we escaped from ");
+ print_msg(M_but_we_escaped);
cprintulong(lost);
- cputs(" of 'em!");
+ // cputs(" of 'em!");
+ print_msg(M_of_em);
if(num_ships <= 10) {
for(i = 9; i >= 0; i--) {
@@ -1241,11 +1284,11 @@ char sea_battle(char id, int num_ships) {
if(num_ships > 0) {
gotoxy(0, 3);
clrtoeol();
- cputs("They're firing on us");
+ // cputs("They're firing on us");
+ print_msg(M_theyre_firing);
cprint_taipan_bang();
set_orders();
- // hide_cursor();
explosion();
fight_stats(num_ships, orders);
@@ -1253,7 +1296,8 @@ char sea_battle(char id, int num_ships) {
gotoxy(0, 3);
clrtoeol();
- cputs("We've been hit");
+ // cputs("We've been hit");
+ print_msg(M_weve_been_hit);
cprint_taipan_bangbang();
under_attack_sound();
@@ -1274,7 +1318,8 @@ char sea_battle(char id, int num_ships) {
fight_stats(num_ships, orders);
gotoxy(0, 3);
clrtoeol();
- cputs("The buggers hit a gun");
+ // cputs("The buggers hit a gun");
+ print_msg(M_buggers_hit_gun);
cprint_taipan_bangbang();
under_attack_sound();
fight_stats(num_ships, orders);
@@ -1335,11 +1380,11 @@ char sea_battle(char id, int num_ships) {
}
if(orders == 1) {
- // clr_screen();
fight_stats(num_ships, orders);
gotoxy(0, 3);
clrtoeol();
- cputs("We got 'em all");
+ // cputs("We got 'em all");
+ print_msg(M_we_got_em_all);
cprint_taipan_bang();
bad_joss_sound();
timed_getch();
@@ -1394,13 +1439,18 @@ void cash_or_guns(void) {
clr_screen();
cprint_Do_you_want();
- cputs("to start . . .\r\n\n");
- cputs(" 1) With cash (and a debt)\r\n\n");
+ // cputs("to start . . .\r\n\n");
+ print_msg(M_to_start);
+ // cputs(" 1) With cash (and a debt)\r\n\n");
+ cputs(" 1");
+ print_msg(M_with_cash);
cspaces(16);
- cputs("-- or --\r\n\n");
- cputs(" 2) With five guns and no cash\r\n");
+ cputs("-- or --\r\n\n 2");
+ // cputs(" 2) With five guns and no cash\r\n");
+ print_msg(M_with_5_guns);
cspaces(16);
- cputs("(But no debt!)");
+ // cputs("(But no debt!)");
+ print_msg(M_but_no_debt);
gotoxy(10, 10);
cputc('?');
@@ -1639,10 +1689,13 @@ void port_stats(void)
void mchenry(void) {
compradores_report();
cprint_taipan_comma();
+ /*
cputs("Mc Henry from the Hong Kong\r\n"
"Shipyards has arrived!! He says, 'I see\r\n"
"ye've a wee bit of damage to yer ship.'\r\n"
"Will ye be wanting repairs? ");
+ */
+ print_msg(M_mchenry_has_arrived);
if(yngetc('y') == 'y') {
static int percent, time;
@@ -1661,13 +1714,17 @@ void mchenry(void) {
repair_price = (br * damage) + 1;
clear_msg_window();
- cputs("Och, 'tis a pity to be ");
+ // cputs("Och, 'tis a pity to be ");
+ print_msg(M_tis_a_pity);
cprintulong(percent);
- cputs("% damaged.\r\nWe can fix yer whole ship for ");
+ // cputs("% damaged.\r\nWe can fix yer whole ship for ");
+ print_msg(M_percent_damaged);
cprintulong(repair_price);
- cputs(",\r\nor make partial repairs if you wish.\r\n");
+ // cputs(",\r\nor make partial repairs if you wish.\r\n");
+ print_msg(M_or_partial_repairs);
how_much();
- cputs("will ye spend? ");
+ // cputs("will ye spend? ");
+ print_msg(M_will_ye_spend);
for (;;) {
gotoxy(24, 21);
@@ -1727,7 +1784,8 @@ void aire(void) {
cputs("T R");
endspace = 0;
}
- cputs(" I L L I O N A I R E !");
+ // cputs(" I L L I O N A I R E !");
+ print_msg(M_illionaire);
if(endspace) cspaces(2);
crlf();
}
@@ -1740,8 +1798,8 @@ void retire(void) {
// crlf();
retire_blanks();
- // cputs(" Y o u ' r e a \r\n");
- cputs(" Y o u ' r e a");
+ // cputs(" Y o u ' r e a");
+ print_msg(M_youre_a);
cspaces(9);
crlf();
@@ -1802,19 +1860,23 @@ void final_stats(void)
port_stat_dirty = 1;
clr_screen();
- cputs("Your final status:\r\n\n"
- "Net cash: ");
+ // cputs("Your final status:\r\n\n"
+ // "Net cash: ");
+ print_msg(M_your_final_status);
#ifdef BIGNUM
cprintfancy_big(finalcash);
#else
cprintfancy(finalcash);
#endif
- cputs("\r\nShip size: ");
+ // cputs("\r\nShip size: ");
+ print_msg(M_ship_size);
cprintulong(capacity);
- cputs(" units with ");
+ // cputs(" units with ");
+ print_msg(M_units_with);
cprintulong(guns);
- cputs(" guns\r\n\n"
- "You traded for ");
+ // cputs(" guns\r\n\n"
+ // "You traded for ");
+ print_msg(M_you_traded_for);
cprintulong(years);
cputs(" year");
if (years != 1)
@@ -1830,7 +1892,8 @@ void final_stats(void)
}
cputs("\r\n\n");
rvs_on();
- cputs("Your score is ");
+ // cputs("Your score is ");
+ print_msg(M_your_score_is);
#ifdef BIGNUM
cprintfancy_big(bigscore);
#else
@@ -1840,38 +1903,40 @@ void final_stats(void)
rvs_off();
if ((score < 100) && (score >= 0))
{
- cputs("Have you considered a land based job?\r\n\n\n");
+ // cputs("Have you considered a land based job?\r\n\n\n");
+ print_msg(M_land_based_job);
} else if (score < 0) {
- cputs("The crew has requested that you stay on\r\n"
- "shore for their safety!!\r\n\n");
+ // cputs("The crew has requested that you stay on\r\n"
+ // "shore for their safety!!\r\n\n");
+ print_msg(M_stay_on_shore);
} else {
cputs("\r\n\n\n");
}
- cputs("Your Rating:\r\n");
+ // cputs("Your Rating:\r\n");
+ print_msg(M_your_rating);
cputc(17); // upper left corner
chline(31);
cputc(5); // upper right corner
- // cputs("\r\n");
crlf();
cprint_pipe();
- // cputc('|');
if (score > 49999L)
{
rvs_on();
}
- cputs("Ma Tsu");
+ // cputs("Ma Tsu");
+ print_msg(M_ma_tsu);
rvs_off();
cspaces(9);
cputs("50,000 and over |\r\n");
cprint_pipe();
- // cputc('|');
if ((score < 50000L) && (score > 7999L))
{
rvs_on();
}
- cputs("Master Taipan");
+ // cputs("Master Taipan");
+ print_msg(M_master_taipan);
rvs_off();
cputs(" 8,000 to 49,999|\r\n");
cprint_pipe();
@@ -1881,30 +1946,29 @@ void final_stats(void)
{
rvs_on();
}
- // cputs("Taipan");
cprint_taipan();
rvs_off();
cspaces(10);
cputs("1,000 to 7,999|\r\n");
cprint_pipe();
- // cputc('|');
if ((score < 1000) && (score > 499))
{
rvs_on();
}
- cputs("Compradore");
+ // cputs("Compradore");
+ print_msg(M_compradore);
rvs_off();
cspaces(8);
cputs("500 to 999|\r\n");
cprint_pipe();
- // cputc('|');
if (score < 500)
{
rvs_on();
}
- cputs("Galley Hand");
+ // cputs("Galley Hand");
+ print_msg(M_galley_hand);
rvs_off();
cspaces(7);
cputs("less than 500|\r\n");
@@ -1914,7 +1978,8 @@ void final_stats(void)
cputc(3); // lower right corner
gotoxy(0, 22);
- cputs("Play again? ");
+ // cputs("Play again? ");
+ print_msg(M_play_again);
choice = yngetc(0);
if(choice == 'y') {
@@ -1976,7 +2041,8 @@ char have_no_cargo(void) {
}
void you_have_only(void) {
- cputs("You have only ");
+ // cputs("You have only ");
+ print_msg(M_you_have_only);
}
void transfer(void)
@@ -1987,7 +2053,8 @@ void transfer(void)
if(have_no_cargo()) {
gotoxy(0, 22);
clrtobot();
- cputs("You have no cargo");
+ // cputs("You have no cargo");
+ print_msg(M_you_have_no_cargo);
cprint_taipan_period();
crlf();
good_joss_sound();
@@ -2005,7 +2072,8 @@ void transfer(void)
compradores_report();
how_much();
cputs(item[i]);
- cputs(" shall I move\r\nto the warehouse");
+ // cputs(" shall I move\r\nto the warehouse");
+ print_msg(M_move_to_whouse);
cprint_taipan_prompt();
amount = get_num();
@@ -2025,12 +2093,14 @@ void transfer(void)
break;
} else if (in_use == 10000) {
gotoxy(0, 21);
- cputs("Your warehouse is full");
+ // cputs("Your warehouse is full");
+ print_msg(M_whouse_full);
cprint_taipan_bang();
good_joss_sound();
} else {
gotoxy(0, 21);
- cputs("Your warehouse will only hold an\r\nadditional ");
+ // cputs("Your warehouse will only hold an\r\nadditional ");
+ print_msg(M_whouse_only_hold);
cprintulong(10000 - in_use);
cprint_taipan_bang();
good_joss_sound();
@@ -2060,7 +2130,8 @@ void transfer(void)
compradores_report();
how_much();
cputs(item[i]);
- cputs(" shall I move\r\naboard ship");
+ // cputs(" shall I move\r\naboard ship");
+ print_msg(M_move_aboard);
cprint_taipan_prompt();
amount = get_num();
@@ -2105,7 +2176,8 @@ void quit(void)
compradores_report();
cprint_taipan_comma();
do_you_wish();
- cputs("me to go to:\r\n");
+ // cputs("me to go to:\r\n");
+ print_msg(M_me_to_go_to);
for(choice = 1; choice < 8; ++choice) {
if(choice == 7) crlf();
@@ -2131,7 +2203,8 @@ void quit(void)
if (choice == port)
{
- cputs("\r\n\nYou're already here");
+ // cputs("\r\n\nYou're already here");
+ print_msg(M_already_here);
cprint_taipan_period();
good_joss_sound();
timed_getch();
@@ -2157,10 +2230,11 @@ void quit(void)
num_ships = 9999;
}
cprintulong(num_ships);
- cputs(" hostile ship");
+ // cputs(" hostile ship");
+ print_msg(M_hostile_ship);
if(num_ships != 1) cputc_s();
- // cputs(" approaching, Taipan!\r\n");
- cputs(" approaching");
+ // cputs(" approaching");
+ print_msg(M_approaching);
cprint_taipan_bang();
crlf();
under_attack_sound();
@@ -2178,7 +2252,8 @@ void quit(void)
captains_report();
cprint_li_yuen();
- cputs("'s fleet drove them off!");
+ // cputs("'s fleet drove them off!");
+ print_msg(M_fleet_drove_off);
timed_getch();
}
@@ -2187,9 +2262,9 @@ void quit(void)
{
clear_msg_window();
cprint_li_yuen();
- cputs("'s pirates");
+ // cputs("'s pirates");
+ print_msg(M_s_pirates);
cprint_taipan_bangbang();
- // cputs("\r\n");
crlf();
crlf();
bad_joss_sound();
@@ -2198,7 +2273,8 @@ void quit(void)
if (li > 0)
{
- cputs("Good joss!! They let us be!!\r\n");
+ // cputs("Good joss!! They let us be!!\r\n");
+ print_msg(M_they_let_us_be);
bad_joss_sound();
timed_getch();
@@ -2211,7 +2287,8 @@ void quit(void)
cprintulong(num_ships);
/* "ships" will always be plural (at least 5 of them) */
- cputs(" ships of Li Yuen's pirate\r\nfleet");
+ // cputs(" ships of Li Yuen's pirate\r\nfleet");
+ print_msg(M_ships_of_fleet);
cprint_taipan_bangbang();
under_attack_sound();
timed_getch();
@@ -2234,21 +2311,23 @@ void quit(void)
captains_report();
if (result == 1)
{
- // fancy_numbers(booty, fancy_num);
- cputs("We captured some booty.\r\n"
- "It's worth ");
- // cputs(fancy_num);
+ // cputs("We captured some booty.\r\n"
+ // "It's worth ");
+ print_msg(M_captured_some_booty);
cprintfancy(booty);
cprint_bang();
cash += booty;
good_joss_sound();
} else if (result == 3) {
- cputs("We made it!");
+ // cputs("We made it!");
+ print_msg(M_we_made_it);
good_joss_sound();
} else {
- cputs("The buggers got us");
+ // cputs("The buggers got us");
+ print_msg(M_buggers_got_us);
cprint_taipan_bangbang();
- cputs("!\r\nIt's all over, now!!!");
+ // cputs("!\r\nIt's all over, now!!!");
+ print_msg(M_all_over_now);
timed_getch();
@@ -2261,18 +2340,17 @@ void quit(void)
if(one_chance_in(10)) {
clear_msg_window();
- // gotoxy(0, 18);
- // clrtobot();
- cputs("Storm");
+ // cputs("Storm");
+ print_msg(M_storm);
cprint_taipan_bangbang();
- // cputs("\r\n");
crlf();
crlf();
bad_joss_sound();
timed_getch();
if(one_chance_in(30)) {
- cputs(" I think we're going down!!\r\n\n");
+ // cputs(" I think we're going down!!\r\n\n");
+ print_msg(M_think_going_down);
timed_getch();
// if (((damage / capacity * 3) * ((float) randi() / RAND_MAX)) >= 1)
@@ -2290,9 +2368,9 @@ void quit(void)
sunk = randclamp(3) != 0;
if(sunk) {
- cputs("We're going down");
+ // cputs("We're going down");
+ print_msg(M_were_going_down);
cprint_taipan_bangbang();
- // cputs("\r\n");
crlf();
under_attack_sound();
timed_getch();
@@ -2301,7 +2379,8 @@ void quit(void)
}
}
- cputs(" We made it!!\r\n\n");
+ // cputs(" We made it!!\r\n\n");
+ print_msg(M_storm_we_made_it);
bad_joss_sound();
timed_getch();
@@ -2312,7 +2391,8 @@ void quit(void)
port = randi()%7 + 1;
clear_msg_window();
- cputs("We've been blown off course\r\nto ");
+ // cputs("We've been blown off course\r\nto ");
+ print_msg(M_blown_off_course);
cputs(location[port]);
timed_getch();
}
@@ -2375,9 +2455,8 @@ void quit(void)
set_prices();
clear_msg_window();
- // gotoxy(0, 18);
- // clrtobot();
- cputs("Arriving at ");
+ // cputs("Arriving at ");
+ print_msg(M_arriving_at);
cputs(location[port]);
cputs("...");
timed_getch();
@@ -2409,9 +2488,11 @@ void li_yuen_extortion(void) {
compradores_report();
cprint_li_yuen();
- cputs(" asks ");
+ // cputs(" asks ");
+ print_msg(M_asks);
cprintfancy(amount);
- cputs(" in donation\r\nto the temple of Tin Hau, the Sea\r\nGoddess. Will you pay? ");
+ // cputs(" in donation\r\nto the temple of Tin Hau, the Sea\r\nGoddess. Will you pay? ");
+ print_msg(M_in_donation);
if(yngetc(0) == 'y') {
if(amount <= cash) {
@@ -2419,20 +2500,17 @@ void li_yuen_extortion(void) {
li = 1;
} else {
clear_msg_window();
- // gotoxy(0, 18);
- // clrtobot();
cprint_taipan_comma();
- cputs("you do not have enough cash!!\r\n\n");
+ // cputs("you do not have enough cash!!\r\n\n");
+ print_msg(M_not_enough_cash);
timed_getch();
cprint_Do_you_want();
cprint_elder_brother_wu();
- cputs("to make up\r\nthe difference for you? ");
+ // cputs("to make up\r\nthe difference for you? ");
+ print_msg(M_make_up_difference);
- // clear_msg_window();
- // gotoxy(0, 18);
- // clrtobot();
if(yngetc(0) == 'y') {
clear_msg_window();
amount -= cash;
@@ -2441,18 +2519,25 @@ void li_yuen_extortion(void) {
li = 1;
cprint_elder_brother_wu();
+ /*
cputs("has given Li Yuen the\r\n"
"difference between what he wanted and\r\n"
"your cash on hand and added the same\r\n"
"amount to your debt.\r\n");
+ */
+ print_msg(M_given_the_diff);
} else {
clear_msg_window();
cash = 0;
- cputs("Very well. ");
+ // cputs("Very well. ");
+ print_msg(M_very_well);
cprint_elder_brother_wu();
+ /*
cputs("will not pay\r\n"
"Li Yuen the difference. I would be very\r\n"
"wary of pirates if I were you.");
+ */
+ print_msg(M_will_not_pay);
cprint_taipan_period();
crlf();
}
@@ -2466,11 +2551,10 @@ void li_yuen_extortion(void) {
#ifdef BIGNUM
void you_only_have(unsigned char in_bank) {
clear_msg_window();
- // gotoxy(0, 18);
- // clrtobot();
cprint_taipan_comma();
- cputs("you only have ");
+ // cputs("you only have ");
+ print_msg(M_you_only_have);
if(in_bank)
cprintfancy_big(bank);
else
@@ -2507,7 +2591,8 @@ void elder_brother_wu(void)
unsigned long wu = 0;
compradores_report();
- cputs("Do you have business with Elder Brother\r\nWu, the moneylender? ");
+ // cputs("Do you have business with Elder Brother\r\nWu, the moneylender? ");
+ print_msg(M_do_you_have_biz_with_wu);
for (;;)
{
@@ -2536,19 +2621,25 @@ void elder_brother_wu(void)
for (;;)
{
compradores_report();
+ /*
cputs("Elder Brother is aware of your plight,\r\n"
"Taipan. He is willing to loan you an\r\n"
"additional ");
+ */
+ print_msg(M_aware_of_your_plight);
cprintulong(i);
- cputs(" if you will pay back\r\n");
+ // cputs(" if you will pay back\r\n");
+ print_msg(M_if_you_will_pay_back);
cprintulong(j);
- cputs(". Are you willing");
+ // cputs(". Are you willing");
+ print_msg(M_are_you_willing);
cprint_taipan_prompt();
choice = agetc();
if(choice != 'y') {
compradores_report();
- cputs("Very well, Taipan, the game is over!\r\n");
+ // cputs("Very well, Taipan, the game is over!\r\n");
+ print_msg(M_game_is_over);
under_attack_sound();
timed_getch();
@@ -2560,7 +2651,8 @@ void elder_brother_wu(void)
port_stats();
compradores_report();
- cputs("Very well, Taipan. Good joss!!\r\n");
+ // cputs("Very well, Taipan. Good joss!!\r\n");
+ print_msg(M_very_well_good_joss);
bad_joss_sound();
timed_getch();
@@ -2574,7 +2666,8 @@ void elder_brother_wu(void)
compradores_report();
how_much();
do_you_wish();
- cputs("to repay\r\nhim? ");
+ // cputs("to repay\r\nhim? ");
+ print_msg(M_to_repay_him);
wu = get_num();
if(wu == UINT32_MAX)
@@ -2607,7 +2700,8 @@ void elder_brother_wu(void)
compradores_report();
how_much();
do_you_wish();
- cputs("to \r\nborrow? ");
+ // cputs("to \r\nborrow? ");
+ print_msg(M_to_borrow);
wu = get_num();
@@ -2622,7 +2716,8 @@ void elder_brother_wu(void)
debt += wu;
break;
} else {
- cputs("\r\n\nHe won't loan you so much");
+ // cputs("\r\n\nHe won't loan you so much");
+ print_msg(M_wont_loan);
cprint_taipan_bang();
good_joss_sound();
timed_getch();
@@ -2646,9 +2741,12 @@ void elder_brother_wu(void)
compradores_report();
cprint_bad_joss();
cprintulong(num);
+ /*
cputs(" of your bodyguards have been killed\r\n"
"by cutthroats and you have been robbed\r\n"
"of all of your cash");
+ */
+ print_msg(M_bodyguards_killed);
cprint_taipan_bangbang();
crlf();
under_attack_sound();
@@ -2663,21 +2761,25 @@ void good_prices(void) {
unsigned char i = randi()%4;
compradores_report();
- cprint_taipan_bangbang();
- cputs(" The price of ");
+ cprint_taipan();
+ // cputs("!! The price of ");
+ print_msg(M_the_price_of);
cputs(item[i]);
cputs("\r\n has ");
if(randi()&1) {
price[i] *= (randi()%5 + 5);
- cputs("risen");
+ // cputs("risen");
+ print_msg(M_risen);
} else {
price[i] /= 5;
/* somehow general cargo dropped to 0 once. stop it. */
if(price[i] < 1) price[i] = 1;
- cputs("dropped");
+ // cputs("dropped");
+ print_msg(M_dropped);
}
- cputs(" to ");
+ // cputs(" to ");
+ print_msg(M_spc_to_spc);
cprintulong(price[i]);
cputs("!!\r\n");
@@ -2693,7 +2795,8 @@ int port_choices(void) {
compradores_report();
cprint_taipan_comma();
- cputs("present prices per unit here are"); /* NB: exactly 40 cols */
+ // cputs("present prices per unit here are"); /* NB: exactly 40 cols */
+ print_msg(M_prices_here_are);
// ===> free code space $0f7b (3936, 3.9K)
// saves 46 bytes:
@@ -2754,16 +2857,19 @@ int port_choices(void) {
retire_ok = (port == 1 && ((cash + bank) >= 1000000L));
#endif
- cputs("Shall I Buy, Sell, ");
+ // cputs("Shall I Buy, Sell, ");
+ print_msg(M_shall_i_buy_sell);
if(port == 1)
- cputs("Visit bank, Transfer\r\ncargo, ");
+ // cputs("Visit bank, Transfer\r\ncargo, ");
+ print_msg(M_bank_transfer);
if(!retire_ok) cputs("or ");
cputs("Quit trading");
- if(retire_ok) cputs(", or Retire");
+ // if(retire_ok) cputs(", or Retire");
+ if(retire_ok) print_msg(M_or_retire);
cprint_question_space();
for(;;) {
@@ -2825,7 +2931,8 @@ void name_firm(void) {
cprint_pipe();
print_bar_line();
cprint_pipe();
- cputs(" What will you name your");
+ // cputs(" What will you name your");
+ print_msg(M_what_will_you_name_firm);
cspaces(14);
cprint_pipe();
print_bar_line();
@@ -2908,15 +3015,18 @@ void buy(void) {
afford = cash / price[choice];
rvs_on();
- cputs(" You can ");
+ // cputs(" You can ");
+ print_msg(M_spc_you_can_spc);
rvs_off();
gotoxy(0, 22);
how_much();
cputs(item[choice]);
- cputs(" shall");
+ // cputs(" shall");
+ print_msg(M_spc_shall);
gotoxy(31, 22);
rvs_on();
- cputs(" afford ");
+ // cputs(" afford ");
+ print_msg(M_spc_afford);
gotoxy(31, 23);
// cspaces(9);
// gotoxy(31, 23);
@@ -2931,7 +3041,8 @@ void buy(void) {
rvs_off();
gotoxy(0, 23);
- cputs("I buy, ");
+ // cputs("I buy, ");
+ print_msg(M_i_buy);
cprint_taipan_colon();
amount = get_num();
@@ -2962,7 +3073,8 @@ void sell(void) {
how_much();
cputs(item[choice]);
- cputs(" shall\r\nI sell, ");
+ // cputs(" shall\r\nI sell, ");
+ print_msg(M_shall_i_sell);
cprint_taipan_colon();
amount = get_num();
@@ -2994,9 +3106,11 @@ char would_overflow(unsigned long a, unsigned long b) {
void too_much_cash(void) {
clear_msg_window();
- cputs("\r\nYou cannot carry so much cash");
+ // cputs("\r\nYou cannot carry so much cash");
+ print_msg(M_too_much_cash);
cprint_taipan_bang();
- cputs("\r\nYour ship would sink under the weight\r\nof your riches.\r\n");
+ // cputs("\r\nYour ship would sink under the weight\r\nof your riches.\r\n");
+ print_msg(M_ship_would_sink);
bad_joss_sound();
timed_getch();
}
@@ -3014,7 +3128,8 @@ void visit_bank(void)
{
compradores_report();
how_much_will_you();
- cputs("deposit? ");
+ // cputs("deposit? ");
+ print_msg(M_deposit);
amount = get_num();
if (amount == UINT32_MAX)
@@ -3041,7 +3156,8 @@ void visit_bank(void)
{
compradores_report();
how_much_will_you();
- cputs("withdraw? ");
+ // cputs("withdraw? ");
+ print_msg(M_withdraw);
amount = get_num();
#ifdef BIGNUM
@@ -3160,18 +3276,21 @@ int main(void) {
wu_assassin = 0;
compradores_report();
cprint_taipan_comma();
- cputs("you have been assassinated!");
+ // cputs("you have been assassinated!");
+ print_msg(M_assassinated_1);
under_attack_sound();
timed_getch();
compradores_report();
- cputs("As the masked figure plunges the blade\r\n"
- "into your heart, he says:\r\n");
+ // cputs("As the masked figure plunges the blade\r\n"
+ // "into your heart, he says:\r\n");
+ print_msg(M_assassinated_2);
timed_getch();
compradores_report();
cprint_elder_brother_wu();
- cputs("regrets to inform you\r\n"
- "that your account has been terminated\r\n"
- "with extreme prejudice.");
+ // cputs("regrets to inform you\r\n"
+ // "that your account has been terminated\r\n"
+ // "with extreme prejudice.");
+ print_msg(M_assassinated_3);
timed_getch();
final_stats();
}
@@ -3188,9 +3307,11 @@ int main(void) {
compradores_report();
cprint_elder_brother_wu();
- cputs("has sent ");
+ // cputs("has sent ");
+ print_msg(M_has_sent);
cprintulong(braves);
- cputs(" braves\r\nto escort you to the Wu mansion");
+ // cputs(" braves\r\nto escort you to the Wu mansion");
+ print_msg(M_braves_to_escort);
cprint_taipan_period();
crlf();
@@ -3198,17 +3319,23 @@ int main(void) {
clear_msg_window();
cprint_elder_brother_wu();
+ /*
cputs("reminds you of the\r\n"
"Confucian ideal of personal worthiness,\r\n"
"and how this applies to paying one's\r\ndebts.\r\n");
+ */
+ print_msg(M_wu_warn_1);
timed_getch();
clear_msg_window();
+ /*
cputs("He is reminded of a fabled barbarian\r\n"
"who came to a bad end, after not caring\r\n"
"for his obligations.\r\n\n"
"He hopes no such fate awaits you, his\r\nfriend");
+ */
+ print_msg(M_wu_warn_2);
cprint_taipan_period();
crlf();
@@ -3240,16 +3367,13 @@ int main(void) {
port_stats();
- // fancy_numbers(fine, fancy_num);
compradores_report();
- // cputs("Bad Joss!!\r\n");
cprint_bad_joss();
- cputs("The local authorities have seized your\r\n"
- "Opium cargo and have also fined you\r\n");
- // cputs(fancy_num);
+ // cputs("The local authorities have seized your\r\n"
+ // "Opium cargo and have also fined you\r\n");
+ print_msg(M_siezed_opium);
cprintfancy(fine);
cprint_taipan_bang();
- // cputs("\r\n");
crlf();
timed_getch();
@@ -3270,9 +3394,9 @@ int main(void) {
port_stats();
compradores_report();
- cputs("Messenger reports large theft\r\nfrom warehouse");
+ // cputs("Messenger reports large theft\r\nfrom warehouse");
+ print_msg(M_whouse_theft);
cprint_taipan_period();
- // cputs("\r\n");
crlf();
timed_getch();
@@ -3286,9 +3410,12 @@ int main(void) {
if((port != 1) && (li == 0) && (!one_chance_in(4))) {
compradores_report();
cprint_li_yuen();
+ /*
cputs(" has sent a Lieutenant,\r\n"
"Taipan. He says his admiral wishes\r\n"
"to see you in Hong Kong, posthaste!\r\n");
+ */
+ print_msg(M_has_sent_lieutenant);
bad_joss_sound();
timed_getch();
}
@@ -3306,9 +3433,11 @@ int main(void) {
compradores_report();
cprint_bad_joss();
- cputs("You've been beaten up and\r\nrobbed of ");
+ // cputs("You've been beaten up and\r\nrobbed of ");
+ print_msg(M_beaten_robbed);
cprintfancy(robbed);
- cputs(" in cash");
+ // cputs(" in cash");
+ print_msg(M_in_cash);
cprint_taipan_bangbang();
crlf();
under_attack_sound();