本文整理汇总了C++中CreateMissile函数的典型用法代码示例。如果您正苦于以下问题:C++ CreateMissile函数的具体用法?C++ CreateMissile怎么用?C++ CreateMissile使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了CreateMissile函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: WP_FireBryarPistolMain
void WP_FireBryarPistolMain(gentity_t*ent)
{
int damage = BRYAR_PISTOL_DAMAGE;
gentity_t *missile;
if((ent->client->ps.eFlags & EF_DUAL_WEAPONS))
{
if(ent->client->leftPistol)
missile = CreateMissile(muzzle2, forward, BRYAR_PISTOL_VEL, 10000, ent, qfalse);
else
missile = CreateMissile(muzzle, forward, BRYAR_PISTOL_VEL, 10000, ent, qfalse );
ent->client->leftPistol = (qboolean)(!ent->client->leftPistol);
}
else
missile = CreateMissile( muzzle, forward, BRYAR_PISTOL_VEL, 10000, ent, qfalse );
missile->classname = "bryar_proj";
missile->s.weapon = WP_BRYAR_PISTOL;
missile->damage = damage;
missile->dflags = DAMAGE_DEATH_KNOCKBACK;
missile->methodOfDeath = MOD_BRYAR_PISTOL;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
// we don't want it to bounce forever
missile->bounceCount = 8;
}
示例2: MissileUpdate
VOID MissileUpdate()
{
if (m_hero.invincible) return;
if (m_missile.active)
{
if (m_missile.countdown)
{
m_missile.countdown--;
if (!m_missile.countdown)
{
m_missile = CreateMissile(WNDWIDTH, m_hero.pos.y + 10, 111, 42, TRUE, 0);
}
else
{
m_missile.pos.y = m_hero.pos.y + 3;
}
}
else
{
m_missile.pos.x -= ScorePerFrame * 12;
if (m_missile.pos.x + 167 < 0) m_missile.active = false;
}
}
else if (!MissileGenerate && m_hero.alive)
{
int roll = GetRandomInt(0, LaserRandom);
if (roll == 0)
{
m_missile = CreateMissile(WNDWIDTH - 85, m_hero.pos.y + 3, 64, 56, TRUE, 50);
}
}
}
示例3: VectorNormalize
gentity_t *fire_grapple( gentity_t *self, vector3 *start, vector3 *dir ) {
gentity_t *hook;
VectorNormalize( dir );
hook = CreateMissile( start, dir, japp_hookSpeed.value, 10000, self, qfalse );//G_Spawn();
hook->classname = "hook";
hook->nextthink = level.time + 10000;
hook->think = Weapon_HookFree;
hook->s.eType = ET_MISSILE;
hook->r.svFlags = SVF_USE_CURRENT_ORIGIN;
hook->s.weapon = WP_STUN_BATON;//WP_BRYAR_PISTOL
hook->r.ownerNum = self->s.number;
hook->methodOfDeath = MOD_STUN_BATON;
hook->clipmask = 267009/*MASK_SHOT*/; //From JA+
hook->parent = self;
hook->target_ent = NULL;
hook->s.pos.trType = TR_LINEAR;
hook->s.pos.trTime = level.time - japp_hookSpeed.integer;
hook->s.otherEntityNum = self->s.number; // Used to match beam in client
if ( self->client->pers.adminData.isGhost ) {
hook->r.svFlags |= SVF_SINGLECLIENT;
hook->r.singleClient = self->s.number;
}
VectorCopy( start, &hook->s.pos.trBase );
VectorScale( dir, 800, &hook->s.pos.trDelta );
VectorSnap( &hook->s.pos.trDelta ); // Save net bandwidth
VectorCopy( start, &hook->r.currentOrigin );
return hook;
}
示例4: WP_FireTurboLaserMissile
//---------------------------------------------------------
void WP_FireTurboLaserMissile( gentity_t *ent, vec3_t start, vec3_t dir )
//---------------------------------------------------------
{
int velocity = ent->mass; //FIXME: externalize
gentity_t *missile;
missile = CreateMissile( start, dir, velocity, 10000, ent, qfalse );
//use a custom shot effect
//missile->s.otherEntityNum2 = G_EffectIndex( "turret/turb_shot" );
//use a custom impact effect
//missile->s.emplacedOwner = G_EffectIndex( "turret/turb_impact" );
missile->classname = "turbo_proj";
missile->s.weapon = WP_TIE_FIGHTER;
missile->damage = ent->damage; //FIXME: externalize
missile->splashDamage = ent->splashDamage; //FIXME: externalize
missile->splashRadius = ent->splashRadius; //FIXME: externalize
missile->dflags = DAMAGE_DEATH_KNOCKBACK;
missile->methodOfDeath = MOD_EMPLACED; //MOD_TURBLAST; //count as a heavy weap
missile->splashMethodOfDeath = MOD_EMPLACED; //MOD_TURBLAST;// ?SPLASH;
missile->clipmask = MASK_SHOT;
// we don't want it to bounce forever
missile->bounceCount = 8;
//set veh as cgame side owner for purpose of fx overrides
//missile->s.owner = ent->s.number;
//don't let them last forever
missile->e_ThinkFunc = thinkF_G_FreeEntity;
missile->nextthink = level.time + 10000;//at 20000 speed, that should be more than enough
}
示例5: WP_ATSTMainFire
// ATST Main
//---------------------------------------------------------
void WP_ATSTMainFire( gentity_t *ent )
//---------------------------------------------------------
{
float vel = ATST_MAIN_VEL;
// if ( ent->client && (ent->client->ps.eFlags & EF_IN_ATST ))
// {
// vel = 4500.0f;
// }
if ( !ent->s.number )
{
// player shoots faster
vel *= 1.6f;
}
gentity_t *missile = CreateMissile( wpMuzzle, wpFwd, vel, 10000, ent );
missile->classname = "atst_main_proj";
missile->s.weapon = WP_ATST_MAIN;
missile->damage = weaponData[WP_ATST_MAIN].damage;
missile->dflags = DAMAGE_DEATH_KNOCKBACK|DAMAGE_HEAVY_WEAP_CLASS;
missile->methodOfDeath = MOD_ENERGY;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
missile->owner = ent;
VectorSet( missile->maxs, ATST_MAIN_SIZE, ATST_MAIN_SIZE, ATST_MAIN_SIZE );
VectorScale( missile->maxs, -1, missile->mins );
}
示例6: 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;
}
}
示例7: 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;
}
示例8: WP_CreateFlechetteBouncyThing
//------------------------------------------------------------------------------
static void WP_CreateFlechetteBouncyThing( vec3_t start, vec3_t fwd, gentity_t *self )
//------------------------------------------------------------------------------
{
gentity_t *missile = CreateMissile( start, fwd, 950 + random() * 700, 1500 + random() * 2000, self, qtrue );
missile->e_ThinkFunc = thinkF_WP_flechette_alt_blow;
missile->s.weapon = WP_FLECHETTE;
missile->classname = "flech_alt";
missile->mass = 4;
// How 'bout we give this thing a size...
VectorSet( missile->mins, -3.0f, -3.0f, -3.0f );
VectorSet( missile->maxs, 3.0f, 3.0f, 3.0f );
missile->clipmask = MASK_SHOT;
missile->clipmask &= ~CONTENTS_CORPSE;
// normal ones bounce, alt ones explode on impact
missile->s.pos.trType = TR_GRAVITY;
missile->s.eFlags |= EF_BOUNCE_HALF;
missile->damage = weaponData[WP_FLECHETTE].altDamage;
missile->dflags = 0;
missile->splashDamage = weaponData[WP_FLECHETTE].splashDamage;
missile->splashRadius = weaponData[WP_FLECHETTE].splashRadius;
missile->svFlags = SVF_USE_CURRENT_ORIGIN;
missile->methodOfDeath = MOD_FLECHETTE_ALT;
missile->splashMethodOfDeath = MOD_FLECHETTE_ALT;
VectorCopy( start, missile->pos2 );
}
示例9: 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;
}
示例10: 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;
}
示例11: WP_EmplacedFire
// Emplaced Gun
//---------------------------------------------------------
void WP_EmplacedFire( gentity_t *ent )
//---------------------------------------------------------
{
float damage = weaponData[WP_EMPLACED_GUN].damage * ( ent->NPC ? 0.1f : 1.0f );
float vel = EMPLACED_VEL * ( ent->NPC ? 0.4f : 1.0f );
gentity_t *missile = CreateMissile( wpMuzzle, wpFwd, vel, 10000, ent );
missile->classname = "emplaced_proj";
missile->s.weapon = WP_EMPLACED_GUN;
missile->damage = damage;
missile->dflags = DAMAGE_DEATH_KNOCKBACK | DAMAGE_HEAVY_WEAP_CLASS;
missile->methodOfDeath = MOD_EMPLACED;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
// do some weird switchery on who the real owner is, we do this so the projectiles don't hit the gun object
missile->owner = ent->owner;
VectorSet( missile->maxs, EMPLACED_SIZE, EMPLACED_SIZE, EMPLACED_SIZE );
VectorScale( missile->maxs, -1, missile->mins );
// alternate wpMuzzles
ent->fxID = !ent->fxID;
}
示例12: 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;
}
示例13: 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;
gentity_t *missile;
mdxaBone_t boltMatrix;
//FIXME: use {0, NPC->client->ps.legsYaw, 0}
gi.G2API_GetBoltMatrix( NPC->ghoul2, NPC->playerModel,
NPC->genericBolt1,
&boltMatrix, NPC->currentAngles, NPC->currentOrigin, (cg.time?cg.time:level.time),
NULL, NPC->s.modelScale );
gi.G2API_GiveMeVectorFromMatrix( boltMatrix, ORIGIN, muzzle1 );
G_PlayEffect( "bryar/muzzle_flash", muzzle1 );
G_Sound( NPC, 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->currentAngles, forward, vright, up);
}
missile = CreateMissile( muzzle1, forward, 1600, 10000, NPC );
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_ENERGY;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
}
示例14: WP_ATSTSideAltFire
// ATST Alt Side
//---------------------------------------------------------
void WP_ATSTSideAltFire( gentity_t *ent )
//---------------------------------------------------------
{
int damage = weaponData[WP_ATST_SIDE].altDamage;
float vel = ATST_SIDE_ALT_NPC_VELOCITY;
if ( ent->client && (ent->client->ps.eFlags & EF_IN_ATST ))
{
vel = ATST_SIDE_ALT_VELOCITY;
}
gentity_t *missile = CreateMissile( wpMuzzle, wpFwd, vel, 10000, ent, qtrue );
missile->classname = "atst_rocket";
missile->s.weapon = WP_ATST_SIDE;
missile->mass = 10;
// Do the damages
if ( ent->s.number != 0 )
{
if ( g_spskill->integer == 0 )
{
damage = ATST_SIDE_ROCKET_NPC_DAMAGE_EASY;
}
else if ( g_spskill->integer == 1 )
{
damage = ATST_SIDE_ROCKET_NPC_DAMAGE_NORMAL;
}
else
{
damage = ATST_SIDE_ROCKET_NPC_DAMAGE_HARD;
}
}
VectorCopy( wpFwd, missile->movedir );
// Make it easier to hit things
VectorSet( missile->maxs, ATST_SIDE_ALT_ROCKET_SIZE, ATST_SIDE_ALT_ROCKET_SIZE, ATST_SIDE_ALT_ROCKET_SIZE );
VectorScale( missile->maxs, -1, missile->mins );
missile->damage = damage;
missile->dflags = DAMAGE_DEATH_KNOCKBACK | DAMAGE_HEAVY_WEAP_CLASS;
missile->methodOfDeath = MOD_EXPLOSIVE;
missile->splashMethodOfDeath = MOD_EXPLOSIVE_SPLASH;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
// Scale damage down a bit if it is coming from an NPC
missile->splashDamage = weaponData[WP_ATST_SIDE].altSplashDamage * ( ent->s.number == 0 ? 1.0f : ATST_SIDE_ALT_ROCKET_SPLASH_SCALE );
missile->splashRadius = weaponData[WP_ATST_SIDE].altSplashRadius;
// we don't want it to ever bounce
missile->bounceCount = 0;
}
示例15: WP_BowcasterAltFire
//---------------------------------------------------------
static void WP_BowcasterAltFire( gentity_t *ent )
//---------------------------------------------------------
{
vec3_t start;
int damage = weaponData[WP_BOWCASTER].altDamage;
VectorCopy( muzzle, start );
WP_TraceSetStart( ent, start, vec3_origin, vec3_origin );//make sure our start point isn't on the other side of a wall
WP_MissileTargetHint(ent, start, forwardVec);
gentity_t *missile = CreateMissile( start, forwardVec, BOWCASTER_VELOCITY, 10000, ent, qtrue );
missile->classname = "bowcaster_alt_proj";
missile->s.weapon = WP_BOWCASTER;
// Do the damages
if ( ent->s.number != 0 )
{
if ( g_spskill->integer == 0 )
{
damage = BOWCASTER_NPC_DAMAGE_EASY;
}
else if ( g_spskill->integer == 1 )
{
damage = BOWCASTER_NPC_DAMAGE_NORMAL;
}
else
{
damage = BOWCASTER_NPC_DAMAGE_HARD;
}
}
VectorSet( missile->maxs, BOWCASTER_SIZE, BOWCASTER_SIZE, BOWCASTER_SIZE );
VectorScale( missile->maxs, -1, missile->mins );
// if ( ent->client && ent->client->ps.powerups[PW_WEAPON_OVERCHARGE] > 0 && ent->client->ps.powerups[PW_WEAPON_OVERCHARGE] > cg.time )
// {
// // in overcharge mode, so doing double damage
// missile->flags |= FL_OVERCHARGED;
// damage *= 2;
// }
missile->s.eFlags |= EF_BOUNCE;
missile->bounceCount = 3;
missile->damage = damage;
missile->dflags = DAMAGE_DEATH_KNOCKBACK;
missile->methodOfDeath = MOD_BOWCASTER_ALT;
missile->clipmask = MASK_SHOT | CONTENTS_LIGHTSABER;
missile->splashDamage = weaponData[WP_BOWCASTER].altSplashDamage;
missile->splashRadius = weaponData[WP_BOWCASTER].altSplashRadius;
}