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

283 lines
6.5 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File : pathhoriage.s
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
#define ANM_horiage_run 0
#define ANM_horiage_throwup 1
#define ANM_horiage_back 2
/*################*/
#ifdef ASSEMBLER
/*################*/
e_horiage:
e_robo:
p_initialize(enemyA)
p_setbit( flag,stf_moveON | stf_YangleSAME | stf_playerdistON | stf_playerangleON | stf_catchON )
p_set_pointer(skelanime,omurobo_anime)
p_set_skelanime_number(0)
p_setmovedata(200,-400,-50,1000,1000,600,0,0)
p_makeobj_child(S_NULL,e_robo_hand)
p_setd(objname,OBJNAME_TAKE)
p_setd(enemyinfo,ENEMYINFO_HORIAGE | ENEMYINFO_CARRY )
p_sethitbox(120,100)
p_save_nowpos
p_hitON
p_while
p_program(s_horiage)
p_loop
e_robo_hand:
p_initialize(enemyA)
p_setbit(flag,stf_moveON | stf_YangleSAME )
p_softspritemodeON
p_while
p_program(s_robo_hand)
p_loop
/*################*/
#else
/*################*/
#define robo_speed (execstp->s[stw_work0].f)
/********************************************************************************
robo hand
********************************************************************************/
extern void s_robo_hand(void)
{
StrategyRecord *firep;
execstp->s[stw_skeletonX].f = 200;
execstp->s[stw_skeletonY].f = -50;
execstp->s[stw_skeletonZ].f = 0;
obj_angleY = execstp->motherobj->s[stw_angleY].d;
switch (execstp->motherobj->s[stw_imm].d ){
case 0:
break;
case 1:
// s_copy_mapwork(player1stp,execstp);
break;
case 2:
objsound(NA_SE3_THROWUP);
player1stp->s[stw_mail].d |= PLAYERMAIL_CARRYMODE_OFF;
playerWorks[0].velocity = -45;
playerWorks[0].speed[1] = 95;
execstp->motherobj->s[stw_imm].d = 0;
break;
}
}
/********************************************************************************
C Program ( horiage wait program )
********************************************************************************/
#define HORIAGE_STARTWAIT 30
#define HORIAGE_WAITTIME 10
#define HORIAGE_ANIMETIME 12
#define ROBOSTOP_TIME 150
typedef struct {
short timer;
short anime;
} TimeAnimeRecord;
static TimeAnimeRecord horiage_data[] = {
{ HORIAGE_STARTWAIT ,0 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*1 ,1 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*1+HORIAGE_WAITTIME*1 ,0 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*2+HORIAGE_WAITTIME*1 ,1 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*2+HORIAGE_WAITTIME*2 ,0 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*3+HORIAGE_WAITTIME*2 ,1 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*3+HORIAGE_WAITTIME*3 ,0 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*4+HORIAGE_WAITTIME*3 ,1 },
{ HORIAGE_STARTWAIT+HORIAGE_ANIMETIME*4+HORIAGE_WAITTIME*4 ,0 },
{ -1, 0 }
};
static void horiage_wait(void)
{
int i = 0;
obj_speedF = 0;
s_wait_anime();
while(1){
if ( horiage_data[i].timer == -1 ){
obj_mode = mode_horiage_search;
break;
}
if ( obj_timer < ( horiage_data[i].timer ) ){
s_set_skelanime_speed(ANM_horiage_back,(float)(horiage_data[i].anime) );
break;
}
i++;
}
}
/********************************************************************************
C Program ( horiage wait program )
********************************************************************************/
static void horiage_search(void)
{
float time;
short chase_angle;
if ( s_calc_playerscope() > 1000 ) obj_targetangle = s_calc_returnangle();
if ( obj_timer > ROBOSTOP_TIME ){
robo_speed = ( (38*4) - (( obj_timer - ROBOSTOP_TIME )*1)) / (38.0f*4);
if ( robo_speed < 0.1 ){
robo_speed = 0.1;
obj_mode = mode_horiage_wait;
}
} else {
robo_speed = 1.0;
}
s_set_skelanime_speed(ANM_horiage_run,robo_speed);
obj_speedF = (10) * robo_speed;
chase_angle = 0x400 * robo_speed;
obj_angleY = s_chase_angle(obj_angleY,obj_targetangle,chase_angle);
}
/********************************************************************************
C Program ( horiage pitch program )
********************************************************************************/
static void horiage_pitch(void)
{
obj_speedF = 0;
if ( obj_timer == 0 ) execstp->s[stw_imm].d = 2; /* nageru shyn kan */
if ( obj_timer == 1 ){
s_set_skelanime_speed(1,1.0);
execstp->hit_counter = 20; /* hit time wait!! */
}
if ( s_check_animeend() ) obj_mode = mode_horiage_wait;
}
/********************************************************************************
C Program ( horiage r program )
********************************************************************************/
static void horiage_init(void)
{
s_copy_initpos();
if ( mcWaterCheck(obj_worldX,obj_worldZ) < obj_worldY && obj_playerdist < 4000 ){
s_hitON();
s_shape_disp();
obj_mode = mode_horiage_wait;
} else {
s_hitOFF();
s_shape_hide();
}
}
/********************************************************************************
C Program ( horiage pitch program )
********************************************************************************/
static void *horiage_modejmp[] = {
horiage_init,
horiage_wait,
horiage_search,
horiage_pitch
};
static void horiage_main(void)
{
s_enemybgcheck();
s_modejmp(horiage_modejmp);
s_enemymove(-78);
if ( obj_movestatus & MOVESTAT_WATER ) obj_animepositionY = -15;
else obj_animepositionY = 0;
if ( obj_speedF > 3 ) objsound_level(NA_LSE3_THROWUP_MOVE);
if ( obj_mode != mode_horiage_init && obj_movestatus & MOVESTAT_WATER ){
obj_mode = mode_horiage_init;
}
if ( execstp->s[stw_mail].d & EMAIL_CARRYMODE_ON ){
execstp->s[stw_mail].d = 0;
execstp->s[stw_imm].d = 1;
obj_mode = mode_horiage_pitch;
}
}
/********************************************************************************
C Program ( horiage pitch program )
********************************************************************************/
extern void s_horiage(void)
{
s_set_scale(2.0);
switch(execstp->s[stw_actionmode].d){
case CHILEDMODE_NO_CATCH: horiage_main(); break;
case CHILEDMODE_CATCH: s_mode_catch(0,0); break;
case CHILEDMODE_THROW: s_mode_drop(); break;
case CHILEDMODE_DROP: s_mode_drop(); break;
}
obj_mail = 0;
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/