home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DOS/V Power Report 1999 February
/
VPR9902A.BIN
/
FFILLY
/
UG
/
chara.tfy
< prev
next >
Wrap
Text File
|
1998-04-30
|
4KB
|
117 lines
// set ----------------------------------------------------------------
int setFrame( int i, int k ){
if ( i == 0 ) {
C_W[i] = K_W[k]; C_H[i] = K_H[k];
C_sX[i] = K_sX[k]; C_sY[i] = K_sY[k];
}
else {
C_W[i] = K_W[k]; C_H[i] = K_H[k];
C_sX[i] = C_PW[i] - ( K_sX[k] + K_W[k] );
C_sY[i] = K_sY[k];
}
} // method end
// FB -----------------------------------------------------------------
int setFB( int f ){
if ( f == 0 ) { paintOrder[0] = 1; paintOrder[1] = 0;}
else { paintOrder[0] = 0; paintOrder[1] = 1;}
} // method end
// MOUSE --------------------------------------------------------------
int MouseDown( int i ){
int cx, cy;
if ( C_AN[i] == AN_MOUNT ) { C_AN[i] = AN_MPUNCH; return; }
cx = ASX + C_X[i] - hsVal;
cy = ASY + C_Y[i] - vsVal;
if ( i == 0 ) {
if ( MesP2 >= cx ) {
if ( MesP3 <= cy - 50 ) { C_AN[i] = AN_PUNCH; }
else if ( MesP3 >= cy + 50 )
{ C_AN[i] = AN_KICK; }
else { C_AN[i] = AN_MOVE_G; }
}
else {
if ( MesP3 <= cy - 50 ) { C_AN[i] = AN_TUCKLE; }
else { C_AN[i] = AN_MOVE_B; }
}
}
else {
if ( MesP2 <= cx ) {
if ( MesP3 <= cy - 50 ) { C_AN[i] = AN_PUNCH; }
else if ( MesP3 >= cy + 50 )
{ C_AN[i] = AN_KICK; }
else { C_AN[i] = AN_MOVE_G; }
}
else {
if ( MesP3 <= cy - 50 ) { C_AN[i] = AN_TUCKLE; }
else { C_AN[i] = AN_MOVE_B; }
}
}
} // method end
// KEY ----------------------------------------------------------------
int KeyDown( int i ){
int n;
if ( i == 0 ) { n = 1; } else { n = 0; }
// STAND
if ( C_AN[i] == AN_WAIT ) {
if ( MesP2 == 0x27 ){ // →
if ( i == 0 ) { C_AN[i] = AN_MOVE_G; }
else { C_AN[i] = AN_MOVE_B; }
}
else if ( MesP2 == 0x25 ){ // ←
if ( i == 0 ) { C_AN[i] = AN_MOVE_B; }
else { C_AN[i] = AN_MOVE_G; }
}
else if ( MesP2 == 90 ) { C_AN[i] = AN_PUNCH; } // Z
else if ( MesP2 == 88 ) { C_AN[i] = AN_KICK; } // X
else if ( MesP2 == 67 ) { C_AN[i] = AN_TUCKLE; } // C
}
// MOUNT
else {
if ( C_AN[i] == AN_MOUNT ) { C_AN[i] = AN_MPUNCH; }
}
} // method end
// CPU ----------------------------------------------------------------
int runCPU( int i, int type ){
int n;
int ct, r, last;
if ( i == 0 ) { n = 1; } else { n = 0; }
ct = 0; last = 0;
mes( TIME ) {
if ( gStatus == GS_END || gStatus == GS_DEMO ) { del_me; } // END
if ( gStatus == GS_PLAY ) {
step( 10 ){
ct = ct +1;
if ( C_AN[i] == AN_WAIT && ( ct >= 3 || Random( 2 ) == 0 ) ) {
ct = 0;
if ( 200 < C_X[1] - C_X[0] ) {
r = Random( 5 );
if ( r < 3 ) { C_AN[i] = AN_MOVE_G; last = C_AN[i]; }
else if ( last != AN_MOVE_B )
{ C_AN[i] = AN_MOVE_B; last = C_AN[i]; }
else { C_AN[i] = AN_MOVE_G; last = C_AN[i]; }
}
else {
r = Random( 7 );
if ( r <= 1 ) { C_AN[i] = AN_PUNCH; last = C_AN[i]; }
else if ( r <= 3 ) { C_AN[i] = AN_KICK; last = C_AN[i]; }
else if ( r == 5 ) { C_AN[i] = AN_TUCKLE; last = C_AN[i]; }
else { C_AN[i] = AN_MOVE_B; last = C_AN[i]; }
}
}
} // step end
step( 6 ) {
if( C_AN[i] == AN_MOUNT ){ C_AN[i] = AN_MPUNCH; last = C_AN[i]; }
}
} // if gStatus end
}
} // method end