本文整理汇总了C++中G_PlayEffect函数的典型用法代码示例。如果您正苦于以下问题:C++ G_PlayEffect函数的具体用法?C++ G_PlayEffect怎么用?C++ G_PlayEffect使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_PlayEffect函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: GM_CreateExplosion
//-----------------------------------------------------------------
static void GM_CreateExplosion( gentity_t *self, const int boltID, qboolean doSmall = qfalse )
{
if ( boltID >=0 )
{
mdxaBone_t boltMatrix;
vec3_t org, dir;
gi.G2API_GetBoltMatrix( self->ghoul2, self->playerModel,
boltID,
&boltMatrix, self->currentAngles, self->currentOrigin, (cg.time?cg.time:level.time),
NULL, self->s.modelScale );
gi.G2API_GiveMeVectorFromMatrix( boltMatrix, ORIGIN, org );
gi.G2API_GiveMeVectorFromMatrix( boltMatrix, NEGATIVE_Y, dir );
if ( doSmall )
{
G_PlayEffect( "env/small_explode2", org, dir );
}
else
{
G_PlayEffect( "env/med_explode2", org, dir );
}
}
}
开发者ID:PJayB,项目名称:jk2src,代码行数:26,代码来源:AI_GalakMech.cpp
示例2: G_MissileReflectEffect
void G_MissileReflectEffect( gentity_t *ent, vec3_t org, vec3_t dir )
#endif // _IMMERSION
{
//FIXME: have an EV_BOUNCE_MISSILE event that checks the s.weapon and does the appropriate effect
switch( ent->s.weapon )
{
case WP_BOWCASTER:
#ifdef _IMMERSION
G_PlayEffect( "bowcaster/deflect", hitEntNum, ent->currentOrigin, dir );
#else
G_PlayEffect( "bowcaster/deflect", ent->currentOrigin, dir );
#endif // _IMMERSION
break;
case WP_BLASTER:
case WP_BRYAR_PISTOL:
case WP_BLASTER_PISTOL:
default:
#ifdef _IMMERSION
G_PlayEffect( "blaster/deflect", hitEntNum, ent->currentOrigin, dir );
#else
G_PlayEffect( "blaster/deflect", ent->currentOrigin, dir );
#endif // _IMMERSION
break;
}
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:25,代码来源:g_missile.cpp
示例3: RT_FlyStart
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
}
}
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:33,代码来源:AI_RocketTrooper.cpp
示例4: thermalDetonatorExplode
//---------------------------------------------------------
void thermalDetonatorExplode( gentity_t *ent )
//---------------------------------------------------------
{
if ( !ent->count )
{
G_Sound( ent, G_SoundIndex( "sound/weapons/thermal/warning.wav" ) );
ent->count = 1;
ent->nextthink = level.time + 800;
ent->svFlags |= SVF_BROADCAST;//so everyone hears/sees the explosion?
}
else
{
vec3_t pos;
VectorSet( pos, ent->currentOrigin[0], ent->currentOrigin[1], ent->currentOrigin[2] + 8 );
ent->takedamage = qfalse; // don't allow double deaths!
G_RadiusDamage( ent->currentOrigin, ent->owner, weaponData[WP_THERMAL].splashDamage, weaponData[WP_THERMAL].splashRadius, NULL, MOD_EXPLOSIVE_SPLASH );
G_PlayEffect( "thermal/explosion", ent->currentOrigin );
G_PlayEffect( "thermal/shockwave", ent->currentOrigin );
G_FreeEntity( ent );
}
}
开发者ID:Almightygir,项目名称:OpenJK,代码行数:27,代码来源:wp_thermal.cpp
示例5: Boba_FlyStart
void Boba_FlyStart( gentity_t *self )
{//switch to seeker AI for a while
if ( TIMER_Done( self, "jetRecharge" )
&& !Boba_Flying( self ) )
{
self->client->ps.gravity = 0;
self->svFlags |= SVF_CUSTOM_GRAVITY;
self->client->moveType = MT_FLYSWIM;
//start jet effect
self->client->jetPackTime = level.time + Q_irand( 3000, 10000 );
if ( self->genericBolt1 != -1 )
{
G_PlayEffect( G_EffectIndex( "boba/jetSP" ), self->playerModel, self->genericBolt1, self->s.number, self->currentOrigin, qtrue, qtrue );
}
if ( self->genericBolt2 != -1 )
{
G_PlayEffect( G_EffectIndex( "boba/jetSP" ), 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
}
}
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:29,代码来源:AI_BobaFett.cpp
示例6: G_MissileBounceEffect
//-------------------------------------------------------------------------
void G_MissileBounceEffect( gentity_t *ent, vec3_t org, vec3_t dir, qboolean hitWorld )
{
//FIXME: have an EV_BOUNCE_MISSILE event that checks the s.weapon and does the appropriate effect
switch( ent->s.weapon )
{
case WP_BOWCASTER:
if ( hitWorld )
{
G_PlayEffect( "bowcaster/bounce_wall", org, dir );
}
else
{
G_PlayEffect( "bowcaster/deflect", ent->currentOrigin, dir );
}
break;
case WP_BLASTER:
case WP_BRYAR_PISTOL:
case WP_BLASTER_PISTOL:
G_PlayEffect( "blaster/deflect", ent->currentOrigin, dir );
break;
default:
{
gentity_t *tent = G_TempEntity( org, EV_GRENADE_BOUNCE );
VectorCopy( dir, tent->pos1 );
tent->s.weapon = ent->s.weapon;
}
break;
}
}
开发者ID:BSzili,项目名称:OpenJK,代码行数:30,代码来源:g_missile.cpp
示例7: 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 )
{
// No head?
if (gi.G2API_GetSurfaceRenderStatus( &NPC->ghoul2[NPC->playerModel], "head" ))
{
if (TIMER_Done(NPC,"smoke") && !TIMER_Done(NPC,"droidsmoketotal"))
{
TIMER_Set( NPC, "smoke", 100);
G_PlayEffect( "droid_smoke" , NPC->currentOrigin,dir);
}
if (TIMER_Done(NPC,"droidspark"))
{
TIMER_Set( NPC, "droidspark", Q_irand(100,500));
G_PlayEffect( "spark", NPC->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:Agustinlv,项目名称:BlueHarvest,代码行数:64,代码来源:AI_Droid.cpp
示例8: WP_FireScepter
void WP_FireScepter( gentity_t *ent, qboolean alt_fire )
{//just a straight beam
int damage = 1;
vec3_t start, end;
trace_t tr;
gentity_t *traceEnt = NULL, *tent;
float shotRange = 8192;
qboolean render_impact = qtrue;
VectorCopy( muzzle, start );
WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );
WP_MissileTargetHint(ent, start, forwardVec);
VectorMA( start, shotRange, forwardVec, end );
gi.trace( &tr, start, NULL, NULL, end, ent->s.number, MASK_SHOT, G2_RETURNONHIT, 10 );
traceEnt = &g_entities[tr.entityNum];
if ( tr.surfaceFlags & SURF_NOIMPACT )
{
render_impact = qfalse;
}
// always render a shot beam, doing this the old way because I don't much feel like overriding the effect.
tent = G_TempEntity( tr.endpos, EV_DISRUPTOR_MAIN_SHOT );
tent->svFlags |= SVF_BROADCAST;
VectorCopy( muzzle, tent->s.origin2 );
if ( render_impact )
{
if ( tr.entityNum < ENTITYNUM_WORLD && traceEnt->takedamage )
{
// Create a simple impact type mark that doesn't last long in the world
G_PlayEffect( G_EffectIndex( "disruptor/flesh_impact" ), tr.endpos, tr.plane.normal );
int hitLoc = G_GetHitLocFromTrace( &tr, MOD_DISRUPTOR );
G_Damage( traceEnt, ent, ent, forwardVec, tr.endpos, damage, DAMAGE_EXTRA_KNOCKBACK, MOD_DISRUPTOR, hitLoc );
}
else
{
G_PlayEffect( G_EffectIndex( "disruptor/wall_impact" ), tr.endpos, tr.plane.normal );
}
}
/*
shotDist = shotRange * tr.fraction;
for ( dist = 0; dist < shotDist; dist += 64 )
{
//FIXME: on a really long shot, this could make a LOT of alerts in one frame...
VectorMA( start, dist, forwardVec, spot );
AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 );
}
VectorMA( start, shotDist-4, forwardVec, spot );
AddSightEvent( ent, spot, 256, AEL_DISCOVERED, 50 );
*/
}
开发者ID:Aura15,项目名称:OpenJK,代码行数:57,代码来源:g_weapon.cpp
示例9: fx_explosion_trail_think
//----------------------------------------------------------
void fx_explosion_trail_think( gentity_t *ent )
{
vec3_t origin;
trace_t tr;
if ( ent->spawnflags & 1 ) // gravity
{
ent->s.pos.trType = TR_GRAVITY;
}
else
{
ent->s.pos.trType = TR_LINEAR;
}
EvaluateTrajectory( &ent->s.pos, level.time, origin );
gi.trace( &tr, ent->currentOrigin, vec3_origin, vec3_origin, origin,
ent->owner ? ent->owner->s.number : ENTITYNUM_NONE, ent->clipmask, G2_RETURNONHIT, 10 );
if ( tr.fraction < 1.0f )
{
// never explode or bounce on sky
if ( !( tr.surfaceFlags & SURF_NOIMPACT ))
{
if ( ent->splashDamage && ent->splashRadius )
{
G_RadiusDamage( tr.endpos, ent, ent->splashDamage, ent->splashRadius, ent, MOD_EXPLOSIVE_SPLASH );
}
}
if ( ent->fullName )
{
// fxFile2....in other words, impact fx
G_PlayEffect( ent->fullName, tr.endpos, tr.plane.normal );
}
if ( VALIDSTRING( ent->soundSet ) == true )
{
G_AddEvent( ent, EV_BMODEL_SOUND, CAS_GetBModelSound( ent->soundSet, BMS_END ));
}
G_FreeEntity( ent );
return;
}
G_RadiusDamage( origin, ent, ent->damage, ent->radius, ent, MOD_EXPLOSIVE_SPLASH );
// call the effect with the desired position and orientation
G_PlayEffect( ent->fxID, origin, ent->currentAngles );
ent->nextthink = level.time + 50;
gi.linkentity( ent );
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:54,代码来源:g_fx.cpp
示例10: SandCreature_MoveEffect
void SandCreature_MoveEffect( void )
{
vec3_t up = {0,0,1};
vec3_t org = {NPC->currentOrigin[0], NPC->currentOrigin[1], NPC->absmin[2]+2};
float playerDist = Distance( player->currentOrigin, NPC->currentOrigin );
if ( playerDist < 256 )
{
CGCam_Shake( 0.75f*playerDist/256.0f, 250 );
}
if ( level.time-NPC->client->ps.lastStationary > 2000 )
{//first time moving for at least 2 seconds
//clear speakingtime
TIMER_Set( NPC, "speaking", -level.time );
}
if ( TIMER_Done( NPC, "breaching" )
&& TIMER_Done( NPC, "breachDebounce" )
&& TIMER_Done( NPC, "pain" )
&& TIMER_Done( NPC, "attacking" )
&& !Q_irand( 0, 10 ) )
{//Breach!
//FIXME: only do this while moving forward?
trace_t trace;
//make him solid here so he can be hit/gets blocked on stuff. Check clear first.
gi.trace( &trace, NPC->currentOrigin, NPC->mins, NPC->maxs, NPC->currentOrigin, NPC->s.number, MASK_NPCSOLID, (EG2_Collision)0, 0 );
if ( !trace.allsolid && !trace.startsolid )
{
NPC->clipmask = MASK_NPCSOLID;//turn solid for a little bit
NPC->contents = CONTENTS_BODY;
//NPC->takedamage = qtrue;//can be shot?
//FIXME: Breach sound?
//FIXME: Breach effect?
NPC_SetAnim( NPC, SETANIM_LEGS, BOTH_WALK2, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD|SETANIM_FLAG_RESTART );
TIMER_Set( NPC, "breaching", NPC->client->ps.legsAnimTimer );
TIMER_Set( NPC, "breachDebounce", NPC->client->ps.legsAnimTimer+Q_irand( 0, 10000 ) );
}
}
if ( !TIMER_Done( NPC, "breaching" ) )
{//different effect when breaching
//FIXME: make effect
G_PlayEffect( G_EffectIndex( "env/sand_move_breach" ), org, up );
}
else
{
G_PlayEffect( G_EffectIndex( "env/sand_move" ), org, up );
}
NPC->s.loopSound = G_SoundIndex( "sound/chars/sand_creature/slither.wav" );
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:51,代码来源:AI_SandCreature.cpp
示例11: RT_JetPackEffect
void RT_JetPackEffect( int duration )
{
if ( NPC->genericBolt1 != -1 )
{
G_PlayEffect( G_EffectIndex( "rockettrooper/flameNEW" ), NPC->playerModel, NPC->genericBolt1, NPC->s.number, NPC->currentOrigin, duration, qtrue );
}
if ( NPC->genericBolt2 != -1 )
{
G_PlayEffect( G_EffectIndex( "rockettrooper/flameNEW" ), NPC->playerModel, NPC->genericBolt2, NPC->s.number, NPC->currentOrigin, duration, qtrue );
}
//take-off sound
G_SoundOnEnt( NPC, CHAN_ITEM, "sound/chars/boba/bf_blast-off.wav" );
}
开发者ID:3ddy,项目名称:Jedi-Academy,代码行数:14,代码来源:AI_RocketTrooper.cpp
示例12: G_MissileReflectEffect
void G_MissileReflectEffect( gentity_t *ent, vec3_t org, vec3_t 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_PlayEffect( "bowcaster/deflect", ent->currentOrigin, dir );
break;
case WP_BLASTER:
case WP_BRYAR_PISTOL:
default:
G_PlayEffect( "blaster/deflect", ent->currentOrigin, dir );
break;
}
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:15,代码来源:g_missile.cpp
示例13: 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->currentOrigin, muzzle1 );
VectorSubtract (enemy_org1, muzzle1, delta1);
vectoangles ( delta1, angleToEnemy1 );
AngleVectors (angleToEnemy1, forward, vright, up);
missile = CreateMissile( NPC->currentOrigin, forward, 1000, 10000, NPC );
G_PlayEffect( "bryar/muzzle_flash", NPC->currentOrigin, forward );
missile->classname = "briar";
missile->s.weapon = WP_BRYAR_PISTOL;
missile->damage = 10;
missile->dflags = DAMAGE_DEATH_KNOCKBACK;
missile->methodOfDeath = MOD_ENERGY;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
}
开发者ID:LTolosa,项目名称:Jedi-Outcast,代码行数:34,代码来源:AI_Remote.cpp
示例14: turret_head_think
//-----------------------------------------------------
void turret_head_think( gentity_t *self )
//-----------------------------------------------------
{
gentity_t *top = &g_entities[self->r.ownerNum];
if ( !top )
{
return;
}
if ( self->painDebounceTime > level.time )
{
vec3_t v_up;
VectorSet( v_up, 0, 0, 1 );
G_PlayEffect( EFFECT_SPARKS, self->r.currentOrigin, v_up );
if ( Q_irand( 0, 3) )
{//25% chance of still firing
return;
}
}
// if it's time to fire and we have an enemy, then gun 'em down! pushDebounce time controls next fire time
if ( self->enemy && self->setTime < level.time && self->attackDebounceTime < level.time )
{
vec3_t fwd, org;
// set up our next fire time
self->setTime = level.time + self->wait;
VectorCopy( top->r.currentOrigin, org );
org[2] += top->r.maxs[2]-8;
AngleVectors( top->r.currentAngles, fwd, NULL, NULL );
VectorMA( org, START_DIS, fwd, org );
turret_fire( top, org, fwd );
self->fly_sound_debounce_time = level.time;//used as lastShotTime
}
}
开发者ID:dpadgett,项目名称:base_enhanced,代码行数:36,代码来源:g_turret.c
示例15: NoghriGasCloudThink
void NoghriGasCloudThink( gentity_t *self )
{
self->nextthink = level.time + FRAMETIME;
AddSightEvent( self->owner, self->currentOrigin, 200, AEL_DANGER, 50 );
if ( self->fx_time < level.time )
{
vec3_t up = {0,0,1};
G_PlayEffect( "noghri_stick/gas_cloud", self->currentOrigin, up );
self->fx_time = level.time + 250;
}
if ( level.time - self->s.time <= 2500 )
{
if ( !Q_irand( 0, 3-g_spskill->integer ) )
{
G_RadiusDamage( self->currentOrigin, self->owner, Q_irand( 1, 4 ), self->splashRadius,
self->owner, self->splashMethodOfDeath );
}
}
if ( level.time - self->s.time > 3000 )
{
G_FreeEntity( self );
}
}
开发者ID:BSzili,项目名称:OpenJK,代码行数:27,代码来源:g_missile.cpp
示例16: Boba_DoFlameThrower
void Boba_DoFlameThrower( gentity_t *self )
{
if ( self->s.number < MAX_CLIENTS )
{
if ( self->client )
{
if ( !self->client->ps.forcePowerDuration[FP_LIGHTNING] )
{
NPC_SetAnim( self, SETANIM_TORSO, BOTH_FORCELIGHTNING_HOLD, SETANIM_FLAG_OVERRIDE|SETANIM_FLAG_HOLD );
self->client->ps.torsoAnimTimer = BOBA_FLAMEDURATION;
G_SoundOnEnt( self, CHAN_WEAPON, "sound/weapons/boba/bf_flame.mp3" );
G_PlayEffect( G_EffectIndex("boba/fthrw"), self->playerModel, self->genericBolt3, self->s.number, self->s.origin, 1 );
self->client->ps.forcePowerDuration[FP_LIGHTNING] = 1;
}
Boba_FireFlameThrower( self );
}
return;
}
if (!(NPCInfo->aiFlags&NPCAI_FLAMETHROW) && TIMER_Done(self, "nextAttackDelay"))
{
Boba_StartFlameThrower( self );
}
if ( (NPCInfo->aiFlags&NPCAI_FLAMETHROW))
{
Boba_FireFlameThrower( self );
}
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:28,代码来源:AI_BobaFett.cpp
示例17: DetPackBlow
void DetPackBlow(gentity_t *self)
{
vec3_t v;
self->pain = 0;
self->die = 0;
self->takedamage = qfalse;
if ( self->target_ent )
{//we were attached to something, do *direct* damage to it!
G_Damage( self->target_ent, self, &g_entities[self->r.ownerNum], v, self->r.currentOrigin, self->damage, 0, MOD_DET_PACK_SPLASH );
}
G_RadiusDamage( self->r.currentOrigin, self->parent, self->splashDamage, self->splashRadius, self, self, MOD_DET_PACK_SPLASH );
v[0] = 0;
v[1] = 0;
v[2] = 1;
if (self->count == -1)
{
VectorCopy(self->pos2, v);
}
G_PlayEffect(EFFECT_EXPLOSION_DETPACK, self->r.currentOrigin, v);
self->think = G_FreeEntity;
self->nextthink = level.time;
}
开发者ID:mehmehsomeone,项目名称:OpenRP,代码行数:27,代码来源:WP_Detpack.cpp
示例18: 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 = NPC->genericBolt1;
gi.G2API_GetBoltMatrix( NPC->ghoul2, NPC->playerModel,
bolt,
&boltMatrix, NPC->currentAngles, NPC->currentOrigin, (cg.time?cg.time:level.time),
NULL, NPC->s.modelScale );
gi.G2API_GiveMeVectorFromMatrix( boltMatrix, ORIGIN, muzzle1 );
gi.G2API_GiveMeVectorFromMatrix( boltMatrix, NEGATIVE_Y, muzzle_dir );
G_PlayEffect( "bryar/muzzle_flash", muzzle1, muzzle_dir );
missile = CreateMissile( muzzle1, muzzle_dir, 1600, 10000, NPC );
G_Sound( NPC, 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_ENERGY;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
}
开发者ID:AlexXT,项目名称:OpenJK,代码行数:38,代码来源:AI_Mark1.cpp
示例19: Boba_DustFallNear
void Boba_DustFallNear(const vec3_t origin, int dustcount)
{
if (!BobaActive)
{
return;
}
trace_t testTrace;
vec3_t testDirection;
vec3_t testStartPos;
vec3_t testEndPos;
VectorCopy(origin, testStartPos);
for (int i=0; i<dustcount; i++)
{
testDirection[0] = (random() * 2.0f) - 1.0f;
testDirection[1] = (random() * 2.0f) - 1.0f;
testDirection[2] = 1.0f;
VectorMA(origin, 1000.0f, testDirection, testEndPos);
gi.trace (&testTrace, origin, NULL, NULL, testEndPos, (player && player->inuse)?(0):(ENTITYNUM_NONE), MASK_SHOT, (EG2_Collision)0, 0 );
if (!testTrace.startsolid &&
!testTrace.allsolid &&
testTrace.fraction>0.1f &&
testTrace.fraction<0.9f)
{
G_PlayEffect( "chunks/dustFall", testTrace.endpos, testTrace.plane.normal );
}
}
}
开发者ID:Christian-Barrett,项目名称:OpenJK,代码行数:31,代码来源:AI_BobaFett.cpp
示例20: 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,代码来源:g_turret.c
注:本文中的G_PlayEffect函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论