Esempio n. 1
0
void myTankBlaster (edict_t *self)
{
	int		flash_number, speed, damage;
	vec3_t	forward, start;

	// alternate attack for commander
	if (self->s.skinnum & 2)
	{
		myTankRail(self);
		return;
	}

	if (self->s.frame == FRAME_attak110)
		flash_number = MZ2_TANK_BLASTER_1;
	else if (self->s.frame == FRAME_attak113)
		flash_number = MZ2_TANK_BLASTER_2;
	else
		flash_number = MZ2_TANK_BLASTER_3;

	damage = 50 + 10*self->monsterinfo.level;
	speed = 1000 + 50*self->monsterinfo.level;

	MonsterAim(self, 0.8, speed, false, flash_number, forward, start);
	monster_fire_blaster(self, start, forward, damage, speed, EF_BLASTER, BLASTER_PROJ_BOLT, 2.0, true, flash_number);
}	
Esempio n. 2
0
void boss_locktarget (edict_t *self, int flash_number, vec3_t forward, vec3_t start)
{
	int		i;
	vec3_t	v;

	if (self->owner->client->weapon_mode) // secondary attack
	{
		VectorCopy(self->enemy->s.origin, v);
		v[2]-=100; // aim at floor
		VectorSubtract(v, self->s.origin, forward);
	}
	else
	{
		MonsterAim(self, -1, TANK_ROCKET_SPEED, true, flash_number, forward, start);
	}

	VectorNormalize(forward);
	vectoangles(forward, forward);
	ValidateAngles(forward);

	// set view angles to target
	for (i = 0 ; i < 3 ; i++)
		self->owner->client->ps.pmove.delta_angles[i] = ANGLE2SHORT(forward[i]-self->owner->client->resp.cmd_angles[i]);
	VectorCopy(forward, self->owner->client->ps.viewangles);
	VectorCopy(forward, self->owner->client->v_angle);
}
Esempio n. 3
0
void myChickRocket (edict_t *self)
{
	int		damage, speed;
	vec3_t	forward, start;

	if (self->monsterinfo.bonus_flags & BF_UNIQUE_FIRE)
	{
		myChickFireball(self);
		return;
	}

	if (!G_EntExists(self->enemy))
		return;

	damage = 50 + 15*self->monsterinfo.level;
	if ( self->activator && self->activator->client )
	{
		speed = 450 + 30*self->monsterinfo.level;
	}
	else
	{
		speed = 450;	
	}

	MonsterAim(self, 1, speed, true, MZ2_CHICK_ROCKET_1, forward, start);
	monster_fire_rocket (self, start, forward, damage, speed, MZ2_CHICK_ROCKET_1);
}
Esempio n. 4
0
void mybrain_jumpattack_takeoff (edict_t *self)
{
	int	speed = 800;
	vec3_t	forward, start;

	if (!G_EntExists(self->enemy))
		return;

	//4.5 monster bonus flags
	if (self->monsterinfo.bonus_flags & BF_FANATICAL)
		speed *= 2;

	gi.sound (self, CHAN_VOICE, sound_sight, 1, ATTN_NORM, 0);

	// launch towards our enemy
	MonsterAim(self, -1, speed, false, 0, forward, start);
	VectorScale (forward, speed, self->velocity);
	self->velocity[2] = 300;

	// jump timeout
	self->monsterinfo.pausetime = level.time + 5.0;

	// shrink our bbox vertically because we're ducking
	self->maxs[2] = 0;
	self->takedamage = DAMAGE_YES;
	gi.linkentity (self);
}
Esempio n. 5
0
// FIXME: He's not firing from the proper Z
void MakronRailgun (edict_t *self)
{
	vec3_t	forward, start;
	int		damage;

	damage = 150 + 35 * self->monsterinfo.level;

	MonsterAim(self, 0.5, 0, false, MZ2_MAKRON_RAILGUN_1, forward, start);

	monster_fire_railgun (self, start, forward, damage, 100, MZ2_MAKRON_RAILGUN_1);
}
Esempio n. 6
0
void makronBFG (edict_t *self)
{
	vec3_t	forward, start;
	int		damage, speed;

	damage = 30 + 2 * self->monsterinfo.level;
	speed = 650 + 35 * self->monsterinfo.level;

	MonsterAim(self, 0.8, speed, true, MZ2_MAKRON_BFG, forward, start);
	monster_fire_bfg (self, start, forward, damage, speed, 0, 150.0, MZ2_MAKRON_BFG);
}	
Esempio n. 7
0
void soldier_fireshotgun (edict_t *self)
{
	int		damage;
	vec3_t	forward, start;

	if (!G_EntExists(self->enemy))
		return;

	damage = 5 + self->monsterinfo.level;
	MonsterAim(self, 0.8, 0, false, MZ2_SOLDIER_SHOTGUN_8, forward, start);
	monster_fire_shotgun(self, start, forward, damage, damage, 375, 375, 10, MZ2_SOLDIER_SHOTGUN_8);
}
Esempio n. 8
0
// FIXME: This is all wrong. He's not firing at the proper angles.
void MakronHyperblaster (edict_t *self)
{
	vec3_t	forward, start;
	int		damage, speed, flash_number;

	flash_number = MZ2_MAKRON_BLASTER_1 + (self->s.frame - FRAME_attak405);

	damage = 50 + 10*self->monsterinfo.level;
	speed = 1000 + 50*self->monsterinfo.level;

	MonsterAim(self, 0.8, 1500, false, flash_number, forward, start);
	monster_fire_blaster(self, start, forward, damage, speed, EF_BLASTER, BLASTER_PROJ_BOLT, 2.0, true, flash_number);
}	
Esempio n. 9
0
void myChickRail (edict_t *self)
{
	int		damage;
	vec3_t	forward, start;

	//if (!self->activator->client)
	//	damage = 50 + 20*self->monsterinfo.level;
	//else
		damage = 50 + 10*self->monsterinfo.level;

	MonsterAim(self, 0.33, 0, false, MZ2_CHICK_ROCKET_1, forward, start);
	monster_fire_railgun (self, start, forward, damage, damage, MZ2_GLADIATOR_RAILGUN_1);
}	
Esempio n. 10
0
void soldier_firerocket (edict_t *self)
{
	int		damage, speed;
	vec3_t	forward, start;
	
	if (!G_EntExists(self->enemy))
		return;

	damage = 50 + 10*self->monsterinfo.level;
	speed = 650 + 30*self->monsterinfo.level;

	MonsterAim(self, 0.8, speed, true, MZ2_SOLDIER_BLASTER_8, forward, start);
	monster_fire_rocket (self, start, forward, damage, speed, MZ2_SOLDIER_BLASTER_8);
}
Esempio n. 11
0
void soldier_fireblaster (edict_t *self)
{
	int		damage, speed;
	vec3_t	forward, start;
	
	if (!G_EntExists(self->enemy))
		return;

	damage = 50 + 10*self->monsterinfo.level;
	speed = 1000 + 50*self->monsterinfo.level;

	MonsterAim(self, 0.8, speed, false, MZ2_SOLDIER_BLASTER_8, forward, start);
	monster_fire_blaster(self, start, forward, damage, speed, EF_BLASTER, BLASTER_PROJ_BOLT, 2.0, true, MZ2_SOLDIER_BLASTER_8);
}
Esempio n. 12
0
void mymedic_fire_bolt (edict_t *self)
{
	int		min, max, damage;
	vec3_t	forward, start;

	min = 4*self->monsterinfo.level;
	max = 60 + 30*self->monsterinfo.level;

	damage = GetRandom(min, max);

	MonsterAim(self, 0.8, 1500, false, MZ2_MEDIC_BLASTER_1, forward, start);
	monster_fire_blaster(self, start, forward, damage, 1500, EF_BLASTER, BLASTER_PROJ_BLAST, 2.0, true, MZ2_MEDIC_BLASTER_1);

	gi.sound (self, CHAN_WEAPON, gi.soundindex("weapons/photon.wav"), 1, ATTN_NORM, 0);
}
Esempio n. 13
0
void myTankRail (edict_t *self)
{
	int		flash_number, damage;
	vec3_t	forward, start;

	if (self->s.frame == FRAME_attak110)
		flash_number = MZ2_TANK_BLASTER_1;
	else if (self->s.frame == FRAME_attak113)
		flash_number = MZ2_TANK_BLASTER_2;
	else
		flash_number = MZ2_TANK_BLASTER_3;

	damage = 50 + 5*self->monsterinfo.level;

	MonsterAim(self, 0.5, 0, false, flash_number, forward, start);
	monster_fire_railgun(self, start, forward, damage, damage, MZ2_GLADIATOR_RAILGUN_1);
}
Esempio n. 14
0
void myTankMachineGun (edict_t *self)
{
	vec3_t	forward, start;
	int		flash_number, damage;

	// sanity check
	if (!self->enemy || !self->enemy->inuse)
		return;

	flash_number = MZ2_TANK_MACHINEGUN_1 + (self->s.frame - FRAME_attak406);

	damage = 20 + 2*self->monsterinfo.level;

	MonsterAim(self, 0.8, 0, false, flash_number, forward, start);

	monster_fire_bullet (self, start, forward, damage, damage, 
		DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}	
Esempio n. 15
0
void GladiatorChainLightning (edict_t *self)
{
	int slvl, damage;
	vec3_t	forward, start;

	if (!G_EntExists(self->enemy))
		return;

	slvl = self->monsterinfo.level;

	if (slvl > 15)
		slvl = 15;

	damage = 50 + 15 * slvl;

	MonsterAim(self, 0.5, 0, false, MZ2_GLADIATOR_RAILGUN_1, forward, start);
	ChainLightning(self, start, forward, damage, 1024, 256);
}
Esempio n. 16
0
void myGunnerFire (edict_t *self)
{
	int		damage, flash_number;
	vec3_t	forward, start;

	// sanity check
	if (!self->enemy || !self->enemy->inuse)
		return;

	flash_number = MZ2_GUNNER_MACHINEGUN_1 + (self->s.frame - FRAME_attak216);
 
	damage = 10 + self->monsterinfo.level;

	MonsterAim(self, 0.8, 0, false, flash_number, forward, start);

	monster_fire_bullet (self, start, forward, damage, damage, 
		DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, flash_number);
}
Esempio n. 17
0
void mymedic_fire_blaster (edict_t *self)
{
	int		effect, damage;
	vec3_t	forward, start;
	qboolean bounce = false;
	
	if ((self->s.frame == FRAME_attack9) || (self->s.frame == FRAME_attack12))
	{
		effect = EF_BLASTER;
		bounce = true;
	}
	else
		effect = EF_HYPERBLASTER;

	damage = 20 + 3*self->monsterinfo.level;

	MonsterAim(self, 0.8, 2000, false, MZ2_MEDIC_BLASTER_1, forward, start);
	monster_fire_blaster(self, start, forward, damage, 2000, effect, BLASTER_PROJ_BOLT, 2.0, bounce, MZ2_MEDIC_BLASTER_1);
}
Esempio n. 18
0
void GladiatorGun (edict_t *self)
{
	int damage;
	vec3_t	forward, start;

	if (self->monsterinfo.bonus_flags & BF_UNIQUE_LIGHTNING)
	{
		GladiatorChainLightning(self);
		return;
	}
	
	if (!G_EntExists(self->enemy))
		return;

	damage = 15 + 10 * self->monsterinfo.level; // from 50. and 15.

	MonsterAim(self, 0.7, 0, false, MZ2_GLADIATOR_RAILGUN_1, forward, start);

	monster_fire_railgun (self, start, forward, damage, 100, MZ2_GLADIATOR_RAILGUN_1);
}
Esempio n. 19
0
void decoy_rocket (edict_t *self)
{
	int		damage, speed;
	vec3_t	forward, start;

	speed = 650 + 30*self->activator->myskills.level;
	if (speed > 950)
		speed = 950;

	//if (random() <= 0.1)
	//	damage = 50 + 10*self->activator->myskills.level;	
	//else
		damage = 1;

	MonsterAim(self, damage, speed, true, 0, forward, start);
	monster_fire_rocket (self, start, forward, damage, speed, 0);

	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (self-g_edicts);
	gi.WriteByte (MZ_ROCKET);
	gi.multicast (self->s.origin, MULTICAST_PVS);
}
Esempio n. 20
0
void myChickFireball (edict_t *self)
{
	int slvl, damage, speed, flame_damage;
	vec3_t	forward, start;

	if (!G_EntExists(self->enemy))
		return;

	slvl = self->monsterinfo.level;

	if (slvl > 15)
		slvl = 15;

	damage = 50 + 15 * slvl;
	flame_damage = 2 * slvl;
	speed = 650 + 35 * slvl;

	MonsterAim(self, 0.9, speed, true, MZ2_CHICK_ROCKET_1, forward, start);
	fire_fireball(self, start, forward, damage, 125.0, speed, 5, flame_damage);

	gi.sound (self, CHAN_ITEM, gi.soundindex("spells/firecast.wav"), 1, ATTN_NORM, 0);
}
Esempio n. 21
0
void myTankRocket (edict_t *self)
{
	int		flash_number, damage, speed;
	vec3_t	forward, start;

	// sanity check
	if (!self->enemy || !self->enemy->inuse)
		return;

	if (self->s.frame == FRAME_attak324)
		flash_number = MZ2_TANK_ROCKET_1;
	else if (self->s.frame == FRAME_attak327)
		flash_number = MZ2_TANK_ROCKET_2;
	else
		flash_number = MZ2_TANK_ROCKET_3;

	damage = 50 + 10*self->monsterinfo.level;
	speed = 650 + 30*self->monsterinfo.level;

	MonsterAim(self, 0.5, speed, true, flash_number, forward, start);

	monster_fire_rocket (self, start, forward, damage, speed, flash_number);
}	
Esempio n. 22
0
void myGunnerGrenade (edict_t *self)
{
	int		damage, speed, flash_number;
	vec3_t	forward, start;

	// sanity check
	if (!self->enemy || !self->enemy->inuse)
		return;

	damage = 50 + 10*self->monsterinfo.level;
	speed = 600 + 30*self->monsterinfo.level;

	if (speed > 900)
		speed = 900;

	if (self->s.frame == FRAME_attak105)
		flash_number = MZ2_GUNNER_GRENADE_1;
	else
		flash_number = MZ2_GUNNER_GRENADE_4;

	MonsterAim(self, 0.8, speed, false, flash_number, forward, start);
	monster_fire_grenade(self, start, forward, damage, speed, flash_number);
}
Esempio n. 23
0
void minisentry_attack (edict_t *self)
{
	int			speed, dmg_radius;
	float		chance;
	vec3_t		forward, start, aim;
	qboolean	slowed=false;

	minisentry_lockon(self);
	if (self->light_level < 1)
		return; // out of ammo
	// are we affected by holy freeze?
	//if (HasActiveCurse(self, AURA_HOLYFREEZE))
	if (que_typeexists(self->curses, AURA_HOLYFREEZE))
		slowed = true;
	
	// calculate muzzle location
	AngleVectors(self->s.angles, forward, NULL, NULL);
	VectorCopy(self->s.origin, start);
	if (self->owner && self->owner->style == SENTRY_FLIPPED)
		start[2] -= abs(self->mins[2]);
	else
		start[2] += self->maxs[2];
	VectorMA(start, (self->maxs[0] + 16), forward, start);

	if ((level.time > self->wait) && infov(self, self->enemy, 30))
	{
		speed = 650 + 35*self->creator->myskills.abilities[BUILD_SENTRY].current_level;
		MonsterAim(self, -1, speed, true, 0, aim, start);
		dmg_radius = self->radius_dmg;
		if (dmg_radius > 150)
			dmg_radius = 150;
		fire_rocket (self, start, aim, self->radius_dmg, speed, dmg_radius, self->radius_dmg);
		if (slowed)
			self->wait = level.time + 2.0;
		else if (self->chill_time > level.time)
			self->wait = level.time + (1.0 * (1 + CHILL_DEFAULT_BASE + CHILL_DEFAULT_ADDON * self->chill_level));
		else
			self->wait = level.time + 1.0;
	
	}
	self->light_level--; // decrease ammo
	
	if (slowed && !(level.framenum%2))
		return;

	// chill effect reduces attack rate/refire
	if (self->chill_time > level.time)
	{
		chance = 1 / (1 + CHILL_DEFAULT_BASE + CHILL_DEFAULT_ADDON * self->chill_level);
		if (random() > chance)
			return;
	}

	fire_bullet (self, start, forward, self->dmg, 2*self->dmg, DEFAULT_BULLET_HSPREAD, DEFAULT_BULLET_VSPREAD, MOD_SENTRY);
	gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/plaser.wav"), 1, ATTN_NORM, 0);

	gi.WriteByte (svc_muzzleflash);
	gi.WriteShort (self-g_edicts);
	gi.WriteByte (MZ_IONRIPPER|MZ_SILENCED);
	gi.multicast (start, MULTICAST_PVS);
}