]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/havocbot/havocbot.qc
random, weird, bot "fixes"/hacks
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / havocbot / havocbot.qc
index 2b86c27ad0b3c6949c4f1ccc109260d601737edb..442711514573e697ac99baa98c25b3ff4403ffc3 100644 (file)
@@ -231,12 +231,14 @@ void havocbot_bunnyhop(vector dir)
                return;
 
        // Don't jump when using some weapons
+       /*
        if(self.aistatus & AI_STATUS_ATTACKING)
        if(self.weapon & WEP_CAMPINGRIFLE)
                return;
 
        if(self.goalcurrent.classname == "player")
                return;
+       */
 
        maxspeed = cvar("sv_maxspeed");
 
@@ -337,6 +339,7 @@ void havocbot_bunnyhop(vector dir)
        }
 
        // Release jump button
+       if(!cvar("sv_pogostick"))
        if(self.flags & FL_ONGROUND == 0)
        {
                if(self.velocity_z < 0 || vlen(self.velocity)<maxspeed)
@@ -950,6 +953,7 @@ void havocbot_chooseweapon()
        local float nex     ; nex      =-1000;
        local float hagar   ; hagar    =-1000;
        local float grenade ; grenade  =-1000;
+       local float mine    ; mine     =-1000;
        local float electro ; electro  =-1000;
        local float crylink ; crylink  =-1000;
        local float uzi     ; uzi      =-1000;
@@ -1077,6 +1081,15 @@ void havocbot_chooseweapon()
                grenade = (cvar("g_balance_grenadelauncher_primary_damage")/cvar("g_balance_grenadelauncher_primary_refire")*1.0)
                        * bound(0,(cvar("g_balance_grenadelauncher_primary_speed")/distance*maxdelaytime),1)*1.1;
 
+       if (client_hasweapon(self, WEP_MINE_LAYER, TRUE, FALSE) &&
+               !(
+                       cvar("bot_ai_weapon_combo") && self.weapon == WEP_MINE_LAYER &&
+                       af > combo_time
+               )
+       )
+               mine = (cvar("g_balance_minelayer_damage")/cvar("g_balance_minelayer_refire")*1.0)
+                       * bound(0,(cvar("g_balance_minelayer_speed")/distance*maxdelaytime),1)*1.1;
+
        if (client_hasweapon(self, WEP_ELECTRO, TRUE, FALSE) &&
                !(      cvar("bot_ai_weapon_combo") && self.weapon == WEP_ELECTRO &&
                        af > combo_time
@@ -1123,6 +1136,7 @@ void havocbot_chooseweapon()
        dprint("Nex: "    , ftos(nex     ), "\n");
        dprint("Hagar: "  , ftos(hagar   ), "\n");
        dprint("Grenade: ", ftos(grenade ), "\n");
+       dprint("Mine: "   , ftos(mine    ), "\n");
        dprint("Electro: ", ftos(electro ), "\n");
        dprint("Crylink: ", ftos(crylink ), "\n");
        dprint("Uzi: "    , ftos(uzi     ), "\n");
@@ -1135,6 +1149,7 @@ void havocbot_chooseweapon()
        w = WEP_NEX              ;s = nex      ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
        w = WEP_HAGAR            ;s = hagar    ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
        w = WEP_GRENADE_LAUNCHER ;s = grenade  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
+       w = WEP_MINE_LAYER       ;s = mine     ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
        w = WEP_ELECTRO          ;s = electro  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
        w = WEP_CRYLINK          ;s = crylink  ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
        w = WEP_UZI              ;s = uzi      ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
@@ -1321,7 +1336,6 @@ vector havocbot_dodge()
 {
        // LordHavoc: disabled because this is too expensive
        return '0 0 0';
-       /*
        local entity head;
        local vector dodge, v, n;
        local float danger, bestdanger, vl, d;
@@ -1366,5 +1380,4 @@ vector havocbot_dodge()
                head = head.chain;
        }
        return dodge;
-       */
 };