float accuracy_isgooddamage(entity attacker, entity targ)
{
+ float targ_isvalid = ((g_td) ? targ.flags & FL_MONSTER : targ.flags & FL_CLIENT);
+
if(!inWarmupStage)
- if((g_td && targ.flags & FL_MONSTER) || (!g_td && targ.flags & FL_CLIENT))
- if(!(attacker.flags & FL_MONSTER)) // no accuracy for monsters
+ if(targ_isvalid)
+ if not(attacker.flags & FL_MONSTER) // no accuracy for monsters
if(targ.deadflag == DEAD_NO)
if(IsDifferentTeam(attacker, targ))
return TRUE;
return FALSE;
}
+void monster_makevectors(entity e)
+{
+ vector v;
+
+ v = e.origin + (e.mins + e.maxs) * 0.5;
+ self.v_angle = vectoangles(v - (self.origin + self.view_ofs));
+ self.v_angle_x = -self.v_angle_x;
+
+ makevectors(self.v_angle);
+}
+
void monster_use ()
{
if (self.enemy)
self.moveto_z = self.origin_z;
if(self.state != MONSTER_STATE_ATTACK_LEAP)
- {
self.angles_y = angles_face_y;
- self.v_angle = self.angles;
- }
if(self.state == MONSTER_STATE_ATTACK_LEAP && (self.flags & FL_ONGROUND))
{
return;
}
+ monster_makevectors(self.enemy);
+
W_SetupShot (self, autocvar_g_antilag_bullets && 18000 >= autocvar_g_antilag_bullets, 0, "weapons/uzi_fire.wav", CH_WEAPON_A, autocvar_g_monster_ogre_attack_uzi_damage);
fireBallisticBullet(w_shotorg, w_shotdir, 0.02, 18000, 5, autocvar_g_monster_ogre_attack_uzi_damage, autocvar_g_monster_ogre_attack_uzi_force, DEATH_MONSTER_OGRE_UZI, 0, 1, 115);
endFireBallisticBullet();
void ogre_gl()
{
entity gren;
+
+ monster_makevectors(self.enemy);
W_SetupShot_ProjectileSize (self, '-3 -3 -3', '3 3 3', FALSE, 4, "weapons/grenade_fire.wav", CH_WEAPON_A, autocvar_g_monster_ogre_attack_grenade_damage);
w_shotdir = v_forward; // no TrueAim for grenades please
missile = spawn ();
missile.owner = missile.realowner = self;
- self.v_angle = self.angles;
- makevectors (self.angles);
+ monster_makevectors(self.enemy);
dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
dist = vlen (self.enemy.origin - self.origin);
float soldier_attack()
{
monsters_setframe(soldier_anim_shoot);
- makevectors(self.angles);
+
+ monster_makevectors(self.enemy);
if(self.currentammo <= 0)
{
self.angles_y = angles_face_y ;
self.attack_finished_single = time + autocvar_g_monster_spider_attack_leap_delay;
- makevectors(self.angles);
+ monster_makevectors(self.enemy);
spider_shootweb(self.spider_type);
}
self.attack_finished_single = time + 0.2;
- self.v_angle = self.angles;
- makevectors (self.angles);
+ vector v;
+
+ v = self.enemy.origin + (self.enemy.mins + self.enemy.maxs) * 0.5;
+ self.v_angle = vectoangles(v - (self.origin + self.view_ofs));
+ self.v_angle_x = -self.v_angle_x;
+
+ makevectors (self.v_angle);
missile = spawn ();
missile.owner = missile.realowner = self;