From: Mircea Kitsune Date: Mon, 4 Oct 2010 15:12:42 +0000 (+0300) Subject: Mine Layer code for havocbot X-Git-Tag: xonotic-v0.1.0preview~307^2~33^2~22 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a0ed4089941dd7b1d2ca861d7fd659edc28c1f39;p=xonotic%2Fxonotic-data.pk3dir.git Mine Layer code for havocbot --- diff --git a/qcsrc/server/bot/havocbot/havocbot.qc b/qcsrc/server/bot/havocbot/havocbot.qc index 2b86c27ad..41b3d66d0 100644 --- a/qcsrc/server/bot/havocbot/havocbot.qc +++ b/qcsrc/server/bot/havocbot/havocbot.qc @@ -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; diff --git a/qcsrc/server/w_minelayer.qc b/qcsrc/server/w_minelayer.qc index e53a573e5..625705f8f 100644 --- a/qcsrc/server/w_minelayer.qc +++ b/qcsrc/server/w_minelayer.qc @@ -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. */