]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/role_assault.qc
Remove a redundant mutator hook
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / role_assault.qc
index edb4995bee5fb50f54d602cc5ba51f1b96e59c20..4456802d5cd59b2bb003225faaa279e37d6cb977 100644 (file)
@@ -1,6 +1,6 @@
 #define HAVOCBOT_AST_ROLE_NONE                 0
 #define HAVOCBOT_AST_ROLE_DEFENSE      2
-#define HAVOCBOT_AST_ROLE_OFFENSE      8
+#define HAVOCBOT_AST_ROLE_OFFENSE      4
 
 .float havocbot_role_flags;
 .float havocbot_attack_time;
@@ -16,12 +16,11 @@ void(entity bot) havocbot_ast_reset_role;
 
 void(float ratingscale, vector org, float sradius) havocbot_goalrating_items;
 void(float ratingscale, vector org, float sradius) havocbot_goalrating_enemyplayers;
-.entity assault_decreaser;
 
 void havocbot_goalrating_ast_targets(float ratingscale)
 {
-       entity ad, best, pl, wp, tod;
-       float radius, found, bestvalue, c;
+       entity ad, best, wp, tod;
+       float radius, found, bestvalue;
        vector p;
 
        ad = findchain(classname, "func_assault_destructible");
@@ -31,7 +30,7 @@ void havocbot_goalrating_ast_targets(float ratingscale)
                if (ad.target == "")
                        continue;
 
-               if(ad.state!=0)
+               if not(ad.bot_attack)
                        continue;
 
                found = FALSE;
@@ -49,18 +48,23 @@ void havocbot_goalrating_ast_targets(float ratingscale)
                }
 
                if(!found)
+               {
+               ///     dprint("target not found\n");
                        continue;
+               }
+               /// dprint("target #", etos(ad), " found\n");
+
 
                p = 0.5 * (ad.absmin + ad.absmax);
        //      dprint(vtos(ad.origin), " ", vtos(ad.absmin), " ", vtos(ad.absmax),"\n");
-               te_knightspike(p);
-               te_lightning2(world, '0 0 0', p);
+       //      te_knightspike(p);
+       //      te_lightning2(world, '0 0 0', p);
 
                // Find and rate waypoints around it
                found = FALSE;
                best = world;
                bestvalue = 99999999999;
-               for(radius=0; radius<1000 && !found; radius+=500)
+               for(radius=0; radius<1500 && !found; radius+=500)
                {
                        for(wp=findradius(p, radius); wp; wp=wp.chain)
                        {
@@ -80,11 +84,11 @@ void havocbot_goalrating_ast_targets(float ratingscale)
 
                if(best)
                {
-                       dprint("waypoints around target were found\n");
+               ///     dprint("waypoints around target were found\n");
                //      te_lightning2(world, '0 0 0', best.origin);
                //      te_knightspike(best.origin);
 
-                       navigation_routerating(best, ratingscale, 10000);
+                       navigation_routerating(best, ratingscale, 4000);
                        best.cnt += 1;
 
                        self.havocbot_attack_time = 0;
@@ -124,19 +128,14 @@ void havocbot_role_ast_offense()
        if (self.bot_strategytime < time)
        {
                navigation_goalrating_start();
-       ///     havocbot_goalrating_enemyplayers(20000, self.origin, 650);
-
-       //      if(!havocbot_goalrating_ast_generator_attack(20000))
-       //              havocbot_goalrating_ast_controlpoints_attack(20000);
-       //      havocbot_goalrating_ast_offenseitems(10000, self.origin, 10000);
-
+               havocbot_goalrating_enemyplayers(20000, self.origin, 650);
                havocbot_goalrating_ast_targets(20000);
-       ///     havocbot_goalrating_items(10000, self.origin, 10000);
+               havocbot_goalrating_items(15000, self.origin, 10000);
                navigation_goalrating_end();
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
-};
+}
 
 void havocbot_role_ast_defense()
 {
@@ -163,16 +162,14 @@ void havocbot_role_ast_defense()
        if (self.bot_strategytime < time)
        {
                navigation_goalrating_start();
-               havocbot_goalrating_enemyplayers(20000, self.origin, 650);
-       //      if(!havocbot_goalrating_ast_generator_attack(20000))
-       //              havocbot_goalrating_ast_controlpoints_attack(20000);
-       //      havocbot_goalrating_ast_offenseitems(10000, self.origin, 10000);
-               havocbot_goalrating_items(10000, self.origin, 10000);
+               havocbot_goalrating_enemyplayers(20000, self.origin, 3000);
+               havocbot_goalrating_ast_targets(20000);
+               havocbot_goalrating_items(15000, self.origin, 10000);
                navigation_goalrating_end();
 
                self.bot_strategytime = time + autocvar_bot_ai_strategyinterval;
        }
-};
+}
 
 void havocbot_role_ast_setrole(entity bot, float role)
 {
@@ -189,25 +186,20 @@ void havocbot_role_ast_setrole(entity bot, float role)
                        bot.havocbot_role_timeout = 0;
                        break;
        }
-};
+}
 
 void havocbot_ast_reset_role(entity bot)
 {
-       local entity head;
-       local float c;
-
        if(self.deadflag != DEAD_NO)
                return;
 
-       bot.havocbot_ast_target = world;
-
        if(bot.team==assault_attacker_team)
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_OFFENSE);
        else
                havocbot_role_ast_setrole(bot, HAVOCBOT_AST_ROLE_DEFENSE);
-};
+}
 
 void havocbot_chooserole_ast()
 {
        havocbot_ast_reset_role(self);
-};
+}