//------------------------------------ void Seeker_Attack( void ) { float distance; qboolean visible, advance; // Always keep a good height off the ground Seeker_MaintainHeight(); // Rate our distance to the target, and our visibilty distance = DistanceHorizontalSquared( NPCS.NPC->r.currentOrigin, NPCS.NPC->enemy->r.currentOrigin ); visible = NPC_ClearLOS4( NPCS.NPC->enemy ); advance = (qboolean)(distance > MIN_DISTANCE_SQR); if ( NPCS.NPC->client->NPC_class == CLASS_BOBAFETT ) { advance = (qboolean)(distance>(200.0f*200.0f)); } // If we cannot see our target, move to see it if ( visible == qfalse ) { if ( NPCS.NPCInfo->scriptFlags & SCF_CHASE_ENEMIES ) { Seeker_Hunt( visible, advance ); return; } } Seeker_Ranged( visible, advance ); }
void Seeker_Attack( void ) { float distance; qboolean visible; qboolean advance; // Always keep a good height off the ground Seeker_MaintainHeight(); // Rate our distance to the target, and our visibilty distance = DistanceHorizontalSquared( NPC->r.currentOrigin, NPC->enemy->r.currentOrigin ); visible = NPC_ClearLOS4( NPC->enemy ); advance = (qboolean)(distance > MIN_DISTANCE_SQR); //[SeekerItemNpc] //dont shoot at dead people if(!NPC->enemy->inuse || NPC->enemy->health <= 0) { NPC->enemy = NULL; return; } //[/SeekerItemNpc] if ( NPC->client->NPC_class == CLASS_BOBAFETT ) { advance = (qboolean)(distance>(200.0f*200.0f)); } // If we cannot see our target, move to see it if ( visible == qfalse ) { if ( NPCInfo->scriptFlags & SCF_CHASE_ENEMIES ) { Seeker_Hunt( visible, advance ); return; } //[SeekerItemNpc] else { //we cant chase them? then return to the follow target NPC->enemy = NULL; if(NPC->client->leader) NPCInfo->goalEntity = NPC->client->leader; return; } //[/SeekerItemNpc] } Seeker_Ranged( visible, advance ); }