self = oldself;
}
-float monster_isvalidtarget (entity targ, entity ent, float neutral)
+float monster_isvalidtarget (entity targ, entity ent)
{
if(!targ || !ent)
return FALSE; // this check should fix a crash
if(trace_ent != targ)
return FALSE; // we can't see the enemy
- if(neutral == TRUE)
- return TRUE; // we come in peace!
-
if(targ.takedamage == DAMAGE_NO)
return FALSE; // enemy can't be damaged
local entity e;
for(e = world; (e = findflags(e, monster_attack, TRUE)); )
{
- if(monster_isvalidtarget(e, ent, FALSE))
+ if(monster_isvalidtarget(e, ent))
{
return e;
}
if(self.enemy != other)
if not(other.flags & FL_MONSTER)
- if(monster_isvalidtarget(other, self, FALSE))
+ if(monster_isvalidtarget(other, self))
self.enemy = other;
}
if (self.health <= 0)
return;
- if(!monster_isvalidtarget(activator, self, -1))
+ if(!monster_isvalidtarget(activator, self))
return;
self.enemy = activator;
return;
if((ignore_turrets && !(attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) || !ignore_turrets)
- if(monster_isvalidtarget(attacker, self, FALSE))
+ if(monster_isvalidtarget(attacker, self))
self.enemy = attacker;
self.health -= damage;
float bigdmg = autocvar_g_monster_demon_attack_jump_damage * self.scale;
- if (monster_isvalidtarget(other, self, FALSE))
+ if (monster_isvalidtarget(other, self))
{
if (vlen(self.velocity) > 300)
{
/**
* Performe a standing attack on self.enemy.
*/
-void spider_attack_standing() {
+void spider_attack_standing()
+{
float dot = 0, bigdmg = autocvar_g_monster_spider_attack_stand_damage * self.scale;
self.velocity_x = 0;
self.velocity_y = 0;
-
- if(self.monster_owner == self.enemy)
- {
- self.enemy = world;
- return;
- }
makevectors (self.angles);
dot = normalize (self.enemy.origin - self.origin) * v_forward;
if(dot > 0.3)
- {
Damage(self.enemy, self, self, bigdmg * monster_skill, DEATH_MONSTER_SPIDER, self.origin, '0 0 0');
- }
-
- if (!monster_isvalidtarget(self.enemy, self, FALSE))
- self.enemy = world;
if(random() < 0.50)
self.frame = spider_anim_attack;
else
self.frame = spider_anim_attack2;
- self.nextthink = time + autocvar_g_monster_spider_attack_stand_delay;
+ self.attack_finished_single = time + autocvar_g_monster_spider_attack_stand_delay;
}
void spider_web_explode ()
if(e.turrcaps_flags & TFL_TURRCAPS_ISTURRET)
continue;
- if(monster_isvalidtarget(e, self, FALSE))
+ if(monster_isvalidtarget(e, self))
if((vlen(trace_endpos - self.origin) < 200 && e.turrcaps_flags & TFL_TURRCAPS_ISTURRET) || (vlen(trace_endpos - self.origin) < 200 && e.classname != "td_generator") || (vlen(trace_endpos - self.origin) < 500 && e.classname == "td_generator"))
{
self.enemy = e;