From 7d59dbc84c6f2af7bf72da3b716276d6f810c4bc Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Sat, 18 Nov 2017 23:17:41 -0500 Subject: [PATCH] tfv: implement lightning --- tfv/tfv_worldmap.s | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/tfv/tfv_worldmap.s b/tfv/tfv_worldmap.s index 58098df3..cbf1d7f7 100644 --- a/tfv/tfv_worldmap.s +++ b/tfv/tfv_worldmap.s @@ -700,20 +700,39 @@ treetrunk_loop: fore_no_forest: + ;============================= ; Draw lightning - ; if (map_x==3) { - ; if ((steps&0xf)==0) { - ; grsim_put_sprite(lightning,25,4); - ; /* Hurt hit points if in range? */ + ;============================= + + lda MAP_X + cmp #3 + bne no_lightning + + lda STEPS + and #$f + bne no_lightning + + lda #>lightning + sta INH + lda #25) && (tfv_x<30) && (tfv_y<12)) { ; printf("HIT! %d %d\n\n",steps,hp); ; if (hp>11) { ; hp=10; - ; } - ; } - ; } - ; } +no_lightning: jsr page_flip