From 0313f01f8c992fb611295f13919f061d72548ff2 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 22 Jun 2018 15:22:05 -0400 Subject: [PATCH] tfv: remember location when we enter buildings --- gr-sim/tfv/TODO | 15 ++++++++++++++ gr-sim/tfv/tfv.game_data | 15 ++++++++++---- gr-sim/tfv/tfv_backgrounds.c | 39 +++++++++++++++++------------------ gr-sim/tfv/tfv_defines.h | 5 +++++ gr-sim/tfv/tfv_mapinfo.h | 29 +++++++++++--------------- gr-sim/tfv/tfv_worldmap.c | 31 ++++++++++++++++++++++++++-- tfv/art/math_office.png | Bin 403 -> 402 bytes 7 files changed, 91 insertions(+), 43 deletions(-) create mode 100644 gr-sim/tfv/TODO diff --git a/gr-sim/tfv/TODO b/gr-sim/tfv/TODO new file mode 100644 index 00000000..497c1c30 --- /dev/null +++ b/gr-sim/tfv/TODO @@ -0,0 +1,15 @@ +Soon: ++ Enable getting back on spaceship ++ Better collision detection on Spaceship land ++ Better collision detection/walk on+off in College Park ++ Hook up art for all possible locations ++ Working conversation ++ Riding animals ++ Battle ++ End sequence + +Not soon: + ++ Play as either DEATER or FROGGY ++ Allow spaceship to land on arbitrary grass space ++ Toggle lowercase/uppercase text diff --git a/gr-sim/tfv/tfv.game_data b/gr-sim/tfv/tfv.game_data index 5cb45e33..2d068936 100644 --- a/gr-sim/tfv/tfv.game_data +++ b/gr-sim/tfv/tfv.game_data @@ -1,5 +1,9 @@ INCLUDE: 5 tents. Can use to heal. Sky goes black while sleeping? +Ride giant bird. Giant guinea pig? +Enter on map with animal, gets off, they run away. + + ITEMS CUPCAKE // cafeteria lady CARROT // capabara @@ -27,7 +31,6 @@ CLASS RING // COLLEGE PARK TALBOT HALL - Have spool be ground scatter? LIZ+WILL LET'S DISCUSS COOL THINGS IN THE LOUNGE --> YES! @@ -67,13 +70,17 @@ METRO STATION TINY CAPABARA GRONK GIANT GUINEA PIG - SQUEAK + SQUEAK? + -> YES + -> NO LARGE BIRD - WARK + WARK? + -> YES + -> NO FOUNTAIN -- drink from it restore heatlh? MERMAID - Did ye put bubbles in fountain? + Did ye put bubbles in yon fountain? diff --git a/gr-sim/tfv/tfv_backgrounds.c b/gr-sim/tfv/tfv_backgrounds.c index 613922f6..64e624ac 100644 --- a/gr-sim/tfv/tfv_backgrounds.c +++ b/gr-sim/tfv/tfv_backgrounds.c @@ -154,27 +154,26 @@ unsigned char math_office_rle[]={ 0x44,0x4F,0x44,0xFF,0x44,0x4F,0x44, 0xFF,0x44,0x4F,0xFF,0xA0,0x19,0x00,0x44,0x4F,0x4F, 0xA4,0x44,0x4F,0xA3,0x44,0x4F,0x44,0x44,0x4F,0xA0,0x19,0x00, - 0xAF,0x44,0x00,0x00,0x88,0xB8,0xA7,0x00,0x80,0x80,0xA7,0x00, - 0xB8,0x88,0x00,0x00,0x0A,0xAF,0x07,0x00,0x00,0x88, - 0xBB,0x0B,0xA6,0x00,0x88,0xBB,0xB0,0xA5,0x00, + 0xAF,0x44,0xAB,0x00,0x80,0x80,0xA7,0x00,0xB8,0x88,0x00,0x00, + 0x0A,0xAF,0x07,0xAB,0x00,0x88,0xBB,0xB0,0xA5,0x00, 0x0B,0xBB,0x88,0xA4,0x00,0xB8,0x88,0xAE,0x00, - 0x88,0xA8,0x00,0x88,0xFB,0xA7,0x00,0x2B,0xA4,0x00, - 0x0B,0xBB,0x88,0xAE,0x00,0x77,0xFF,0xA7,0x00, - 0xF8,0xFF,0xF0,0xA5,0x00,0x44,0x22,0xA5,0x00, - 0xFF,0x08,0x80,0xAD,0x00,0xF7,0xF7,0x0B,0xA6,0x00, - 0x7F,0x11,0x7F,0xA4,0x70,0x11,0x74,0x72, - 0xA3,0x70,0x11,0x7F,0x7F,0xA6,0x70,0xA9,0x00,0x4F,0x4F,0xA5,0x00, - 0x70,0x77,0x77,0x71,0xA5,0x77,0x71,0xA5,0x77,0x71, - 0xA6,0x77,0x57,0x55,0xA9,0x00,0x44,0x44,0xA4,0x00,0xA0,0x16,0x57, - 0x55,0x05,0x55,0xA8,0x00,0x04,0x04,0xB4,0x04, - 0xA3,0x00,0x55,0x05,0x05,0x55,0x05,0xB5,0xA4,0x05, - 0xD5,0xA5,0x05,0xB5,0xA4,0x05,0x55,0x00,0x00,0x55, - 0xAA,0x00,0xBB,0xA4,0x00,0x55,0x00,0x00,0x55,0x00, - 0x08,0x08,0x00,0x00,0x08,0x08,0xA4,0x00,0x08,0x08,0xA4,0x00,0x55, - 0x00,0x00,0x55,0xAA,0x00,0x8B,0x80,0xA3,0x00,0x55, - 0x00,0x00,0x55,0xA0,0x11,0x00,0x55,0x00,0x00,0x55,0xAA,0x00, - 0x08,0x08,0xA3,0x00,0x55,0x00,0x00,0x05,0xA0,0x11,0x00,0x55, - 0x00,0x00,0x05,0xAF,0x00,0x55,0xA0,0x14,0x00,0x55,0xA0,0x82,0x00,0xA1, }; + 0x88,0xB8,0xA7,0x00,0x88,0xFB,0xA7,0x00,0x2B, + 0xA4,0x00,0x0B,0xBB,0x88,0xAE,0x00,0x88,0xBB, + 0x0B,0xA6,0x00,0xF8,0xFF,0xF0,0xA5,0x00,0x44, + 0x22,0xA5,0x00,0xFF,0x08,0x80,0xAD,0x00,0x88, + 0xF0,0xA7,0x00,0x7F,0x11,0x7F,0xA4,0x70,0x11, + 0x74,0x72,0xA3,0x70,0x11,0x7F,0x7F,0xA6,0x70,0xA9,0x00, + 0x77,0x7F,0xB0,0xA4,0x00,0x70,0x77,0x77,0x71, + 0xA5,0x77,0x71,0xA5,0x77,0x71,0xA6,0x77,0x57,0x55, + 0xA9,0x00,0x4F,0x4F,0xA4,0x00,0xA0,0x16,0x57,0x55,0x05,0x55, + 0xA8,0x00,0x04,0xB4,0x04,0x04,0xA3,0x00,0x55,0x05,0x05, + 0x55,0x05,0xB5,0xA4,0x05,0xD5,0xA5,0x05,0xB5, + 0xA4,0x05,0x55,0x00,0x00,0x55,0xA9,0x00,0x8F,0x80, + 0xA4,0x00,0x55,0x00,0x00,0x55,0x00,0x08,0x08,0x00,0x00, + 0x08,0x08,0xA4,0x00,0x08,0x08,0xA4,0x00,0x55,0x00,0x00,0x55, + 0xAF,0x00,0x55,0x00,0x00,0x55,0xA0,0x11,0x00,0x55,0x00,0x00, + 0x55,0xAF,0x00,0x55,0xA0,0x14,0x00,0x55,0xA0,0x12,0x00,0x05, + 0xA0,0x14,0x00,0x05,0xA0,0x82,0x00,0xA1, }; unsigned char video_hr_rle[]={ 0x28, /* ysize=40 */ 0xA0,0x20,0x00,0x77,0xA6,0x57,0x77,0xA0,0x20,0x00,0x77,0x55,0x55, diff --git a/gr-sim/tfv/tfv_defines.h b/gr-sim/tfv/tfv_defines.h index 21046b67..7c4469a6 100644 --- a/gr-sim/tfv/tfv_defines.h +++ b/gr-sim/tfv/tfv_defines.h @@ -48,6 +48,7 @@ #define LOCATION_PLACE 0 #define LOCATION_CONVERSATION 1 +#define LOCATION_SPACESHIP 2 struct location_type { char *name; @@ -83,6 +84,9 @@ struct location_type { #define ENTRY_MINY 0x20 #define ENTRY_MAXY 0x40 +#define EXIT_NORMAL 0x00 +#define EXIT_HIGH 0x01 +#define EXIT_R_OR_L 0x02 @@ -97,6 +101,7 @@ struct map_info_type { int scatter; int scatter_x,scatter_y,scatter_cutoff; int entry_type,entry_x,entry_y; + int saved_x,saved_y; unsigned char *background_image; }; diff --git a/gr-sim/tfv/tfv_mapinfo.h b/gr-sim/tfv/tfv_mapinfo.h index 6d2b8bd0..ac9f823e 100644 --- a/gr-sim/tfv/tfv_mapinfo.h +++ b/gr-sim/tfv/tfv_mapinfo.h @@ -88,7 +88,7 @@ struct map_info_type map_info[33] = { .scatter=SCATTER_PINE, .scatter_x=25, .scatter_y=16, .scatter_cutoff=15, .land_type=LAND_LEFT_BEACH, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MINX, .entry_x=11, .entry_y=0, .background_image=NULL, }, [LANDING_SITE]={ // 5: LANDING_SITE @@ -129,7 +129,7 @@ struct map_info_type map_info[33] = { .miny=4, .scatter=SCATTER_NONE, .land_type=LAND_FOREST|LAND_RIGHT_BEACH, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MAXX, .entry_x=27, .entry_y=0, .background_image=NULL, }, [PALM_BEACH]={ // 8: PALM_BEACH @@ -143,7 +143,7 @@ struct map_info_type map_info[33] = { .scatter=SCATTER_PALM, .scatter_x=10, .scatter_y=20, .scatter_cutoff=22, .land_type=LAND_LEFT_BEACH, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MINX, .entry_x=11, .entry_y=0, .background_image=NULL, }, [GRASSLAND]={ // 9: GRASSLAND @@ -182,7 +182,7 @@ struct map_info_type map_info[33] = { .miny=4, .scatter=SCATTER_NONE, .land_type=LAND_FOREST|LAND_RIGHT_BEACH, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MAXX, .entry_x=27, .entry_y=0, .background_image=NULL, }, [SOUTH_BEACH]={ // 12: SOUTH_BEACH @@ -196,7 +196,7 @@ struct map_info_type map_info[33] = { .scatter=SCATTER_PALM, .scatter_x=20, .scatter_y=20, .scatter_cutoff=22, .land_type=LAND_LEFT_BEACH|LAND_SOUTHSHORE, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MINX, .entry_x=11, .entry_y=0, .background_image=NULL, }, [CACTUS_RANCH]={ // 13: CACTUS_RANCH @@ -248,16 +248,16 @@ struct map_info_type map_info[33] = { .miny=4, .scatter=SCATTER_NONE, .land_type=LAND_RIGHT_BEACH|LAND_SOUTHSHORE, - .entry_type=ENTRY_NORMAL, .entry_x=0, .entry_y=0, + .entry_type=ENTRY_MAXX, .entry_x=27, .entry_y=0, .background_image=NULL, }, [U_OF_MD]={ // 16: U of MD .name="University of M", .ground_color=(COLOR_LIGHTGREEN|(COLOR_LIGHTGREEN<<4)), .n_exit=NOEXIT, - .s_exit=NOEXIT, + .s_exit=COLLEGE_PARK, .e_exit=COLLEGE_PARK, - .w_exit=COLLEGE_PARK, + .w_exit=NOEXIT, .miny=4, .scatter=SCATTER_NONE, .land_type=LAND_BORING, @@ -500,8 +500,8 @@ struct map_info_type map_info[33] = { .ground_color=(COLOR_DARKGREEN|(COLOR_DARKGREEN<<4)), .n_exit=NOEXIT, .s_exit=BEL_AIR, - .e_exit=NOEXIT, - .w_exit=NOEXIT, + .e_exit=BEL_AIR, + .w_exit=BEL_AIR, .miny=4, .scatter=SCATTER_NONE, .entry_type=ENTRY_CENTER, .entry_x=0, .entry_y=0, @@ -677,15 +677,8 @@ struct map_info_type map_info[33] = { #if 0 - video_hr_rle: - "GUS", - "RAISTLIN", - "FORD", - "SISTER SCARYNUN", - calculs_rle: team I-1 - PADRINO JENNI MR. APPLEBY KATHY @@ -707,6 +700,8 @@ struct map_info_type map_info[33] = { patriot_room: agent N + PADRINO + #endif diff --git a/gr-sim/tfv/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c index d6fe8667..e7db18f1 100644 --- a/gr-sim/tfv/tfv_worldmap.c +++ b/gr-sim/tfv/tfv_worldmap.c @@ -193,10 +193,13 @@ int world_map(void) { if (ch==13) { if (special_destination!=NOEXIT) { + map_info[map_location].saved_x=tfv_x; + map_info[map_location].saved_y=tfv_y; + map_location=special_destination; + entry=1; + refresh=1; } - entry=1; - refresh=1; } if (ch=='h') print_help(); @@ -213,6 +216,17 @@ int world_map(void) { /* Handle entry to a new area */ if (entry) { printf("Entering!\n"); + + /* Y can never be 0 by accident */ + if (map_info[map_location].saved_y) { + newx=map_info[map_location].saved_x; + newy=map_info[map_location].saved_y; + map_info[map_location].saved_x=0; + map_info[map_location].saved_y=0; + goto done_entry; + } + + if (map_info[map_location].entry_type&ENTRY_R_OR_L) { if (tfv_x<20) newx=10; else newx=30; @@ -226,12 +240,24 @@ int world_map(void) { newx=19; newy=26; } + if (map_info[map_location].entry_type&ENTRY_MINX) { + if (newxmap_info[map_location].entry_x) { + newx=map_info[map_location].entry_x; + } + } if (map_info[map_location].entry_type&ENTRY_MAXY) { if (newy>map_info[map_location].entry_y) { newy=map_info[map_location].entry_y; } } +done_entry: + entry=0; //moved=1; printf("Newx=%d,Newy=%d\n",newx,newy); @@ -489,6 +515,7 @@ int world_map(void) { move_and_print(map_info[map_location].location[i].name); special_destination=map_info[map_location].location[i].destination; + break; } } diff --git a/tfv/art/math_office.png b/tfv/art/math_office.png index ee046f15ecb694d47a1b5be0c36d6c141b449da3..d48c17fd5aaf8c1698154d4ba5c0f4ed37ff1170 100644 GIT binary patch delta 281 zcmV+!0p|Xb1Cj%ff`29}9jf540002;Nkl2!Ppqy|7|DfI*@+i z{Na+_#LyrdDbh}pSxZyXBY=1)0n#d3#EU=%BzUx!feE6YuPeN5%QyG%`D1ena6LqJ z+n}jVIx7V2F=<^xIO8NR|J)EzBN@`IHvgiokRau1hc-waJ%6I}Z0KjcK@D6M2}Cqk z7;lj}kaC(p?Ll;ofzC0I{M{3qcMQNe9@g5rI?4biU=yN&-WP!YpDuz$-WP$QD`s2~ zC~gUF6D3ryBReoA6e<)`_}@>k5}`dGQ%OzipNPq!|#qW)To~vIt0{)&sBT gTIlnEfBm9fuM;;G_-WpfkN^Mx07*qoM6N<$g0Cus(EtDd