146 lines
3.5 KiB
OpenEdge ABL
146 lines
3.5 KiB
OpenEdge ABL
/********************************************************************************
|
|
-------------------------
|
|
Ultra 64 MARIO Brothers
|
|
-------------------------
|
|
|
|
File : pathjumpblock.s
|
|
Description :
|
|
Date : 1995.
|
|
Author : H.yajima
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
/*################*/
|
|
#ifdef ASSEMBLER
|
|
/*################*/
|
|
|
|
e_jumpblock:
|
|
p_initialize(enemyA)
|
|
p_setbit(flag,stf_moveON | stf_catchON | stf_playerdistON )
|
|
p_setmovedata(30,-400,-50,1000,1000,600,0,0)
|
|
p_while
|
|
p_program(s_jumpblock)
|
|
p_loop
|
|
|
|
/*################*/
|
|
#else
|
|
/*################*/
|
|
/********************************************************************************
|
|
jumpblock hitcheck data
|
|
********************************************************************************/
|
|
|
|
static HitCheckRecord jumpblock_hit = {
|
|
OBJNAME_TAKE,
|
|
20,0,1,5, /* flag,ap,hp,coin */
|
|
130+20,210+40, /* player attack hitarea */
|
|
130+20,210+40, /* player attack hitarea */
|
|
};
|
|
|
|
/********************************************************************************
|
|
jumpblock main program
|
|
********************************************************************************/
|
|
|
|
#define jumpblock_timer (execstp->s[stw_work1].d)
|
|
|
|
/*----------------------------------------------*/
|
|
/* jumpblock strategy */
|
|
/*----------------------------------------------*/
|
|
static void jumpblock_move(void)
|
|
{
|
|
|
|
|
|
if ( obj_process == 0 ){
|
|
|
|
if ( jumpblock_timer-- < 0 ) obj_process++;
|
|
if ( obj_timer > obj_work0 ){
|
|
obj_speedY = 15 + Randomf()*5;
|
|
obj_process++;
|
|
}
|
|
|
|
} else {
|
|
if ( obj_movestatus & MOVESTAT_BGTOUCH ){
|
|
obj_process = 0;
|
|
jumpblock_timer = 30+Randomf()*60;
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/*----------------------------------------------*/
|
|
/* jumpblock fly */
|
|
/*----------------------------------------------*/
|
|
static void jumpblock_fly(void)
|
|
{
|
|
|
|
if ( obj_movestatus & ( MOVESTAT_BGBOUND | MOVESTAT_WATER | MOVESTAT_WALL ) ){
|
|
s_remove_obj(execstp);
|
|
s_kemuri();
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/*----------------------------------------------*/
|
|
/* jumpblock indexjump */
|
|
/*----------------------------------------------*/
|
|
|
|
static void *jumpblock_modejmp[] = {
|
|
|
|
jumpblock_move,
|
|
jumpblock_fly
|
|
|
|
};
|
|
|
|
/*----------------------------------------------*/
|
|
/* jumpblock main */
|
|
/*----------------------------------------------*/
|
|
static void jumpblock_main(void)
|
|
{
|
|
s_change_shape(S_hibiblock);
|
|
s_set_scale(0.5);
|
|
s_set_hitparam(execstp,&jumpblock_hit);
|
|
s_enemybgcheck();
|
|
s_enemymove(78);
|
|
s_modejmp(jumpblock_modejmp);
|
|
|
|
}
|
|
|
|
/********************************************************************************
|
|
jumpblock main program
|
|
********************************************************************************/
|
|
|
|
extern void s_jumpblock(void)
|
|
{
|
|
switch(execstp->s[stw_actionmode].d){
|
|
case CHILEDMODE_NO_CATCH: jumpblock_main(); break;
|
|
case CHILEDMODE_CATCH:
|
|
s_copy_worldXYZ(execstp,player1stp);
|
|
s_change_shape(S_hibiblock_noshadow);
|
|
s_mode_catch(-1,0);
|
|
break;
|
|
case CHILEDMODE_THROW: s_mode_throw(40,20,mode_jumpblock_fly); break;
|
|
case CHILEDMODE_DROP: s_mode_drop();
|
|
obj_mode = mode_jumpblock_fly;
|
|
break;
|
|
}
|
|
|
|
/* OFF request ? */
|
|
if ( obj_mail & EMAIL_NOKOBOARD_OFF ){
|
|
obj_remove_sound(NA_SE2_BLOCK_BURST);
|
|
s_burn_remove(46,BURNSET_NORMAL_COIN);
|
|
}
|
|
|
|
obj_mail = 0;
|
|
}
|
|
|
|
/*################*/
|
|
#endif
|
|
/*################*/
|
|
/*===============================================================================
|
|
end end end end end end end end
|
|
===============================================================================*/
|
|
|
|
|
|
|