From f5fef317262c4ef87f92f5e214a6c4ec2bb0d10a Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 14 Jul 2018 14:57:19 -0400 Subject: [PATCH] tfv: add ending sequence --- gr-sim/tfv/Makefile | 7 +++- gr-sim/tfv/README.references | 21 +++++++--- gr-sim/tfv/tfv_definitions.h | 2 + gr-sim/tfv/tfv_ending.c | 75 ++++++++++++++++++++++++++++++++++++ gr-sim/tfv/tfv_worldmap.c | 25 +++++++++--- 5 files changed, 118 insertions(+), 12 deletions(-) create mode 100644 gr-sim/tfv/tfv_ending.c diff --git a/gr-sim/tfv/Makefile b/gr-sim/tfv/Makefile index 6db0a009..096f7c06 100644 --- a/gr-sim/tfv/Makefile +++ b/gr-sim/tfv/Makefile @@ -85,6 +85,9 @@ tfv_credits.o: tfv_credits.c tfv_dialog.o: tfv_dialog.c $(CC) $(CFLAGS) -c tfv_dialog.c +tfv_ending.o: tfv_ending.c + $(CC) $(CFLAGS) -c tfv_ending.c + tfv_flying.o: tfv_flying.c tfv_flying_fixed.c tfv_flying_float.c tfv_flying_6502.c $(CC) $(CFLAGS) -c tfv_flying.c @@ -127,14 +130,14 @@ tfv.o: tfv.c ../gr-sim.h tfv_backgrounds.h tfv_sprites.h $(CC) $(CFLAGS) -c tfv.c tfv: tfv.o tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \ - tfv_flying.o \ + tfv_ending.o tfv_flying.o \ tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \ tfv_opener.o tfv_sprites.o tfv_textentry.o \ tfv_title.o tfv_worldmap.o tfv_mapinfo.h \ $(GR_SIM) $(CC) $(LFLAGS) $(SDL_LIBS) -o tfv tfv.o \ tfv_backgrounds.o tfv_battle.o tfv_credits.o tfv_dialog.o \ - tfv_flying.o \ + tfv_ending.o tfv_flying.o \ tfv_game_over.o tfv_help.o tfv_info.o tfv_map.o \ tfv_opener.o tfv_sprites.o tfv_textentry.o \ tfv_title.o tfv_worldmap.o \ diff --git a/gr-sim/tfv/README.references b/gr-sim/tfv/README.references index 1bcfbafb..8a58fc50 100644 --- a/gr-sim/tfv/README.references +++ b/gr-sim/tfv/README.references @@ -39,11 +39,6 @@ Talbot Hall Kenjesu was Pete's roommate. That's a stuffed tiger by his feet, not an actual cat. - Metrocat was a gnomic cat who made the front page of the - Washington Post metro section. We ran him for head of the UM - Student Government twice. He lost both times, and after the - second they banned write-in candidates. - Mathemagician is a famous college professor now. Darth Tater is spouting some poetry we wrote in a misguided @@ -252,6 +247,21 @@ Susie the Guinea Pig California and back by car, as well as to Canada at least twice. +Summons: + + Metrocat was a gnomic cat who made the front page of the + Washington Post metro section. We ran him for head of the UM + Student Government twice. He lost both times, and after the + second they banned write-in candidates. + + We actually did build a Vortex Cannon. There were directions + on how to build one in the kids section of the Washington Post. + It required a large cereal box. As a joke I asked random people + in my EE classes if they had a giant cereal box I could use, and + to my surprise a few days later one of my classmates brought in + a giant Honeycombs box. You cut a circle in the proper place, + and indeed you could shoot air vortices across the room at people. + Other interesting things that I can't figure out how to fit into the game. Freshman Steve / Freshman Jenny -- people with duplicate names @@ -270,3 +280,4 @@ Other interesting things that I can't figure out how to fit into the game. on the enterprise, my brief part was to report the destruction of the language lab before dying (I was wearing a red shirt of course). + diff --git a/gr-sim/tfv/tfv_definitions.h b/gr-sim/tfv/tfv_definitions.h index 11bd1ac8..48ac5e5d 100644 --- a/gr-sim/tfv/tfv_definitions.h +++ b/gr-sim/tfv/tfv_definitions.h @@ -27,6 +27,8 @@ int name_screen(void); int do_battle(int background); +int do_ending(void); + int world_map(void); int city_map(void); diff --git a/gr-sim/tfv/tfv_ending.c b/gr-sim/tfv/tfv_ending.c new file mode 100644 index 00000000..563a13bc --- /dev/null +++ b/gr-sim/tfv/tfv_ending.c @@ -0,0 +1,75 @@ +#include +#include +#include +#include + +#include + +#include "gr-sim.h" +#include "tfv_utils.h" +#include "tfv_zp.h" +#include "tfv_defines.h" +#include "tfv_definitions.h" + +#include "tfv_sprites.h" +#include "tfv_backgrounds.h" + + +int do_ending(void) { + + int i; + int saved_drawpage; + +// boss_battle(); + + saved_drawpage=ram[DRAW_PAGE]; + + grsim_unrle(harfco_rle,0xc00); + + ram[DRAW_PAGE]=PAGE0; + clear_bottom(); + ram[DRAW_PAGE]=PAGE1; + clear_bottom(); + + ram[DRAW_PAGE]=saved_drawpage; + + gr_copy_to_current(0xc00); + page_flip(); + + for(i=0;i<10;i++) { + usleep(100000); + } + + for(i=0;i<20;i++) { + gr_copy_to_current(0xc00); + color_equals(COLOR_AQUA); + vlin(20-i,20,21); + page_flip(); + + usleep(50000); + } + for(i=0;i<30;i+=2) { + gr_copy_to_current(0xc00); + color_equals(COLOR_YELLOW); + hlin_double(ram[DRAW_PAGE],0,39,0); + if (i>2) hlin_double(ram[DRAW_PAGE],0,39,2); + if (i>4) hlin_double(ram[DRAW_PAGE],0,39,4); + if (i>6) hlin_double(ram[DRAW_PAGE],0,39,6); + if (i>8) hlin_double(ram[DRAW_PAGE],0,39,8); + page_flip(); + + usleep(100000); + } + + gr_copy_to_current(0xc00); + ram[CH]=13; + ram[CV]=21; + move_and_print("YOU HAVE WON!!"); + page_flip(); + + usleep(3400000); + + credits(); + + return 0; +} diff --git a/gr-sim/tfv/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c index cff9585b..f62eeb68 100644 --- a/gr-sim/tfv/tfv_worldmap.c +++ b/gr-sim/tfv/tfv_worldmap.c @@ -229,17 +229,32 @@ int world_map(void) { } } - if (ch=='h') print_help(); - if (ch=='b') { - do_battle(map_info[map_location].ground_color); - refresh=1; + if (ch=='h') { + print_help(); } - if (ch=='i') print_info(); + if (ch=='i') { + print_info(); + } + if (ch=='m') { show_map(); refresh=1; } + + /* debugging routines */ + if (ch=='b') { + do_battle(map_info[map_location].ground_color); + refresh=1; + } + + if (ch=='e') { + do_ending(); + refresh=1; + } + + + /* Handle entry to a new area */ if (entry) { printf("Entering!\n");