]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Mine Layer code for havocbot
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 15:12:42 +0000 (18:12 +0300)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Mon, 4 Oct 2010 15:12:42 +0000 (18:12 +0300)
qcsrc/server/bot/havocbot/havocbot.qc
qcsrc/server/w_minelayer.qc

index 2b86c27ad0b3c6949c4f1ccc109260d601737edb..41b3d66d094f6cd0dd88b5650cf4184cf8c1f0a5 100644 (file)
@@ -950,6 +950,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 +1078,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_speedstart")/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 +1133,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 +1146,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;
index e53a573e5f36a12bce86a04454ec1c84e7214a5e..625705f8ffa7a237413c658fbaa1a5c7da7d5c72 100644 (file)
@@ -1,6 +1,5 @@
 /*TODO list (things left to do before this weapon should be ready, delete once it's all done):
 - The weapon currently uses sounds and models from other weapons. We need a modeler and sound artist to make this weapon its own (the gun model should probably be something between the porto and rocket launcher design-wise).
-- Bot code for the weapon may be needed. The bot AI may not have any info about this gun yet.
 - The mine model needs to face properly when it sticks to a surface. Once we'll have a correct mine model, we can't afford the model facing any way it falls to the ground. Should probably look at the porto code to see how portals face in the right direction when sticking to walls. 
 */