195 lines
4.3 KiB
OpenEdge ABL
195 lines
4.3 KiB
OpenEdge ABL
/********************************************************************************
|
|
-------------------------
|
|
Ultra 64 MARIO Brothers
|
|
-------------------------
|
|
|
|
File : pathkiller
|
|
Description : mario's enemy killer
|
|
Date : 1995.9.8
|
|
Author : H.yajima
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
/*################*/
|
|
#ifdef ASSEMBLER
|
|
/*################*/
|
|
|
|
|
|
/********************************************************************************
|
|
killer program
|
|
********************************************************************************/
|
|
e_killer:
|
|
p_initialize(enemyA)
|
|
p_setbit( flag,stf_moveON | stf_YangleSAME | stf_FspeedON | stf_playerdistON | stf_playerangleON )
|
|
p_save_nowpos
|
|
p_sethitbox2(50,50,50)
|
|
p_setobjname(DAMAGE)
|
|
p_setd(ap,3)
|
|
p_set_scale(40)
|
|
p_hitON
|
|
p_setmovedata(30,0,0,0,0,0,0,0)
|
|
p_program(s_killer_init)
|
|
p_while
|
|
p_program(s_killer)
|
|
p_loop
|
|
|
|
|
|
e_killer_smorke:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON )
|
|
p_softspritemodeON
|
|
p_addf(worldY,-100)
|
|
p_program(s_killer_smorke)
|
|
p_animereset
|
|
p_do(10)
|
|
p_animeinc
|
|
p_next
|
|
p_killshape
|
|
|
|
|
|
/*################*/
|
|
#else
|
|
/*################*/
|
|
|
|
#define killer_angleY (execstp->s[stw_work1].d)
|
|
|
|
/********************************************************************************
|
|
killer smoke
|
|
********************************************************************************/
|
|
|
|
extern void s_killer_smorke(void)
|
|
{
|
|
s_set_scale( 2.0+Randomf()*2 );
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer initialize
|
|
********************************************************************************/
|
|
extern void s_killer_init(void)
|
|
{
|
|
killer_angleY = obj_angleY;
|
|
}
|
|
|
|
static void killer_init(void)
|
|
{
|
|
s_hitON();
|
|
obj_speedF = 0;
|
|
obj_angleY = killer_angleY;
|
|
obj_animeangleX = 0;
|
|
obj_animeangleZ = 0;
|
|
obj_movestatus = 0;
|
|
s_copy_initpos();
|
|
obj_mode = mode_killer_playerwait;
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer playerwait
|
|
********************************************************************************/
|
|
static void killer_playerwait(void)
|
|
{
|
|
|
|
short dangle = s_calc_dangle(obj_targetangle,obj_angleY);
|
|
|
|
if ( dangle < 0x2000 && 400 < obj_playerdist && obj_playerdist < 1500 ){
|
|
obj_mode = mode_killer_move;
|
|
}
|
|
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer moving
|
|
********************************************************************************/
|
|
static void killer_move(void)
|
|
{
|
|
if ( obj_timer < 40 ) obj_speedF = 3;
|
|
else if ( obj_timer < 50 ){
|
|
if (obj_timer%2) obj_speedF = 3;
|
|
else obj_speedF = -3;
|
|
}
|
|
else {
|
|
|
|
if ( obj_timer > 70 ) s_enemybgcheck();
|
|
|
|
s_makeobj_nowpos(execstp,S_dust,e_killer_smorke);
|
|
obj_speedF = 30;
|
|
if ( obj_playerdist > 300 ) s_chase_angleY(obj_targetangle,0x100);
|
|
|
|
if ( obj_timer == 50 ){
|
|
objsound(NA_SE3_TAIHOU);
|
|
s_call_Viewshake(VS_SMALL);
|
|
}
|
|
|
|
if ( (obj_timer > 150) || (obj_movestatus & MOVESTAT_WALL) ){
|
|
obj_mode = mode_killer_end;
|
|
s_kemuri();
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer ending
|
|
********************************************************************************/
|
|
static void killer_end(void)
|
|
{
|
|
obj_mode = mode_killer_init;
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer hit
|
|
********************************************************************************/
|
|
static void killer_hit(void)
|
|
{
|
|
if ( obj_timer == 0 ){
|
|
obj_speedF = -30;
|
|
s_hitOFF();
|
|
}
|
|
|
|
obj_animeangleX += 0x1000;
|
|
obj_animeangleZ += 0x1000;
|
|
|
|
obj_worldY += 20;
|
|
if ( obj_timer > 90 ) obj_mode = mode_killer_init;
|
|
|
|
}
|
|
|
|
/********************************************************************************
|
|
killer moving
|
|
********************************************************************************/
|
|
|
|
static void *killer_modejmp[] = {
|
|
|
|
killer_init,
|
|
killer_playerwait,
|
|
killer_move,
|
|
killer_end,
|
|
killer_hit
|
|
|
|
};
|
|
|
|
extern void s_killer(void)
|
|
{
|
|
|
|
s_modejmp(killer_modejmp);
|
|
if ( s_pl_hitcheck() ) obj_mode = mode_killer_hit;
|
|
|
|
|
|
}
|
|
|
|
/*################*/
|
|
#endif
|
|
/*################*/
|
|
/*===============================================================================
|
|
end end end end end end end end
|
|
===============================================================================*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|