Пример #1
0
//------------------------------------
void Seeker_Ranged( qboolean visible, qboolean advance )
{
	if ( NPCS.NPC->client->NPC_class != CLASS_BOBAFETT )
	{
		if ( NPCS.NPC->count > 0 )
		{
			if ( TIMER_Done( NPCS.NPC, "attackDelay" ))	// Attack?
			{
				TIMER_Set( NPCS.NPC, "attackDelay", Q_irand( 250, 2500 ));
				Seeker_Fire();
				NPCS.NPC->count--;
			}
		}
		else
		{
			// out of ammo, so let it die...give it a push up so it can fall more and blow up on impact
	//		NPC->client->ps.gravity = 900;
	//		NPC->svFlags &= ~SVF_CUSTOM_GRAVITY;
	//		NPC->client->ps.velocity[2] += 16;
			G_Damage( NPCS.NPC, NPCS.NPC, NPCS.NPC, NULL, NULL, 999, 0, MOD_UNKNOWN );
		}
	}

	if ( NPCS.NPCInfo->scriptFlags & SCF_CHASE_ENEMIES )
	{
		Seeker_Hunt( visible, advance );
	}
}
Пример #2
0
//------------------------------------
void Seeker_Ranged( qboolean visible, qboolean advance )
{
    if ( NPC->client->NPC_class != CLASS_BOBAFETT )
    {   //racc - boba fett doesn't run out of ammo.
        if ( NPC->count > 0 || NPC->count == -1)
        {
            //[SeekerItemNpc]
            //better than using the timer, and if the dynamic music is ever used, then we can apply it to them using the shootTime
            //meh, just using TIMER_ stuff for now, in case standard npc ai messes it up
            //if (NPCInfo->shotTime < level.time)	// Attack?
            if ( TIMER_Done( NPC, "attackDelay" ))	// Attack?
            {
                //NPCInfo->shotTime = level.time + NPC->delay + Q_irand(0, NPC->random);
                TIMER_Set( NPC, "attackDelay", Q_irand(NPC->genericValue1, NPC->genericValue2));
                Seeker_Fire();
                if(NPC->count != -1)
                    NPC->count--;
            }
            /*
            if ( TIMER_Done( NPC, "attackDelay" ))	// Attack?
            {
            	TIMER_Set( NPC, "attackDelay", Q_irand( 250, 2500 ));
            	Seeker_Fire();
            	NPC->count--;
            }
            */
            //[/SeekerItemNpc]
        }
        else
        {
            //[SeekerItemNpc] what is wrong with this?  re-enabling...
            //hmm, somewhere I saw code that handles the final death, but I cant find it anymore...
            //meh, disabling again

            // out of ammo, so let it die...give it a push up so it can fall more and blow up on impact
            //NPC->client->ps.gravity = 900;
            //NPC->svFlags &= ~SVF_CUSTOM_GRAVITY;
            //NPC->client->ps.velocity[2] += 16;
            G_Damage( NPC, NPC, NPC, NULL, NULL, NPC->health/*999*/, 0, MOD_UNKNOWN );
            //[/SeekerItemNpc]
        }
    }

    if ( NPCInfo->scriptFlags & SCF_CHASE_ENEMIES )
    {
        Seeker_Hunt( visible, advance );
    }
}