Example #1
0
void
BloodFountain(edict_t *self, int number, vec3_t startpos, int damage)
{
	int n;
	vec3_t vd;
	vec3_t origin, size, velocity;

	if (!self)
	{
		return;
	}

	return;

	for (n = 0; n < number; n++)
	{
		if (startpos)
		{
			VectorCopy(startpos, origin);
		}
		else
		{
			VectorScale(self->size, 0.5, size);
			VectorAdd(self->absmin, size, origin);
			origin[0] = origin[0] + crandom() * size[0];
			origin[1] = origin[1] + crandom() * size[1];
			origin[2] = origin[2] + crandom() * size[2];
		}

		WidowVelocityForDamage(damage, vd);
		VectorMA(self->velocity, 1.0, vd, velocity);
		velocity[0] *= 2;
		velocity[1] *= 2;
	}
}
Example #2
0
void BloodFountain (edict_t *self, int number, vec3_t startpos, int damage)
{
	int n;
	vec3_t	vd;
	vec3_t	origin, size, velocity;

	return;

	for (n= 0; n < number; n++)
	{
		if (startpos)
			VectorCopy (startpos, origin);
		else
		{
			VectorScale (self->size, 0.5, size);
			VectorAdd (self->absmin, size, origin);
			origin[0] = origin[0] + crandom() * size[0];
			origin[1] = origin[1] + crandom() * size[1];
			origin[2] = origin[2] + crandom() * size[2];
		}

		WidowVelocityForDamage (damage, vd);
		VectorMA (self->velocity, 1.0, vd, velocity);
		velocity[0] *= 2;
		velocity[1] *= 2;

//		gi.WriteByte (svc_temp_entity);
//		gi.WriteByte (TE_BLOOD_FOUNTAIN);
//		gi.WritePosition (origin);
//		gi.WritePosition (velocity);
//		gi.WriteShort (50);
//		gi.multicast (self->s.origin, MULTICAST_ALL);
	}
}
Example #3
0
void
ThrowWidowGibReal(edict_t *self, char *gibname, int damage, int type,
		vec3_t startpos, qboolean sized, int hitsound, qboolean fade)
{
	edict_t *gib;
	vec3_t vd;
	vec3_t origin;
	vec3_t size;
	float vscale;

	if (!self || !gibname)
	{
		return;
	}

	gib = G_Spawn();

	if (startpos)
	{
		VectorCopy(startpos, gib->s.origin);
	}
	else
	{
		VectorScale(self->size, 0.5, size);
		VectorAdd(self->absmin, size, origin);
		gib->s.origin[0] = origin[0] + crandom() * size[0];
		gib->s.origin[1] = origin[1] + crandom() * size[1];
		gib->s.origin[2] = origin[2] + crandom() * size[2];
	}

	gib->solid = SOLID_NOT;
	gib->s.effects |= EF_GIB;
	gib->flags |= FL_NO_KNOCKBACK;
	gib->takedamage = DAMAGE_YES;
	gib->die = gib_die;
	gib->s.renderfx |= RF_IR_VISIBLE;

	if (fade)
	{
		gib->think = G_FreeEdict;

		/* sized gibs last longer */
		if (sized)
		{
			gib->nextthink = level.time + 20 + random() * 15;
		}
		else
		{
			gib->nextthink = level.time + 5 + random() * 10;
		}
	}
	else
	{
		gib->think = G_FreeEdict;

		/* sized gibs last longer */
		if (sized)
		{
			gib->nextthink = level.time + 60 + random() * 15;
		}
		else
		{
			gib->nextthink = level.time + 25 + random() * 10;
		}
	}

	if (type == GIB_ORGANIC)
	{
		gib->movetype = MOVETYPE_TOSS;
		gib->touch = gib_touch;
		vscale = 0.5;
	}
	else
	{
		gib->movetype = MOVETYPE_BOUNCE;
		vscale = 1.0;
	}

	WidowVelocityForDamage(damage, vd);
	VectorMA(self->velocity, vscale, vd, gib->velocity);
	ClipGibVelocity(gib);

	gi.setmodel(gib, gibname);

	if (sized)
	{
		gib->plat2flags = hitsound;
		gib->solid = SOLID_BBOX;
		gib->avelocity[0] = random() * 400;
		gib->avelocity[1] = random() * 400;
		gib->avelocity[2] = random() * 200;

		if (gib->velocity[2] < 0)
		{
			gib->velocity[2] *= -1;
		}

		gib->velocity[0] *= 2;
		gib->velocity[1] *= 2;
		ClipGibVelocity(gib);
		gib->velocity[2] = max((350 + (random() * 100.0)), gib->velocity[2]);
		gib->gravity = 0.25;
		gib->touch = widow_gib_touch;
		gib->owner = self;

		if (gib->s.modelindex == gi.modelindex("models/monsters/blackwidow2/gib2/tris.md2"))
		{
			VectorSet(gib->mins, -10, -10, 0);
			VectorSet(gib->maxs, 10, 10, 10);
		}
		else
		{
			VectorSet(gib->mins, -5, -5, 0);
			VectorSet(gib->maxs, 5, 5, 5);
		}
	}
	else
	{
		gib->velocity[0] *= 2;
		gib->velocity[1] *= 2;
		gib->avelocity[0] = random() * 600;
		gib->avelocity[1] = random() * 600;
		gib->avelocity[2] = random() * 600;
	}

	gi.linkentity(gib);
}