本文整理汇总了C++中G_PlayEffectID函数的典型用法代码示例。如果您正苦于以下问题:C++ G_PlayEffectID函数的具体用法?C++ G_PlayEffectID怎么用?C++ G_PlayEffectID使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了G_PlayEffectID函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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,代码来源:NPC_AI_GalakMech.c
示例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,代码来源:NPC_AI_Droid.cpp
示例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,代码来源:g_turret.c
示例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,代码来源:NPC_AI_Remote.c
示例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,代码来源:NPC_AI_Seeker.c
示例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,代码来源:NPC_AI_Mark1.c
示例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,代码来源:NPC_AI_ImperialProbe.c
示例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,代码来源:NPC_AI_Mark2.cpp
示例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,代码来源:NPC_AI_Mark1.c
示例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,代码来源:NPC_AI_GalakMech.cpp
示例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,代码来源:g_missile.cpp
示例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,代码来源:g_turret.c
示例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,代码来源:glua_sys.c
示例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,代码来源:NPC_AI_GalakMech.c
示例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,代码来源:NPC_AI_Atst.c
示例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,代码来源:NPC_AI_Mark2.cpp
示例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,代码来源:NPC_AI_Mark1.c
示例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,代码来源:NPC_AI_Remote.c
示例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,代码来源:SpeederNPC.c
示例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,代码来源:g_missile.c
注:本文中的G_PlayEffectID函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论