/* ------------------------- MineMonster_Patrol ------------------------- */ void MineMonster_Patrol( void ) { NPCInfo->localState = LSTATE_CLEAR; //If we have somewhere to go, then do that if ( UpdateGoal() ) { ucmd.buttons &= ~BUTTON_WALKING; NPC_MoveToGoal( qtrue ); } vec3_t dif; VectorSubtract( g_entities[0].currentOrigin, NPC->currentOrigin, dif ); if ( VectorLengthSquared( dif ) < 256 * 256 ) { G_SetEnemy( NPC, &g_entities[0] ); } if ( NPC_CheckEnemyExt( qtrue ) == qfalse ) { MineMonster_Idle(); return; } }
/* ------------------------- MineMonster_Patrol ------------------------- */ void MineMonster_Patrol( void ) { vector3 dif; NPCInfo->localState = LSTATE_CLEAR; //If we have somewhere to go, then do that if ( UpdateGoal() ) { ucmd.buttons &= ~BUTTON_WALKING; NPC_MoveToGoal( qtrue ); } else { if ( TIMER_Done( NPC, "patrolTime" )) { TIMER_Set( NPC, "patrolTime", crandom() * 5000 + 5000 ); } } //rwwFIXMEFIXME: Care about all clients, not just client 0 VectorSubtract( &g_entities[0].r.currentOrigin, &NPC->r.currentOrigin, &dif ); if ( VectorLengthSquared( &dif ) < 256 * 256 ) { G_SetEnemy( NPC, &g_entities[0] ); } if ( NPC_CheckEnemyExt( qtrue ) == qfalse ) { MineMonster_Idle(); return; } }
/* ------------------------- NPC_BSMineMonster_Default ------------------------- */ void NPC_BSMineMonster_Default( void ) { if ( NPC->enemy ) { MineMonster_Combat(); } else if ( NPCInfo->scriptFlags & SCF_LOOK_FOR_ENEMIES ) { MineMonster_Patrol(); } else { MineMonster_Idle(); } NPC_UpdateAngles( qtrue, qtrue ); }