257 lines
7.7 KiB
OpenEdge ABL
257 lines
7.7 KiB
OpenEdge ABL
/********************************************************************************
|
|
-------------------------
|
|
Ultra 64 MARIO Brothers
|
|
-------------------------
|
|
|
|
File : pathtatsumaki.s
|
|
Description :
|
|
Date : 1995.
|
|
Author : H.yajima
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
/*################*/
|
|
#ifdef ASSEMBLER
|
|
/*################*/
|
|
|
|
|
|
/********************************************************************************
|
|
tornedo program
|
|
********************************************************************************/
|
|
|
|
/* gomi program */
|
|
|
|
e_tatsumaki_object:
|
|
p_initialize(effect)
|
|
p_setbit(flag,stf_moveON | stf_FspeedON )
|
|
p_softspritemodeON
|
|
p_while
|
|
p_program(s_tatsumaki_object)
|
|
p_loop
|
|
|
|
|
|
e_tornedo:
|
|
p_initialize(player_friend)
|
|
p_setbit(flag,stf_moveON | stf_playerangleON | stf_playerdistON | stf_alldispON )
|
|
p_setmovedata(30,-400,0,0,0,200,0,0)
|
|
p_BGcheckYset
|
|
p_save_nowpos
|
|
p_while
|
|
p_program(s_tornedo)
|
|
p_loop
|
|
|
|
|
|
/********************************************************************************
|
|
tatsumaki object
|
|
********************************************************************************/
|
|
|
|
|
|
/*################*/
|
|
#else
|
|
/*################*/
|
|
|
|
/********************************************************************************
|
|
tornedo work
|
|
********************************************************************************/
|
|
|
|
|
|
static HitCheckRecord tatsumaki_hit = {
|
|
OBJNAME_TORNEDO,
|
|
0,0,0,0, /* flag,ap,hp,coin */
|
|
1500,4000, /* player attack hitarea */
|
|
0,0, /* player damage hitarea */
|
|
};
|
|
|
|
#define TORNEDO_SCALETIME 60.0f /* tornedo demo scalling time */
|
|
|
|
#define tornedo_work0 (execstp->s[stw_work0].d)
|
|
#define tornedo_timer (execstp->s[stw_work1].d)
|
|
|
|
|
|
/********************************************************************************
|
|
tornedo animation program
|
|
********************************************************************************/
|
|
|
|
#define TORNEDO_enemyp0 -83
|
|
#define TORNEDO_enemyp1 11
|
|
#define TORNEDO_enemyp2 14
|
|
#define TORNEDO_enemyp3 1
|
|
|
|
static void tornedo_anime(float totalscale)
|
|
{
|
|
short angle_add;
|
|
float scale;
|
|
|
|
angle_add = TORNEDO_enemyp1 * 0x400;
|
|
scale = 0.4*totalscale;
|
|
execstp->map.scale[0] = ( (cos(tornedo_work0)+1.0) * 0.5 * 0.3 + 1.0 ) * scale;
|
|
execstp->map.scale[1] = ((-cos(tornedo_work0)+1.0) * 0.5 * 0.5 + 0.5 ) * scale;
|
|
execstp->map.scale[2] = ( (cos(tornedo_work0)+1.0) * 0.5 * 0.3 + 1.0 ) * scale;
|
|
tornedo_work0 += 0x200;
|
|
obj_speedF = TORNEDO_enemyp2;
|
|
obj_animeangleY += angle_add;
|
|
}
|
|
|
|
/********************************************************************************
|
|
tornedo initial program
|
|
********************************************************************************/
|
|
|
|
static void tornedo_init(void)
|
|
{
|
|
if ( obj_process == 0 ){
|
|
s_hitON();
|
|
s_copy_initpos();
|
|
s_set_scale(0);
|
|
tornedo_timer = 0;
|
|
if ( obj_playerdist < 1500 ) obj_process++;
|
|
obj_timer = 0;
|
|
} else {
|
|
objsound_level(NA_LSE2_SANDSTORM);
|
|
tornedo_anime(obj_timer / TORNEDO_SCALETIME );
|
|
if ( obj_timer >= (int)TORNEDO_SCALETIME ) obj_mode = mode_tornedo_move;
|
|
}
|
|
|
|
}
|
|
|
|
/********************************************************************************
|
|
tornedo move program
|
|
********************************************************************************/
|
|
|
|
static void tornedo_move(void)
|
|
{
|
|
|
|
float scope = obj_programselect*100;
|
|
obj_returnangle = s_calc_returnangle(); /* set return angle */
|
|
|
|
objsound_level(NA_LSE2_SANDSTORM);
|
|
|
|
if ( s_calc_playerscope() < scope && obj_process == 0 ){
|
|
obj_speedF = 20;
|
|
s_chase_angleY(obj_targetangle,0x200);
|
|
dbPrint("off ",0);
|
|
if ( playerWorks[0].status == PS_SPINJUMP ) obj_process++;
|
|
} else {
|
|
obj_speedF = 20;
|
|
s_chase_angleY(obj_returnangle,0x200);
|
|
if ( s_calc_enemyscope() < 200 ) obj_mode = mode_tornedo_erase;
|
|
}
|
|
|
|
if ( obj_playerdist > 3000 ) obj_mode = mode_tornedo_erase;
|
|
|
|
s_enemybgcheck();
|
|
if ( obj_movestatus & MOVESTAT_WALL ) obj_angleY = obj_wallangleY;
|
|
s_enemymove(60);
|
|
tornedo_anime(1.0);
|
|
s_makeobj_nowpos(execstp,S_sand_dust,e_tatsumaki_object);
|
|
|
|
}
|
|
|
|
|
|
/********************************************************************************
|
|
erase tornedo
|
|
********************************************************************************/
|
|
|
|
static void tornedo_erase(void)
|
|
{
|
|
float scale = TORNEDO_SCALETIME-obj_timer;
|
|
|
|
if ( scale >= 0 ){
|
|
tornedo_anime( scale / TORNEDO_SCALETIME);
|
|
} else {
|
|
s_hitOFF();
|
|
if ( s_calc_playerscope() > 2500 ) obj_mode = 0;
|
|
if ( obj_timer > (int)(TORNEDO_SCALETIME)+ 300 ) obj_mode = 0;
|
|
}
|
|
|
|
}
|
|
|
|
|
|
/********************************************************************************
|
|
tornedo main program
|
|
********************************************************************************/
|
|
|
|
static void *tornedo_modejmp[] = {
|
|
|
|
tornedo_init,
|
|
tornedo_move,
|
|
tornedo_erase
|
|
|
|
};
|
|
|
|
extern void s_tornedo(void)
|
|
{
|
|
|
|
s_set_hitparam(execstp,&tatsumaki_hit); /* Set HitCheck Param */
|
|
s_modejmp(tornedo_modejmp);
|
|
obj_mail = 0;
|
|
|
|
}
|
|
|
|
|
|
/*===============================================================================
|
|
===============================================================================*/
|
|
|
|
|
|
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
/********************************************************************************/
|
|
|
|
|
|
#define motherobj_worldX (execstp->motherobj->s[stw_worldX].f)
|
|
#define motherobj_worldY (execstp->motherobj->s[stw_worldY].f)
|
|
#define motherobj_worldZ (execstp->motherobj->s[stw_worldZ].f)
|
|
|
|
|
|
|
|
/********************************************************************************
|
|
---------------------------
|
|
tatsumaki object program
|
|
---------------------------
|
|
********************************************************************************/
|
|
|
|
extern void s_tatsumaki_object(void)
|
|
{
|
|
|
|
obj_angleY += 55 * 0x100;
|
|
obj_speedF += 15;
|
|
obj_worldY += 22;
|
|
s_set_scale(1.0+Randomf());
|
|
if ( obj_timer == 0 ){
|
|
s_random_XZ_offset(execstp,100);
|
|
obj_animeangleX = Randomd();
|
|
obj_animeangleY = Randomd();
|
|
}
|
|
if ( obj_timer > 15 ) s_remove_obj(execstp);
|
|
|
|
}
|
|
|
|
/*################*/
|
|
#endif
|
|
/*################*/
|
|
/*===============================================================================
|
|
end end end end end end end end
|
|
===============================================================================*/
|
|
|
|
|
|
|