tfv: split off summons
This commit is contained in:
parent
777614c801
commit
614778e999
|
@ -76,7 +76,8 @@ TFV_WORLD: tfv_world.o
|
||||||
|
|
||||||
tfv_world.o: tfv_world.s zp.inc \
|
tfv_world.o: tfv_world.s zp.inc \
|
||||||
tfv_overworld.s tfv_drawmap.s \
|
tfv_overworld.s tfv_drawmap.s \
|
||||||
tfv_battle.s tfv_battle_menu.s tfv_battle_limit.s \
|
tfv_battle.s tfv_battle_menu.s tfv_battle_limit.s tfv_battle_summons.s \
|
||||||
|
tfv_battle_boss.s \
|
||||||
help_overworld.s rotate_intro.s \
|
help_overworld.s rotate_intro.s \
|
||||||
sound_effects.s speaker_tone.s \
|
sound_effects.s speaker_tone.s \
|
||||||
graphics_map/tfv_backgrounds.inc \
|
graphics_map/tfv_backgrounds.inc \
|
||||||
|
|
|
@ -1098,390 +1098,6 @@ done_magic_damage:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;========================
|
|
||||||
; summon metrocat
|
|
||||||
;========================
|
|
||||||
summon_metrocat:
|
|
||||||
|
|
||||||
lda #$17
|
|
||||||
sta DAMAGE_VAL
|
|
||||||
|
|
||||||
lda #28
|
|
||||||
sta MAGIC_X
|
|
||||||
lda #2
|
|
||||||
sta MAGIC_Y
|
|
||||||
|
|
||||||
;===========================
|
|
||||||
; draw looming metrocat head
|
|
||||||
|
|
||||||
lda #30
|
|
||||||
sta ANIMATE_LOOP
|
|
||||||
looming_metrocat_loop:
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
; draw hero
|
|
||||||
lda #34
|
|
||||||
sta HERO_X
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw metrocat's head
|
|
||||||
|
|
||||||
lda MAGIC_X
|
|
||||||
sta XPOS
|
|
||||||
lda MAGIC_Y
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<metrocat_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>metrocat_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
; draw battle bottom
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
lda #75
|
|
||||||
jsr WAIT ; delay a bit
|
|
||||||
|
|
||||||
dec ANIMATE_LOOP
|
|
||||||
bne looming_metrocat_loop
|
|
||||||
|
|
||||||
move_metrocat_loop:
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw metrocat's head
|
|
||||||
|
|
||||||
lda MAGIC_X
|
|
||||||
sta XPOS
|
|
||||||
lda MAGIC_Y
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<metrocat_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>metrocat_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
; draw battle bottom
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
lda #50 ; delay
|
|
||||||
jsr WAIT
|
|
||||||
|
|
||||||
dec MAGIC_X
|
|
||||||
lda MAGIC_X
|
|
||||||
|
|
||||||
cmp #15
|
|
||||||
bcs metrocat_no_move_y
|
|
||||||
|
|
||||||
; have to keep even
|
|
||||||
|
|
||||||
and #1
|
|
||||||
bne metrocat_no_move_y
|
|
||||||
|
|
||||||
inc MAGIC_Y
|
|
||||||
inc MAGIC_Y
|
|
||||||
|
|
||||||
metrocat_no_move_y:
|
|
||||||
lda MAGIC_X
|
|
||||||
cmp #5 ; move until X=5
|
|
||||||
bcs move_metrocat_loop
|
|
||||||
|
|
||||||
|
|
||||||
lda #30
|
|
||||||
sta ANIMATE_LOOP
|
|
||||||
|
|
||||||
metrocat_damage_loop:
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw metrocat's head
|
|
||||||
|
|
||||||
lda MAGIC_X
|
|
||||||
sta XPOS
|
|
||||||
lda MAGIC_Y
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<metrocat_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>metrocat_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
lda #50
|
|
||||||
jsr WAIT
|
|
||||||
|
|
||||||
dec ANIMATE_LOOP
|
|
||||||
bne metrocat_damage_loop
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw hero
|
|
||||||
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw bottom
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr damage_enemy
|
|
||||||
|
|
||||||
lda #2
|
|
||||||
sta XPOS
|
|
||||||
lda #10
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
jsr gr_put_num
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
; long wait (2s?)
|
|
||||||
ldx #200
|
|
||||||
jsr long_wait
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;=========================
|
|
||||||
; Vortex Cannon
|
|
||||||
;=========================
|
|
||||||
|
|
||||||
summon_vortex_cannon:
|
|
||||||
|
|
||||||
lda #5
|
|
||||||
sta DAMAGE_VAL
|
|
||||||
|
|
||||||
lda #20
|
|
||||||
sta MAGIC_X
|
|
||||||
sta MAGIC_Y
|
|
||||||
|
|
||||||
|
|
||||||
; draw the cannon
|
|
||||||
|
|
||||||
lda #30
|
|
||||||
sta ANIMATE_LOOP
|
|
||||||
|
|
||||||
vortex_setup_loop:
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
|
|
||||||
; draw hero
|
|
||||||
lda #34
|
|
||||||
sta HERO_X
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; grsim_put_sprite(vortex_cannon,ax,ay);
|
|
||||||
|
|
||||||
; draw vortex_cannon
|
|
||||||
|
|
||||||
lda #20
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<vortex_cannon_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>vortex_cannon_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
; draw bottom
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
lda #50
|
|
||||||
jsr WAIT
|
|
||||||
|
|
||||||
dec ANIMATE_LOOP
|
|
||||||
bne vortex_setup_loop
|
|
||||||
|
|
||||||
|
|
||||||
; Fire vortices
|
|
||||||
|
|
||||||
|
|
||||||
lda #5
|
|
||||||
sta ANIMATE_LOOP
|
|
||||||
|
|
||||||
vortex_cannon_fire_loop:
|
|
||||||
|
|
||||||
lda #20
|
|
||||||
sta MAGIC_X
|
|
||||||
|
|
||||||
vortex_cannon_move_loop:
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
; draw hero
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw vortex_cannon
|
|
||||||
|
|
||||||
lda #20
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<vortex_cannon_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>vortex_cannon_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
; draw vortex
|
|
||||||
|
|
||||||
lda MAGIC_X
|
|
||||||
sta XPOS
|
|
||||||
lda #24
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
lda #<vortex_sprite
|
|
||||||
sta INL
|
|
||||||
lda #>vortex_sprite
|
|
||||||
sta INH
|
|
||||||
|
|
||||||
jsr put_sprite_crop
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
|
|
||||||
; print damage if < 10
|
|
||||||
lda MAGIC_X
|
|
||||||
cmp #10
|
|
||||||
bcs vortex_no_print_damage
|
|
||||||
|
|
||||||
lda #2
|
|
||||||
sta XPOS
|
|
||||||
lda #10
|
|
||||||
sta YPOS
|
|
||||||
|
|
||||||
jsr gr_put_num
|
|
||||||
|
|
||||||
vortex_no_print_damage:
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
lda #100
|
|
||||||
jsr WAIT
|
|
||||||
|
|
||||||
dec MAGIC_X
|
|
||||||
|
|
||||||
lda MAGIC_X
|
|
||||||
cmp #5
|
|
||||||
bcs vortex_cannon_move_loop
|
|
||||||
|
|
||||||
; damage enemy
|
|
||||||
jsr damage_enemy
|
|
||||||
|
|
||||||
dec ANIMATE_LOOP
|
|
||||||
bne vortex_cannon_fire_loop
|
|
||||||
|
|
||||||
|
|
||||||
; end of summon
|
|
||||||
|
|
||||||
|
|
||||||
jsr gr_copy_to_current
|
|
||||||
|
|
||||||
; draw enemy
|
|
||||||
lda ENEMY_X
|
|
||||||
sta XPOS
|
|
||||||
lda #20
|
|
||||||
sta YPOS
|
|
||||||
jsr draw_enemy
|
|
||||||
|
|
||||||
; draw hero
|
|
||||||
jsr draw_hero_and_sword
|
|
||||||
|
|
||||||
jsr draw_battle_bottom
|
|
||||||
|
|
||||||
jsr page_flip
|
|
||||||
|
|
||||||
; wait 2s
|
|
||||||
ldx #200
|
|
||||||
jsr long_wait
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
;=========================
|
|
||||||
; summon
|
|
||||||
;=========================
|
|
||||||
summon:
|
|
||||||
lda MENU_POSITION
|
|
||||||
beq do_summon_metrocat
|
|
||||||
bne do_summon_vortex_cannon
|
|
||||||
|
|
||||||
do_summon_metrocat:
|
|
||||||
jmp summon_metrocat
|
|
||||||
do_summon_vortex_cannon:
|
|
||||||
jmp summon_vortex_cannon
|
|
||||||
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
;=============================
|
;=============================
|
||||||
; done attack
|
; done attack
|
||||||
|
@ -1601,151 +1217,4 @@ long_wait:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
;====================
|
|
||||||
;====================
|
|
||||||
; Boss Battle
|
|
||||||
;====================
|
|
||||||
;====================
|
|
||||||
|
|
||||||
boss_battle:
|
|
||||||
|
|
||||||
; int i,ch;
|
|
||||||
|
|
||||||
; int saved_drawpage;
|
|
||||||
|
|
||||||
; int ax=34;
|
|
||||||
; int enemy_count=30;
|
|
||||||
; int old;
|
|
||||||
|
|
||||||
|
|
||||||
; susie_out=1;
|
|
||||||
|
|
||||||
; rotate_intro();
|
|
||||||
|
|
||||||
; battle_count=20;
|
|
||||||
|
|
||||||
; enemy_type=8;
|
|
||||||
|
|
||||||
; enemy_hp=255;
|
|
||||||
|
|
||||||
; saved_drawpage=ram[DRAW_PAGE];
|
|
||||||
|
|
||||||
; ram[DRAW_PAGE]=PAGE2;
|
|
||||||
|
|
||||||
;=====================
|
|
||||||
; Draw background
|
|
||||||
|
|
||||||
; Draw sky */
|
|
||||||
; color_equals(COLOR_BLACK);
|
|
||||||
; for(i=0;i<20;i++) {
|
|
||||||
; hlin_double(ram[DRAW_PAGE],0,39,i);
|
|
||||||
; }
|
|
||||||
|
|
||||||
; color_equals(COLOR_ORANGE);
|
|
||||||
; for(i=20;i<39;i++) {
|
|
||||||
; hlin_double(ram[DRAW_PAGE],0,39,i);
|
|
||||||
; }
|
|
||||||
|
|
||||||
; Draw horizon */
|
|
||||||
; color_equals(COLOR_GREY);
|
|
||||||
; hlin_double(ram[DRAW_PAGE],0,39,10);
|
|
||||||
|
|
||||||
; ram[DRAW_PAGE]=saved_drawpage;
|
|
||||||
|
|
||||||
; draw_battle_bottom(enemy_type);
|
|
||||||
|
|
||||||
; while(1) {
|
|
||||||
|
|
||||||
; gr_copy_to_current(0xc00);
|
|
||||||
;
|
|
||||||
; 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);
|
|
||||||
; }
|
|
||||||
; else {
|
|
||||||
; grsim_put_sprite(tfv_walk_right,ax,20);
|
|
||||||
; }
|
|
||||||
; }
|
|
||||||
; else {
|
|
||||||
; grsim_put_sprite(tfv_stand_left,ax,20);
|
|
||||||
; grsim_put_sprite(tfv_led_sword,ax-5,20);
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; grsim_put_sprite(susie_left,28,30);
|
|
||||||
;
|
|
||||||
; if ((enemy_count&0xf)<4) {
|
|
||||||
; grsim_put_sprite(roboknee1,enemy_x,16);
|
|
||||||
; }
|
|
||||||
; else {
|
|
||||||
; grsim_put_sprite(roboknee2,enemy_x,16);
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; draw_battle_bottom(enemy_type);
|
|
||||||
;
|
|
||||||
; page_flip();
|
|
||||||
;
|
|
||||||
; if (hp==0) {
|
|
||||||
; for(i=0;i<15;i++) usleep(100000);
|
|
||||||
; break;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; usleep(100000);
|
|
||||||
;
|
|
||||||
; ch=grsim_input();
|
|
||||||
; if (ch=='q') return 0;
|
|
||||||
;
|
|
||||||
; if (enemy_count==0) {
|
|
||||||
; ; attack and decrement HP
|
|
||||||
; enemy_attack(ax);
|
|
||||||
; ; update limit count
|
|
||||||
; if (limit<4) limit++;
|
|
||||||
;
|
|
||||||
; ; reset enemy time. FIXME: variable?
|
|
||||||
; enemy_count=50;
|
|
||||||
; }
|
|
||||||
; else {
|
|
||||||
; enemy_count--;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; if (battle_count>=64) {
|
|
||||||
;
|
|
||||||
; ; TODO: randomly fail at running? */
|
|
||||||
; if (running) {
|
|
||||||
; break;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; if (menu_state==MENU_NONE) menu_state=MENU_MAIN;
|
|
||||||
; menu_keypress(ch);
|
|
||||||
;
|
|
||||||
; } else {
|
|
||||||
; battle_count++;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; old=battle_bar;
|
|
||||||
; battle_bar=(battle_count/16);
|
|
||||||
; if (battle_bar!=old) draw_battle_bottom(enemy_type);
|
|
||||||
;
|
|
||||||
;
|
|
||||||
; if (enemy_hp==0) {
|
|
||||||
; ; FIXME?
|
|
||||||
; victory_dance();
|
|
||||||
; break;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
;
|
|
||||||
; }
|
|
||||||
;
|
|
||||||
; ram[DRAW_PAGE]=PAGE0;
|
|
||||||
; clear_bottom();
|
|
||||||
; ram[DRAW_PAGE]=PAGE1;
|
|
||||||
; clear_bottom();
|
|
||||||
;
|
|
||||||
; running=0;
|
|
||||||
;
|
|
||||||
; return 0;
|
|
||||||
;}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,148 @@
|
||||||
|
|
||||||
|
;====================
|
||||||
|
;====================
|
||||||
|
; Boss Battle
|
||||||
|
;====================
|
||||||
|
;====================
|
||||||
|
|
||||||
|
boss_battle:
|
||||||
|
|
||||||
|
; int i,ch;
|
||||||
|
|
||||||
|
; int saved_drawpage;
|
||||||
|
|
||||||
|
; int ax=34;
|
||||||
|
; int enemy_count=30;
|
||||||
|
; int old;
|
||||||
|
|
||||||
|
|
||||||
|
; susie_out=1;
|
||||||
|
|
||||||
|
; rotate_intro();
|
||||||
|
|
||||||
|
; battle_count=20;
|
||||||
|
|
||||||
|
; enemy_type=8;
|
||||||
|
|
||||||
|
; enemy_hp=255;
|
||||||
|
|
||||||
|
; saved_drawpage=ram[DRAW_PAGE];
|
||||||
|
|
||||||
|
; ram[DRAW_PAGE]=PAGE2;
|
||||||
|
|
||||||
|
;=====================
|
||||||
|
; Draw background
|
||||||
|
|
||||||
|
; Draw sky */
|
||||||
|
; color_equals(COLOR_BLACK);
|
||||||
|
; for(i=0;i<20;i++) {
|
||||||
|
; hlin_double(ram[DRAW_PAGE],0,39,i);
|
||||||
|
; }
|
||||||
|
|
||||||
|
; color_equals(COLOR_ORANGE);
|
||||||
|
; for(i=20;i<39;i++) {
|
||||||
|
; hlin_double(ram[DRAW_PAGE],0,39,i);
|
||||||
|
; }
|
||||||
|
|
||||||
|
; Draw horizon */
|
||||||
|
; color_equals(COLOR_GREY);
|
||||||
|
; hlin_double(ram[DRAW_PAGE],0,39,10);
|
||||||
|
|
||||||
|
; ram[DRAW_PAGE]=saved_drawpage;
|
||||||
|
|
||||||
|
; draw_battle_bottom(enemy_type);
|
||||||
|
|
||||||
|
; while(1) {
|
||||||
|
|
||||||
|
; gr_copy_to_current(0xc00);
|
||||||
|
;
|
||||||
|
; 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);
|
||||||
|
; }
|
||||||
|
; else {
|
||||||
|
; grsim_put_sprite(tfv_walk_right,ax,20);
|
||||||
|
; }
|
||||||
|
; }
|
||||||
|
; else {
|
||||||
|
; grsim_put_sprite(tfv_stand_left,ax,20);
|
||||||
|
; grsim_put_sprite(tfv_led_sword,ax-5,20);
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; grsim_put_sprite(susie_left,28,30);
|
||||||
|
;
|
||||||
|
; if ((enemy_count&0xf)<4) {
|
||||||
|
; grsim_put_sprite(roboknee1,enemy_x,16);
|
||||||
|
; }
|
||||||
|
; else {
|
||||||
|
; grsim_put_sprite(roboknee2,enemy_x,16);
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; draw_battle_bottom(enemy_type);
|
||||||
|
;
|
||||||
|
; page_flip();
|
||||||
|
;
|
||||||
|
; if (hp==0) {
|
||||||
|
; for(i=0;i<15;i++) usleep(100000);
|
||||||
|
; break;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; usleep(100000);
|
||||||
|
;
|
||||||
|
; ch=grsim_input();
|
||||||
|
; if (ch=='q') return 0;
|
||||||
|
;
|
||||||
|
; if (enemy_count==0) {
|
||||||
|
; ; attack and decrement HP
|
||||||
|
; enemy_attack(ax);
|
||||||
|
; ; update limit count
|
||||||
|
; if (limit<4) limit++;
|
||||||
|
;
|
||||||
|
; ; reset enemy time. FIXME: variable?
|
||||||
|
; enemy_count=50;
|
||||||
|
; }
|
||||||
|
; else {
|
||||||
|
; enemy_count--;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; if (battle_count>=64) {
|
||||||
|
;
|
||||||
|
; ; TODO: randomly fail at running? */
|
||||||
|
; if (running) {
|
||||||
|
; break;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; if (menu_state==MENU_NONE) menu_state=MENU_MAIN;
|
||||||
|
; menu_keypress(ch);
|
||||||
|
;
|
||||||
|
; } else {
|
||||||
|
; battle_count++;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; old=battle_bar;
|
||||||
|
; battle_bar=(battle_count/16);
|
||||||
|
; if (battle_bar!=old) draw_battle_bottom(enemy_type);
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; if (enemy_hp==0) {
|
||||||
|
; ; FIXME?
|
||||||
|
; victory_dance();
|
||||||
|
; break;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
;
|
||||||
|
; }
|
||||||
|
;
|
||||||
|
; ram[DRAW_PAGE]=PAGE0;
|
||||||
|
; clear_bottom();
|
||||||
|
; ram[DRAW_PAGE]=PAGE1;
|
||||||
|
; clear_bottom();
|
||||||
|
;
|
||||||
|
; running=0;
|
||||||
|
;
|
||||||
|
; return 0;
|
||||||
|
;}
|
||||||
|
rts
|
|
@ -0,0 +1,389 @@
|
||||||
|
|
||||||
|
|
||||||
|
;========================
|
||||||
|
; summon metrocat
|
||||||
|
;========================
|
||||||
|
summon_metrocat:
|
||||||
|
|
||||||
|
lda #$17
|
||||||
|
sta DAMAGE_VAL
|
||||||
|
|
||||||
|
lda #28
|
||||||
|
sta MAGIC_X
|
||||||
|
lda #2
|
||||||
|
sta MAGIC_Y
|
||||||
|
|
||||||
|
;===========================
|
||||||
|
; draw looming metrocat head
|
||||||
|
|
||||||
|
lda #30
|
||||||
|
sta ANIMATE_LOOP
|
||||||
|
looming_metrocat_loop:
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; draw hero
|
||||||
|
lda #34
|
||||||
|
sta HERO_X
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw metrocat's head
|
||||||
|
|
||||||
|
lda MAGIC_X
|
||||||
|
sta XPOS
|
||||||
|
lda MAGIC_Y
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<metrocat_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>metrocat_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
; draw battle bottom
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #75
|
||||||
|
jsr WAIT ; delay a bit
|
||||||
|
|
||||||
|
dec ANIMATE_LOOP
|
||||||
|
bne looming_metrocat_loop
|
||||||
|
|
||||||
|
move_metrocat_loop:
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw metrocat's head
|
||||||
|
|
||||||
|
lda MAGIC_X
|
||||||
|
sta XPOS
|
||||||
|
lda MAGIC_Y
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<metrocat_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>metrocat_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
; draw battle bottom
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #50 ; delay
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
dec MAGIC_X
|
||||||
|
lda MAGIC_X
|
||||||
|
|
||||||
|
cmp #15
|
||||||
|
bcs metrocat_no_move_y
|
||||||
|
|
||||||
|
; have to keep even
|
||||||
|
|
||||||
|
and #1
|
||||||
|
bne metrocat_no_move_y
|
||||||
|
|
||||||
|
inc MAGIC_Y
|
||||||
|
inc MAGIC_Y
|
||||||
|
|
||||||
|
metrocat_no_move_y:
|
||||||
|
lda MAGIC_X
|
||||||
|
cmp #5 ; move until X=5
|
||||||
|
bcs move_metrocat_loop
|
||||||
|
|
||||||
|
|
||||||
|
lda #30
|
||||||
|
sta ANIMATE_LOOP
|
||||||
|
|
||||||
|
metrocat_damage_loop:
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw metrocat's head
|
||||||
|
|
||||||
|
lda MAGIC_X
|
||||||
|
sta XPOS
|
||||||
|
lda MAGIC_Y
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<metrocat_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>metrocat_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #50
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
dec ANIMATE_LOOP
|
||||||
|
bne metrocat_damage_loop
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw hero
|
||||||
|
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw bottom
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr damage_enemy
|
||||||
|
|
||||||
|
lda #2
|
||||||
|
sta XPOS
|
||||||
|
lda #10
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
jsr gr_put_num
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
; long wait (2s?)
|
||||||
|
ldx #200
|
||||||
|
jsr long_wait
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
;=========================
|
||||||
|
; Vortex Cannon
|
||||||
|
;=========================
|
||||||
|
|
||||||
|
summon_vortex_cannon:
|
||||||
|
|
||||||
|
lda #5
|
||||||
|
sta DAMAGE_VAL
|
||||||
|
|
||||||
|
lda #20
|
||||||
|
sta MAGIC_X
|
||||||
|
sta MAGIC_Y
|
||||||
|
|
||||||
|
|
||||||
|
; draw the cannon
|
||||||
|
|
||||||
|
lda #30
|
||||||
|
sta ANIMATE_LOOP
|
||||||
|
|
||||||
|
vortex_setup_loop:
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
|
||||||
|
; draw hero
|
||||||
|
lda #34
|
||||||
|
sta HERO_X
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; grsim_put_sprite(vortex_cannon,ax,ay);
|
||||||
|
|
||||||
|
; draw vortex_cannon
|
||||||
|
|
||||||
|
lda #20
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<vortex_cannon_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>vortex_cannon_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
; draw bottom
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #50
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
dec ANIMATE_LOOP
|
||||||
|
bne vortex_setup_loop
|
||||||
|
|
||||||
|
|
||||||
|
; Fire vortices
|
||||||
|
|
||||||
|
|
||||||
|
lda #5
|
||||||
|
sta ANIMATE_LOOP
|
||||||
|
|
||||||
|
vortex_cannon_fire_loop:
|
||||||
|
|
||||||
|
lda #20
|
||||||
|
sta MAGIC_X
|
||||||
|
|
||||||
|
vortex_cannon_move_loop:
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; draw hero
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw vortex_cannon
|
||||||
|
|
||||||
|
lda #20
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<vortex_cannon_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>vortex_cannon_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
; draw vortex
|
||||||
|
|
||||||
|
lda MAGIC_X
|
||||||
|
sta XPOS
|
||||||
|
lda #24
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
lda #<vortex_sprite
|
||||||
|
sta INL
|
||||||
|
lda #>vortex_sprite
|
||||||
|
sta INH
|
||||||
|
|
||||||
|
jsr put_sprite_crop
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
|
||||||
|
; print damage if < 10
|
||||||
|
lda MAGIC_X
|
||||||
|
cmp #10
|
||||||
|
bcs vortex_no_print_damage
|
||||||
|
|
||||||
|
lda #2
|
||||||
|
sta XPOS
|
||||||
|
lda #10
|
||||||
|
sta YPOS
|
||||||
|
|
||||||
|
jsr gr_put_num
|
||||||
|
|
||||||
|
vortex_no_print_damage:
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
lda #100
|
||||||
|
jsr WAIT
|
||||||
|
|
||||||
|
dec MAGIC_X
|
||||||
|
|
||||||
|
lda MAGIC_X
|
||||||
|
cmp #5
|
||||||
|
bcs vortex_cannon_move_loop
|
||||||
|
|
||||||
|
; damage enemy
|
||||||
|
jsr damage_enemy
|
||||||
|
|
||||||
|
dec ANIMATE_LOOP
|
||||||
|
bne vortex_cannon_fire_loop
|
||||||
|
|
||||||
|
|
||||||
|
; end of summon
|
||||||
|
|
||||||
|
|
||||||
|
jsr gr_copy_to_current
|
||||||
|
|
||||||
|
; draw enemy
|
||||||
|
lda ENEMY_X
|
||||||
|
sta XPOS
|
||||||
|
lda #20
|
||||||
|
sta YPOS
|
||||||
|
jsr draw_enemy
|
||||||
|
|
||||||
|
; draw hero
|
||||||
|
jsr draw_hero_and_sword
|
||||||
|
|
||||||
|
jsr draw_battle_bottom
|
||||||
|
|
||||||
|
jsr page_flip
|
||||||
|
|
||||||
|
; wait 2s
|
||||||
|
ldx #200
|
||||||
|
jsr long_wait
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
;=========================
|
||||||
|
; summon
|
||||||
|
;=========================
|
||||||
|
summon:
|
||||||
|
lda MENU_POSITION
|
||||||
|
beq do_summon_metrocat
|
||||||
|
bne do_summon_vortex_cannon
|
||||||
|
|
||||||
|
do_summon_metrocat:
|
||||||
|
jmp summon_metrocat
|
||||||
|
do_summon_vortex_cannon:
|
||||||
|
jmp summon_vortex_cannon
|
||||||
|
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,9 @@
|
||||||
.include "tfv_battle.s"
|
.include "tfv_battle.s"
|
||||||
.include "tfv_battle_menu.s"
|
.include "tfv_battle_menu.s"
|
||||||
.include "tfv_battle_limit.s"
|
.include "tfv_battle_limit.s"
|
||||||
|
.include "tfv_battle_summons.s"
|
||||||
|
.include "tfv_battle_boss.s"
|
||||||
|
|
||||||
.include "rotate_intro.s"
|
.include "rotate_intro.s"
|
||||||
|
|
||||||
;===============================================
|
;===============================================
|
||||||
|
|
Loading…
Reference in New Issue