コード例 #1
0
void RT_FlyStart( gentity_t *self )
{//switch to seeker AI for a while
	if ( TIMER_Done( self, "jetRecharge" ) 
		&& !RT_Flying( self ) )
	{
		self->client->ps.gravity = 0;
		self->svFlags |= SVF_CUSTOM_GRAVITY;
		self->client->moveType = MT_FLYSWIM;
		//Inform NPC_HandleAIFlags we want to fly
		self->NPC->aiFlags |= NPCAI_FLY;
		self->lastInAirTime = level.time;
		
		//start jet effect
		self->client->jetPackTime = Q3_INFINITE;
		if ( self->genericBolt1 != -1 )
		{
			G_PlayEffect( G_EffectIndex( "rockettrooper/flameNEW" ), self->playerModel, self->genericBolt1, self->s.number, self->currentOrigin, qtrue, qtrue );
		}
		if ( self->genericBolt2 != -1 )
		{
			G_PlayEffect( G_EffectIndex( "rockettrooper/flameNEW" ), self->playerModel, self->genericBolt2, self->s.number, self->currentOrigin, qtrue, qtrue );
		}

		//take-off sound
		G_SoundOnEnt( self, CHAN_ITEM, "sound/chars/boba/bf_blast-off.wav" );
		//jet loop sound
		self->s.loopSound = G_SoundIndex( "sound/chars/boba/bf_jetpack_lp.wav"  );
		if ( self->NPC )
		{
			self->count = Q3_INFINITE; // SEEKER shot ammo count
		}
	}
}
コード例 #2
0
void NPC_BSRT_Default( void )
{
	//FIXME: custom pain and death funcs:
		//pain3 is in air
		//die in air is both_falldeath1
		//attack1 is on ground, attack2 is in air

	//FIXME: this doesn't belong here
	if ( NPC->client->ps.groundEntityNum != ENTITYNUM_NONE )
	{
		if ( NPCInfo->rank >= RANK_LT )//&& !Q_irand( 0, 50 ) )
		{//officers always stay in the air
			NPC->client->ps.velocity[2] = Q_irand( 50, 125 );
			NPC->NPC->aiFlags |= NPCAI_FLY;	//fixme also, Inform NPC_HandleAIFlags we want to fly
		}
	}

	if ( RT_Flying( NPC ) )
	{//FIXME: only officers need do this, right?
		RT_Flying_Think();
	}
	else if ( NPC->enemy != NULL )
	{//rocketrooper on ground with enemy
		UpdateGoal();
		RT_RunStormtrooperAI();
		RT_CheckJump();
		//NPC_BSST_Default();//FIXME: add missile avoidance
		//RT_Hunt();//NPC_BehaviorSet_Jedi( bState );
	}
	else
	{//shouldn't have gotten in here
		RT_RunStormtrooperAI();
		//NPC_BSST_Patrol();
	}
}
コード例 #3
0
ファイル: NPC_utils.cpp プロジェクト: matthewvdz/joja
qboolean JET_Flying( gentity_t *self )
{
	if ( !self || !self->client )
	{
		return qfalse;
	}
	if ( self->client->NPC_class == CLASS_BOBAFETT )
	{
		return (Boba_Flying(self));
	}
	else if ( self->client->NPC_class == CLASS_ROCKETTROOPER )
	{
		return (RT_Flying(self));
	}
	else
	{
		return qfalse;
	}
}