/* ------------------------- Droid_Run ------------------------- */ void Droid_Run( void ) { R2D2_PartsMove(); if ( NPCInfo->localState == LSTATE_BACKINGUP ) { ucmd.forwardmove = -127; NPCInfo->desiredYaw += 5; NPCInfo->localState = LSTATE_NONE; // So he doesn't constantly backup. } else { ucmd.forwardmove = 64; //If we have somewhere to go, then do that if ( UpdateGoal() ) { if (NPC_MoveToGoal( qfalse )) { NPCInfo->desiredYaw += sin(level.time*.5) * 5; // Weaves side to side a little } } } NPC_UpdateAngles( qtrue, qtrue ); }
void Droid_Patrol( void ) { NPC->pos1.yaw = AngleNormalize360( NPC->pos1.yaw ); if ( NPC->client && NPC->client->NPC_class != CLASS_GONK ) { if ( NPC->client->NPC_class != CLASS_R5D2 ) { //he doesn't have an eye. R2D2_PartsMove(); // Get his eye moving. } R2D2_TurnAnims(); } //If we have somewhere to go, then do that if ( UpdateGoal() ) { ucmd.buttons |= BUTTON_WALKING; NPC_MoveToGoal( qtrue ); if ( NPC->client && NPC->client->NPC_class == CLASS_MOUSE ) { NPCInfo->desiredYaw += sinf( level.time*.5f ) * 25; // Weaves side to side a little if ( TIMER_Done( NPC, "patrolNoise" ) ) { G_SoundOnEnt( NPC, CHAN_AUTO, va( "sound/chars/mouse/misc/mousego%d.wav", Q_irand( 1, 3 ) ) ); TIMER_Set( NPC, "patrolNoise", Q_irand( 2000, 4000 ) ); } } else if ( NPC->client && NPC->client->NPC_class == CLASS_R2D2 ) { if ( TIMER_Done( NPC, "patrolNoise" ) ) { G_SoundOnEnt( NPC, CHAN_AUTO, va( "sound/chars/r2d2/misc/r2d2talk0%d.wav", Q_irand( 1, 3 ) ) ); TIMER_Set( NPC, "patrolNoise", Q_irand( 2000, 4000 ) ); } } else if ( NPC->client && NPC->client->NPC_class == CLASS_R5D2 ) { if ( TIMER_Done( NPC, "patrolNoise" ) ) { G_SoundOnEnt( NPC, CHAN_AUTO, va( "sound/chars/r5d2/misc/r5talk%d.wav", Q_irand( 1, 4 ) ) ); TIMER_Set( NPC, "patrolNoise", Q_irand( 2000, 4000 ) ); } } if ( NPC->client && NPC->client->NPC_class == CLASS_GONK ) { if ( TIMER_Done( NPC, "patrolNoise" ) ) { G_SoundOnEnt( NPC, CHAN_AUTO, va( "sound/chars/gonk/misc/gonktalk%d.wav", Q_irand( 1, 2 ) ) ); TIMER_Set( NPC, "patrolNoise", Q_irand( 2000, 4000 ) ); } } // else // { // R5D2_LookAround(); // } } NPC_UpdateAngles( qtrue, qtrue ); }