269 lines
6.7 KiB
OpenEdge ABL
269 lines
6.7 KiB
OpenEdge ABL
/********************************************************************************
|
|
-------------------------
|
|
Ultra 64 MARIO Brothers
|
|
-------------------------
|
|
|
|
File : pathwater.s
|
|
Description :
|
|
Date : 1995.11.14
|
|
Author : H.yajima
|
|
|
|
********************************************************************************/
|
|
|
|
|
|
/*################*/
|
|
#ifdef ASSEMBLER
|
|
/*################*/
|
|
|
|
/*--------------------------------------------------------------*/
|
|
/* small splash !! */
|
|
/*--------------------------------------------------------------*/
|
|
|
|
e_smallsplash:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON)
|
|
p_shapeOFF
|
|
p_program(s_smallsplash_init)
|
|
p_wait(1)
|
|
p_killshape
|
|
|
|
/*--------------------------------------------------------------*/
|
|
/* small splash !! */
|
|
/*--------------------------------------------------------------*/
|
|
|
|
e_jumpsplash:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON)
|
|
p_shapeOFF
|
|
p_program(s_jumpsplash_init)
|
|
p_wait(1)
|
|
p_killshape
|
|
|
|
/*--------------------------------------------------------------*/
|
|
/* small drop */
|
|
/*--------------------------------------------------------------*/
|
|
|
|
e_smallwaterdrop:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON | stf_FspeedON | stf_YangleSAME )
|
|
p_while
|
|
p_program(s_smalldrop_main)
|
|
p_loop
|
|
|
|
/*--------------------------------------------------------------*/
|
|
/* small drop */
|
|
/*--------------------------------------------------------------*/
|
|
|
|
e_smalldropripple:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON)
|
|
p_animereset
|
|
p_program(s_smallripple_init)
|
|
p_do(6)
|
|
p_animeinc
|
|
p_next
|
|
p_killshape
|
|
|
|
/*--------------------------------------------------------------*/
|
|
/* funsui */
|
|
/*--------------------------------------------------------------*/
|
|
|
|
|
|
e_funsui:
|
|
p_initialize(option)
|
|
p_setbit(flag,stf_moveON | stf_playerdistON )
|
|
p_shapeOFF
|
|
p_while
|
|
p_program(s_funsui_main)
|
|
p_loop
|
|
|
|
|
|
|
|
/*################*/
|
|
#else
|
|
/*################*/
|
|
|
|
extern AnimePtr RCP_fishAnime[];
|
|
|
|
/********************************************************************************
|
|
----------------
|
|
funsui program
|
|
----------------
|
|
********************************************************************************/
|
|
|
|
extern void s_funsui_main(void)
|
|
{
|
|
|
|
|
|
int i;
|
|
float sc;
|
|
StrategyRecord *stratp;
|
|
float waterY = mcWaterCheck(obj_worldX,obj_worldZ);
|
|
|
|
switch(obj_mode){
|
|
case 0:
|
|
if ( obj_playerdist < 200 ) obj_mode++;
|
|
break;
|
|
case 1:
|
|
if ( waterY > -10000 ){
|
|
if ( beforeframe_objcount < ( NUM_STRATEGY - 28 )){
|
|
|
|
if ( frameCounter % 32 == 0 ) objsound(NA_SE2_FISH);
|
|
|
|
for(i=0;i<2;i++){
|
|
|
|
if ( ( Randomd() & 0x1f ) == 0 ){
|
|
stratp = s_makeobj_nowpos(execstp,S_fish,e_smallwaterdrop);
|
|
s_set_skeletonobj(stratp,(void *)RCP_fishAnime,0);
|
|
} else {
|
|
stratp = s_makeobj_nowpos(execstp,S_waterdrop,e_smallwaterdrop);
|
|
sc = Randomf()*1+0.5;
|
|
stSetScale(stratp,sc,sc,sc);
|
|
s_softspritemodeON(stratp);
|
|
}
|
|
|
|
stratp->s[stw_angleY].d = Randomd();
|
|
stratp->s[stw_worldY].f = waterY;
|
|
stratp->s[stw_speedF].f = Randomf()*3+2;
|
|
stratp->s[stw_speedY].f = Randomf()*20+20;
|
|
}
|
|
}
|
|
}
|
|
|
|
if ( obj_playerdist > 300 ) obj_mode = 0;
|
|
break;
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/********************************************************************************
|
|
C Program
|
|
********************************************************************************/
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
/* jump */
|
|
/*------------------------------------------------------------------------------*/
|
|
extern void s_jumpsplash_init(void)
|
|
{
|
|
int i;
|
|
float sc;
|
|
float waterY;
|
|
StrategyRecord *stratp;
|
|
|
|
if ( beforeframe_objcount < ( NUM_STRATEGY - 28 )){
|
|
waterY = mcWaterCheck(obj_worldX,obj_worldZ);
|
|
if ( waterY > -10000 ){
|
|
|
|
for(i=0;i<20;i++){
|
|
if ( ( Randomd() & 0xff ) == 0 ){
|
|
stratp = s_makeobj_nowpos(execstp,S_fish,e_smallwaterdrop);
|
|
s_set_skeletonobj(stratp,(void *)RCP_fishAnime,0);
|
|
} else {
|
|
stratp = s_makeobj_nowpos(execstp,S_waterdrop,e_smallwaterdrop);
|
|
sc = Randomf()*1+0.5;
|
|
stSetScale(stratp,sc,sc,sc);
|
|
s_softspritemodeON(stratp);
|
|
}
|
|
|
|
stratp->s[stw_angleY].d = Randomd();
|
|
stratp->s[stw_worldY].f = waterY;
|
|
stratp->s[stw_speedF].f = Randomf()*3+2;
|
|
stratp->s[stw_speedY].f = Randomf()*20+20;
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
Mbitclr( player1stp->s[stw_effect].d , stf_jumpsink ); /* effect flag off */
|
|
|
|
}
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
/* main */
|
|
/*------------------------------------------------------------------------------*/
|
|
extern void s_smallsplash_init(void)
|
|
{
|
|
int i;
|
|
float sc;
|
|
float waterY;
|
|
StrategyRecord *stratp;
|
|
|
|
if ( beforeframe_objcount < ( NUM_STRATEGY - 28 )){
|
|
waterY = mcWaterCheck(obj_worldX,obj_worldZ);
|
|
if ( waterY > -10000 ){
|
|
for(i=0;i<5;i++){
|
|
stratp = s_makeobj_nowpos(execstp,S_waterdrop,e_smallwaterdrop);
|
|
stratp->s[stw_angleY].d = (player1stp->s[stw_angleY].d+0x8000) + (long)(Randomf()*0x6000 - 0x3000);
|
|
stratp->s[stw_worldY].f = waterY;
|
|
stratp->s[stw_speedF].f = Randomf()*8+2;
|
|
stratp->s[stw_speedY].f = Randomf()*10+10;
|
|
sc = Randomf()*1+0.5;
|
|
stSetScale(stratp,sc,sc,sc);
|
|
s_softspritemodeON(stratp);
|
|
}
|
|
}
|
|
}
|
|
|
|
Mbitclr( player1stp->s[stw_effect].d , stf_sink ); /* effect flag off */
|
|
|
|
}
|
|
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
/* ripple */
|
|
/*------------------------------------------------------------------------------*/
|
|
extern void s_smallripple_init(void)
|
|
{
|
|
|
|
s_set_scale( 1.5+Randomf() );
|
|
|
|
}
|
|
|
|
/*------------------------------------------------------------------------------*/
|
|
/* drop */
|
|
/*------------------------------------------------------------------------------*/
|
|
extern void s_smalldrop_main(void)
|
|
{
|
|
|
|
StrategyRecord *stratp;
|
|
float waterY = mcWaterCheck(obj_worldX,obj_worldZ);
|
|
|
|
if (obj_timer == 0 ){
|
|
obj_animeangleY = Randomd();
|
|
}
|
|
|
|
obj_speedY -= 4;
|
|
obj_worldY += obj_speedY;
|
|
|
|
if ( obj_speedY < 0 ){
|
|
if ( waterY > (execstp->s[stw_worldY].f) ){
|
|
stratp = s_makeobj(execstp,0,S_rippleA,e_smalldropripple);
|
|
stratp->s[stw_worldX].f = execstp->s[stw_worldX].f;
|
|
stratp->s[stw_worldY].f = waterY + 5;
|
|
stratp->s[stw_worldZ].f = execstp->s[stw_worldZ].f;
|
|
s_remove_obj(execstp);
|
|
} else {
|
|
if ( obj_timer > 60 ) s_remove_obj(execstp);
|
|
}
|
|
|
|
}
|
|
|
|
if ( waterY < -10000 ) s_remove_obj(execstp);
|
|
|
|
}
|
|
|
|
|
|
/*################*/
|
|
#endif
|
|
/*################*/
|
|
/*===============================================================================
|
|
end end end end end end end end
|
|
===============================================================================*/
|
|
|