Пример #1
0
static void func_explosive_use( edict_t *self, edict_t *other, edict_t *activator )
{
	self->enemy = other;
	self->count = ceil( self->health );

	if( self->delay )
	{
		self->think = func_explosive_think;
		self->nextThink = level.time + self->delay * 1000;
		return;
	}

	func_explosive_explode( self, self, other, self->count, vec3_origin );
}
Пример #2
0
void func_explosive_use(edict_t *self, edict_t *other, edict_t *activator)
{
	func_explosive_explode (self, self, other, self->health, vec3_origin);
}
Пример #3
0
void Tramcar_die( gentity_t *self, gentity_t *inflictor, gentity_t *attacker, int damage, int mod ) {
	gentity_t       *slave;

	if ( !self ) {
		return;
	}

	func_explosive_explode( self, self, inflictor, 0, 0 );

	// link all teammembers
	for ( slave = self ; slave ; slave = slave->teamchain )
	{

		if ( slave == self ) {
			continue;
		}

		// slaves need to inherit position
		slave->nextTrain = self->nextTrain;

		slave->s.pos.trType = self->s.pos.trType;
		slave->s.pos.trTime = self->s.pos.trTime;
		slave->s.pos.trDuration = self->s.pos.trDuration;
		VectorCopy( self->s.pos.trBase, slave->s.pos.trBase );
		VectorCopy( self->s.pos.trDelta, slave->s.pos.trDelta );

		slave->s.apos.trType = self->s.apos.trType;
		slave->s.apos.trTime = self->s.apos.trTime;
		slave->s.apos.trDuration = self->s.apos.trDuration;
		VectorCopy( self->s.apos.trBase, slave->s.apos.trBase );
		VectorCopy( self->s.apos.trDelta, slave->s.apos.trDelta );

		slave->think = self->think;
		slave->nextthink = self->nextthink;

		VectorCopy( self->pos1, slave->pos1 );
		VectorCopy( self->pos2, slave->pos2 );

		slave->speed = self->speed;

		slave->flags &= ~FL_TEAMSLAVE;
		// make it visible

		if ( self->use ) {
			slave->use = self->use;
		}

		trap_LinkEntity( slave );
	}

	self->use = 0;

	self->is_dead = qtrue;

	self->takedamage = qfalse;

	if ( self->nextTrain ) {
		self->nextTrain = 0;
	}

	self->s.loopSound = 0;

	VectorCopy( self->r.currentOrigin, self->s.pos.trBase );
	VectorCopy( self->r.currentAngles, self->s.apos.trBase );

	self->flags |= FL_TEAMSLAVE;
	trap_UnlinkEntity( self );

}
Пример #4
0
static void func_explosive_think( edict_t *self )
{
	func_explosive_explode( self, self, self->enemy, self->count, vec3_origin );
}