From f8adb650751d9976a37c5300139505621097b848 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Fri, 13 Jul 2018 23:36:01 -0400 Subject: [PATCH] tfv: die when hit points go to zero --- gr-sim/tfv/TODO | 2 +- gr-sim/tfv/tfv_battle.c | 13 +++++++++---- gr-sim/tfv/tfv_dialog.h | 5 ++++- gr-sim/tfv/tfv_sprites.c | 2 +- gr-sim/tfv/tfv_sprites.h | 2 ++ gr-sim/tfv/tfv_worldmap.c | 2 ++ 6 files changed, 19 insertions(+), 7 deletions(-) diff --git a/gr-sim/tfv/TODO b/gr-sim/tfv/TODO index 62bf4773..764758cf 100644 --- a/gr-sim/tfv/TODO +++ b/gr-sim/tfv/TODO @@ -5,10 +5,10 @@ Soon: --> Fix weird glitch on damage printing --> Sound effects --> enemy uses magic +--> Enemy more likely to spawn on appropriate territory --> green background on anti-damage printing --> pick up vortex cannon from someone --> Balance the battles ---> Keep menu cursor from going out of bounds + Game over screen --> Pause 2 seconds diff --git a/gr-sim/tfv/tfv_battle.c b/gr-sim/tfv/tfv_battle.c index 15e1f014..79c6b937 100644 --- a/gr-sim/tfv/tfv_battle.c +++ b/gr-sim/tfv/tfv_battle.c @@ -1399,7 +1399,10 @@ int do_battle(int ground_color) { gr_copy_to_current(0xc00); - if (running) { + if (hp==0) { + grsim_put_sprite(tfv_defeat,ax-2,24); + } + else if (running) { if (battle_count%2) { grsim_put_sprite(tfv_stand_right,ax,20); } @@ -1418,6 +1421,11 @@ int do_battle(int ground_color) { page_flip(); + if (hp==0) { + for(i=0;i<15;i++) usleep(100000); + break; + } + usleep(100000); ch=grsim_input(); @@ -1460,9 +1468,6 @@ int do_battle(int ground_color) { break; } -// if (hp==0) { -// game_over(); -// } } diff --git a/gr-sim/tfv/tfv_dialog.h b/gr-sim/tfv/tfv_dialog.h index f35ff7a8..fe2c5ab9 100644 --- a/gr-sim/tfv/tfv_dialog.h +++ b/gr-sim/tfv/tfv_dialog.h @@ -90,8 +90,11 @@ struct dialog_type dialog[100]={ [DIALOG_PETE] = { .statement[0].words="Your journey takes you toward Bel Air.", .statement[0].next=1, - .statement[1].words="PLOT!", + .statement[1].words="Hari Seldon predicted this!", .statement[1].next=1, + .statement[2].words="PLOT!", + .statement[2].next=1, + }, [DIALOG_KENJESU] = { .statement[0].words="Have you found your lost guinea pig?", diff --git a/gr-sim/tfv/tfv_sprites.c b/gr-sim/tfv/tfv_sprites.c index 5fea790a..520e2844 100644 --- a/gr-sim/tfv/tfv_sprites.c +++ b/gr-sim/tfv/tfv_sprites.c @@ -52,7 +52,7 @@ unsigned char tfv_victory[]={ unsigned char tfv_defeat[]={ 0x7,0x3, 0x00,0x00,0x00,0x2b,0x00,0x00,0x00, - 0x88,0x00,0x00,0x22,0xb0,0xb0,0x0d, + 0x88,0x00,0x00,0x22,0xb0,0xb0,0xd0, 0x88,0x22,0x22,0x22,0xdd,0xdb,0xdd, }; diff --git a/gr-sim/tfv/tfv_sprites.h b/gr-sim/tfv/tfv_sprites.h index 87bb13e7..8e79eceb 100644 --- a/gr-sim/tfv/tfv_sprites.h +++ b/gr-sim/tfv/tfv_sprites.h @@ -3,6 +3,7 @@ extern unsigned char tfv_walk_right[]; extern unsigned char tfv_stand_left[]; extern unsigned char tfv_walk_left[]; extern unsigned char tfv_victory[]; +extern unsigned char tfv_defeat[]; extern unsigned char tfv_led_sword[]; extern unsigned char tfg_stand_right[]; @@ -10,6 +11,7 @@ extern unsigned char tfg_walk_right[]; extern unsigned char tfg_stand_left[]; extern unsigned char tfg_walk_left[]; extern unsigned char tfg_victory[]; +extern unsigned char tfg_defeat[]; extern unsigned char bird_rider_stand_right[]; extern unsigned char bird_rider_walk_right[]; diff --git a/gr-sim/tfv/tfv_worldmap.c b/gr-sim/tfv/tfv_worldmap.c index 06604a17..55529ac3 100644 --- a/gr-sim/tfv/tfv_worldmap.c +++ b/gr-sim/tfv/tfv_worldmap.c @@ -163,6 +163,8 @@ int world_map(void) { ch=grsim_input(); + if (hp==0) break; + if ((ch=='q') || (ch==27)) break; if ((ch=='t')) {