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

165 lines
3.9 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File : pathbikkuriswitch.s
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
/*################*/
#ifdef ASSEMBLER
/*################*/
/*----------------------------------------------*/
/* */
/* bikkuri switch */
/* */
/*----------------------------------------------*/
e_bikkuri_dodai:
p_initialize(moveBG)
p_setbit(flag,stf_moveON | stf_YangleSAME )
p_setshapeinfo(bikkuri_dodai_info)
p_while
p_program(stMainMoveBG)
p_loop
e_bikkuri_switch:
p_initialize(moveBG)
p_setbit(flag,stf_moveON | stf_YangleSAME )
p_setshapeinfo(bikkuri_button_info)
p_while
p_program(s_bikkuri)
p_program(stMainMoveBG)
p_loop
/*################*/
#else
/*################*/
/********************************************************************************
bikkuri switch ( BACKUP PARAMETER )
********************************************************************************/
#define BIKKURI_MINSCALE 0.1f
#define BIKKURI_SCALE 0.5f
#define BIKKURI_YOFFSET (142*BIKKURI_SCALE)
static unsigned char backup_switchmessage[] = { 10,11,12 };
#define bikkuri_timer (execstp->s[stw_work0].d)
/********************************************************************************
bikkuri switch initialize
********************************************************************************/
static void bikkuri_init(void)
{
obj_animecounter = obj_programselect;
s_set_scale(BIKKURI_SCALE);
obj_worldY += BIKKURI_YOFFSET;
s_makeobj_chain_scale(0,0,-BIKKURI_YOFFSET,0,BIKKURI_SCALE,execstp,S_bikkuri_dodai , e_bikkuri_dodai);
if ( activeStageNo != 32 ){
if ( BuGetItemFlag() & backup_switchtable[obj_programselect] ){
obj_mode = mode_bikkuri_off;
execstp->map.scale[1] = BIKKURI_MINSCALE;
}
else obj_mode = mode_bikkuri_oncheck;
} else {
obj_mode = mode_bikkuri_oncheck;
}
}
/********************************************************************************
bikkuri switch ON check
********************************************************************************/
static void bikkuri_oncheck(void)
{
if ( s_rideon_player() ){
BuSetItemFlag(backup_switchtable[obj_programselect] );
obj_mode = mode_bikkuri_on;
objsound(NA_SE2_BIGSWITCH );
}
}
/********************************************************************************
bikkuri switch ON Animation
********************************************************************************/
static void bikkuri_on(void)
{
int data;
if ( obj_timer < 5 ){
s_scale_timezoom(TIMESCALE_Y,4,BIKKURI_SCALE,BIKKURI_MINSCALE);
if ( obj_timer == 4 ){
s_call_Viewshake(VS_SMALL);
s_kemuri();
s_boxeffect(60,S_polygon_hoshi,0.3,obj_programselect);
SendMotorEvent(5,80); /* MOTOR 1997.5.30 */
}
} else {
if ( data = s_call_talkdemo( DLOG_LOOKFRONT,
ENEMYDEMO_SETMESSAGE_YESNO+ENEMYDEMO_CAMERA,
CAM_DEMO_ITEM,0) ){
obj_mode = mode_bikkuri_off;
}
}
}
/********************************************************************************
bikkuri switch OFF
********************************************************************************/
static void bikkuri_off(void)
{
}
/********************************************************************************
bikkuri program
********************************************************************************/
static void *bikkuri_modejmp[] = {
bikkuri_init,
bikkuri_oncheck,
bikkuri_on,
bikkuri_off
};
extern void s_bikkuri(void)
{
s_modejmp(bikkuri_modejmp);
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/