本文整理汇总了C++中BecomeExplosion1函数的典型用法代码示例。如果您正苦于以下问题:C++ BecomeExplosion1函数的具体用法?C++ BecomeExplosion1怎么用?C++ BecomeExplosion1使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了BecomeExplosion1函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doppleganger_timeout
void
doppleganger_timeout(edict_t *self)
{
if (self->teamchain)
{
BecomeExplosion1(self->teamchain);
}
BecomeExplosion1(self);
}
示例2: mass
/*QUAKED func_explosive (0 .5 .8) ? Trigger_Spawn ANIMATED ANIMATED_FAST
Any brush that you want to explode or break apart. If you want an
ex0plosion, set dmg and it will do a radius explosion of that amount
at the center of the bursh.
If targeted it will not be shootable.
health defaults to 100.
mass defaults to 75. This determines how much debris is emitted when
it explodes. You get one large chunk per 100 of mass (up to 8) and
one small chunk per 25 of mass (up to 16). So 800 gives the most.
*/
void func_explosive_explode(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
vec3_t origin;
vec3_t chunkorigin;
vec3_t size;
int count;
int mass;
// bmodel origins are (0 0 0), we need to adjust that here
VectorScale(self->size, 0.5f, size);
VectorAdd(self->absmin, size, origin);
VectorCopy(origin, self->s.origin);
self->takedamage = DAMAGE_NO;
if (self->dmg)
T_RadiusDamage(self, attacker, self->dmg, NULL, self->dmg + 40, MOD_EXPLOSIVE);
VectorSubtract(self->s.origin, inflictor->s.origin, self->velocity);
VectorNormalize(self->velocity);
VectorScale(self->velocity, 150, self->velocity);
// start chunks towards the center
VectorScale(size, 0.5f, size);
mass = self->mass;
if (!mass)
mass = 75;
// big chunks
if (mass >= 100) {
count = mass / 100;
if (count > 8)
count = 8;
while (count--) {
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris(self, "models/objects/debris1/tris.md2", 1, chunkorigin);
}
}
// small chunks
count = mass / 25;
if (count > 16)
count = 16;
while (count--) {
chunkorigin[0] = origin[0] + crandom() * size[0];
chunkorigin[1] = origin[1] + crandom() * size[1];
chunkorigin[2] = origin[2] + crandom() * size[2];
ThrowDebris(self, "models/objects/debris2/tris.md2", 2, chunkorigin);
}
G_UseTargets(self, attacker);
if (self->dmg)
BecomeExplosion1(self);
else
G_FreeEdict(self);
}
示例3: model_die
void model_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
edict_t *e, *next;
e = self->movewith_next;
while(e) {
next = e->movewith_next;
if(e->solid == SOLID_NOT) {
e->nextthink = 0;
G_FreeEdict(e);
} else
BecomeExplosion1 (e);
e = next;
}
BecomeExplosion1(self);
}
示例4: fixbot_die
void fixbot_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
// shards
}
示例5: sphere_think_explode
// =================
// =================
void sphere_think_explode (edict_t *self)
{
if(self->owner && self->owner->client && !(self->spawnflags & SPHERE_DOPPLEGANGER))
{
self->owner->client->owned_sphere = NULL;
}
BecomeExplosion1 (self);
}
示例6: hover_deadthink
void hover_deadthink(edict_t *self)
{
if (!self->groundentity && level.time < self->timestamp) {
self->nextthink = level.time + FRAMETIME;
return;
}
BecomeExplosion1(self);
}
示例7: supplystation_explode
void supplystation_explode (edict_t *self, char *message)
{
if (self->creator && self->creator->inuse)
{
safe_cprintf(self->creator, PRINT_HIGH, message);
self->creator->supplystation = NULL;
T_RadiusDamage(self, self->creator, 150, self, 150, MOD_SUPPLYSTATION);
}
BecomeExplosion1(self);
}
示例8: base_die
void base_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
if (self->creator && self->creator->inuse)
{
self->creator->num_sentries--;
if (self->creator->num_sentries < 0)
self->creator->num_sentries = 0;
}
BecomeExplosion1(self);
}
示例9: base_think
void base_think (edict_t *self)
{
// make sure sentry has settled down
if (!minisentry_checkposition(self))
{
BecomeExplosion1(self);
return;
}
self->nextthink = level.time + FRAMETIME;
}
示例10: model_die
void model_die (edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
if(self->deathtarget)
{
self->target = self->deathtarget;
G_UseTargets (self, attacker);
}
train_kill_children(self);
BecomeExplosion1(self);
}
示例11: flyer_spawn_gibs
//mxd
void flyer_spawn_gibs(edict_t *self, int damage)
{
for (int n = 0; n < 6; n++)
ThrowGib(self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC);
for (int n = 0; n < 4; n++)
ThrowGib(self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
ThrowGib(self, "models/objects/gibs/skull/tris.md2", damage, GIB_ORGANIC); //mxd
gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
示例12: flyer_die
void flyer_die(edict_t *self, edict_t *inflictor, edict_t *attacker, int damage, vec3_t point)
{
int n;
// Knightmare- gibs!
for (n= 0; n < 4; n++)
ThrowGib (self, "models/objects/gibs/sm_metal/tris.md2", damage, GIB_METALLIC);
for (n= 0; n < 2; n++)
ThrowGib (self, "models/objects/gibs/sm_meat/tris.md2", damage, GIB_ORGANIC);
gi.sound (self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
示例13: flyer_die
void
flyer_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker /* unused */,
int damage /* unused */, vec3_t point /* unused */)
{
if (!self)
{
return;
}
gi.sound(self, CHAN_VOICE, sound_die, 1, ATTN_NORM, 0);
BecomeExplosion1(self);
}
示例14: doppleganger_die
void
doppleganger_die(edict_t *self, edict_t *inflictor /* unused */, edict_t *attacker,
int damage, vec3_t point)
{
edict_t *sphere;
float dist;
vec3_t dir;
if (!self || !attacker)
{
return;
}
if ((self->enemy) && (self->enemy != self->teammaster))
{
VectorSubtract(self->enemy->s.origin, self->s.origin, dir);
dist = VectorLength(dir);
if (dist > 768)
{
sphere = Sphere_Spawn(self, SPHERE_HUNTER | SPHERE_DOPPLEGANGER);
sphere->pain(sphere, attacker, 0, 0);
}
else
{
sphere = Sphere_Spawn(self, SPHERE_VENGEANCE | SPHERE_DOPPLEGANGER);
sphere->pain(sphere, attacker, 0, 0);
}
}
if (self->teamchain)
{
BecomeExplosion1(self->teamchain);
}
BecomeExplosion1(self);
}
示例15: RemoveLaserDefense
/*
==========
RemoveLaserDefense
removes all lasers for this entity
==========
*/
void RemoveLaserDefense (edict_t *ent)
{
edict_t *e = NULL;
while((e = G_Find(e, FOFS(classname), "laser_defense_gr")) != NULL) {
if (e && (e->owner == ent))
{
// remove the linked laser
if (e->creator)
G_FreeEdict(e->creator);
// remove the grenade
BecomeExplosion1(e);
}
}
ent->num_lasers = 0;
}