From 2d2512ea768b42b539ba75764aa6a3a4ed1669cc Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Thu, 7 Jan 2016 01:38:31 -0500 Subject: tracking down damage bug --- help.txt | 6 +++--- taipan.c | 13 +++++++++++++ 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/help.txt b/help.txt index 583833e..0b6f204 100644 --- a/help.txt +++ b/help.txt @@ -1,3 +1,3 @@ -\B:Change BG Color \E\s\c = more -\T:Change Text Color \E\s\c = more -\A\n\y other key: Start \E\s\c = more +\B:Change BG Color \E\s\c:more +\T:Change Text Color \E\s\c:more +\A\n\y other key: Start \E\s\c:more diff --git a/taipan.c b/taipan.c index 3200ef2..8722400 100644 --- a/taipan.c +++ b/taipan.c @@ -22,6 +22,9 @@ 1000 capacity, 20 guns, and 1 billion cash and bank. */ // #define TIMEWARP +/* define this to start the game in a 99% damaged ship */ +// #define ALMOST_DEAD + /**** atari-specific stuff */ /* values returned by cgetc() for backspace & enter keys */ @@ -520,10 +523,15 @@ int sea_battle(int id, int num_ships) { fight_stats(num_ships, orders); while(num_ships > 0) { + if(damage >= capacity) return 4; + status = 100L - ((damage * 100L / capacity)); + /* // I think this is a problem: if(status <= 0) { return 4; } + */ + flushinp(); gotoxy(0, 3); clrtoeol(); @@ -1179,6 +1187,8 @@ void cash_or_guns(void) } cputc(choice); + capacity = 60; + damage = 0; if (choice == '1') { cash = 400; @@ -1207,6 +1217,9 @@ void cash_or_guns(void) guns = 5; li = 1; bp = 7; +#endif +#ifdef ALMOST_DEAD + damage = capacity - 1; #endif } -- cgit v1.2.3