Пример #1
0
// PMM - kamikaze code .. blow up if blocked	
int flyer_blocked (edict_t *self, float dist)
{
	vec3_t origin;

	// kamikaze = 100, normal = 50
	if (self->mass == 100)
	{
		flyer_kamikaze_check(self);

		// if the above didn't blow us up (i.e. I got blocked by the player)
		if (self->inuse)
		{
			if (self->monsterinfo.commander && self->monsterinfo.commander->inuse && 
				!strcmp(self->monsterinfo.commander->classname, "monster_carrier"))
			{
				self->monsterinfo.commander->monsterinfo.monster_slots++;
			}

			VectorMA (self->s.origin, -0.02, self->velocity, origin);
			gi.WriteByte (svc_temp_entity);
			gi.WriteByte (TE_ROCKET_EXPLOSION);
			gi.WritePosition (origin);
			gi.multicast (self->s.origin, MULTICAST_PHS);

			G_FreeEdict (self);
		}
		return true;
	}
	// we're a normal flyer
	if(blocked_checkshot (self, 0.25 + (0.05 * skill->value) ))
		return true;

	return false;
}
Пример #2
0
//mxd. Kamikaze code .. blow up if blocked
qboolean flyer_blocked(edict_t *self, float dist)
{
	if (self->class_id == ENTITY_MONSTER_FLYER_KAMIKAZE)
	{
		flyer_kamikaze_check(self);

		// if the above didn't blow us up (i.e. I got blocked by the player)
		if (self->inuse)
		{
			vec3_t origin;

			VectorMA(self->s.origin, -0.02, self->velocity, origin);
			gi.WriteByte(svc_temp_entity);
			gi.WriteByte(TE_ROCKET_EXPLOSION);
			gi.WritePosition(origin);
			gi.multicast(self->s.origin, MULTICAST_PHS);

			G_FreeEdict(self);
		}

		return true;
	}

	// We're a normal flyer
	if (!self->enemy || !(self->enemy->client) || random() < 0.25 + (0.05 * skill->value)) 
		return false; // Very stripped version of blocked_checkshot :)

	return true;
}