Esempio n. 1
0
File: z_boss.c Progetto: ZwS/qudos
void FireFlare(edict_t *self)
{
	vec3_t	forward, right;
	vec3_t	start;
	vec3_t	dir;
	vec3_t	vec;

	int offset = (self->s.frame - 71) / 3;

	AngleVectors (self->s.angles, forward, right, NULL);

	G_ProjectSource (self->s.origin, rocketoffset[offset], forward, right, start);

	if(self->monsterinfo.aiflags & AI_ONESHOTTARGET)
	{
		VectorCopy(	self->monsterinfo.shottarget, vec );
	}
	else
	{
		VectorCopy (self->enemy->s.origin, vec);
		vec[2] += self->enemy->viewheight;
	}

	VectorSubtract (vec, start, dir);
	VectorNormalize (dir);
	
	if(!(self->monsterinfo.aiflags & AI_ONESHOTTARGET))
	{
		ANIM_AIM(self, dir);
	}
	fire_flare (self, start, dir, 10, 1000, 10, 10);

	// play shooting sound
	gi.sound(self, CHAN_WEAPON, gi.soundindex("weapons/flare/shoot.wav"), 1, ATTN_NORM, 0);
}
Esempio n. 2
0
void monster_fire_grenade (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int flashtype)
{
	ANIM_AIM(self, aimdir);
	fire_grenade (self, start, aimdir, damage, speed, 2.5, damage+40);

	gi.WriteByte (svc_muzzleflash2);
	gi.WriteShort (self - g_edicts);
	gi.WriteByte (flashtype);
	gi.multicast (start, MULTICAST_PVS);
}
Esempio n. 3
0
void monster_fire_shotgun (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int kick, int hspread, int vspread, int count, int flashtype)
{
	ANIM_AIM(self, aimdir);
	fire_shotgun (self, start, aimdir, damage, kick, hspread, vspread, count, MOD_UNKNOWN);

	gi.WriteByte (svc_muzzleflash2);
	gi.WriteShort (self - g_edicts);
	gi.WriteByte (flashtype);
	gi.multicast (start, MULTICAST_PVS);
}
Esempio n. 4
0
File: z_boss.c Progetto: ZwS/qudos
void FireHook(edict_t *self)
{
	vec3_t	forward, right;
	vec3_t	start;
	vec3_t	dir;
	vec3_t	vec;
	vec3_t	hookoffset	= {-1, -24, 34};
	edict_t	*hook;
	float speed;

	AngleVectors (self->s.angles, forward, right, NULL);

	G_ProjectSource (self->s.origin, hookoffset, forward, right, start);
	VectorCopy (self->enemy->s.origin, vec);
	vec[2] += self->enemy->viewheight;
	VectorSubtract (vec, start, dir);
	VectorNormalize (dir);
	
  ANIM_AIM(self, dir);

	self->s.modelindex3 = 0;
	
	speed = 1000;

	gi.sound (self, CHAN_WEAPON, sound_hooklaunch, 1, ATTN_NORM, 0);

	self->laser = hook = G_Spawn();
	VectorCopy (start, hook->s.origin);
	VectorCopy (dir, hook->movedir);
	vectoangles (dir, hook->s.angles);
	VectorScale (dir, speed, hook->velocity);
	hook->movetype = MOVETYPE_FLYMISSILE;
	hook->clipmask = MASK_SHOT;
	hook->solid = SOLID_BBOX;
	VectorClear (hook->mins);
	VectorClear (hook->maxs);
	hook->s.modelindex = gi.modelindex ("models/monsters/bossz/grapple/tris.md2");
	hook->s.frame = 282;
	hook->owner = self;
	hook->touch = HookTouch;
	hook->powerarmor_time = level.time + 8000 / speed;
	hook->nextthink = level.time + FRAMETIME;
	hook->think = HookThink;
	hook->s.sound = sound_hookfly; // replace...
	hook->classname = "bosshook";

	gi.linkentity (hook);
}
Esempio n. 5
0
void monster_fire_bfg (edict_t *self, vec3_t start, vec3_t aimdir, int damage, int speed, int kick, float damage_radius, int flashtype)
{
	if(EMPNukeCheck(self, start))
	{
		gi.sound (self, CHAN_AUTO, gi.soundindex("items/empnuke/emp_missfire.wav"), 1, ATTN_NORM, 0);
		return;
	}

	ANIM_AIM(self, aimdir);
	fire_bfg (self, start, aimdir, damage, speed, damage_radius);

	gi.WriteByte (svc_muzzleflash2);
	gi.WriteShort (self - g_edicts);
	gi.WriteByte (flashtype);
	gi.multicast (start, MULTICAST_PVS);
}