tfv: mermaid health works at least

This commit is contained in:
Vince Weaver 2018-07-16 13:41:04 -04:00
parent 90c959bb81
commit 4e029a33a3
5 changed files with 91 additions and 19 deletions

View File

@ -2,7 +2,6 @@ Known bugs:
+ When moving to new screen can get stuck or else wrap at weird offset
+ Weird glitch at top of screen when printing damage during battle
+ No sound/music on Linux version
+ Game starts with all items
+ It is not possible to trigger the final battle
+ Cannot save game
@ -16,6 +15,12 @@ Soon:
--> green background on anti-damage printing
--> pick up vortex cannon from someone
--> Balance the battles
--> Do something with experience/leveling up
+ Worldmap
--> Make location inverse text to offset it from dialog?
--> Make actions inverse to highlight
--> Start with 0 money
+ Game over screen
--> Pause 2 seconds

View File

@ -11,10 +11,10 @@
/* stats */
unsigned char level=0;
unsigned char hp=100,max_hp=100;
unsigned char mp=50,max_mp=50;
unsigned char hp=95,max_hp=100;
unsigned char mp=45,max_mp=50;
unsigned char limit=1;
unsigned char money=0,experience=0;
unsigned char money=10,experience=0;
unsigned char time_hours=0,time_minutes=0;
//unsigned char items1=0xff,items2=0xff,items3=0x07;
unsigned char items1=0,items2=0,items3=0;

View File

@ -102,10 +102,13 @@ struct dialog_type dialog[MAX_DIALOG]={
.statement[0].action=ACTION_QUERY,
.statement[1].words="YES",
.statement[1].next=3,
// .statement[1].action=ACTION_ITEM,
// .statement[1].item=ITEM_SMARTPASS,
.statement[2].words="NO",
.statement[2].next=4,
.statement[3].words="That will be $5",
.statement[3].action=ACTION_SMARTPASS,
.statement[3].action=ACTION_ITEM,
.statement[3].item=ITEM_SMARTPASS,
.statement[3].next=4,
.statement[4].words="Sorry, all trains cancelled. SmartTrip",
.statement[4].next=4,
@ -124,15 +127,17 @@ struct dialog_type dialog[MAX_DIALOG]={
.statement[0].words="WARK?",
.statement[0].next=0,
.statement[0].action=ACTION_QUERY,
.statement[1].words="YES",
.statement[1].next=3,
.statement[2].words="NO",
.statement[2].next=4,
.statement[1].words="NO",
.statement[1].next=4,
.statement[2].words="YES",
.statement[2].next=3,
// .statement[2].action=ACTION_BIRD,
.statement[3].words="WARK!",
.statement[3].action=ACTION_BIRD,
.statement[3].next=0,
.statement[4].words="Poot-tee-tweet",
.statement[4].next=0,
.statement[4].action=ACTION_DONE,
},
// FOUNTAIN
[DIALOG_MERMAID]= {
@ -143,11 +148,14 @@ struct dialog_type dialog[MAX_DIALOG]={
.statement[1].next=3,
.statement[2].words="NO",
.statement[2].next=4,
.statement[2].action=ACTION_RESTORE,
.statement[3].words="Begone, wastrel!",
.statement[3].next=0,
.statement[3].action=ACTION_DONE,
.statement[4].words="Must have been those band knaves.",
.statement[4].next=0,
.statement[4].action=ACTION_RESTORE,
.statement[4].action=ACTION_DONE,
// .statement[4].action=ACTION_RESTORE,
},
// BEL AIR
[DIALOG_CMW]= {

View File

@ -441,14 +441,14 @@ struct map_info_type map_info[34] = {
.location[1] = {
.name="Large Bird",
.x0 = 26, .x1 = 33,
.y0 = 16, .y1 = 20,
.y0 = 16, .y1 = 22,
.destination=DIALOG_LARGE_BIRD,
.type=LOCATION_CONVERSATION,
},
.location[2] = {
.name="Giant Guinea Pig",
.x0 = 28, .x1 = 33,
.y0 = 22, .y1 = 30,
.y0 = 24, .y1 = 30,
.destination=DIALOG_GIANT_GUINEA_PIG,
.type=LOCATION_CONVERSATION,
},

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;
int item_received=-1,health_restored=0;
int in_query=0;
/************************************************/
@ -213,11 +213,16 @@ int world_map(void) {
if (moved) conversation_started=0;
if (ch==13) {
health_restored=0;
if (destination_type==LOCATION_CONVERSATION) {
conversation_started=1;
conversation_person=special_destination;
/* HACK */
/* Action Done */
conversation_count=dialog[conversation_person].count;
if (dialog[conversation_person].statement[conversation_count].action==ACTION_DONE) {
conversation_started=0;
@ -225,6 +230,22 @@ int world_map(void) {
goto skip_all_this;
}
/* Get on Large Bird */
if (dialog[conversation_person].statement[conversation_count].action==ACTION_BIRD) {
printf("BIRD BIRD BIRD BIRD!\n");
on_bird=1;
conversation_started=0;
dialog[conversation_person].count=-1;
map_location=COLLEGE_PARK;
tfv_x=35;
tfv_y=5;
refresh=1;
goto skip_all_this;
}
/* Action Time */
if (dialog[conversation_person].statement[conversation_count].action==ACTION_TIME) {
conversation_started=0;
dialog[conversation_person].count=-1;
@ -232,7 +253,6 @@ int world_map(void) {
goto skip_all_this;
}
if (dialog[conversation_person].count==-1) {
dialog[conversation_person].count=0;
}
@ -244,11 +264,24 @@ int world_map(void) {
if (dialog[conversation_person].statement[conversation_count].action==ACTION_ITEM) {
item_received=dialog[conversation_person].statement[conversation_count].item;
printf("ACTION ITEM %d\n",item_received);
/* Action Smartpass */
/* FIXME: make generic item buy? */
if (item_received==ITEM_SMARTPASS) {
printf("Trying to get smartpass!\n");
if (money<5) {
goto no_smartpass;
}
else {
money-=5;
}
}
if (item_received<8) {
items1|=(1<<item_received);
}
@ -259,6 +292,7 @@ int world_map(void) {
items3|=(1<<(item_received&0x7));
}
dialog[conversation_person].statement[conversation_count].action=ACTION_NONE;
no_smartpass:;
}
else {
item_received=-1;
@ -628,6 +662,12 @@ done_entry:
move_and_print(item_name);
}
if (health_restored) {
ram[CH]=10;
ram[CV]=23;
move_and_print("HEALTH/MP RESTORED");
}
}
page_flip();
@ -639,12 +679,17 @@ done_entry:
saved_draw=ram[DRAW_PAGE];
ram[DRAW_PAGE]=ram[DISP_PAGE];
ram[DRAW_PAGE]=ram[DISP_PAGE]*4;
ram[CH]=5;
ram[CV]=22;
move_and_print(
dialog[conversation_person].statement[dialog[conversation_person].count+1].words);
printf("Printing %s at %d,%d page %d\n",
dialog[conversation_person].statement[dialog[conversation_person].count+1].words,
ram[CH],ram[CV],ram[DRAW_PAGE]);
ram[CH]=5;
ram[CV]=23;
move_and_print(
@ -678,9 +723,23 @@ done_entry:
usleep(100000);
}
dialog[conversation_person].count=
dialog[conversation_person].statement[dialog[conversation_person].count+1+which_line].next;
dialog[conversation_person].count+1+which_line;
// dialog[conversation_person].statement[dialog[conversation_person].count]+1+which_line;
ram[DRAW_PAGE]=saved_draw;
in_query=0;
conversation_count=dialog[conversation_person].count;
if (dialog[conversation_person].statement[conversation_count].action==ACTION_RESTORE) {
printf("RESTORE RESTORE RESTORE!\n");
hp=max_hp;
mp=max_mp;
health_restored=1;
}
dialog[conversation_person].count=
dialog[conversation_person].statement[dialog[conversation_person].count].next;
}