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

112 lines
2.8 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File : pathswitchdoor.s
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
/*################*/
#ifdef ASSEMBLER
/*################*/
e_switchdoor_object:
p_initialize(moveBG)
p_setbit(flag,stf_moveON | stf_YangleSAME )
p_while
p_program(s_switchdoor_object)
p_program(stMainMoveBG)
p_loop
e_switchdoor:
p_initialize(option)
p_setbit(flag,stf_moveON | stf_YangleSAME )
p_while
p_program(s_switchdoor)
p_loop
/*################*/
#else
/*################*/
/********************************************************************************
switch door << door >>
********************************************************************************/
extern void s_switchdoor_object(void)
{
if ( obj_mode == 0 ){
if ( execstp->motherobj->s[stw_imm].d != 0 ) obj_mode++;
} else if ( obj_mode == 1 ){
if ( obj_timer < 0x40 ) obj_angleY -= 0x100 * obj_programselect;
else obj_mode++;
}
}
/********************************************************************************
switch door << door >>
********************************************************************************/
typedef struct {
short Xoffset;
short shape;
short *funlike;
} SwitchDoorRecord;
extern short pl_moveobj_03_check_info[];
extern short kdow_f_tr_check_info[];
static SwitchDoorRecord switchdoor_data[] = {
{ 320,S_movebg03,pl_moveobj_03_check_info },
{ 410,S_movebg07,kdow_f_tr_check_info },
};
extern void s_switchdoor(void)
{
StrategyRecord *stp;
int n;
switch(obj_mode){
case 0:
n = obj_programselect;
stp = s_makeobj_chain(-1,switchdoor_data[n].Xoffset ,0,0,execstp,switchdoor_data[n].shape,e_switchdoor_object);
stp->s[stw_angleY].d += 0x8000;
s_set_shapeinfo(stp,switchdoor_data[n].funlike);
stp = s_makeobj_chain(1,-switchdoor_data[n].Xoffset,0,0,execstp,switchdoor_data[n].shape,e_switchdoor_object);
s_set_shapeinfo(stp,switchdoor_data[n].funlike);
obj_mode++;
break;
case 1:
if ( ( execstp->s[stw_work0].pointer = (void *)s_find_obj(e_switchdoor_switch)) != NULL ) obj_mode++;
break;
case 2:
stp = ( StrategyRecord *)(execstp->s[stw_work0].pointer);
if ( stp->s[stw_mode].d == MODE_SWITCH_ON ){
obj_imm = MODE_SWITCH_ON;
objsound(NA_SE2_METAL_GATE);
obj_mode++;
if ( obj_programselect ) Na_NazoClearBgm();
}
break;
case 3:
break;
}
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/