tfv: dialog queries now hacked together to more or less work

big hacks everywhere :(
This commit is contained in:
Vince Weaver 2018-07-16 13:59:04 -04:00
parent 4e029a33a3
commit 42308a1bfc
3 changed files with 29 additions and 11 deletions

View File

@ -21,6 +21,7 @@ Soon:
--> Make location inverse text to offset it from dialog?
--> Make actions inverse to highlight
--> Start with 0 money
--> Face proper way when entering/leaving certain places (fountain?)
+ Game over screen
--> Pause 2 seconds

View File

@ -97,21 +97,23 @@ struct dialog_type dialog[MAX_DIALOG]={
},
// Metro Station
[DIALOG_METRO_WORKER]= {
.statement[0].words="Would you like to buy at SmartPass?",
.statement[0].words="Would you like to buy a SmartPass?",
.statement[0].next=1,
.statement[0].action=ACTION_QUERY,
.statement[1].words="YES",
.statement[1].next=3,
// .statement[1].action=ACTION_ITEM,
.statement[1].action=ACTION_SMARTPASS,
// .statement[1].item=ITEM_SMARTPASS,
.statement[2].words="NO",
.statement[2].next=4,
.statement[3].words="That will be $5",
.statement[3].action=ACTION_ITEM,
.statement[3].item=ITEM_SMARTPASS,
// .statement[3].action=ACTION_SMARTPASS,
// .statement[3].item=ITEM_SMARTPASS,
.statement[3].next=4,
.statement[4].words="Sorry, all trains cancelled. SmartTrip",
.statement[4].next=4,
.statement[4].action=ACTION_ITEM,
.statement[4].item=ITEM_SMARTPASS,
},
[DIALOG_TINY_CAPABARA]= {
.statement[0].words="GRONK",

View File

@ -148,7 +148,7 @@ int world_map(void) {
int conversation_started=0;
int conversation_person=0;
int conversation_count=0;
int item_received=-1,health_restored=0;
int item_received=-1,health_restored=0,buy_smartpass=0;
int in_query=0;
/************************************************/
@ -237,7 +237,7 @@ int world_map(void) {
conversation_started=0;
dialog[conversation_person].count=-1;
map_location=COLLEGE_PARK;
tfv_x=35;
tfv_x=32;
tfv_y=5;
refresh=1;
goto skip_all_this;
@ -253,6 +253,7 @@ int world_map(void) {
goto skip_all_this;
}
/* Move to next conversation */
if (dialog[conversation_person].count==-1) {
dialog[conversation_person].count=0;
}
@ -263,7 +264,7 @@ int world_map(void) {
conversation_count=dialog[conversation_person].count;
/* Check for items */
if (dialog[conversation_person].statement[conversation_count].action==ACTION_ITEM) {
item_received=dialog[conversation_person].statement[conversation_count].item;
@ -272,12 +273,20 @@ int world_map(void) {
/* Action Smartpass */
/* FIXME: make generic item buy? */
if (item_received==ITEM_SMARTPASS) {
printf("Trying to get smartpass!\n");
if (money<5) {
goto no_smartpass;
if (buy_smartpass) {
printf("Trying to get smartpass!\n");
if (money<5) {
item_received=-1;
goto no_smartpass;
}
else {
money-=5;
}
}
else {
money-=5;
item_received=-1;
goto no_smartpass;
}
}
@ -728,6 +737,7 @@ done_entry:
ram[DRAW_PAGE]=saved_draw;
in_query=0;
/* Handle health restore */
conversation_count=dialog[conversation_person].count;
if (dialog[conversation_person].statement[conversation_count].action==ACTION_RESTORE) {
printf("RESTORE RESTORE RESTORE!\n");
@ -736,6 +746,11 @@ done_entry:
health_restored=1;
}
if (dialog[conversation_person].statement[conversation_count].action==ACTION_SMARTPASS) {
printf("Attempt to buy!\n");
buy_smartpass=1;
}
dialog[conversation_person].count=
dialog[conversation_person].statement[dialog[conversation_person].count].next;