home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 February
/
VPR9902A.BIN
/
FFILLY
/
UG
/
waza.tfy
< prev
next >
Wrap
Text File
|
1998-04-30
|
7KB
|
213 lines
#define DIST_PUNCH 110
#define DIST_KICK 140
#define DIST_TUCKLE 120
// PLAY ---------------------------------------------------------------
int playAction( int i, int an ) {
C_Koma[i] = C_Koma[i] + 1;
if ( an == AN_MOUNTED ){ C_Koma[i] = 0; return; }
else if ( an == AN_MOVE_G ) { Action_Move( i, C_Koma[i], 1 ); }
else if ( an == AN_MOVE_B ) { Action_Move( i, C_Koma[i], -1 ); }
else if ( an == AN_DAMAGE ) { Action_Damage( i, C_Koma[i] ); }
else if ( an == AN_PUNCH ) { Action_Punch( i, C_Koma[i] ); }
else if ( an == AN_KICK ) { Action_Kick( i, C_Koma[i] ); }
else if ( an == AN_TUCKLE ) { Action_Tuckle( i, C_Koma[i] ); }
else if ( an == AN_MPUNCH ) { Action_MPunch( i, C_Koma[i] ); }
} // method end
// BASE ---------------------------------------------------------------
int setStandBase( int i ) {
C_AN[i] = AN_WAIT; setFrame( i, KM_BASE );
C_Koma[i] = 0;
C_Y[i] = startY;
} // method end
// BASE ---------------------------------------------------------------
int setMountFrame( int i, int n, int an, int kn ) {
C_AN[i] = an; setFrame( i, kn );
C_Y[i] = startY;
if ( i == 0 ) {
C_sX[i] = C_sX[i] + C_Type[n] * K_W[ KM_MOUNT ];
}
else {
C_sX[i] = C_sX[i] - C_Type[n] * K_W[ KM_MOUNT ];
}
setFrame( n, KM_MOUNTED ); C_AN[n] = AN_MOUNTED;
} // method end
// fire ---------------------------------------------------------------
int setFire( int i, int n, int x, int y ) {
fire_On[i] = 1;
F_X[i] = x; F_Y[i] = y;
sound_On = WV_HIT;
C_Ene[n] = C_Ene[n] - C_Hakai[i];
if ( C_Ene[n] <= 0 ) { gStatus = GS_DEMO; winner = i; }
} // method end
// Punch --------------------------------------------------------------
int setDamage( int i, int n ) {
if ( i == 0 ) { C_Koma[n] = 0; C_AN[n] = AN_DAMAGE; }
else { C_Koma[n] = 1; C_AN[n] = AN_DAMAGE; Action_Damage( n, 1 ); }
} // method end
// set ----------------------------------------------------------------
int movePosition( int i, int mx, int my ){
if ( i == 0 ) { C_X[i] = C_X[i] + mx; C_Y[i] = C_Y[i] + my; }
else { C_X[i] = C_X[i] - mx; C_Y[i] = C_Y[i] + my; }
} // method end
// MOVE ---------------------------------------------------------------
int Action_Move( int i, int kn, int pm ) {
if ( kn == 1 ) { movePosition( i, 35 * pm, 0 ); setFrame( i, KM_MOVE ); }
else if ( kn >= 2 ) { movePosition( i, 20 * pm, 0 ); setStandBase( i ); }
} // method end
// Punch --------------------------------------------------------------
int Action_Damage( int i, int kn ) {
if ( kn == 1 ) { movePosition( i, -10, 0 ); setFrame( i, KM_DAMAGE ); }
else if ( kn >= 2 ) { setStandBase( i ); }
} // method end
// Punch --------------------------------------------------------------
int Action_Punch( int i, int kn ) {
int n, dist;
if ( i == 0 ) { n = 1; } else { n = 0; }
if ( kn == 1 ) {
setFB(i); movePosition( i, 50, 0 ); setFrame( i, KM_PUNCH );
dist = C_X[1] - C_X[0];
if ( dist > DIST_PUNCH - 50 && dist < DIST_PUNCH ) { // HIT
setDamage( i, n );
setFire( i, n, C_X[n], C_Y[n] - 75 );
}
}
else if ( kn >= 2 ) { setStandBase( i ); }
} // method end
// Kick ---------------------------------------------------------------
int Action_Kick( int i, int kn ) {
int n, dist;
if ( i == 0 ) { n = 1; } else { n = 0; }
if ( kn == 1 ){
setFB(i); movePosition( i, 50, 0 ); setFrame( i, KM_KICK_0 );
}
else if ( kn == 2 ){
setFB(i); setFrame( i, KM_KICK_1 );
dist = C_X[1] - C_X[0];
if ( dist > DIST_KICK - 80 && dist < DIST_KICK ) { // HIT
setDamage( i, n );
setFire( i, n, C_X[n], C_Y[n] + 35 );
}
}
else if ( kn >= 3 ) { setStandBase( i ); }
} // method end
// Tuckle -------------------------------------------------------------
int Action_Tuckle( int i, int kn ) {
int n, dist;
if ( i == 0 ) { n = 1; } else { n = 0; }
if ( kn == 1 ){
setFB(i); movePosition( i, 50, 0 ); setFrame( i, KM_TUCKLE );
dist = C_X[1] - C_X[0];
if ( dist < DIST_TUCKLE && Random( 7 ) < 3 ) {
movePosition( n, -10, 0 ); setFrame( n, KM_DAMAGE );
C_Koma[n] = 0; C_AN[n] = AN_MOUNTED;
winner = i; isMount = 1;
}
}
else if ( kn >= 2 ) {
if ( winner == i ) {
setMountFrame( i, n, AN_MOUNT, KM_MOUNT ); C_Koma[i] = 0;
C_X[i] = C_X[n];
}
else { setStandBase( i ); }
}
} // method end
// MPunch -------------------------------------------------------------
int Action_MPunch( int i, int kn ) {
int n;
if ( i == 0 ) { n = 1; } else { n = 0; }
if ( kn == 1 ) {
setMountFrame( i, n, AN_MPUNCH, KM_MPUNCH );
if ( i == 0 ) { setFire( i, n, C_X[i] + 65, C_Y[i] + 65 ); }
else { setFire( i, n, C_X[i] - 65, C_Y[i] + 65 ); }
}
else if ( kn >= 2 ){ setMountFrame( i, n, AN_MOUNT, KM_MOUNT ); C_Koma[i] = 0; }
} // method end
// OFF ----------------------------------------------------------------
int Action_Demo( int pic, int i ) { // i = WINNER
int n, end;
int xpi, xpn;
if( i == 0 ) { n = 1; } else { n = 0; }
end = 0;
mes( TIME ) {
step( 30 ) {
,
setFB( i );
if ( isMount == 1 ) { xpi = -60; xpn = 0; }
else { xpi = 0; xpn = -50; }
movePosition( i, xpi, 0 ); setFrame( i, KM_BASE );
movePosition( n, xpn, 0 ); setFrame( n, KM_DEF );
sound_On = WV_END;
updateBI( pic );
paintEndMes( pic );
,
end = 1;
del_me;
}
}
mes( KEY_DOWN ) { if ( end == 1 ) { del_us; endGame( pic ); del_me; } }
mes( LBDOWN ) { if ( end == 1 ) { del_us; endGame( pic ); del_me; } }
} // method end
// MES ----------------------------------------------------------------
int paintEndMes( int pic ) {
int r, g, b;
int x, y;
str string;
if ( device < 2 ) {
if ( winner == LR ) {
string = "勝ちでしゅ、ワーイ!!";
r = 255; g = 0; b = 0;
}
else {
string = "負けちゃった、グスン....";
r = 0; g = 0; b = 255;
}
}
else {
if ( winner == 0 ) { string = "左が勝ちまちた"; }
else { string = "右が勝ちまちた"; }
r = 255; g = 255; b = 255;
}
x = ASX + ASW/2 - StrLen( string ) * 20 / 2;
y = ASY + 30;
paintBText( pic, x, y, 40, r,g,b, string );
string = "KEYDOWN OR CLICK TO CLEAR";
x = ASX + ASW/2 - StrLen( string ) * 15 / 2;
y = y + 50;
paintBText( pic, x, y, 25, 255,255,255, string );
} // method end
/*
// MES ----------------------------------------------------------------
int paintRandomMes( int pic ){
mes( TIME ){
step( 10 ){
del_me;
}
}
} // method end
*/