tfv: remember location when we enter buildings

This commit is contained in:
Vince Weaver 2018-06-22 15:22:05 -04:00
parent e133352c48
commit 0313f01f8c
7 changed files with 91 additions and 43 deletions

15
gr-sim/tfv/TODO Normal file
View File

@ -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

View File

@ -1,5 +1,9 @@
INCLUDE: 5 tents. Can use to heal. Sky goes black while sleeping? 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 ITEMS
CUPCAKE // cafeteria lady CUPCAKE // cafeteria lady
CARROT // capabara CARROT // capabara
@ -27,7 +31,6 @@ CLASS RING //
COLLEGE PARK COLLEGE PARK
TALBOT HALL TALBOT HALL
Have spool be ground scatter?
LIZ+WILL LIZ+WILL
LET'S DISCUSS COOL THINGS IN THE LOUNGE LET'S DISCUSS COOL THINGS IN THE LOUNGE
--> YES! --> YES!
@ -67,13 +70,17 @@ METRO STATION
TINY CAPABARA TINY CAPABARA
GRONK GRONK
GIANT GUINEA PIG GIANT GUINEA PIG
SQUEAK SQUEAK?
-> YES
-> NO
LARGE BIRD LARGE BIRD
WARK WARK?
-> YES
-> NO
FOUNTAIN -- drink from it restore heatlh? FOUNTAIN -- drink from it restore heatlh?
MERMAID MERMAID
Did ye put bubbles in fountain? Did ye put bubbles in yon fountain?

View File

@ -154,27 +154,26 @@ unsigned char math_office_rle[]={
0x44,0x4F,0x44,0xFF,0x44,0x4F,0x44, 0x44,0x4F,0x44,0xFF,0x44,0x4F,0x44,
0xFF,0x44,0x4F,0xFF,0xA0,0x19,0x00,0x44,0x4F,0x4F, 0xFF,0x44,0x4F,0xFF,0xA0,0x19,0x00,0x44,0x4F,0x4F,
0xA4,0x44,0x4F,0xA3,0x44,0x4F,0x44,0x44,0x4F,0xA0,0x19,0x00, 0xA4,0x44,0x4F,0xA3,0x44,0x4F,0x44,0x44,0x4F,0xA0,0x19,0x00,
0xAF,0x44,0x00,0x00,0x88,0xB8,0xA7,0x00,0x80,0x80,0xA7,0x00, 0xAF,0x44,0xAB,0x00,0x80,0x80,0xA7,0x00,0xB8,0x88,0x00,0x00,
0xB8,0x88,0x00,0x00,0x0A,0xAF,0x07,0x00,0x00,0x88, 0x0A,0xAF,0x07,0xAB,0x00,0x88,0xBB,0xB0,0xA5,0x00,
0xBB,0x0B,0xA6,0x00,0x88,0xBB,0xB0,0xA5,0x00,
0x0B,0xBB,0x88,0xA4,0x00,0xB8,0x88,0xAE,0x00, 0x0B,0xBB,0x88,0xA4,0x00,0xB8,0x88,0xAE,0x00,
0x88,0xA8,0x00,0x88,0xFB,0xA7,0x00,0x2B,0xA4,0x00, 0x88,0xB8,0xA7,0x00,0x88,0xFB,0xA7,0x00,0x2B,
0x0B,0xBB,0x88,0xAE,0x00,0x77,0xFF,0xA7,0x00, 0xA4,0x00,0x0B,0xBB,0x88,0xAE,0x00,0x88,0xBB,
0xF8,0xFF,0xF0,0xA5,0x00,0x44,0x22,0xA5,0x00, 0x0B,0xA6,0x00,0xF8,0xFF,0xF0,0xA5,0x00,0x44,
0xFF,0x08,0x80,0xAD,0x00,0xF7,0xF7,0x0B,0xA6,0x00, 0x22,0xA5,0x00,0xFF,0x08,0x80,0xAD,0x00,0x88,
0x7F,0x11,0x7F,0xA4,0x70,0x11,0x74,0x72, 0xF0,0xA7,0x00,0x7F,0x11,0x7F,0xA4,0x70,0x11,
0xA3,0x70,0x11,0x7F,0x7F,0xA6,0x70,0xA9,0x00,0x4F,0x4F,0xA5,0x00, 0x74,0x72,0xA3,0x70,0x11,0x7F,0x7F,0xA6,0x70,0xA9,0x00,
0x70,0x77,0x77,0x71,0xA5,0x77,0x71,0xA5,0x77,0x71, 0x77,0x7F,0xB0,0xA4,0x00,0x70,0x77,0x77,0x71,
0xA6,0x77,0x57,0x55,0xA9,0x00,0x44,0x44,0xA4,0x00,0xA0,0x16,0x57, 0xA5,0x77,0x71,0xA5,0x77,0x71,0xA6,0x77,0x57,0x55,
0x55,0x05,0x55,0xA8,0x00,0x04,0x04,0xB4,0x04, 0xA9,0x00,0x4F,0x4F,0xA4,0x00,0xA0,0x16,0x57,0x55,0x05,0x55,
0xA3,0x00,0x55,0x05,0x05,0x55,0x05,0xB5,0xA4,0x05, 0xA8,0x00,0x04,0xB4,0x04,0x04,0xA3,0x00,0x55,0x05,0x05,
0xD5,0xA5,0x05,0xB5,0xA4,0x05,0x55,0x00,0x00,0x55, 0x55,0x05,0xB5,0xA4,0x05,0xD5,0xA5,0x05,0xB5,
0xAA,0x00,0xBB,0xA4,0x00,0x55,0x00,0x00,0x55,0x00, 0xA4,0x05,0x55,0x00,0x00,0x55,0xA9,0x00,0x8F,0x80,
0x08,0x08,0x00,0x00,0x08,0x08,0xA4,0x00,0x08,0x08,0xA4,0x00,0x55, 0xA4,0x00,0x55,0x00,0x00,0x55,0x00,0x08,0x08,0x00,0x00,
0x00,0x00,0x55,0xAA,0x00,0x8B,0x80,0xA3,0x00,0x55, 0x08,0x08,0xA4,0x00,0x08,0x08,0xA4,0x00,0x55,0x00,0x00,0x55,
0x00,0x00,0x55,0xA0,0x11,0x00,0x55,0x00,0x00,0x55,0xAA,0x00, 0xAF,0x00,0x55,0x00,0x00,0x55,0xA0,0x11,0x00,0x55,0x00,0x00,
0x08,0x08,0xA3,0x00,0x55,0x00,0x00,0x05,0xA0,0x11,0x00,0x55, 0x55,0xAF,0x00,0x55,0xA0,0x14,0x00,0x55,0xA0,0x12,0x00,0x05,
0x00,0x00,0x05,0xAF,0x00,0x55,0xA0,0x14,0x00,0x55,0xA0,0x82,0x00,0xA1, }; 0xA0,0x14,0x00,0x05,0xA0,0x82,0x00,0xA1, };
unsigned char video_hr_rle[]={ unsigned char video_hr_rle[]={
0x28, /* ysize=40 */ 0x28, /* ysize=40 */
0xA0,0x20,0x00,0x77,0xA6,0x57,0x77,0xA0,0x20,0x00,0x77,0x55,0x55, 0xA0,0x20,0x00,0x77,0xA6,0x57,0x77,0xA0,0x20,0x00,0x77,0x55,0x55,

View File

@ -48,6 +48,7 @@
#define LOCATION_PLACE 0 #define LOCATION_PLACE 0
#define LOCATION_CONVERSATION 1 #define LOCATION_CONVERSATION 1
#define LOCATION_SPACESHIP 2
struct location_type { struct location_type {
char *name; char *name;
@ -83,6 +84,9 @@ struct location_type {
#define ENTRY_MINY 0x20 #define ENTRY_MINY 0x20
#define ENTRY_MAXY 0x40 #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;
int scatter_x,scatter_y,scatter_cutoff; int scatter_x,scatter_y,scatter_cutoff;
int entry_type,entry_x,entry_y; int entry_type,entry_x,entry_y;
int saved_x,saved_y;
unsigned char *background_image; unsigned char *background_image;
}; };

View File

@ -88,7 +88,7 @@ struct map_info_type map_info[33] = {
.scatter=SCATTER_PINE, .scatter=SCATTER_PINE,
.scatter_x=25, .scatter_y=16, .scatter_cutoff=15, .scatter_x=25, .scatter_y=16, .scatter_cutoff=15,
.land_type=LAND_LEFT_BEACH, .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, .background_image=NULL,
}, },
[LANDING_SITE]={ // 5: LANDING_SITE [LANDING_SITE]={ // 5: LANDING_SITE
@ -129,7 +129,7 @@ struct map_info_type map_info[33] = {
.miny=4, .miny=4,
.scatter=SCATTER_NONE, .scatter=SCATTER_NONE,
.land_type=LAND_FOREST|LAND_RIGHT_BEACH, .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, .background_image=NULL,
}, },
[PALM_BEACH]={ // 8: PALM_BEACH [PALM_BEACH]={ // 8: PALM_BEACH
@ -143,7 +143,7 @@ struct map_info_type map_info[33] = {
.scatter=SCATTER_PALM, .scatter=SCATTER_PALM,
.scatter_x=10, .scatter_y=20, .scatter_cutoff=22, .scatter_x=10, .scatter_y=20, .scatter_cutoff=22,
.land_type=LAND_LEFT_BEACH, .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, .background_image=NULL,
}, },
[GRASSLAND]={ // 9: GRASSLAND [GRASSLAND]={ // 9: GRASSLAND
@ -182,7 +182,7 @@ struct map_info_type map_info[33] = {
.miny=4, .miny=4,
.scatter=SCATTER_NONE, .scatter=SCATTER_NONE,
.land_type=LAND_FOREST|LAND_RIGHT_BEACH, .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, .background_image=NULL,
}, },
[SOUTH_BEACH]={ // 12: SOUTH_BEACH [SOUTH_BEACH]={ // 12: SOUTH_BEACH
@ -196,7 +196,7 @@ struct map_info_type map_info[33] = {
.scatter=SCATTER_PALM, .scatter=SCATTER_PALM,
.scatter_x=20, .scatter_y=20, .scatter_cutoff=22, .scatter_x=20, .scatter_y=20, .scatter_cutoff=22,
.land_type=LAND_LEFT_BEACH|LAND_SOUTHSHORE, .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, .background_image=NULL,
}, },
[CACTUS_RANCH]={ // 13: CACTUS_RANCH [CACTUS_RANCH]={ // 13: CACTUS_RANCH
@ -248,16 +248,16 @@ struct map_info_type map_info[33] = {
.miny=4, .miny=4,
.scatter=SCATTER_NONE, .scatter=SCATTER_NONE,
.land_type=LAND_RIGHT_BEACH|LAND_SOUTHSHORE, .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, .background_image=NULL,
}, },
[U_OF_MD]={ // 16: U of MD [U_OF_MD]={ // 16: U of MD
.name="University of M", .name="University of M",
.ground_color=(COLOR_LIGHTGREEN|(COLOR_LIGHTGREEN<<4)), .ground_color=(COLOR_LIGHTGREEN|(COLOR_LIGHTGREEN<<4)),
.n_exit=NOEXIT, .n_exit=NOEXIT,
.s_exit=NOEXIT, .s_exit=COLLEGE_PARK,
.e_exit=COLLEGE_PARK, .e_exit=COLLEGE_PARK,
.w_exit=COLLEGE_PARK, .w_exit=NOEXIT,
.miny=4, .miny=4,
.scatter=SCATTER_NONE, .scatter=SCATTER_NONE,
.land_type=LAND_BORING, .land_type=LAND_BORING,
@ -500,8 +500,8 @@ struct map_info_type map_info[33] = {
.ground_color=(COLOR_DARKGREEN|(COLOR_DARKGREEN<<4)), .ground_color=(COLOR_DARKGREEN|(COLOR_DARKGREEN<<4)),
.n_exit=NOEXIT, .n_exit=NOEXIT,
.s_exit=BEL_AIR, .s_exit=BEL_AIR,
.e_exit=NOEXIT, .e_exit=BEL_AIR,
.w_exit=NOEXIT, .w_exit=BEL_AIR,
.miny=4, .miny=4,
.scatter=SCATTER_NONE, .scatter=SCATTER_NONE,
.entry_type=ENTRY_CENTER, .entry_x=0, .entry_y=0, .entry_type=ENTRY_CENTER, .entry_x=0, .entry_y=0,
@ -677,15 +677,8 @@ struct map_info_type map_info[33] = {
#if 0 #if 0
video_hr_rle:
"GUS",
"RAISTLIN",
"FORD",
"SISTER SCARYNUN",
calculs_rle: calculs_rle:
team I-1 team I-1
PADRINO
JENNI JENNI
MR. APPLEBY MR. APPLEBY
KATHY KATHY
@ -707,6 +700,8 @@ struct map_info_type map_info[33] = {
patriot_room: patriot_room:
agent N agent N
PADRINO
#endif #endif

View File

@ -193,10 +193,13 @@ int world_map(void) {
if (ch==13) { if (ch==13) {
if (special_destination!=NOEXIT) { if (special_destination!=NOEXIT) {
map_info[map_location].saved_x=tfv_x;
map_info[map_location].saved_y=tfv_y;
map_location=special_destination; map_location=special_destination;
entry=1;
refresh=1;
} }
entry=1;
refresh=1;
} }
if (ch=='h') print_help(); if (ch=='h') print_help();
@ -213,6 +216,17 @@ int world_map(void) {
/* Handle entry to a new area */ /* Handle entry to a new area */
if (entry) { if (entry) {
printf("Entering!\n"); 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 (map_info[map_location].entry_type&ENTRY_R_OR_L) {
if (tfv_x<20) newx=10; if (tfv_x<20) newx=10;
else newx=30; else newx=30;
@ -226,12 +240,24 @@ int world_map(void) {
newx=19; newx=19;
newy=26; newy=26;
} }
if (map_info[map_location].entry_type&ENTRY_MINX) {
if (newx<map_info[map_location].entry_x) {
newx=map_info[map_location].entry_x;
}
}
if (map_info[map_location].entry_type&ENTRY_MAXX) {
if (newx>map_info[map_location].entry_x) {
newx=map_info[map_location].entry_x;
}
}
if (map_info[map_location].entry_type&ENTRY_MAXY) { if (map_info[map_location].entry_type&ENTRY_MAXY) {
if (newy>map_info[map_location].entry_y) { if (newy>map_info[map_location].entry_y) {
newy=map_info[map_location].entry_y; newy=map_info[map_location].entry_y;
} }
} }
done_entry:
entry=0; entry=0;
//moved=1; //moved=1;
printf("Newx=%d,Newy=%d\n",newx,newy); 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); move_and_print(map_info[map_location].location[i].name);
special_destination=map_info[map_location].location[i].destination; special_destination=map_info[map_location].location[i].destination;
break; break;
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 B

After

Width:  |  Height:  |  Size: 402 B