Beispiel #1
0
/*
=================
sdWalker::Event_GroundPound
=================
*/
void sdWalker::Event_GroundPound( float force, float damageScale, float shockWaveRange ) {
	GroundPound( force, damageScale, shockWaveRange );

	bool leftleg = false;
	jointHandle_t jh = GetAnimator()->GetJointHandle( spawnArgs.GetString( leftleg ? "joint_foot_left" : "joint_foot_right" ) );

	idVec3 traceOrig;
	GetWorldOrigin( jh, traceOrig );

	idVec3 traceEnd = traceOrig;
	traceOrig.z += 100.0f;
	traceEnd.z -= 10.0f;

	trace_t		traceObject;
	gameLocal.clip.TracePoint( CLIP_DEBUG_PARMS traceObject, traceOrig, traceEnd, MASK_SOLID | CONTENTS_WATER | MASK_OPAQUE, this );
	traceEnd = traceObject.endpos;

	if ( traceObject.fraction < 1.f ) {
		int cont = gameLocal.clip.Contents( CLIP_DEBUG_PARMS traceEnd, NULL, mat3_identity, CONTENTS_WATER, this );
		if ( !cont ) {

			const char* surfaceTypeName = NULL;
			if ( traceObject.c.surfaceType ) {
				surfaceTypeName = traceObject.c.surfaceType->GetName();
			}

			idVec3 colorWhite(1.f,1.f,1.f);
			idVec3 xaxis(-1.f, 0.f, 0.f);
			PlayEffect( "fx_ground_pound", colorWhite, surfaceTypeName, traceEnd, xaxis.ToMat3() );
		}
	}
}
int main(){
    int t , n, xini , yini , xfin , yfin, q ,dif1 , dif2;
    scanf("%d" , &t );
    while( t-- ){
        scanf("%d %d" , &q , &n );
        while( q-- ){
            scanf("%d %d %d %d" , &xini , &yini , &xfin  ,&yfin );
            if( xini <= 0 || xini > n || yini <= 0 || yini > n || xfin <= 0 || xfin >n || yfin <= 0 || yfin > n ){
                puts("no move");
                continue;
            }

            if( xini == xfin && yini == yfin )puts("0");
            else if( abs( xini - xfin ) == abs( yini - yfin ) )puts("1");
            else if( ( xini + yini ) == ( xfin + yfin ) )puts("1");
            else if( colorWhite( xini , yini , xfin , yfin ) || colorBlack( xini , yini , xfin , yfin ) )puts("2");
            else puts("no move");
        }
    }

    return 0;
}