当前位置: 首页>>代码示例>>C++>>正文


C++ G_EffectIndex函数代码示例

本文整理汇总了C++中G_EffectIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ G_EffectIndex函数的具体用法?C++ G_EffectIndex怎么用?C++ G_EffectIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了G_EffectIndex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NPC_Mark2_Precache

void NPC_Mark2_Precache( void )
{
	G_SoundIndex( "sound/chars/mark2/misc/mark2_explo" );// blows up on death
	G_SoundIndex( "sound/chars/mark2/misc/mark2_pain" );
	G_SoundIndex( "sound/chars/mark2/misc/mark2_fire" );
	G_SoundIndex( "sound/chars/mark2/misc/mark2_move_lp" );

	G_EffectIndex( "droidexplosion1" );
	G_EffectIndex( "env/med_explode2" );
	G_EffectIndex( "blaster/smoke_bolton" );
	G_EffectIndex( "bryar/muzzle_flash" );

	RegisterItem( FindItemForWeapon( WP_BRYAR_PISTOL ));
	RegisterItem( FindItemForAmmo( 	AMMO_METAL_BOLTS));
	RegisterItem( FindItemForAmmo( AMMO_POWERCELL ));
	RegisterItem( FindItemForAmmo( AMMO_BLASTER ));
}
开发者ID:Agustinlv,项目名称:BlueHarvest,代码行数:17,代码来源:AI_Mark2.cpp

示例2: auto_turret_die

//------------------------------------------------------------------------------------------------------------
void auto_turret_die ( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int meansOfDeath )
//------------------------------------------------------------------------------------------------------------
{
	vec3_t	forward = { 0,0, 1 }, pos;

	// Turn off the thinking of the base & use it's targets
	g_entities[self->r.ownerNum].think = NULL;
	g_entities[self->r.ownerNum].use = NULL;

	// clear my data
	self->die = NULL;
	self->takedamage = qfalse;
	self->s.health = self->health = 0;
	self->s.loopSound = 0;
	self->s.shouldtarget = qfalse;

	VectorCopy( self->r.currentOrigin, pos );
	pos[2] += self->r.maxs[2]*0.5f;
	G_PlayEffect( EFFECT_EXPLOSION_TURRET, pos, forward );
	G_PlayEffectID( G_EffectIndex( "turret/explode" ), pos, forward );
	
	if ( self->splashDamage > 0 && self->splashRadius > 0 )
	{
		G_RadiusDamage( self->r.currentOrigin, 
						attacker, 
						self->splashDamage, 
						self->splashRadius, 
						attacker,
						NULL,
						MOD_UNKNOWN );
	}

	self->s.weapon = 0; // crosshair code uses this to mark crosshair red


	if ( self->s.modelindex2 )
	{
		// switch to damage model if we should
		self->s.modelindex = self->s.modelindex2;

		if (self->target_ent && self->target_ent->s.modelindex2)
		{
			self->target_ent->s.modelindex = self->target_ent->s.modelindex2;
		}

		VectorCopy( self->r.currentAngles, self->s.apos.trBase );
		VectorClear( self->s.apos.trDelta );
		
		if ( self->target )
		{
			G_UseTargets( self, attacker );
		}
	}
	else
	{
		ObjectDie( self, inflictor, attacker, damage, meansOfDeath );
	}
}
开发者ID:dpadgett,项目名称:base_enhanced,代码行数:59,代码来源:g_turret.c

示例3: ImperialProbe_FireBlaster

/*
-------------------------
ImperialProbe_FireBlaster
-------------------------
*/
void ImperialProbe_FireBlaster(void)
{
	vec3_t	muzzle1,enemy_org1,delta1,angleToEnemy1;
	static	vec3_t	forward, vright, up;
//	static	vec3_t	muzzle;
	int genBolt1;
	gentity_t	*missile;
	mdxaBone_t	boltMatrix;

	genBolt1 = trap_G2API_AddBolt(NPC->ghoul2, 0, "*flash");

	//FIXME: use {0, NPC->client->ps.legsYaw, 0}
	trap_G2API_GetBoltMatrix( NPC->ghoul2, 0, 
				genBolt1,
				&boltMatrix, NPC->r.currentAngles, NPC->r.currentOrigin, level.time,
				NULL, NPC->modelScale );

	BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, muzzle1 );

	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), muzzle1, vec3_origin );

	G_Sound( NPC, CHAN_AUTO, G_SoundIndex( "sound/chars/probe/misc/fire" ));

	if (NPC->health)
	{
		CalcEntitySpot( NPC->enemy, SPOT_CHEST, enemy_org1 );
		enemy_org1[0]+= Q_irand(0,10);
		enemy_org1[1]+= Q_irand(0,10);
		VectorSubtract (enemy_org1, muzzle1, delta1);
		vectoangles ( delta1, angleToEnemy1 );
		AngleVectors (angleToEnemy1, forward, vright, up);
	}
	else
	{
		AngleVectors (NPC->r.currentAngles, forward, vright, up);
	}

	missile = CreateMissile( muzzle1, forward, 1600, 10000, NPC, qfalse );

	missile->classname = "bryar_proj";
	missile->s.weapon = WP_BRYAR_PISTOL;

	if ( g_spskill.integer <= 1 )
	{
		missile->damage = 5;
	}
	else 
	{
		missile->damage = 10;
	}


	missile->dflags = DAMAGE_DEATH_KNOCKBACK;
	missile->methodOfDeath = MOD_UNKNOWN;
	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;

}
开发者ID:ForcePush,项目名称:OJPRPFZ,代码行数:62,代码来源:NPC_AI_ImperialProbe.c

示例4: NPC_Interrogator_Precache

/*
-------------------------
NPC_Interrogator_Precache
-------------------------
*/
void NPC_Interrogator_Precache(gentity_t *self)
{
	G_SoundIndex( "sound/chars/interrogator/misc/torture_droid_lp" );
	G_SoundIndex("sound/chars/mark1/misc/anger.wav");
	G_SoundIndex( "sound/chars/probe/misc/talk");
	G_SoundIndex( "sound/chars/interrogator/misc/torture_droid_inject" );
	G_SoundIndex( "sound/chars/interrogator/misc/int_droid_explo" );
	G_EffectIndex( "explosions/droidexplosion1" );
}
开发者ID:AlexCSilva,项目名称:jediacademy,代码行数:14,代码来源:NPC_AI_Interrogator.c

示例5: NPC_Probe_Precache

void NPC_Probe_Precache(void)
{
	for ( int i = 1; i < 4; i++)
	{
		G_SoundIndex( va( "sound/chars/probe/misc/probetalk%d", i ) );
	}
	G_SoundIndex( "sound/chars/probe/misc/probedroidloop" );
	G_SoundIndex("sound/chars/probe/misc/anger1");
	G_SoundIndex("sound/chars/probe/misc/fire");

	G_EffectIndex( "chunks/probehead" );
	G_EffectIndex( "env/med_explode2" );
	G_EffectIndex( "explosions/probeexplosion1");
	G_EffectIndex( "bryar/muzzle_flash" );

	RegisterItem( FindItemForAmmo( AMMO_BLASTER ));
	RegisterItem( FindItemForWeapon( WP_BRYAR_PISTOL ) );
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:18,代码来源:AI_ImperialProbe.cpp

示例6: G_ATSTCheckPain

void G_ATSTCheckPain( gentity_t *self, gentity_t *other, const vec3_t point, int damage, int mod,int hitLoc )
{
    int newBolt;

    if ( rand() & 1 )
    {
        G_SoundOnEnt( self, CHAN_LESS_ATTEN, "sound/chars/atst/atst_damaged1" );
    }
    else
    {
        G_SoundOnEnt( self, CHAN_LESS_ATTEN, "sound/chars/atst/atst_damaged2" );
    }

    if ((hitLoc==HL_ARM_LT) && (self->locationDamage[HL_ARM_LT] > LEFT_ARM_HEALTH))
    {
        if (self->locationDamage[hitLoc] >= LEFT_ARM_HEALTH)	// Blow it up?
        {
            newBolt = gi.G2API_AddBolt( &self->ghoul2[self->playerModel], "*flash3" );
            if ( newBolt != -1 )
            {
//				G_PlayEffect( "small_chunks", self->playerModel, self->genericBolt1, self->s.number);
                ATST_PlayEffect( self, self->genericBolt1, "env/med_explode2" );
                G_PlayEffect( G_EffectIndex("blaster/smoke_bolton"), self->playerModel, newBolt, self->s.number, point);
            }

            gi.G2API_SetSurfaceOnOff( &self->ghoul2[self->playerModel], "head_light_blaster_cann", TURN_OFF );
        }
    }
    else if ((hitLoc==HL_ARM_RT) && (self->locationDamage[HL_ARM_RT] > RIGHT_ARM_HEALTH))	// Blow it up?
    {
        if (self->locationDamage[hitLoc] >= RIGHT_ARM_HEALTH)
        {
            newBolt = gi.G2API_AddBolt( &self->ghoul2[self->playerModel], "*flash4" );
            if ( newBolt != -1 )
            {
//				G_PlayEffect( "small_chunks", self->playerModel, self->genericBolt2, self->s.number);
                ATST_PlayEffect( self, self->genericBolt2, "env/med_explode2" );
                G_PlayEffect( G_EffectIndex("blaster/smoke_bolton"), self->playerModel, newBolt, self->s.number, point);
            }

            gi.G2API_SetSurfaceOnOff( &self->ghoul2[self->playerModel], "head_concussion_charger", TURN_OFF );
        }
    }
}
开发者ID:MrSquirrely,项目名称:Jedi-Academy,代码行数:44,代码来源:AI_Atst.cpp

示例7: NPC_Gonk_Precache

void NPC_Gonk_Precache( void ) {
	G_SoundIndex( "sound/chars/gonk/misc/gonktalk1.wav" );
	G_SoundIndex( "sound/chars/gonk/misc/gonktalk2.wav" );

	G_SoundIndex( "sound/chars/gonk/misc/death1.wav" );
	G_SoundIndex( "sound/chars/gonk/misc/death2.wav" );
	G_SoundIndex( "sound/chars/gonk/misc/death3.wav" );

	G_EffectIndex( "env/med_explode" );
}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:10,代码来源:NPC_AI_Droid.cpp

示例8: NPC_R2D2_Precache

/*
-------------------------
NPC_R2D2_Precache
-------------------------
*/
void NPC_R2D2_Precache(void)
{
	for ( int i = 1; i < 4; i++)
	{
		G_SoundIndex( va( "sound/chars/r2d2/misc/r2d2talk0%d.wav", i ) );
	}
	G_SoundIndex( "sound/chars/mark2/misc/mark2_explo" ); // ??
	G_SoundIndex( "sound/chars/r2d2/misc/r2_move_lp.wav" );
	G_EffectIndex( "env/med_explode");
}
开发者ID:Agustinlv,项目名称:BlueHarvest,代码行数:15,代码来源:AI_Droid.cpp

示例9: NPC_Sentry_Precache

/*
-------------------------
NPC_Sentry_Precache
-------------------------
*/
void NPC_Sentry_Precache( void ) {
    int i;

    G_SoundIndex( "sound/chars/sentry/misc/sentry_explo" );
    G_SoundIndex( "sound/chars/sentry/misc/sentry_pain" );
    G_SoundIndex( "sound/chars/sentry/misc/sentry_shield_open" );
    G_SoundIndex( "sound/chars/sentry/misc/sentry_shield_close" );
    G_SoundIndex( "sound/chars/sentry/misc/sentry_hover_1_lp" );
    G_SoundIndex( "sound/chars/sentry/misc/sentry_hover_2_lp" );

    for ( i = 1; i < 4; i++ ) {
        G_SoundIndex( va( "sound/chars/sentry/misc/talk%d", i ) );
    }

    G_EffectIndex( "bryar/muzzle_flash" );
    G_EffectIndex( "env/med_explode" );

    RegisterItem( BG_FindItemForAmmo( AMMO_BLASTER ) );
}
开发者ID:redsaurus,项目名称:japp,代码行数:24,代码来源:NPC_AI_Sentry.c

示例10: G_PlayEffect

// Play an effect bolted onto the muzzle of the specified client
//----------------------------
void G_PlayEffect( const char *name, int clientNum )
{
	gentity_t	*tent;

	tent = G_TempEntity( g_entities[clientNum].currentOrigin, EV_PLAY_MUZZLE_EFFECT );
	tent->s.eventParm = G_EffectIndex( name );
	tent->s.otherEntityNum = clientNum;
	VectorSet( tent->maxs, FX_ENT_RADIUS, FX_ENT_RADIUS, FX_ENT_RADIUS );
	VectorScale( tent->maxs, -1, tent->mins );
}
开发者ID:kikili,项目名称:OpenJK,代码行数:12,代码来源:g_utils.cpp

示例11: NPC_Howler_Pain

/*
-------------------------
NPC_Howler_Pain
-------------------------
*/
void NPC_Howler_Pain( gentity_t *self, gentity_t *inflictor, gentity_t *other, const vec3_t point, int damage, int mod,int hitLoc ) 
{
	if ( !self || !self->NPC )
	{
		return;
	}

	if ( self->NPC->localState != LSTATE_BERZERK )//damage >= 10 )
	{
		self->NPC->stats.aggression += damage;
		self->NPC->localState = LSTATE_WAITING;

		TIMER_Remove( self, "attacking" );

		VectorCopy( self->NPC->lastPathAngles, self->s.angles );

		//if ( self->client->ps.legsAnim == BOTH_GESTURE1 )
		{
			G_StopEffect( G_EffectIndex( "howler/sonic" ), self->playerModel, self->genericBolt1, self->s.number );
		}

		NPC_SetAnim( self, SETANIM_BOTH, BOTH_PAIN1, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD );
		TIMER_Set( self, "takingPain", self->client->ps.legsAnimTimer );//2900 );

		if ( self->health > HOWLER_PANIC_HEALTH )
		{//still have some health left
			if ( Q_irand( 0, self->max_health ) > self->health )//FIXME: or check damage?
			{//back off!
				TIMER_Set( self, "standing", -level.time );
				TIMER_Set( self, "running", -level.time );
				TIMER_Set( self, "walking", -level.time );
				TIMER_Set( self, "retreating", Q_irand( 1000, 5000 ) );
			}
			else
			{//go after him!
				TIMER_Set( self, "standing", -level.time );
				TIMER_Set( self, "running", self->client->ps.legsAnimTimer+Q_irand(3000,6000) );
				TIMER_Set( self, "walking", -level.time );
				TIMER_Set( self, "retreating", -level.time );
			}
		}
		else if ( self->NPC )
		{//panic!
			if ( Q_irand( 0, 1 ) )
			{//berzerk
				self->NPC->localState = LSTATE_BERZERK;
			}
			else
			{//flee
				self->NPC->localState = LSTATE_FLEE;
				TIMER_Set( self, "flee", Q_irand( 10000, 30000 ) );
			}
		}
	}
}
开发者ID:Arbixal,项目名称:OpenJK,代码行数:60,代码来源:AI_Howler.cpp

示例12: NPC_Mouse_Precache

void NPC_Mouse_Precache( void ) {
	int	i;

	for ( i = 1; i < 4; i++ ) {
		G_SoundIndex( va( "sound/chars/mouse/misc/mousego%d.wav", i ) );
	}

	G_EffectIndex( "env/small_explode" );
	G_SoundIndex( "sound/chars/mouse/misc/death1" );
	G_SoundIndex( "sound/chars/mouse/misc/mouse_lp" );
}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:11,代码来源:NPC_AI_Droid.cpp

示例13: SP_fx_explosion_trail

//----------------------------------------------------------
void SP_fx_explosion_trail( gentity_t *ent )
{
	// We have to be useable, otherwise we won't spawn in
	if ( !ent->targetname )
	{
		gi.Printf( S_COLOR_RED"ERROR: fx_explosion_trail at %s has no targetname specified\n", vtos( ent->s.origin ));
		G_FreeEntity( ent );
		return;
	}

	// Get our defaults
	G_SpawnString( "fxFile", "env/exp_trail_comp", &ent->fxFile );
	G_SpawnInt( "damage", "128", &ent->damage );
	G_SpawnFloat( "radius", "128", &ent->radius );
	G_SpawnFloat( "speed", "350", &ent->speed );

	// Try and associate an effect file, unfortunately we won't know if this worked or not until the CGAME trys to register it...
	ent->fxID = G_EffectIndex( ent->fxFile );

	if ( ent->fullName )
	{
		G_EffectIndex( ent->fullName );
	}

	if ( ent->model )
	{
		ent->s.modelindex2 = G_ModelIndex( ent->model );
	}

	// Give us a bit of time to spawn in the other entities, since we may have to target one of 'em
	ent->e_ThinkFunc = thinkF_fx_explosion_trail_link; 
	ent->nextthink = level.time + 500;

	// Save our position and link us up!
	G_SetOrigin( ent, ent->s.origin );

	VectorSet( ent->maxs, FX_ENT_RADIUS, FX_ENT_RADIUS, FX_ENT_RADIUS );
	VectorScale( ent->maxs, -1, ent->mins );

	gi.linkentity( ent );
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:42,代码来源:g_fx.cpp

示例14: NPC_Mark2_Part_Explode

void NPC_Mark2_Part_Explode( gentity_t *self, int bolt ) {
	if ( bolt >= 0 ) {
		mdxaBone_t	boltMatrix;
		vector3		org, dir;

		trap->G2API_GetBoltMatrix( self->ghoul2, 0,
			bolt,
			&boltMatrix, &self->r.currentAngles, &self->r.currentOrigin, level.time,
			NULL, &self->modelScale );

		BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, &org );
		BG_GiveMeVectorFromMatrix( &boltMatrix, NEGATIVE_Y, &dir );

		G_PlayEffectID( G_EffectIndex( "env/med_explode2" ), &org, &dir );
		G_PlayEffectID( G_EffectIndex( "blaster/smoke_bolton" ), &org, &dir );
	}

	//G_PlayEffectID( G_EffectIndex("blaster/smoke_bolton"), self->playerModel, bolt, self->s.number);

	self->count++;	// Count of pods blown off
}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:21,代码来源:NPC_AI_Mark2.cpp

示例15: Boba_Precache

void Boba_Precache( void )
{
	G_SoundIndex( "sound/chars/boba/bf_blast-off.wav" );
	G_SoundIndex( "sound/chars/boba/bf_jetpack_lp.wav" );
	G_SoundIndex( "sound/chars/boba/bf_land.wav" );
	G_SoundIndex( "sound/weapons/boba/bf_flame.mp3" );
	G_SoundIndex( "sound/player/footsteps/boot1" );
	G_SoundIndex( "sound/player/footsteps/boot2" );
	G_SoundIndex( "sound/player/footsteps/boot3" );
	G_SoundIndex( "sound/player/footsteps/boot4" );
	G_EffectIndex( "boba/jetSP" );
	G_EffectIndex( "boba/fthrw" );
	G_EffectIndex( "volumetric/black_smoke" );
	G_EffectIndex( "chunks/dustFall" );

	AverageEnemyDirectionSamples = 0;
	VectorClear(AverageEnemyDirection);
	BobaHadDeathScript			= false;
	BobaActive					= true;
	BobaFootStepCount			= 0;
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:21,代码来源:AI_BobaFett.cpp


注:本文中的G_EffectIndex函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。