sm64/data/p/pathkopa3bg.p
2022-12-04 22:27:02 -05:00

204 lines
5.3 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File : pathkopa3bg.s
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
/*################*/
#ifdef ASSEMBLER
/*################*/
/********************************************************************************
-------------------------
kopa(3) moveBG Program
-------------------------
********************************************************************************/
e_kopa3_moveBG:
p_initialize(moveBG)
p_setbit(flag,stf_moveON )
p_setf(shapeLOD,20000)
p_setf(movebg_checkdist,20000)
p_save_nowpos
p_while
p_program(s_kopa3_moveBG)
p_program(stMainMoveBG)
p_loop
/*################*/
#else
/*################*/
/********************************************************************************
========================
kopa(3) moveBG Program
========================
********************************************************************************/
typedef struct {
short *funlike;
short posX;
short posZ;
short angY;
} KopaBGRecord;
extern short kopa3_A_info[];
extern short kopa3_B_info[];
extern short kopa3_C_info[];
extern short kopa3_D_info[];
extern short kopa3_E_info[];
extern short kopa3_F_info[];
extern short kopa3_G_info[];
extern short kopa3_H_info[];
extern short kopa3_I_info[];
extern short kopa3_J_info[];
static KopaBGRecord kopa_fin_bgdata[] = {
{ NULL , 0, 0 ,0 }, /* 0 */
{ kopa3_A_info, -800,-1000 ,0xae00 }, /* 1 */
{ kopa3_B_info, -1158, 390 ,0xb800 }, /* 2 */
{ kopa3_C_info, -1158, 390 ,0xe200 }, /* 3 */
{ kopa3_D_info, 0, 1240 ,0xe800 }, /* 4 */
{ kopa3_E_info, 0, 1240 ,0x1800 }, /* 5 */
{ kopa3_F_info, 1158, 390 ,0x1e00 }, /* 6 */
{ kopa3_G_info, 1158, 390 ,0x4800 }, /* 7 */
{ kopa3_H_info, 800,-1000 ,0x5200 }, /* 8 */
{ kopa3_I_info, 800,-1000 ,0x8400 }, /* 9 */
{ kopa3_J_info, -800,-1000 ,0x7c00 }, /* 10 */
};
#define mother_kopa (execstp->s[stw_work1].pointer)
#define kopa3bg_timer (execstp->s[stw_work2].d)
/********************************************************************************
kopa3 moveBG initialize !!
********************************************************************************/
static void kopa_fin_moveBG_init(void)
{
mother_kopa = (void *)s_find_obj(e_kopa);
s_set_shapeinfo(execstp,kopa_fin_bgdata[obj_programselect].funlike);
if ( mother_kopa != NULL ) obj_mode = mode_kopa_fin_moveBG_wait;
}
/********************************************************************************
kopa_fin moveBG waitting !!
********************************************************************************/
static void kopa_fin_moveBG_wait(void)
{
float dist;
StrategyRecord *mother = (StrategyRecord *)mother_kopa;
if ( mother->ride_strat == execstp ){
if ( (mother->s[stw_mode].d == mode_s_kopa_jump_atom ) && ( mother->s[stw_work0].d & KOPA_SUPERJUMP ) ){
obj_mode = mode_kopa_fin_moveBG_burn;
}
}
if ( ( mother->s[stw_hp].d == 1 ) &&
( ( mother->s[stw_mode].d == mode_s_kopa_punch ) || ( mother->s[stw_actionmode].d != 0 ) ) ){
obj_process = 1;
}
#ifdef yajima
if ( effect_p7 ) obj_process = 1;
#endif
if ( obj_process == 0 ) kopa3bg_timer = 0;
else {
if ( (20+effect_p6) * (obj_programselect-1) < kopa3bg_timer ) obj_mode = mode_kopa_fin_moveBG_burn;
kopa3bg_timer++;
}
}
/********************************************************************************
kopa_fin moveBG burn !!
********************************************************************************/
static void kopa_fin_moveBG_burn(void)
{
float wpos[3];
short angle;
float r;
StrategyRecord *mother = (StrategyRecord *)mother_kopa;
if ( obj_timer == 0 || obj_timer == 22 ) objsound(NA_SE2_STAGE_CRUMBLE);
// if ( obj_timer == 0 ) s_call_Viewshake(VS_SMALL);
if (obj_timer < 22 ){
Viewshake(VS_QUAKE);
obj_speedY = 8;
obj_gravity = 0;
} else {
obj_gravity = -4;
}
if ( ( obj_timer % 2 == 0 ) && obj_timer < 14 ){
angle = kopa_fin_bgdata[obj_programselect].angY + 0x100*effect_p1;
r = 290 * ( 6 - obj_timer / 2 );
s_copy_f(wpos,&obj_worldX);
obj_worldX = kopa_fin_bgdata[obj_programselect].posX + r * sin(angle+5296);
obj_worldZ = kopa_fin_bgdata[obj_programselect].posZ + r * cos(angle+5296);
obj_worldY = 307;
s_burneffect(4,0,100);
obj_worldX = kopa_fin_bgdata[obj_programselect].posX + r * sin(angle-5296);
obj_worldZ = kopa_fin_bgdata[obj_programselect].posZ + r * cos(angle-5296);
s_burneffect(4,0,100);
s_copy_f(&obj_worldX,wpos);
}
s_optionmove_F();
if ( obj_timer > 300 ) s_remove_obj(execstp);
}
/********************************************************************************
kopa_fin moveBG
********************************************************************************/
static void *kopa_fin_moveBG_modejmp[] = {
kopa_fin_moveBG_init,
kopa_fin_moveBG_wait,
kopa_fin_moveBG_burn
};
extern void s_kopa3_moveBG(void)
{
s_modejmp(kopa_fin_moveBG_modejmp);
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/