本文整理汇总了C++中G_PlayEffectID函数的典型用法代码示例。如果您正苦于以下问题:C++ G_PlayEffectID函数的具体用法?C++ G_PlayEffectID怎么用?C++ G_PlayEffectID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_PlayEffectID函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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 );
}
}
}
示例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 );
}
示例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 );
}
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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
}
示例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 );
}
}
示例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" );
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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" );
}
}
示例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 );
}
}