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

114 lines
2.7 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File : pathautodoor.s
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
/*################*/
#ifdef ASSEMBLER
/*################*/
/********************************************************************************
auto door program
********************************************************************************/
/*------------------------------------------*/
/* autodoor program */
/*------------------------------------------*/
e_autodoor:
p_initialize(moveBG)
p_setd(objname,OBJNAME_DOOR)
p_setshapeinfo(auto_door_check_info)
p_setd(enemyinfo,ENEMYINFO_AUTO_DOOR)
p_setbit(flag,stf_moveON | stf_playerdistON | stf_alldispON )
p_sethitbox(80,100)
p_save_nowpos
p_setf(shapeLOD,20000)
p_program(s_doorsystem_init)
p_hitON
p_while
p_program(s_autodoor)
p_program(s_doorsystem_main) /* stw_imm USE */
p_program(stMainMoveBG)
p_loop
/*################*/
#else
/*################*/
extern void s_speedL_move(void)
{
obj_speedX = obj_speedL * cos(obj_angleY);
obj_speedZ = obj_speedL * -sin(obj_angleY);
obj_worldX += obj_speedX;
obj_worldZ += obj_speedZ;
}
/********************************************************************************
autodoor (L)
********************************************************************************/
extern void s_autodoor(void)
{
int i;
StrategyRecord *stp = s_find_obj(e_autodoor);
switch(obj_mode){
case 0:
s_hitON();
if ( ( execstp-> s[stw_mail].d ) & ( EMAIL_DOOROPEN_1 + EMAIL_DOOROPEN_2 ) ) obj_mode = 1;
if ( stp != NULL && stp->s[stw_mode].d != 0 ) obj_mode = 1;
break;
case 1:
if ( obj_timer == 0 && (short)obj_angleY >= 0 ){
objsound(NA_SE2_AUTO_DOOR_OPEN);
SendMotorEvent(35,30); /* MOTOR 1997.6.5 */
}
s_hitOFF();
obj_speedL = -8;
s_speedL_move();
if ( obj_timer > 15 ) obj_mode++;
break;
case 2:
if ( obj_timer > 30 ) obj_mode++;
break;
case 3:
if ( obj_timer == 0 && (short)obj_angleY >= 0 ){
objsound(NA_SE2_AUTO_DOOR_CLOSE);
SendMotorEvent(35,30); /* MOTOR 1997.6.5 */
}
obj_speedL = 8;
s_speedL_move();
if ( obj_timer > 15 ) obj_mode++;
break;
case 4:
execstp->s[stw_mail].d = 0;
obj_mode = 0;
break;
}
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/