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

393 lines
10 KiB
OpenEdge ABL

/********************************************************************************
-------------------------
Ultra 64 MARIO Brothers
-------------------------
File :
Description :
Date : 1995.
Author : H.yajima
********************************************************************************/
/*################*/
#ifdef ASSEMBLER
/*################*/
/********************************************************************************
---------------------
stage24 Rotation BG
---------------------
********************************************************************************/
e_rotland:
p_initialize(moveBG)
p_setbit(flag,stf_moveON )
p_save_nowpos
p_while
p_program(s_castle_rotland)
p_program(stMainMoveBG)
p_loop
/********************************************************************************
----------------------
stage24 Tower Check
----------------------
********************************************************************************/
e_stage24_tower_check:
p_initialize(moveBG)
p_setbit(flag,stf_moveON )
p_setshapeinfo(ca_n_bg06_check_info)
p_setf(movebg_checkdist,3000)
p_setf(shapeLOD,20000)
p_while
p_program(stMainMoveBG)
p_loop
/********************************************************************************
----------------------
stage24 Killer Check
----------------------
********************************************************************************/
e_stage24_killer_check:
p_initialize(moveBG)
p_setbit(flag,stf_moveON )
p_setshapeinfo(ca_n_bg07_check_info)
p_setf(movebg_checkdist,300)
p_while
p_program(stMainMoveBG)
p_loop
/********************************************************************************
--------------------
castle attack wall
--------------------
********************************************************************************/
e_castle_attackwall_1:
p_initialize(moveBG)
p_setshapeinfo(ca_moveobj01_info)
p_jmp(castle_attackwall_common)
e_castle_attackwall_2:
p_initialize(moveBG)
p_setshapeinfo(ca_moveobj02_info)
castle_attackwall_common:
p_setbit( flag,stf_moveON | stf_YangleSAME | stf_playerdistON | stf_alldispON )
p_sethitbox(300,400)
p_hitON
p_while
p_program(s_castle_attackwall)
p_program(stMainMoveBG)
p_loop
/********************************************************************************
----------------------
castle attack bridge
----------------------
********************************************************************************/
e_castle_attackbridge:
p_initialize(moveBG)
p_setbit( flag,stf_moveON | stf_YangleSAME | stf_playerdistON | stf_alldispON | stf_playerangleON )
p_setshapeinfo(ca_moveobj03_info)
p_sethitbox(100,1200)
p_setdamagebox(1,1)
p_setf(movebg_checkdist,1500)
p_hitON
p_while
p_program(s_castle_attackbridge)
p_loop
/********************************************************************************
-------------
castle futa
-------------
********************************************************************************/
e_castle_futa:
p_initialize(moveBG)
p_setbit( flag,stf_moveON | stf_playerdistON | stf_alldispON )
p_setshapeinfo(ca_moveobj04_info)
p_sethitbox(100,100)
p_hitON
p_while
p_program(s_castle_futa)
p_program(stMainMoveBG)
p_loop
/********************************************************************************
----------------
castle sidebar
----------------
********************************************************************************/
e_castle_sidebar:
p_initialize(option)
p_end
/********************************************************************************
----------------
castle rotbar
----------------
********************************************************************************/
e_castle_rotbar:
p_initialize(moveBG)
p_setbit( flag,stf_moveON )
p_setshapeinfo(rote_bar_info)
p_while
p_program(s_castle_rotbar)
p_program(stMainMoveBG)
p_loop
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*------------------------------------------------------------------------------*/
/*################*/
#else
/*################*/
/********************************************************************************
---------------------
castle attack wall
---------------------
********************************************************************************/
extern void s_castle_attackwall(void)
{
if ( playerWorks[0].status == PS_CANNJUMP ){
s_hitON();
if ( s_hitcheck(execstp,player1stp) ){
if ( s_check_pathname(e_castle_attackwall_1) ) Na_NazoClearBgm();
obj_remove_sound(NA_SE2_WALLCRASH);
obj_objname = OBJNAME_DAMAGE;
obj_ap = 1;
s_burn_remove(80,BURNSET_NOTHING);
}
} else {
s_hitOFF();
}
}
/********************************************************************************
----------------------
castle attack bridge
----------------------
********************************************************************************/
/*
static unsigned long pl_attackdata[] = {
PS_ATTACK,
PS_RUNATTACK,
PS_SLIDEATTACK.
0
}
static unsigned long pl_jp_attackdata[] = {
PS_ATTACK,
PS_RUNATTACK,
PS_SLIDEATTACK.
0
}
*/
extern int s_attackcheck(int flag)
{
if ( s_hitcheck(execstp,player1stp) ){
if ( s_calc_dangle(obj_angleY,player1stp->s[stw_angleY].d) > 0x6000 ){
if ( playerWorks[0].status == PS_JUMPKICK ) return(1);
if ( playerWorks[0].status == PS_ATTACK ) return(1);
if ( playerWorks[0].status == PS_RUNATTACK ) return(1);
if ( playerWorks[0].status == PS_SLIDEKICK ) return(1);
if ( playerWorks[0].status == PS_JPPOWKICK ) return(2);
if ( playerWorks[0].status == PS_JUMPWALL ) return(2);
}
}
return(0);
}
static void attackbridge_reset(void)
{
obj_work1 = 1600;
obj_work0 = 0;
}
extern void s_castle_attackbridge(void)
{
int code;
switch(obj_mode){
case 0:
obj_animeangleX = 0;
if( s_attackcheck(0) ){
attackbridge_reset();
obj_mode++;
}
stMainMoveBG();
break;
case 1:
obj_animeangleX = 0; /* angleX ... 0 */
stMainMoveBG();
obj_animeangleX = - sin(obj_work0) * obj_work1; /* ( attack bridge move ) */
if( ( obj_timer > 30 ) && ( code = s_attackcheck(0) ) ){
if ( (player_worldY > obj_worldY+160) && ( code == 2 )){
obj_mode++;
objsound(NA_SE2_WOODPOLE_SWING);
} else obj_timer = 0;
}
if ( obj_timer != 0 ){
obj_work1 -= 8;
if ( obj_work1 < 0 ) obj_mode = 0;
} else {
attackbridge_reset();
}
if ( ( obj_work0 & 0x7fff ) == 0 ) objsound(NA_SE2_WOODPOLE_SWING);
obj_work0 += 0x400;
break;
case 2:
s_hitOFF();
s_change_shape(S_movebg05);
obj_anglespeedX -= 0x80;
obj_animeangleX += obj_anglespeedX;
if ( obj_animeangleX < -0x4000 ){
obj_animeangleX = -0x4000;
obj_anglespeedX = 0;
obj_mode++;
s_call_Viewshake(VS_SMALL);
objsound(NA_SE2_WOODPOLE_BOUND);
}
stMainMoveBG();
break;
case 3:
stMainMoveBG();
break;
}
execstp->map.matrix = NULL;
}
/********************************************************************************
-------------
castle futa
-------------
********************************************************************************/
extern void s_castle_futa(void)
{
if ( obj_timer == 0 ) obj_angleY -= 0x4000;
if ( s_attackcheck(0) ){
s_burn_remove(80,BURNSET_NOTHING);
obj_remove_sound(NA_SE2_WALLCRUMBLE);
}
}
/********************************************************************************
C Program
********************************************************************************/
#define rotbar_speed 0x100
#define rotbar_angle 0x8000
extern void s_castle_rotbar(void)
{
if ( obj_mode == 0 ){
obj_anglespeedY = 0;
if ( obj_timer > 60 ) obj_mode++;
} else {
obj_anglespeedY = rotbar_speed;
if ( obj_timer >= ( rotbar_angle/rotbar_speed-1 ) ) obj_mode=0;
objsound_level(NA_LSE2_RAFT_MOVE);
}
s_move_animeangle();
}
/********************************************************************************
C Program
********************************************************************************/
extern short ca_mobj14_check_info[];
extern short po_mobj07_check_info[];
static RotateMoveBGRecord rotbg_data[] = {
{ 0,100,ca_mobj14_check_info,2000 }, /* actorcode = 0 */
{ 0,150,po_mobj07_check_info,1000 }, /* actorcode = 1 */
};
extern void s_castle_rotland(void)
{
char speed = ( execstp->s[stw_actorcode].d >> 24 );
if ( obj_timer == 0 ){
s_set_shapeinfo(execstp,rotbg_data[obj_programselect].funlike );
obj_movebg_checkdist = rotbg_data[obj_programselect].checkdist;
s_set_scale(rotbg_data[obj_programselect].scale * 0.01f );
}
obj_anglespeedY = speed * 0x10;
obj_animeangleY += obj_anglespeedY;
}
/*################*/
#endif
/*################*/
/*===============================================================================
end end end end end end end end
===============================================================================*/