]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Improve mage friend health/ammo check a bit
authorMario <mario.mario@y7mail.com>
Fri, 26 Apr 2013 11:08:41 +0000 (21:08 +1000)
committerMario <mario.mario@y7mail.com>
Fri, 26 Apr 2013 11:08:41 +0000 (21:08 +1000)
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/monsters/monster/shalrath.qc

index 56b37e317a30b0d85200d5b6cae91bb5a64d48fc..860fe39f205f08db2f9ce9003e987be151208f58 100644 (file)
@@ -105,6 +105,9 @@ float monster_isvalidtarget (entity targ, entity ent)
                
        if(targ.items & IT_INVISIBILITY)
                return FALSE; // enemy is invisible
+               
+       if(substring(targ.classname, 0, 10) == "onslaught_")
+               return FALSE; // don't attack onslaught targets
        
        if(IS_SPEC(targ) || IS_OBSERVER(targ))
                return FALSE; // enemy is a spectator
index e6191c8884bac4f2eae69e60b583654b73b9d881..3c57e0f0a9dfedfa276cb534b0c4a037e6946eba 100644 (file)
@@ -47,20 +47,21 @@ void() shalrath_shield_die;
 void shalrath_think()
 {
        entity head;
-       float friend_needshelp = FALSE;
+       float friend_needshelp = FALSE, need_hpammo = FALSE;
        
        FOR_EACH_PLAYER(head)
        {
+               need_hpammo = ((g_minstagib) ? head.ammo_cells < start_ammo_cells : head.health < autocvar_g_balance_health_regenstable);
                if not(IsDifferentTeam(head, self))
                if(head.health > 0)
                if(vlen(head.origin - self.origin) < autocvar_g_monster_shalrath_heal_range)
-               if((!g_minstagib && head.health < start_health) || (g_minstagib && head.ammo_cells < start_ammo_cells))
+               if(need_hpammo)
                {
                        friend_needshelp = TRUE;
                        break; // found 1 player near us who is low on health
                }
        }
-       FOR_EACH_MONSTER(head)
+       FOR_EACH_MONSTER(head) if(head != self)
        {
                if not(IsDifferentTeam(head, self))
                if(head.health > 0)