From 45083e66657bed6167e7513d599581b0517bbf81 Mon Sep 17 00:00:00 2001 From: Franklin Wei Date: Tue, 24 Jun 2014 10:21:04 -0400 Subject: EVEN MORE BUGFIXES, FEATURES! Maybe I should actually start writing good commit messages :) --- MAP | 2 +- games.c | 13 +++++++++++-- joshua.c | 4 ++-- location.h | 5 +++-- map.h | 2 +- strings.h | 2 +- util.h | 2 +- 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/MAP b/MAP index 0053ed3..d0beda8 100644 --- a/MAP +++ b/MAP @@ -6,7 +6,7 @@ | / _/ _/\/. |. | _/. __ __/ \. /. / ___/.// - \__ / | / \/. + \__ / | / \/. \________ __ _____.\. \_. ____--_ /\_ \ \__. / V. \ \ \__ _/. \_/ // \ /. \/. \. _/. // diff --git a/games.c b/games.c index a4234ce..41973e6 100644 --- a/games.c +++ b/games.c @@ -65,8 +65,17 @@ void global_thermonuclear_war(void) remove_punct(response); if(strcmp(response, "yes")==0 || strcmp(response, "y")==0) { - targets[num_targets_found]=world[j]; - ++num_targets_found; + print_string("\n\nATTEMPTING TO FIRE AT OWN CITY.\nARE YOU SURE (YES OR NO): "); + response[0]=0; + getnstr(response, 16); + allLower(response); + remove_punct(response); + if(strcmp(response, "yes")==0 || strcmp(response, "y")==0) + { + print_string("\nTARGET CONFIRMED.\n\n"); + targets[num_targets_found]=world[j]; + ++num_targets_found; + } } } } diff --git a/joshua.c b/joshua.c index 33fceb8..65b2818 100644 --- a/joshua.c +++ b/joshua.c @@ -48,7 +48,7 @@ void be_joshua() int ret=getnstr(buf, 32); allLower(buf); usleep(SLEEP_TIME*100); - if(strcmp(buf, "help logon")==0) + if(strcmp(buf, "help logon")==0 && !gamesPhase) { print_string("\nHELP NOT AVAILABLE\n\n\n"); } @@ -57,7 +57,7 @@ void be_joshua() print_string("\n'GAMES' REFERS TO MODELS, SIMULATIONS AND GAMES\nWHICH HAVE TACTICAL AND STRATEGIC APPLICATIONS.\n\n\n"); gamesPhase=true; } - else if(strcmp(buf, "list games")==0) + else if(strcmp(buf, "list games")==0 && gamesPhase) { print_string("\nFALKEN'S MAZE\nBLACK JACK\nGIN RUMMY\nHEARTS\nBRIDGE\nCHECKERS\nCHESS\nPOKER\nFIGHTER COMBAT\nGUERRILLA ENGAGEMENT\nDESERT WARFARE\nAIR-TO-GROUND ACTIONS\nTHEATERWIDE TACTICAL WARFARE\nTHEATERWIDE BIOTOXIC AND CHEMICAL WARFARE\n\nGLOBAL THERMONUCLEAR WAR\n\n\n"); } diff --git a/location.h b/location.h index 974da64..fc72b16 100644 --- a/location.h +++ b/location.h @@ -17,11 +17,12 @@ struct location_t world[]={ {"winston-salem", 30, 7, USA}, {"san francisco", 1, 6, USA}, {"chicago", 24, 4, USA}, - {"miami", 32, 11, USA}, + {"miami", 33, 11, USA}, /* Soviet cities */ - /* NOTE: These are not neccessarily correct. I simply eyed them relative to Murmansk */ + /* NOTE: These cities are not accurate! */ {"murmansk", 74, 1, USSR}, {"moscow", 70, 5, USSR}, {"minsk", 66, 4, USSR}, + {"chelyabinsk", 64, 8, USSR} }; diff --git a/map.h b/map.h index 3fb4d63..dddaca6 100644 --- a/map.h +++ b/map.h @@ -8,7 +8,7 @@ char *map[] = { /* 5 */ (char[]){"| / _/ _/\\/."}, /* 6 */ (char[]){"|. | _/. __ __/"}, /* 7 */ (char[]){" \\. /. / ___/.//"}, - /* 8 */ (char[]){" \\__ / | / \\/."}, + /* 8 */ (char[]){" \\__ / | / \\/."}, /* 9 */ (char[]){" \\________ __ _____.\\. \\_. ____--_ /\\_ \\"}, /* 10 */ (char[]){" \\__. / V. \\ \\ \\__ _/. \\_/ //"}, /* 11 */ (char[]){" \\ /. \\/. \\. _/. //"}, diff --git a/strings.h b/strings.h index 411a5c4..d7ae734 100644 --- a/strings.h +++ b/strings.h @@ -4,7 +4,7 @@ const char* stage1_triggers[5]; const char* stage2_triggers[6]; const char* stage3_triggers[4]; const char* stage4_triggers[7]; -const char* tictactoe_triggers[]; +const char* tictactoe_triggers[8]; const char punctuation_marks[9]; const char* exit_triggers[6]; const char* exit_responses[4]; diff --git a/util.h b/util.h index 3070d39..63409fa 100644 --- a/util.h +++ b/util.h @@ -1,4 +1,4 @@ -#define SLEEP_TIME 10000 +#define SLEEP_TIME 0 void allLower(char*); void print_string(const char*); void remove_punct(char*); -- cgit v1.1