Exemple #1
0
//------------------------------------
void NPC_Seeker_Pain(gentity_t *self, gentity_t *attacker, int damage)
{

    if ( !(self->NPC->aiFlags&NPCAI_CUSTOM_GRAVITY ))
    {   //void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int hitLoc=HL_NONE );
        //[CoOp]
        //I assume this means the seeker dies if it doesn't have it's custom gravity.
        //changed this to look like the SP version of this call
        G_Damage( self, NULL, NULL, vec3_origin, (float*)vec3_origin, 999, 0, MOD_FALLING );
        //G_Damage( self, NULL, NULL, (float*)vec3_origin, (float*)vec3_origin, 999, 0, MOD_FALLING );
        //[/CoOp]
    }

    //[SeekerItemNpc]
    //if we die, remove the control from our owner
    if(self->health < 0 && self->activator && self->activator->client) {
        self->activator->client->remote = NULL;
        self->activator->client->ps.stats[STAT_HOLDABLE_ITEMS] &= ~(1 << HI_SEEKER);
    }
    //[/SeekerItemNpc]

    SaveNPCGlobals();
    SetNPCGlobals( self );
    Seeker_Strafe();
    RestoreNPCGlobals();
    NPC_Pain( self, attacker, damage );
}
Exemple #2
0
//------------------------------------
void NPC_Seeker_Pain(gentity_t *self, gentity_t *attacker, int damage)
{
	if ( !(self->NPC->aiFlags&NPCAI_CUSTOM_GRAVITY ))
	{
		G_Damage( self, NULL, NULL, (float*)vec3_origin, (float*)vec3_origin, 999, 0, MOD_FALLING );
	}

	SaveNPCGlobals();
	SetNPCGlobals( self );
	Seeker_Strafe();
	RestoreNPCGlobals();
	NPC_Pain( self, attacker, damage );
}
Exemple #3
0
//------------------------------------
void NPC_Seeker_Pain(gentity_t *self, gentity_t *attacker, int damage)
{
	if ( !(self->NPC->aiFlags&NPCAI_CUSTOM_GRAVITY ))
	{//void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vector3 *dir, vector3 *point, int damage, int dflags, int mod, int hitLoc=HL_NONE );
		G_Damage( self, NULL, NULL, &vec3_origin, &vec3_origin, 999, 0, MOD_FALLING );
	}

	SaveNPCGlobals();
	SetNPCGlobals( self );
	Seeker_Strafe();
	RestoreNPCGlobals();
	NPC_Pain( self, attacker, damage );
}
Exemple #4
0
//------------------------------------
void NPC_Seeker_Pain( gentity_t *self, gentity_t *inflictor, gentity_t *other, vec3_t point, int damage, int mod,int hitLoc ) 
{
	if ( !(self->svFlags & SVF_CUSTOM_GRAVITY ))
	{//void G_Damage( gentity_t *targ, gentity_t *inflictor, gentity_t *attacker, vec3_t dir, vec3_t point, int damage, int dflags, int mod, int hitLoc=HL_NONE );
		G_Damage( self, NULL, NULL, (float*)vec3_origin, (float*)vec3_origin, 999, 0, MOD_FALLING );
	}

	SaveNPCGlobals();
	SetNPCGlobals( self );
	Seeker_Strafe();
	RestoreNPCGlobals();
	NPC_Pain( self, inflictor, other, point, damage, mod );
}
Exemple #5
0
//------------------------------------
void Seeker_Hunt( qboolean visible, qboolean advance )
{
	float	distance, speed;
	vec3_t	forward;

	NPC_FaceEnemy( qtrue );

	// If we're not supposed to stand still, pursue the player
	if ( NPCS.NPCInfo->standTime < level.time )
	{
		// Only strafe when we can see the player
		if ( visible )
		{
			Seeker_Strafe();
			return;
		}
	}

	// If we don't want to advance, stop here
	if ( advance == qfalse )
	{
		return;
	}

	// Only try and navigate if the player is visible
	if ( visible == qfalse )
	{
		// Move towards our goal
		NPCS.NPCInfo->goalEntity = NPCS.NPC->enemy;
		NPCS.NPCInfo->goalRadius = 24;

		// Get our direction from the navigator if we can't see our target
		if ( NPC_GetMoveDirection( forward, &distance ) == qfalse )
		{
			return;
		}
	}
	else
	{
		VectorSubtract( NPCS.NPC->enemy->r.currentOrigin, NPCS.NPC->r.currentOrigin, forward );
		/*distance = */VectorNormalize( forward );
	}

	speed = SEEKER_FORWARD_BASE_SPEED + SEEKER_FORWARD_MULTIPLIER * g_npcspskill.integer;
	VectorMA( NPCS.NPC->client->ps.velocity, speed, forward, NPCS.NPC->client->ps.velocity );
}
Exemple #6
0
//------------------------------------
void Seeker_Hunt( qboolean visible, qboolean advance )
{
    float	distance, speed;
    vec3_t	forward;

    NPC_FaceEnemy( qtrue );

    //[SeekerItemNpc]
    if(NPC->genericValue3) {
        if ( TIMER_Done( NPC, "seekerAlert" )) {
            //TODO: different sound for 'found enemy' or 'searching' ?
            /*
            if(visible)
            	G_Sound( NPC, CHAN_AUTO, G_SoundIndex( "sound/chars/seeker/misc/hiss" ));
            else
            */
            TIMER_Set(NPC, "seekerAlert", level.time + 900);
            G_Sound(NPC, CHAN_AUTO, NPC->genericValue3);
        }
    }
    //[/SeekerItemNpc]


    // If we're not supposed to stand still, pursue the player
    if ( NPCInfo->standTime < level.time )
    {
        // Only strafe when we can see the player
        if ( visible )
        {
            Seeker_Strafe();
            return;
        }
    }

    // If we don't want to advance, stop here
    if ( advance == qfalse )
    {
        return;
    }

    // Only try and navigate if the player is visible
    if ( visible == qfalse )
    {
        // Move towards our goal
        NPCInfo->goalEntity = NPC->enemy;
        NPCInfo->goalRadius = 24;

        //[CoOp]
        NPC_MoveToGoal(qtrue);
        return;
        /*
        // Get our direction from the navigator if we can't see our target
        if ( NPC_GetMoveDirection( forward, &distance ) == qfalse )
        {
        	return;
        }
        */
        //[/CoOp]
    }
    else
    {
        VectorSubtract( NPC->enemy->r.currentOrigin, NPC->r.currentOrigin, forward );
        distance = VectorNormalize( forward );
    }

    speed = SEEKER_FORWARD_BASE_SPEED + SEEKER_FORWARD_MULTIPLIER * g_spskill.integer;
    VectorMA( NPC->client->ps.velocity, speed, forward, NPC->client->ps.velocity );
}