**************************************************************************** **************************************************************************** ** ** Platinum (Enemy destruction) ** ** This software is in the public domain. There is no warranty. ** ** by Patrick Davidson (pad@calc.org, http://pad.calc.org/) ** ** Last updated July 24, 2001 ** **************************************************************************** **************************************************************************** ********************************************** ENEMY DESCTRUCTION ROUTINES * * This file consists of enemy destruction routines. These routines are * called when an enemy is destroyed, with A4 pointing to the address of the * enemy structure. The routine should "destroy" the enemy by changing its * type to an explosion. Also, special actions are possible, such as making * the enemy become another enemy type, for enemies which must be destroyed * in stages. These routines can only modify D0/D1/A0/A1. * * The address of the enemy destruction routine (as a word offset from the * label Destroy_Base) is stored in the e_dstry field of each enemy structure. * ******** EDestruct_MBL: move.w e_dmg(a4),d0 add.w d0,e_dmg-e_size(a4) move.w #1,e_dmg(a4) rts EDestruct_MBR: move.w e_dmg(a4),d0 add.w d0,e_dmg-2*e_size(a4) move.w #1,e_dmg(a4) rts EDestruct_MBC: move.w #MEGABOSS_DIE,e_size(a4) move.w #MEGABOSS_DIE,2*e_size(a4) move.w #-2,e_data+e_size(a4) move.w #2,e_data+2*e_size(a4) EDestruct_Normal: lea bcd_buffer(a5),a0 lea score+4(a5),a1 move.l #$500,(a0)+ lea Move_Enemies-2,a2 add.w e_type(a4),A2 cmp.w #31337,(a2) bne.s noentry move.l #$2000,-4(a0) noentry: bsr Add_BCD cmp.w #FORM_SPIN3,(a4) bne.s EDestruct_Explode cmp.w #34,e_misc(a4) bne.s EDestruct_Solid EDestruct_Explode: move.w #-10000,e_h(a4) cmp.w #15,e_w(a4) bge.s edl move.w #EXPLODE,(a4) move.w #in_Explosion1,e_image(a4) rts edl: move.w #EXPLODE2,(a4) move.w #in_LExplosion1,e_image(a4) rts EDestruct_Solid: ; Solid enemy moveq #4,d0 bsr random tst.w d0 bne.s EDestruct_Explode ; Use normal destruction move.w #SPINNERM,(a4) subq.w #2,e_h(a4) subq.w #2,e_w(a4) move.w #8,e_dmg(a4) move.w #$101,e_data(a4) move.w #34,e_misc(a4) move.w #in_Enemy_Small_1,e_image(a4) rts EDestruct_Boss: move.w #EXPLODE2,(a4) move.w #-10000,e_h(a4) move.w #in_LExplosion1,e_image(a4) cmp.w #18,-e_size(a4) ; Previous/next superboss part bne.s not_type_18_prev addq.w #8,-e_size+e_image(a4) bra.s boss_explode_done not_type_18_prev: cmp.w #20,e_size(a4) bne.s boss_explode_done addq.w #8,e_size+e_image(a4) boss_explode_done: rts