您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ G_PlayEffectID函数代码示例

51自学网 2021-06-01 21:01:47
  C++
这篇教程C++ G_PlayEffectID函数代码示例写得很实用,希望能帮到您。

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

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

示例1: GM_CreateExplosion

//-----------------------------------------------------------------static void GM_CreateExplosion( gentity_t *self, const int boltID, qboolean doSmall ) //doSmall = qfalse{	if ( boltID >=0 )	{		mdxaBone_t	boltMatrix;		vec3_t		org, dir;		trap->G2API_GetBoltMatrix( self->ghoul2, 0,					boltID,					&boltMatrix, self->r.currentAngles, self->r.currentOrigin, level.time,					NULL, self->modelScale );		BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, org );		BG_GiveMeVectorFromMatrix( &boltMatrix, NEGATIVE_Y, dir );		if ( doSmall )		{			G_PlayEffectID( G_EffectIndex("env/small_explode2"), org, dir );		}		else		{			G_PlayEffectID( G_EffectIndex("env/med_explode2"), org, dir );		}	}}
开发者ID:Avygeil,项目名称:NewJK,代码行数:26,


示例2: Droid_Spin

/*-------------------------void Droid_Spin( void )-------------------------*/void Droid_Spin( void ){	vec3_t dir = {0,0,1};	R2D2_TurnAnims();							// Head is gone, spin and spark	if ( NPC->client->NPC_class == CLASS_R5D2 		|| NPC->client->NPC_class == CLASS_R2D2 )	{		// No head?		if (trap->G2API_GetSurfaceRenderStatus( NPC->ghoul2, 0, "head" )>0)		{			if (TIMER_Done(NPC,"smoke") && !TIMER_Done(NPC,"droidsmoketotal"))			{				TIMER_Set( NPC, "smoke", 100);				G_PlayEffectID( G_EffectIndex("volumetric/droid_smoke") , NPC->r.currentOrigin,dir);			}			if (TIMER_Done(NPC,"droidspark"))			{				TIMER_Set( NPC, "droidspark", Q_irand(100,500));				G_PlayEffectID( G_EffectIndex("sparks/spark"), NPC->r.currentOrigin,dir);			}			ucmd.forwardmove = Q_irand( -64, 64);			if (TIMER_Done(NPC,"roam"))			{					TIMER_Set( NPC, "roam", Q_irand( 250, 1000 ) );				NPCInfo->desiredYaw = Q_irand( 0, 360 ); // Go in random directions			}		}		else		{			if (TIMER_Done(NPC,"roam"))			{				NPCInfo->localState = LSTATE_NONE;			}			else			{				NPCInfo->desiredYaw = AngleNormalize360(NPCInfo->desiredYaw + 40); // Spin around			}		}	}	else 	{		if (TIMER_Done(NPC,"roam"))		{			NPCInfo->localState = LSTATE_NONE;		}		else		{			NPCInfo->desiredYaw = AngleNormalize360(NPCInfo->desiredYaw + 40); // Spin around		}	}	NPC_UpdateAngles( qtrue, qtrue );}
开发者ID:DarthFutuza,项目名称:JediKnightGalaxies,代码行数:65,


示例3: 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.maxhealth = self->maxHealth = 0;	self->s.loopSound = 0;	self->s.shouldtarget = qfalse;	//self->s.owner = MAX_CLIENTS; //not owned by any client	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:3ddy,项目名称:Jedi-Academy,代码行数:61,


示例4: Remote_Fire

/*-------------------------Remote_Fire-------------------------*/void Remote_Fire (void){	vec3_t	delta1, enemy_org1, muzzle1;	vec3_t	angleToEnemy1;	static	vec3_t	forward, vright, up;//	static	vec3_t	muzzle;	gentity_t	*missile;	CalcEntitySpot( NPC->enemy, SPOT_HEAD, enemy_org1 );	VectorCopy( NPC->r.currentOrigin, muzzle1 );		VectorSubtract (enemy_org1, muzzle1, delta1);	vectoangles ( delta1, angleToEnemy1 );	AngleVectors (angleToEnemy1, forward, vright, up);	missile = CreateMissile( NPC->r.currentOrigin, forward, 1000, 10000, NPC, qfalse );	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), NPC->r.currentOrigin, forward );	missile->classname = "briar";	missile->s.weapon = WP_BRYAR_PISTOL;	missile->damage = 10;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	missile->methodOfDeath = MOD_BRYAR_PISTOL;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;}
开发者ID:Camron,项目名称:OpenJK,代码行数:34,


示例5: Seeker_Fire

//------------------------------------void Seeker_Fire( void ){	vec3_t		dir, enemy_org, muzzle;	gentity_t	*missile;	CalcEntitySpot( NPCS.NPC->enemy, SPOT_HEAD, enemy_org );	VectorSubtract( enemy_org, NPCS.NPC->r.currentOrigin, dir );	VectorNormalize( dir );	// move a bit forward in the direction we shall shoot in so that the bolt doesn't poke out the other side of the seeker	VectorMA( NPCS.NPC->r.currentOrigin, 15, dir, muzzle );	missile = CreateMissile( muzzle, dir, 1000, 10000, NPCS.NPC, qfalse );	G_PlayEffectID( G_EffectIndex("blaster/muzzle_flash"), NPCS.NPC->r.currentOrigin, dir );	missile->classname = "blaster";	missile->s.weapon = WP_BLASTER;	missile->damage = 5;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	missile->methodOfDeath = MOD_BLASTER;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;	if ( NPCS.NPC->r.ownerNum < ENTITYNUM_NONE )	{		missile->r.ownerNum = NPCS.NPC->r.ownerNum;	}}
开发者ID:Avygeil,项目名称:NewJK,代码行数:29,


示例6: Mark1Dead_FireBlaster

/*-------------------------Mark1Dead_FireBlaster- Shoot the left weapon, the multi-blaster-------------------------*/void Mark1Dead_FireBlaster (void){	vec3_t	muzzle1,muzzle_dir;	gentity_t	*missile;	mdxaBone_t	boltMatrix;	int			bolt;	bolt = trap_G2API_AddBolt(NPC->ghoul2, 0, "*flash1"); 	trap_G2API_GetBoltMatrix( NPC->ghoul2, 0, 				bolt,				&boltMatrix, NPC->r.currentAngles, NPC->r.currentOrigin, level.time,				NULL, NPC->modelScale );	BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, muzzle1 );	BG_GiveMeVectorFromMatrix( &boltMatrix, NEGATIVE_Y, muzzle_dir );	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), muzzle1, muzzle_dir );	missile = CreateMissile( muzzle1, muzzle_dir, 1600, 10000, NPC, qfalse );	G_Sound( NPC, CHAN_AUTO, G_SoundIndex("sound/chars/mark1/misc/mark1_fire"));	missile->classname = "bryar_proj";	missile->s.weapon = WP_BRYAR_PISTOL;	missile->damage = 1;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	missile->methodOfDeath = MOD_BRYAR_PISTOL;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;}
开发者ID:NoahBennet,项目名称:base_enhanced,代码行数:38,


示例7: 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,


示例8: 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,


示例9: NPC_Mark1_Part_Explode

/*-------------------------NPC_Mark1_Part_Explode-------------------------*/void NPC_Mark1_Part_Explode( gentity_t *self, int bolt ){	if ( bolt >=0 )	{		mdxaBone_t	boltMatrix;		vec3_t		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 );	}}
开发者ID:NoahBennet,项目名称:base_enhanced,代码行数:26,


示例10: NPC_GM_StartLaser

void NPC_GM_StartLaser( void ){	if ( !NPC->lockCount )	{//haven't already started a laser attack		//warm up for the beam attack		TIMER_Set( NPC, "beamDelay", NPC->client->ps.torsoTimer );		TIMER_Set( NPC, "attackDelay", NPC->client->ps.torsoTimer+3000 );		NPC->lockCount = 1;		//turn on warmup effect		G_PlayEffectID( G_EffectIndex("galak/beam_warmup"), NPC->r.currentOrigin, vec3_origin );		G_SoundOnEnt( NPC, CHAN_AUTO, "sound/weapons/galak/lasercharge.wav" );	}}
开发者ID:mehmehsomeone,项目名称:OpenRP,代码行数:13,


示例11: G_MissileBounceEffect

void G_MissileBounceEffect( gentity_t *ent, vector3 *org, vector3 *dir ) {	//FIXME: have an EV_BOUNCE_MISSILE event that checks the s.weapon and does the appropriate effect	switch ( ent->s.weapon ) {	case WP_BOWCASTER:		G_PlayEffectID( G_EffectIndex( "bowcaster/deflect" ), &ent->r.currentOrigin, dir );		break;	case WP_BLASTER:	case WP_BRYAR_PISTOL:		G_PlayEffectID( G_EffectIndex( "blaster/deflect" ), &ent->r.currentOrigin, dir );		break;	default:	{		gentity_t *te = G_TempEntity( org, EV_SABER_BLOCK );		VectorCopy( org, &te->s.origin );		VectorCopy( dir, &te->s.angles );		te->s.eventParm = 0;		te->s.weapon = 0;//saberNum		te->s.legsAnim = 0;//bladeNum	}		break;	}}
开发者ID:Arcadiaprime,项目名称:japp,代码行数:22,


示例12: turret_fire

//----------------------------------------------------------------static void turret_fire ( gentity_t *ent, vec3_t start, vec3_t dir )//----------------------------------------------------------------{	vec3_t		org;	gentity_t	*bolt;	if ( (trap_PointContents( start, ent->s.number )&MASK_SHOT) )	{		return;	}	VectorMA( start, -START_DIS, dir, org ); // dumb....	G_PlayEffectID( ent->genericValue13, org, dir );	bolt = G_Spawn();		//use a custom shot effect	bolt->s.otherEntityNum2 = ent->genericValue14;	//use a custom impact effect	bolt->s.emplacedOwner = ent->genericValue15;	bolt->classname = "turret_proj";	bolt->nextthink = level.time + 10000;	bolt->think = G_FreeEntity;	bolt->s.eType = ET_MISSILE;	bolt->s.weapon = WP_EMPLACED_GUN;	bolt->r.ownerNum = ent->s.number;	bolt->damage = ent->damage;	bolt->alliedTeam = ent->alliedTeam;	bolt->teamnodmg = ent->teamnodmg;	//bolt->dflags = DAMAGE_NO_KNOCKBACK;// | DAMAGE_HEAVY_WEAP_CLASS;		// Don't push them around, or else we are constantly re-aiming	bolt->splashDamage = ent->damage;	bolt->splashRadius = 100;	bolt->methodOfDeath = MOD_TARGET_LASER;	//[BugFix16]	bolt->splashMethodOfDeath = MOD_TARGET_LASER;	//[/BugFix16]	bolt->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;	//bolt->trigger_formation = qfalse;		// don't draw tail on first frame		VectorSet( bolt->r.maxs, 1.5, 1.5, 1.5 );	VectorScale( bolt->r.maxs, -1, bolt->r.mins );	bolt->s.pos.trType = TR_LINEAR;	bolt->s.pos.trTime = level.time;	VectorCopy( start, bolt->s.pos.trBase );	VectorScale( dir, ent->mass, bolt->s.pos.trDelta );	SnapVector( bolt->s.pos.trDelta );		// save net bandwidth	VectorCopy( start, bolt->r.currentOrigin);	bolt->parent = ent;}
开发者ID:jwginge,项目名称:ojpa,代码行数:52,


示例13: GLua_Sys_PlayEffect

static int GLua_Sys_PlayEffect(lua_State *L) {	vec3_t org, angs;	GLuaVec_t *org2, *angs2;	org2 = GLua_CheckVector(L,2);	ConvertVec(org2, org);	if (!lua_isnoneornil(L,3)) {		angs2 = GLua_CheckVector(L,2);		ConvertVec(angs2, angs);	} else {		VectorClear(angs);	}	G_PlayEffectID(luaL_checkint(L,1), org, angs);	return 0;}
开发者ID:Stoiss,项目名称:JediKnightGalaxies,代码行数:14,


示例14: NPC_GM_StartLaser

void NPC_GM_StartLaser( void ){	if ( !NPCS.NPC->lockCount )	{//haven't already started a laser attack		//warm up for the beam attack#if 0		NPC_SetAnim( NPC, SETANIM_TORSO, TORSO_RAISEWEAP2, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );#endif		TIMER_Set( NPCS.NPC, "beamDelay", NPCS.NPC->client->ps.torsoTimer );		TIMER_Set( NPCS.NPC, "attackDelay", NPCS.NPC->client->ps.torsoTimer+3000 );		NPCS.NPC->lockCount = 1;		//turn on warmup effect		G_PlayEffectID( G_EffectIndex("galak/beam_warmup"), NPCS.NPC->r.currentOrigin, vec3_origin );		G_SoundOnEnt( NPCS.NPC, CHAN_AUTO, "sound/weapons/galak/lasercharge.wav" );	}}
开发者ID:Avygeil,项目名称:NewJK,代码行数:16,


示例15: ATST_PlayEffect

static void ATST_PlayEffect( gentity_t *self, const int boltID, const char *fx ) {    if ( boltID >= 0 && fx && fx[0] ) {        mdxaBone_t	boltMatrix;        vector3		org, dir;        trap->G2API_GetBoltMatrix( self->ghoul2, 0,                                   boltID,                                   &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( (char *)fx ), org, dir );    }}
开发者ID:redsaurus,项目名称:japp,代码行数:16,


示例16: Mark2_FireBlaster

/*-------------------------Mark2_FireBlaster-------------------------*/void Mark2_FireBlaster(qboolean advance){	vec3_t	muzzle1,enemy_org1,delta1,angleToEnemy1;	static	vec3_t	forward, vright, up;	static	vec3_t	muzzle;	gentity_t	*missile;	mdxaBone_t	boltMatrix;	int bolt = trap_G2API_AddBolt(NPC->ghoul2, 0, "*flash");	trap_G2API_GetBoltMatrix( NPC->ghoul2, 0, 				bolt,				&boltMatrix, NPC->r.currentAngles, NPC->r.currentOrigin, level.time,				NULL, NPC->modelScale );	BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, muzzle1 );	if (NPC->health)	{		CalcEntitySpot( NPC->enemy, SPOT_HEAD, enemy_org1 );		VectorSubtract (enemy_org1, muzzle1, delta1);		vectoangles ( delta1, angleToEnemy1 );		AngleVectors (angleToEnemy1, forward, vright, up);	}	else	{		AngleVectors (NPC->r.currentAngles, forward, vright, up);	}	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), muzzle1, forward );	G_Sound( NPC, CHAN_AUTO, G_SoundIndex("sound/chars/mark2/misc/mark2_fire"));	missile = CreateMissile( muzzle1, forward, 1600, 10000, NPC, qfalse );	missile->classname = "bryar_proj";	missile->s.weapon = WP_BRYAR_PISTOL;	missile->damage = 1;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	missile->methodOfDeath = MOD_BRYAR_PISTOL;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;}
开发者ID:NikitaRus,项目名称:JediKnightGalaxies-1,代码行数:48,


示例17: Mark1Dead_FireRocket

/*-------------------------Mark1Dead_FireRocket- Shoot the left weapon, the multi-blaster-------------------------*/void Mark1Dead_FireRocket (void){	mdxaBone_t	boltMatrix;	vec3_t	muzzle1,muzzle_dir;	gentity_t *missile;	int	damage	= 50;	int bolt = trap_G2API_AddBolt(NPC->ghoul2, 0, "*flash5");	trap_G2API_GetBoltMatrix( NPC->ghoul2, 0, 				bolt,				&boltMatrix, NPC->r.currentAngles, NPC->r.currentOrigin, level.time,				NULL, NPC->modelScale );	BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, muzzle1 );	BG_GiveMeVectorFromMatrix( &boltMatrix, NEGATIVE_Y, muzzle_dir );	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), muzzle1, muzzle_dir );	G_Sound( NPC, CHAN_AUTO, G_SoundIndex("sound/chars/mark1/misc/mark1_fire"));	missile = CreateMissile( muzzle1, muzzle_dir, BOWCASTER_VELOCITY, 10000, NPC, qfalse );	missile->classname = "bowcaster_proj";	missile->s.weapon = WP_BOWCASTER;	VectorSet( missile->r.maxs, BOWCASTER_SIZE, BOWCASTER_SIZE, BOWCASTER_SIZE );	VectorScale( missile->r.maxs, -1, missile->r.mins );	missile->damage = damage;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	//missile->methodOfDeath = MOD_ENERGY;	missile->methodOfDeath = MOD_ROCKET;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;	missile->splashDamage = BOWCASTER_SPLASH_DAMAGE;	missile->splashRadius = BOWCASTER_SPLASH_RADIUS;	// we don't want it to bounce	missile->bounceCount = 0;}
开发者ID:Chedo,项目名称:OpenJK,代码行数:47,


示例18: Remote_Fire

/*-------------------------Remote_Fire-------------------------*/void Remote_Fire (void){	vec3_t	delta1, enemy_org1, muzzle1;	vec3_t	angleToEnemy1;	//[SeekerItemNpc]	//these dont need to be static, and vright and up arent used	/*static*/ vec3_t	forward;//, vright, up;	/*static vec3_t	muzzle;*/	//[/SeekerItemNpc]	gentity_t	*missile;	CalcEntitySpot( NPC->enemy, SPOT_HEAD, enemy_org1 );	VectorCopy( NPC->r.currentOrigin, muzzle1 );		VectorSubtract (enemy_org1, muzzle1, delta1);	vectoangles ( delta1, angleToEnemy1 );	//[SeekerItemNpc]	AngleVectors (angleToEnemy1, forward, NULL, NULL);	//AngleVectors (angleToEnemy1, forward, vright, up);	//[/SeekerItemNpc]	missile = CreateMissile( NPC->r.currentOrigin, forward, 1000, 10000, NPC, qfalse );	G_PlayEffectID( G_EffectIndex("bryar/muzzle_flash"), NPC->r.currentOrigin, forward );	missile->classname = "briar";	missile->s.weapon = WP_BRYAR_PISTOL;	missile->damage = 10;	missile->dflags = DAMAGE_DEATH_KNOCKBACK;	//RAFIXME - impliment this MOD?	//missile->methodOfDeath = MOD_ENERGY;	missile->methodOfDeath = MOD_BRYAR_PISTOL;	missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;}
开发者ID:jwginge,项目名称:ojpa,代码行数:42,


示例19: ProcessMoveCommands

//MP RULE - ALL PROCESSMOVECOMMANDS FUNCTIONS MUST BE BG-COMPATIBLE!!!//If you really need to violate this rule for SP, then use ifdefs.//By BG-compatible, I mean no use of game-specific data - ONLY use//stuff available in the MP bgEntity (in SP, the bgEntity is #defined//as a gentity, but the MP-compatible access restrictions are based//on the bgEntity structure in the MP codebase) -rww// ProcessMoveCommands the Vehicle.static void ProcessMoveCommands( Vehicle_t *pVeh ){	/************************************************************************************/	/*	BEGIN	Here is where we move the vehicle (forward or back or whatever). BEGIN	*/	/************************************************************************************/	//Client sets ucmds and such for speed alterations	float speedInc, speedIdleDec, speedIdle, speedIdleAccel, speedMin, speedMax;	playerState_t *parentPS;	playerState_t *pilotPS = NULL;	int	curTime;#ifdef _JK2MP	parentPS = pVeh->m_pParentEntity->playerState;	if (pVeh->m_pPilot)	{		pilotPS = pVeh->m_pPilot->playerState;	}#else	parentPS = &pVeh->m_pParentEntity->client->ps;	if (pVeh->m_pPilot)	{		pilotPS = &pVeh->m_pPilot->client->ps;	}#endif	// If we're flying, make us accelerate at 40% (about half) acceleration rate, and restore the pitch	// to origin (straight) position (at 5% increments). 	if ( pVeh->m_ulFlags & VEH_FLYING ) 	{		speedInc = pVeh->m_pVehicleInfo->acceleration * pVeh->m_fTimeModifier * 0.4f;	}#ifdef _JK2MP	else if ( !parentPS->m_iVehicleNum )#else	else if ( !pVeh->m_pVehicleInfo->Inhabited( pVeh ) )#endif	{//drifts to a stop		speedInc = 0;		//pVeh->m_ucmd.forwardmove = 127;	}	else	{		speedInc = pVeh->m_pVehicleInfo->acceleration * pVeh->m_fTimeModifier;	}	speedIdleDec = pVeh->m_pVehicleInfo->decelIdle * pVeh->m_fTimeModifier;#ifndef _JK2MP//SP	curTime = level.time;#elif QAGAME//MP GAME	curTime = level.time;#elif CGAME//MP CGAME	//FIXME: pass in ucmd?  Not sure if this is reliable...	curTime = pm->cmd.serverTime;#endif	if ( (pVeh->m_pPilot /*&& (pilotPS->weapon == WP_NONE || pilotPS->weapon == WP_MELEE )*/ &&		(pVeh->m_ucmd.buttons & BUTTON_ALT_ATTACK) && pVeh->m_pVehicleInfo->turboSpeed)		/*||		(parentPS && parentPS->electrifyTime > curTime && pVeh->m_pVehicleInfo->turboSpeed)*/ //make them go!		)	{		if ( (parentPS && parentPS->electrifyTime > curTime) ||			 (pVeh->m_pPilot->playerState &&			  (pVeh->m_pPilot->playerState->weapon == WP_MELEE ||			  (pVeh->m_pPilot->playerState->weapon == WP_SABER && BG_SabersOff( pVeh->m_pPilot->playerState ) ))) )		{			if ((curTime - pVeh->m_iTurboTime)>pVeh->m_pVehicleInfo->turboRecharge)			{				pVeh->m_iTurboTime = (curTime + pVeh->m_pVehicleInfo->turboDuration);				if (pVeh->m_pVehicleInfo->iTurboStartFX)				{					int i;					for (i=0; (i<MAX_VEHICLE_EXHAUSTS && pVeh->m_iExhaustTag[i]!=-1); i++)					{#ifdef QAGAME						if (pVeh->m_pParentEntity &&							pVeh->m_pParentEntity->ghoul2 &&							pVeh->m_pParentEntity->playerState)						{ //fine, I'll use a tempent for this, but only because it's played only once at the start of a turbo.							vec3_t boltOrg, boltDir;							mdxaBone_t boltMatrix;							VectorSet(boltDir, 0.0f, pVeh->m_pParentEntity->playerState->viewangles[YAW], 0.0f);							trap_G2API_GetBoltMatrix(pVeh->m_pParentEntity->ghoul2, 0, pVeh->m_iExhaustTag[i], &boltMatrix, boltDir, pVeh->m_pParentEntity->playerState->origin, level.time, NULL, pVeh->m_pParentEntity->modelScale);							BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, boltOrg);							BG_GiveMeVectorFromMatrix(&boltMatrix, ORIGIN, boltDir);							G_PlayEffectID(pVeh->m_pVehicleInfo->iTurboStartFX, boltOrg, boltDir);						}#endif//.........这里部分代码省略.........
开发者ID:dmead,项目名称:jkaq3,代码行数:101,


示例20: G_MissileImpact

//.........这里部分代码省略.........                    //permanently disable the saboteur's cloak                    other->client->cloakToggleTime = Q3_INFINITE;                }                else                {   //temp disable                    other->client->cloakToggleTime = level.time + Q_irand( 3000, 10000 );                }            }        }    }#if _GRAPPLE//_GRAPPLE    if (!strcmp(ent->classname, "laserTrap") && ent->s.weapon == WP_BRYAR_PISTOL) {        //gentity_t *nent;        vec3_t v;        /*        nent = G_Spawn(qtrue);        nent->freeAfterEvent = qtrue;        nent->s.weapon = WP_BRYAR_PISTOL;//WP_GRAPPLING_HOOK; -- idk what this is        nent->s.saberInFlight = qtrue;        nent->s.owner = ent->s.owner;        */        ent->enemy = NULL;        ent->s.otherEntityNum = -1;        ent->s.groundEntityNum = -1;        if ( other->s.eType == ET_MOVER || (other->client && !( other->s.eFlags & EF_DEAD ) ) ) {            if ( other->client ) {                //G_AddEvent( nent, EV_MISSILE_HIT, DirToByte( trace->plane.normal ) );							//Event                if (!ent->s.hasLookTarget) {                    G_PlayEffectID( G_EffectIndex("tusken/hit"), trace->endpos, trace->plane.normal );                }                ent->s.hasLookTarget = qtrue;                ent->enemy = other;                other->s.otherEntityNum = ent->parent->s.number;                v[0] = other->r.currentOrigin[0];// + (other->r.mins[0] + other->r.maxs[0]) * 0.5;                v[1] = other->r.currentOrigin[1];// + (other->r.mins[1] + other->r.maxs[1]) * 0.5;                v[2] = other->r.currentOrigin[2] + (other->r.mins[2] + other->r.maxs[2]) * 0.5;                SnapVectorTowards( v, ent->s.pos.trBase );	// save net bandwidth                ent->s.otherEntityNum = ent->enemy->s.clientNum;                other->s.otherEntityNum = ent->parent->s.clientNum;            } else {                if ( !strcmp(other->classname, "func_rotating") || !strcmp(other->classname, "func_pendulum") ) {                    Weapon_HookFree(ent);	// don't work                    return;                }                ent->s.otherEntityNum = other->s.number;                ent->s.groundEntityNum = other->s.number;                VectorCopy(trace->endpos, v);                //G_AddEvent( nent, EV_MISSILE_MISS, 0); //DirToByte( trace->plane.normal ) );				//Event                if (!ent->s.hasLookTarget) {                    G_PlayEffectID( G_EffectIndex("tusken/hitwall"), trace->endpos, trace->plane.normal );                }                ent->s.hasLookTarget = qtrue;            }        } else {            VectorCopy(trace->endpos, v);            //G_AddEvent( nent, EV_MISSILE_MISS, 0);//DirToByte( trace->plane.normal ) );						//Event            if (!ent->s.hasLookTarget) {                G_PlayEffectID( G_EffectIndex("tusken/hitwall"), trace->endpos, trace->plane.normal );
开发者ID:videoP,项目名称:jaPRO,代码行数:67,


示例21: NPC_BSGM_Attack

//.........这里部分代码省略.........					//throw them					G_Throw( NPCS.NPC->enemy, smackDir, 100 );					//make them backflip					NPC_SetAnim( NPCS.NPC->enemy, SETANIM_BOTH, BOTH_KNOCKDOWN5, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );				}				//done with the damage				NPCS.NPCInfo->blockedDebounceTime = 1;			}		}	}	else if ( NPCS.NPC->lockCount ) //already shooting laser	{//sometimes use the laser beam attack, but only after he's taken down our generator		shoot4 = qfalse;		if ( NPCS.NPC->lockCount == 1 )		{//charging up			if ( TIMER_Done( NPCS.NPC, "beamDelay" ) )			{//time to start the beam				int laserAnim;				//if ( Q_irand( 0, 1 ) )				if (1)				{					laserAnim = BOTH_ATTACK2;				}				/*				else				{					laserAnim = BOTH_ATTACK7;				}				*/				NPC_SetAnim( NPCS.NPC, SETANIM_BOTH, laserAnim, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );				TIMER_Set( NPCS.NPC, "attackDelay", NPCS.NPC->client->ps.torsoTimer + Q_irand( 1000, 3000 ) );				//turn on beam effect				NPCS.NPC->lockCount = 2;				G_PlayEffectID( G_EffectIndex("galak/trace_beam"), NPCS.NPC->r.currentOrigin, vec3_origin );				NPCS.NPC->s.loopSound = G_SoundIndex( "sound/weapons/galak/lasercutting.wav" );				if ( !NPCS.NPCInfo->coverTarg )				{//for moving looping sound at end of trace					NPCS.NPCInfo->coverTarg = G_Spawn();					if ( NPCS.NPCInfo->coverTarg )					{						G_SetOrigin( NPCS.NPCInfo->coverTarg, NPCS.NPC->client->renderInfo.muzzlePoint );						NPCS.NPCInfo->coverTarg->r.svFlags |= SVF_BROADCAST;						NPCS.NPCInfo->coverTarg->s.loopSound = G_SoundIndex( "sound/weapons/galak/lasercutting.wav" );					}				}			}		}		else		{//in the actual attack now			if ( NPCS.NPC->client->ps.torsoTimer <= 0 )			{//attack done!				NPCS.NPC->lockCount = 0;				G_FreeEntity( NPCS.NPCInfo->coverTarg );				NPCS.NPC->s.loopSound = 0;#if 0				NPC_SetAnim( NPC, SETANIM_TORSO, TORSO_DROPWEAP2, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );#endif				TIMER_Set( NPCS.NPC, "attackDelay", NPCS.NPC->client->ps.torsoTimer );			}			else			{//attack still going				//do the trace and damage				trace_t	trace;				vec3_t	end, mins={-3,-3,-3}, maxs={3,3,3};				VectorMA( NPCS.NPC->client->renderInfo.muzzlePoint, 1024, NPCS.NPC->client->renderInfo.muzzleDir, end );				trap->Trace( &trace, NPCS.NPC->client->renderInfo.muzzlePoint, mins, maxs, end, NPCS.NPC->s.number, MASK_SHOT, qfalse, 0, 0 );
开发者ID:Avygeil,项目名称:NewJK,代码行数:67,


示例22: Howler_Attack

static void Howler_Attack( float enemyDist, qboolean howl ){	int dmg = (NPCInfo->localState==LSTATE_BERZERK)?5:2;	vec3_t boltOrg;	vec3_t fwd;	if ( !TIMER_Exists( NPC, "attacking" ))	{		int attackAnim = BOTH_GESTURE1;		// Going to do an attack		if ( NPC->enemy && NPC->enemy->client && PM_InKnockDown( &NPC->enemy->client->ps )			&& enemyDist <= MIN_DISTANCE )		{			attackAnim = BOTH_ATTACK2;		}		else if ( !Q_irand( 0, 4 ) || howl )		{//howl attack			//G_SoundOnEnt( NPC, CHAN_VOICE, "sound/chars/howler/howl.mp3" );		}		else if ( enemyDist > MIN_DISTANCE && Q_irand( 0, 1 ) )		{//lunge attack			//jump foward			vec3_t	fwd, yawAng;						VectorSet( yawAng, 0, NPC->client->ps.viewangles[YAW], 0 );			AngleVectors( yawAng, fwd, NULL, NULL );			VectorScale( fwd, (enemyDist*3.0f), NPC->client->ps.velocity );			NPC->client->ps.velocity[2] = 200;			NPC->client->ps.groundEntityNum = ENTITYNUM_NONE;						attackAnim = BOTH_ATTACK1;		}		else		{//tongue attack			attackAnim = BOTH_ATTACK2;		}		NPC_SetAnim( NPC, SETANIM_BOTH, attackAnim, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD | SETANIM_FLAG_RESTART );		if ( NPCInfo->localState == LSTATE_BERZERK )		{//attack again right away			TIMER_Set( NPC, "attacking", NPC->client->ps.legsTimer );		}		else		{			TIMER_Set( NPC, "attacking", NPC->client->ps.legsTimer + Q_irand( 0, 1500 ) );//FIXME: base on skill			TIMER_Set( NPC, "standing", -level.time );			TIMER_Set( NPC, "walking", -level.time );			TIMER_Set( NPC, "running", NPC->client->ps.legsTimer + 5000 );		}		TIMER_Set( NPC, "attack_dmg", 200 ); // level two damage	}	// Need to do delayed damage since the attack animations encapsulate multiple mini-attacks	switch ( NPC->client->ps.legsAnim )	{	case BOTH_ATTACK1:	case BOTH_MELEE1:		if ( NPC->client->ps.legsTimer > 650//more than 13 frames left			&& BG_AnimLength( NPC->localAnimIndex, (animNumber_t)NPC->client->ps.legsAnim ) - NPC->client->ps.legsTimer >= 800 )//at least 16 frames into anim		{			Howler_TryDamage( dmg, qfalse, qfalse );		}		break;	case BOTH_ATTACK2:	case BOTH_MELEE2:		if ( NPC->client->ps.legsTimer > 350//more than 7 frames left			&& BG_AnimLength( NPC->localAnimIndex, (animNumber_t)NPC->client->ps.legsAnim ) - NPC->client->ps.legsTimer >= 550 )//at least 11 frames into anim		{			Howler_TryDamage( dmg, qtrue, qfalse );		}		break;	case BOTH_GESTURE1:		{			if ( NPC->client->ps.legsTimer > 1800//more than 36 frames left				&& BG_AnimLength( NPC->localAnimIndex, (animNumber_t)NPC->client->ps.legsAnim ) - NPC->client->ps.legsTimer >= 950 )//at least 19 frames into anim			{				Howler_Howl();				if ( !NPC->count )				{					//RAFIXME - this probably won't work correctly.					G_GetBoltPosition(NPC, NPC->NPC->genericBolt1, boltOrg, 0);					AngleVectors( NPC->client->ps.viewangles, fwd, NULL, NULL );					G_PlayEffectID( G_EffectIndex( "howler/sonic" ), boltOrg, fwd);					//G_PlayEffect( G_EffectIndex( "howler/sonic" ), NPC->ghoul2, NPC->NPC->genericBolt1, NPC->s.number, NPC->currentOrigin, 4750, qtrue );					G_SoundOnEnt( NPC, CHAN_VOICE, "sound/chars/howler/howl.mp3" );					NPC->count = 1;				}			}		}		break;	default:		//anims seem to get reset after a load, so just stop attacking and it will restart as needed.		TIMER_Remove( NPC, "attacking" );		break;	}	// Just using this to remove the attacking flag at the right time	TIMER_Done2( NPC, "attacking", qtrue );//.........这里部分代码省略.........
开发者ID:mehmehsomeone,项目名称:OpenRP,代码行数:101,


示例23: turretG2_fire

//----------------------------------------------------------------static void turretG2_fire ( gentity_t *ent, vec3_t start, vec3_t dir )//----------------------------------------------------------------{    vec3_t		org, ang;    gentity_t	*bolt;    if ( (trap_PointContents( start, ent->s.number )&MASK_SHOT) )    {        return;    }    VectorMA( start, -START_DIS, dir, org ); // dumb....    if ( ent->random )    {        vectoangles( dir, ang );        ang[PITCH] += flrand( -ent->random, ent->random );        ang[YAW] += flrand( -ent->random, ent->random );        AngleVectors( ang, dir, NULL, NULL );    }    vectoangles(dir, ang);    if ( (ent->spawnflags&SPF_TURRETG2_TURBO) )    {        //muzzle flash        G_PlayEffectID( ent->genericValue13, org, ang );        WP_FireTurboLaserMissile( ent, start, dir );        if ( ent->alt_fire )        {            TurboLaser_SetBoneAnim( ent, 2, 3 );        }        else        {            TurboLaser_SetBoneAnim( ent, 0, 1 );        }    }    else    {        G_PlayEffectID( G_EffectIndex("blaster/muzzle_flash"), org, ang );        bolt = G_Spawn();        bolt->classname = "turret_proj";        bolt->nextthink = level.time + 10000;        bolt->think = G_FreeEntity;        bolt->s.eType = ET_MISSILE;        bolt->s.weapon = WP_BLASTER;        bolt->r.ownerNum = ent->s.number;        bolt->damage = ent->damage;        bolt->alliedTeam = ent->alliedTeam;        bolt->teamnodmg = ent->teamnodmg;        bolt->dflags = (DAMAGE_NO_KNOCKBACK|DAMAGE_HEAVY_WEAP_CLASS);		// Don't push them around, or else we are constantly re-aiming        bolt->splashDamage = ent->splashDamage;        bolt->splashRadius = ent->splashDamage;        bolt->methodOfDeath = MOD_TARGET_LASER;//MOD_ENERGY;        bolt->splashMethodOfDeath = MOD_TARGET_LASER;//MOD_ENERGY;        bolt->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;        //bolt->trigger_formation = qfalse;		// don't draw tail on first frame        VectorSet( bolt->r.maxs, 1.5, 1.5, 1.5 );        VectorScale( bolt->r.maxs, -1, bolt->r.mins );        bolt->s.pos.trType = TR_LINEAR;        bolt->s.pos.trTime = level.time;        VectorCopy( start, bolt->s.pos.trBase );        VectorScale( dir, ent->mass, bolt->s.pos.trDelta );        SnapVector( bolt->s.pos.trDelta );		// save net bandwidth        VectorCopy( start, bolt->r.currentOrigin);    }}
开发者ID:Atlas-zz,项目名称:SDK-JKA-ACADEMIE-HCF,代码行数:70,


示例24: Sentry_Fire

/*-------------------------Sentry_Fire-------------------------*/void Sentry_Fire( void ) {    vector3	muzzle;    static	vector3	forward, vright, up;    gentity_t	*missile;    mdxaBone_t	boltMatrix;    int			bolt;    int			which;    NPC->flags &= ~FL_SHIELDED;    if ( NPCInfo->localState == LSTATE_POWERING_UP ) {        if ( TIMER_Done( NPC, "powerup" ) ) {            NPCInfo->localState = LSTATE_ATTACKING;            NPC_SetAnim( NPC, SETANIM_BOTH, BOTH_ATTACK1, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD );        }        else {            // can't do anything right now            return;        }    }    else if ( NPCInfo->localState == LSTATE_ACTIVE ) {        NPCInfo->localState = LSTATE_POWERING_UP;        G_Sound( NPC, CHAN_AUTO, G_SoundIndex( "sound/chars/sentry/misc/sentry_shield_open" ) );        NPC_SetAnim( NPC, SETANIM_BOTH, BOTH_POWERUP1, SETANIM_FLAG_OVERRIDE | SETANIM_FLAG_HOLD );        TIMER_Set( NPC, "powerup", 250 );        return;    }    else if ( NPCInfo->localState != LSTATE_ATTACKING ) {        // bad because we are uninitialized        NPCInfo->localState = LSTATE_ACTIVE;        return;    }    // Which muzzle to fire from?    which = NPCInfo->burstCount % 3;    switch ( which ) {    case 0:        bolt = trap->G2API_AddBolt( NPC->ghoul2, 0, "*flash1" );        break;    case 1:        bolt = trap->G2API_AddBolt( NPC->ghoul2, 0, "*flash2" );        break;    case 2:    default:        bolt = trap->G2API_AddBolt( NPC->ghoul2, 0, "*flash03" );    }    trap->G2API_GetBoltMatrix( NPC->ghoul2, 0,                               bolt,                               &boltMatrix, &NPC->r.currentAngles, &NPC->r.currentOrigin, level.time,                               NULL, &NPC->modelScale );    BG_GiveMeVectorFromMatrix( &boltMatrix, ORIGIN, &muzzle );    AngleVectors( &NPC->r.currentAngles, &forward, &vright, &up );    //	G_Sound( NPC, G_SoundIndex("sound/chars/sentry/misc/shoot.wav"));    G_PlayEffectID( G_EffectIndex( "bryar/muzzle_flash" ), &muzzle, &forward );    missile = CreateMissile( &muzzle, &forward, 1600, 10000, NPC, qfalse );    missile->classname = "bryar_proj";    missile->s.weapon = WP_BRYAR_PISTOL;    missile->dflags = DAMAGE_DEATH_KNOCKBACK;    missile->methodOfDeath = MOD_BRYAR_PISTOL;    missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;    NPCInfo->burstCount++;    NPC->attackDebounceTime = level.time + 50;    missile->damage = 5;    // now scale for difficulty    if ( g_spSkill.integer == 0 ) {        NPC->attackDebounceTime += 200;        missile->damage = 1;    }    else if ( g_spSkill.integer == 1 ) {        NPC->attackDebounceTime += 100;        missile->damage = 3;    }}
开发者ID:redsaurus,项目名称:japp,代码行数:88,


示例25: GM_Dying

void GM_Dying( gentity_t *self ){	if ( level.time - self->s.time < 4000 )	{//FIXME: need a real effect		//self->s.powerups |= ( 1 << PW_SHOCKED );		//self->client->ps.powerups[PW_SHOCKED] = level.time + 1000;		self->client->ps.electrifyTime = level.time + 1000;		if ( TIMER_Done( self, "dyingExplosion" ) )		{			int	newBolt;			switch ( Q_irand( 1, 14 ) )			{			// Find place to generate explosion			case 1:				if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "r_hand" ))				{//r_hand still there					GM_CreateExplosion( self, trap->G2API_AddBolt(self->ghoul2, 0, "*flasha"), qtrue );					NPC_SetSurfaceOnOff( self, "r_hand", TURN_OFF );				}				else if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "r_arm_middle" ))				{//r_arm_middle still there					newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*r_arm_elbow" );					NPC_SetSurfaceOnOff( self, "r_arm_middle", TURN_OFF );				}				break;			case 2:				//FIXME: do only once?				if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "l_hand" ))				{//l_hand still there					GM_CreateExplosion( self, trap->G2API_AddBolt(self->ghoul2, 0, "*flashc"), qfalse );					NPC_SetSurfaceOnOff( self, "l_hand", TURN_OFF );				}				else if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "l_arm_wrist" ))				{//l_arm_wrist still there					newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*l_arm_cap_l_hand" );					NPC_SetSurfaceOnOff( self, "l_arm_wrist", TURN_OFF );				}				else if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "l_arm_middle" ))				{//l_arm_middle still there					newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*l_arm_cap_l_hand" );					NPC_SetSurfaceOnOff( self, "l_arm_middle", TURN_OFF );				}				else if (!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "l_arm_augment" ))				{//l_arm_augment still there					newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*l_arm_elbow" );					NPC_SetSurfaceOnOff( self, "l_arm_augment", TURN_OFF );				}				break;			case 3:			case 4:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*hip_fr" );				GM_CreateExplosion( self, newBolt, qfalse );				break;			case 5:			case 6:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*shldr_l" );				GM_CreateExplosion( self, newBolt, qfalse );				break;			case 7:			case 8:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*uchest_r" );				GM_CreateExplosion( self, newBolt, qfalse );				break;			case 9:			case 10:				GM_CreateExplosion( self, self->client->renderInfo.headBolt, qfalse );				break;			case 11:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*l_leg_knee" );				GM_CreateExplosion( self, newBolt, qtrue );				break;			case 12:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*r_leg_knee" );				GM_CreateExplosion( self, newBolt, qtrue );				break;			case 13:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*l_leg_foot" );				GM_CreateExplosion( self, newBolt, qtrue );				break;			case 14:				newBolt = trap->G2API_AddBolt( self->ghoul2, 0, "*r_leg_foot" );				GM_CreateExplosion( self, newBolt, qtrue );				break;			}			TIMER_Set( self, "dyingExplosion", Q_irand( 300, 1100 ) );		}	}	else	{//one final, huge explosion		G_PlayEffectID( G_EffectIndex("galak/explode"), self->r.currentOrigin, vec3_origin );//		G_PlayEffect( "small_chunks", self->r.currentOrigin );//		G_PlayEffect( "env/exp_trail_comp", self->r.currentOrigin, self->currentAngles );		self->nextthink = level.time + FRAMETIME;		self->think = G_FreeEntity;	}}
开发者ID:Avygeil,项目名称:NewJK,代码行数:97,


示例26: NPC_Droid_Pain

/*-------------------------NPC_BSDroid_Pain-------------------------*/void NPC_Droid_Pain(gentity_t *self, gentity_t *attacker, int damage){	gentity_t *other = attacker;	int		anim;	int		mod = gPainMOD;	float	pain_chance;	VectorCopy( self->NPC->lastPathAngles, self->s.angles );	if ( self->client->NPC_class == CLASS_R5D2 )	{		pain_chance = NPC_GetPainChance( self, damage );		// Put it in pain		if ( mod == MOD_DEMP2 || mod == MOD_DEMP2_ALT || random() < pain_chance )	// Spin around in pain? Demp2 always does this		{			// Health is between 0-30 or was hit by a DEMP2 so pop his head			if ( !self->s.m_iVehicleNum				&& ( self->health < 30 || mod == MOD_DEMP2 || mod == MOD_DEMP2_ALT ) )			{				if (!(self->spawnflags & 2))	// Doesn't have to ALWAYSDIE				{					if ((self->NPC->localState != LSTATE_SPINNING) && 						(!trap->G2API_GetSurfaceRenderStatus( self->ghoul2, 0, "head" )))					{						NPC_SetSurfaceOnOff( self, "head", TURN_OFF );						if ( self->client->ps.m_iVehicleNum )						{							vec3_t	up;							AngleVectors( self->r.currentAngles, NULL, NULL, up );							G_PlayEffectID( G_EffectIndex("chunks/r5d2head_veh"), self->r.currentOrigin, up );						}						else						{							G_PlayEffectID( G_EffectIndex("small_chunks") , self->r.currentOrigin, vec3_origin );							G_PlayEffectID( G_EffectIndex("chunks/r5d2head"), self->r.currentOrigin, vec3_origin );						}						//self->s.powerups |= ( 1 << PW_SHOCKED );						//self->client->ps.powerups[PW_SHOCKED] = level.time + 3000;						self->client->ps.electrifyTime = level.time + 3000;						TIMER_Set( self, "droidsmoketotal", 5000);						TIMER_Set( self, "droidspark", 100);						self->NPC->localState = LSTATE_SPINNING;					}				}			}			// Just give him normal pain for a little while			else			{				anim = self->client->ps.legsAnim;				if ( anim == BOTH_STAND2 )	// On two legs?				{					anim = BOTH_PAIN1;				}				else						// On three legs				{					anim = BOTH_PAIN2;				}				NPC_SetAnim( self, SETANIM_BOTH, anim, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );				// Spin around in pain				self->NPC->localState = LSTATE_SPINNING;				TIMER_Set( self, "roam", Q_irand(1000,2000));			} 		}	}	else if (self->client->NPC_class == CLASS_MOUSE)	{		if ( mod == MOD_DEMP2 || mod == MOD_DEMP2_ALT )		{			self->NPC->localState = LSTATE_SPINNING;			//self->s.powerups |= ( 1 << PW_SHOCKED );			//self->client->ps.powerups[PW_SHOCKED] = level.time + 3000;			self->client->ps.electrifyTime = level.time + 3000;		}		else		{			self->NPC->localState = LSTATE_BACKINGUP;		}		self->NPC->scriptFlags &= ~SCF_LOOK_FOR_ENEMIES;	}	else if (self->client->NPC_class == CLASS_R2D2)	{		pain_chance = NPC_GetPainChance( self, damage );		if ( mod == MOD_DEMP2 || mod == MOD_DEMP2_ALT || random() < pain_chance )	// Spin around in pain? Demp2 always does this		{			// Health is between 0-30 or was hit by a DEMP2 so pop his head//.........这里部分代码省略.........
开发者ID:DarthFutuza,项目名称:JediKnightGalaxies,代码行数:101,


示例27: Seeker_Fire

//------------------------------------qboolean Seeker_Fire( void ){    //[SeekerItemNpc]#if 1    vec3_t		dir, enemy_org, muzzle;    gentity_t	*missile;    trace_t tr;    int randomnum = irand(1,5);    if (randomnum == 1)    {        CalcEntitySpot( NPC->enemy, SPOT_HEAD, enemy_org );    }    else if (randomnum == 2)    {        CalcEntitySpot( NPC->enemy,SPOT_WEAPON,enemy_org);    }    else if (randomnum == 3)    {        CalcEntitySpot(NPC->enemy,SPOT_ORIGIN,enemy_org);    }    else if (randomnum == 4)    {        CalcEntitySpot(NPC->enemy,SPOT_CHEST,enemy_org);    }    else    {        CalcEntitySpot(NPC->enemy,SPOT_LEGS,enemy_org);    }    enemy_org[0]+=irand(2,15);    enemy_org[1]+=irand(2,15);    //calculate everything based on our model offset    VectorCopy(NPC->r.currentOrigin, muzzle);    //correct for our model offset    muzzle[2] -= 22;    muzzle[2] -= randomnum;    VectorSubtract( enemy_org, NPC->r.currentOrigin, dir );    VectorNormalize( dir );    // move a bit forward in the direction we shall shoot in so that the bolt doesn't poke out the other side of the seeker    VectorMA( muzzle, 15, dir, muzzle );    trap_Trace(&tr, muzzle, NULL, NULL, enemy_org, NPC->s.number, MASK_PLAYERSOLID);    //tr.fraction wont be 1.0f, since we hit our enemy.    if(tr.entityNum != NPC->enemy->s.number)        //if(tr.fraction >= 1.0f)        //we cant reach our target        return qfalse;    //our player should get the kill, if any    //FIXME: we have a special case here.  we want the kill to be given to the activator, BUT we want the missile to NOT hurt the player    //attempting to leave missile->parent == NPC, but missile->r.ownerNum to NPC->activator->s.number, no idea if it will work, just doing a guess.    //if(NPC->activator)    //	missile = CreateMissile( muzzle, dir, 1000, 10000, NPC->activator, qfalse );    //else    missile = CreateMissile( muzzle, dir, 1000, 10000, NPC, qfalse );    //missile = CreateMissile( muzzle, dir, 1000, 10000, NPC, qfalse );    G_PlayEffectID( G_EffectIndex("blaster/muzzle_flash"), muzzle, dir );    missile->classname = "blaster";    missile->s.weapon = WP_BLASTER;    missile->damage = NPC->damage;    missile->dflags = DAMAGE_DEATH_KNOCKBACK;    //[SeekerItemNPC]    //seeker items have different MOD    if(NPC->client->leader //has leader            && NPC->client->leader->client //leader is a client            && NPC->client->leader->client->remote == NPC) //has us as their remote.    {   //yep, this is a player's seeker, use different MOD        missile->methodOfDeath = MOD_SEEKER;    }    else    {        missile->methodOfDeath = MOD_BLASTER;    }    //missile->methodOfDeath = MOD_BLASTER;    //[/SeekerItemNPC]    missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;    //[CoOp]    /* Not in SP version of code.    if ( NPC->r.ownerNum < ENTITYNUM_NONE )    {    	missile->r.ownerNum = NPC->r.ownerNum;    }    */    //[/CoOp]    ////no, it isnt in SP version, but will it let the player get the kill but not let the seeker shoot itself?//.........这里部分代码省略.........
开发者ID:jwginge,项目名称:ojpa,代码行数:101,



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


C++ G_Printf函数代码示例
C++ G_PlayEffect函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。