3 void() havocbot_chooserole;
4 .float havocbot_keyboardskill;
5 .float facingwalltime, ignoregoaltime;
8 vector havocbot_dodge()
10 // LordHavoc: disabled because this is too expensive
14 local vector dodge, v, n;
15 local float danger, bestdanger, vl, d;
18 // check for dangerous objects near bot or approaching bot
19 head = findchainfloat(bot_dodge, TRUE);
22 if (head.owner != self)
24 vl = vlen(head.velocity);
25 if (vl > sv_maxspeed * 0.3)
27 n = normalize(head.velocity);
28 v = self.origin - head.origin;
30 if (d > (0 - head.bot_dodgerating))
31 if (d < (vl * 0.2 + head.bot_dodgerating))
33 // calculate direction and distance from the flight path, by removing the forward axis
34 v = v - (n * (v * n));
35 danger = head.bot_dodgerating - vlen(v);
36 if (bestdanger < danger)
39 // dodge to the side of the object
46 danger = head.bot_dodgerating - vlen(head.origin - self.origin);
47 if (bestdanger < danger)
50 dodge = normalize(self.origin - head.origin);
60 .float havocbot_keyboardtime;
61 .float havocbot_ducktime;
62 .vector havocbot_keyboard;
63 void havocbot_keyboard_movement(vector destorg)
65 local vector keyboard;
66 local float blend, maxspeed;
68 maxspeed = cvar("sv_maxspeed");
70 if (time < self.havocbot_keyboardtime)
73 self.havocbot_keyboardtime =
75 self.havocbot_keyboardtime
76 + bound(0,0.05/(skill+self.havocbot_keyboardskill),0.05)
77 +random()*bound(0,0.025/(skill+self.havocbot_keyboardskill),100)
79 keyboard = self.movement * (1.0 / maxspeed);
81 local float trigger, trigger1;
82 blend = bound(0,skill*0.1,1);
83 trigger = cvar("bot_ai_keyboard_treshold");
84 trigger1 = 0 - trigger;
86 // categorize forward movement
87 // at skill < 1.5 only forward
88 // at skill < 2.5 only individual directions
89 // at skill < 4.5 only individual directions, and forward diagonals
90 // at skill >= 4.5, all cases allowed
91 if (keyboard_x > trigger)
97 else if (keyboard_x < trigger1 && skill > 1.5)
112 if (keyboard_y > trigger)
114 else if (keyboard_y < trigger1)
119 if (keyboard_z > trigger)
121 else if (keyboard_z < trigger1)
126 self.havocbot_keyboard = keyboard * maxspeed;
127 if (self.havocbot_ducktime>time) self.BUTTON_CROUCH=TRUE;
129 keyboard = self.havocbot_keyboard;
130 blend = bound(0,vlen(destorg-self.origin)/cvar("bot_ai_keyboard_distance"),1); // When getting close move with 360 degree
131 //dprint("movement ", vtos(self.movement), " keyboard ", vtos(keyboard), " blend ", ftos(blend), "\n");
132 self.movement = self.movement + (keyboard - self.movement) * blend;
135 //.float havocbotignoretime;
136 //.vector bot_dodgevector;
137 //.float bot_dodgevector_time;
138 //.float bot_dodgevector_jumpbutton;
139 void havocbot_movetogoal()
141 local vector destorg;
144 local vector flatdir;
147 local vector evadeobstacle;
148 local vector evadelava;
150 local float maxspeed;
153 //if (self.goalentity)
154 // te_lightning2(self, self.origin, (self.goalentity.absmin + self.goalentity.absmax) * 0.5);
155 self.movement = '0 0 0';
156 maxspeed = cvar("sv_maxspeed");
158 if(self.jumppadcount)
160 if(self.flags & FL_ONGROUND)
161 self.jumppadcount = FALSE;
166 if (self.goalcurrent == world)
169 navigation_poptouchedgoals();
170 if (self.goalcurrent == world)
172 if(self.alternativegoal==world)
174 // ran out of goals, rethink strategy as soon as possible
175 self.bot_strategytime = 0;
178 // try to use the alternative goal
179 navigation_findnearestwaypoint(self.alternativegoal, TRUE);
180 navigation_routetogoal(self.alternativegoal);
181 self.alternativegoal = world;
185 // te_wizspike(self.goalcurrent.origin);
186 // te_lightning2(world, self.origin, self.goalcurrent.origin);
188 m1 = self.goalcurrent.origin + self.goalcurrent.mins;
189 m2 = self.goalcurrent.origin + self.goalcurrent.maxs;
190 destorg = self.origin;
191 destorg_x = bound(m1_x, destorg_x, m2_x);
192 destorg_y = bound(m1_y, destorg_y, m2_y);
193 destorg_z = bound(m1_z, destorg_z, m2_z);
194 diff = destorg - self.origin;
196 dir = normalize(diff);
197 flatdir = diff;flatdir_z = 0;
198 flatdir = normalize(flatdir);
200 //if (self.bot_dodgevector_time < time)
202 // self.bot_dodgevector_time = time + cvar("bot_ai_dodgeupdateinterval");
203 // self.bot_dodgevector_jumpbutton = 1;
204 evadeobstacle = '0 0 0';
208 makevectors(self.v_angle);
209 self.BUTTON_JUMP = TRUE;
214 // jump if going toward an obstacle that doesn't look like stairs we
215 // can walk up directly
216 tracebox(self.origin, self.mins, self.maxs, self.origin + self.velocity * 0.2, FALSE, self);
217 if (trace_fraction < 1)
218 if (trace_plane_normal_z < 0.7)
221 tracebox(self.origin + '0 0 16', self.mins, self.maxs, self.origin + self.velocity * 0.2 + '0 0 16', FALSE, self);
222 if (trace_fraction < s + 0.01)
223 if (trace_plane_normal_z < 0.7)
226 tracebox(self.origin + '0 0 48', self.mins, self.maxs, self.origin + self.velocity * 0.2 + '0 0 48', FALSE, self);
227 if (trace_fraction > s)
228 self.BUTTON_JUMP = 1;
232 // avoiding dangers and obstacles
233 // TODO: don't make this check every frame
234 if(self.flags & FL_ONGROUND)
236 local vector dst_ahead, dst_down;
237 dst_ahead = self.origin + self.view_ofs + (self.velocity * 0.3);
238 dst_down = dst_ahead + '0 0 -1500';
240 traceline(self.origin + self.view_ofs , dst_ahead, TRUE, world);
242 // Check head-banging against walls
243 if(vlen(self.origin + self.view_ofs - trace_endpos) < 2)
245 if(self.facingwalltime && time > self.facingwalltime)
247 self.ignoregoal = self.goalcurrent;
248 self.ignoregoaltime = time + cvar("bot_ai_ignoregoal_timeout");
249 navigation_poproute();
253 self.facingwalltime = time + 0.05;
258 self.facingwalltime = 0;
260 if(self.ignoregoal != world && time > self.ignoregoaltime)
262 self.ignoregoal = world;
263 self.ignoregoaltime = 0;
267 // Check for water/slime/lava and edges
268 if(trace_fraction == 1){
269 traceline(dst_ahead , dst_down, TRUE, world);
270 // te_lightning2(world, self.origin, dst_ahead); // Draw "ahead" look
271 s = pointcontents(trace_endpos + '0 0 1');
272 if (s != CONTENT_SOLID)
273 if (s == CONTENT_LAVA || s == CONTENT_SLIME)
274 evadelava = normalize(self.velocity) * -1;
275 else if (s == CONTENT_SKY)
276 evadeobstacle = normalize(self.velocity) * -1;
277 else if (tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
279 // te_lightning2(world, dst_ahead, dst_down); // Draw "downwards" look
280 // if ain't a safe goal with "holes" (like the soylent jumpad)
281 if(!boxesoverlap(dst_ahead - self.view_ofs + self.mins, dst_ahead - self.view_ofs + self.maxs,
282 self.goalcurrent.absmin, self.goalcurrent.absmax))
284 // Remove dangerous dynamic goals from stack
285 if (self.goalcurrent.classname == "player" || self.goalcurrent.classname == "droppedweapon")
286 navigation_poproute();
289 evadeobstacle = normalize(self.velocity) * -1;
298 makevectors(self.v_angle_y * '0 1 0');
301 dodge = havocbot_dodge();
302 dodge = dodge * bound(0,3+skill*0.1,1);
303 evadelava = evadelava * bound(1,3-skill,3); //Noobs fear lava a lot and take more distance from it
304 traceline(self.origin, self.enemy.origin, TRUE, world);
305 if(trace_ent.classname == "player")
306 dir = dir * bound(0,skill/7,1);
308 dir = normalize(dir + dodge + evadeobstacle + evadelava);
309 // self.bot_dodgevector = dir;
310 // self.bot_dodgevector_jumpbutton = self.BUTTON_JUMP;
313 //dir = self.bot_dodgevector;
314 //if (self.bot_dodgevector_jumpbutton)
315 // self.BUTTON_JUMP = 1;
317 self.movement_x = dir * v_forward * maxspeed;
318 self.movement_y = dir * v_right * maxspeed;
319 self.movement_z = dir * v_up * maxspeed;
321 // Emulate keyboard interface
323 havocbot_keyboard_movement(destorg);
325 if ((dir * v_up) >= cvar("sv_jumpvelocity")*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
326 if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill)*0.1,1)) self.BUTTON_JUMP=TRUE;
327 if (((dodge * v_up) < 0) && random()*frametime >= 0.5*bound(0,(10-skill)*0.1,1)) self.havocbot_ducktime=time+0.3/bound(0.1,skill,10);
330 .float havocbot_chooseenemy_finished;
331 .float havocbot_stickenemy;
332 void havocbot_chooseenemy()
334 local entity head, best;
335 local float rating, bestrating;
337 if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
344 if (!bot_shouldattack(self.enemy))
346 // enemy died or something, find a new target
348 self.havocbot_chooseenemy_finished = time;
350 else if (self.havocbot_stickenemy)
352 // tracking last chosen enemy
353 // if enemy is visible
354 // and not really really far away
355 // and we're not severely injured
356 // then keep tracking for a half second into the future
357 traceline(self.origin+self.view_ofs, self.enemy.origin+self.enemy.view_ofs*0.5,FALSE,world);
358 if (trace_ent == self.enemy || trace_fraction == 1)
359 if (vlen(self.enemy.origin - self.origin) < 1000)
360 if (self.health > 30)
362 // remain tracking him for a shot while (case he went after a small corner or pilar
363 self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
366 // enemy isn't visible, or is far away, or we're injured severely
367 // so stop preferring this enemy
368 // (it will still take a half second until a new one is chosen)
369 self.havocbot_stickenemy = 0;
372 if (time < self.havocbot_chooseenemy_finished)
374 self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
375 eye = (self.origin + self.view_ofs);
377 bestrating = 100000000;
378 head = findchainfloat(bot_attack, TRUE);
381 v = (head.absmin + head.absmax) * 0.5;
382 rating = vlen(v - eye);
383 if (bestrating > rating)
384 if (bot_shouldattack(head))
386 traceline(eye, v, TRUE, self);
387 if (trace_ent == head || trace_fraction >= 1)
396 self.havocbot_stickenemy = TRUE;
399 .float bot_chooseweapontime;
400 float(entity e) w_getbestweapon;
401 void havocbot_chooseweapon()
403 // TODO: clean this up by moving it to weapon code
404 if(self.enemy.classname!="player")
406 self.switchweapon = w_getbestweapon(self);
411 local float rocket ; rocket =-1000;
412 local float nex ; nex =-1000;
413 local float hagar ; hagar =-1000;
414 local float grenade ; grenade =-1000;
415 local float electro ; electro =-1000;
416 local float crylink ; crylink =-1000;
417 local float uzi ; uzi =-1000;
418 local float shotgun ; shotgun =-1000;
419 local float campingrifle ; campingrifle =-1000;
420 local float laser ; laser =-1000;
421 local float minstanex ; minstanex =-1000;
422 local float currentscore;
423 local float bestscore; bestscore = 0;
424 local float bestweapon; bestweapon=self.switchweapon;
425 local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
426 local float maxdelaytime=0.5;
427 local float spreadpenalty=10;
428 local float distancefromfloor;
430 local float af, ct, combo_time;
432 traceline(self.enemy.origin,self.enemy.origin-'0 0 1000',TRUE,world);
433 distancefromfloor = self.enemy.origin_z - trace_endpos_z;
435 af = ATTACK_FINISHED(self);
436 ct = cvar("bot_ai_weapon_combo_threshold");
438 // Bots with no skill will be 4 times more slower than "godlike" bots when doing weapon combos
439 // Ideally this 4 should be calculated as longest_weapon_refire / bot_ai_weapon_combo_threshold
440 combo_time = time + ct + (ct * ((-0.3*skill)+3));
442 // Custom weapon list based on distance to the enemy
443 local float i; i = 0;
444 if(bot_custom_weapon){
446 // Choose weapons for far distance
447 if ( distance > bot_distance_far ) {
448 for(i=0; i < WEP_LAST && bot_weapons_far[i] != -1 ; ++i){
449 w = bot_weapons_far[i];
450 if ( client_hasweapon(self, w, TRUE, FALSE) ){
451 if ( self.weapon == w){
452 if( cvar("bot_ai_weapon_combo") && af > combo_time)
455 self.switchweapon = w;
462 // Choose weapons for mid distance
463 if ( distance > bot_distance_close ) {
464 for(i=0; i < WEP_LAST && bot_weapons_mid[i] != -1 ; ++i){
465 w = bot_weapons_mid[i];
466 if ( client_hasweapon(self, w, TRUE, FALSE) ){
467 if ( self.weapon == w){
468 if( cvar("bot_ai_weapon_combo") && af > combo_time)
471 self.switchweapon = w;
478 // Choose weapons for close distance
479 for(i=0; i < WEP_LAST && bot_weapons_close[i] != -1 ; ++i){
480 w = bot_weapons_close[i];
481 if ( client_hasweapon(self, w, TRUE, FALSE) ){
482 if ( self.weapon == w){
483 if( cvar("bot_ai_weapon_combo") && af > combo_time)
486 self.switchweapon = w;
491 // If now weapon was chosen by this system fall back to the previous one
495 // (Damage/Sec * Weapon spefic change to get that damage)
496 // *(Time to get to target * weapon specfic hitchange bonus) / (in a time of maxdelaytime)
497 // *(Spread change of hit) // if it applies
498 // *(Penality for target beeing in air)
500 if (client_hasweapon(self, WEP_MINSTANEX, TRUE, FALSE))
501 minstanex = (1000/cvar("g_balance_minstanex_refire")*1.0)
504 if (client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE) &&
505 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ROCKET_LAUNCHER &&
509 rocket = (cvar("g_balance_rocketlauncher_damage")/cvar("g_balance_rocketlauncher_refire")*0.75)
510 * bound(0,(cvar("g_balance_rocketlauncher_speed")/distance*maxdelaytime),1)*1.5;
512 if (client_hasweapon(self, WEP_NEX, TRUE, FALSE) &&
513 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_NEX &&
517 nex = (cvar("g_balance_nex_damage")/cvar("g_balance_nex_refire")*1.0)
520 if (client_hasweapon(self, WEP_HAGAR, TRUE, FALSE) ) // &&
521 // !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_HAGAR && time < self.bot_lastshot + cvar("g_balance_hagar_primary_refire") ))
522 hagar = (cvar("g_balance_hagar_primary_damage")/cvar("g_balance_hagar_primary_refire")*1.0)
523 * bound(0,(cvar("g_balance_hagar_primary_speed")/distance*maxdelaytime),1)*0.2;
525 if (client_hasweapon(self, WEP_GRENADE_LAUNCHER, TRUE, FALSE) &&
527 cvar("bot_ai_weapon_combo") && self.weapon == WEP_GRENADE_LAUNCHER &&
531 grenade = (cvar("g_balance_grenadelauncher_primary_damage")/cvar("g_balance_grenadelauncher_primary_refire")*1.0)
532 * bound(0,(cvar("g_balance_grenadelauncher_primary_speed")/distance*maxdelaytime),1)*1.1;
534 if (client_hasweapon(self, WEP_ELECTRO, TRUE, FALSE) &&
535 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ELECTRO &&
539 electro = (cvar("g_balance_electro_primary_damage")/cvar("g_balance_electro_primary_refire")*0.75)
540 * bound(0,(cvar("g_balance_electro_primary_speed")/distance*maxdelaytime),1)*1.0;
542 if (client_hasweapon(self, WEP_CRYLINK, TRUE, FALSE) ) // &&
543 // !( self.weapon == WEP_CRYLINK && time < self.bot_lastshot + cvar("g_balance_crylink_primary_refire") ))
544 crylink = (cvar("g_balance_crylink_primary_damage")/cvar("g_balance_crylink_primary_refire")*1.0)
545 * bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*(64/(32+cvar("g_balance_crylink_primary_spread")*distance))*1.0;
547 if (client_hasweapon(self, WEP_UZI, TRUE, FALSE) ) // &&
548 // !( self.weapon == WEP_UZI && time < self.bot_lastshot + cvar("g_balance_uzi_sustained_refire") ))
549 uzi = (cvar("g_balance_uzi_sustained_damage")/cvar("g_balance_uzi_sustained_refire")*1.0)
550 * bound(0,32/(32+cvar("g_balance_uzi_sustained_spread")*distance),1);
552 if (client_hasweapon(self, WEP_SHOTGUN, TRUE, FALSE) &&
553 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_SHOTGUN &&
557 shotgun = (cvar("g_balance_shotgun_primary_damage")*cvar("g_balance_shotgun_primary_bullets")/cvar("g_balance_shotgun_primary_refire")*1.0)
558 * bound(0,32/(32+cvar("g_balance_shotgun_primary_spread")*distance),1);
560 if (client_hasweapon(self, WEP_LASER, FALSE, FALSE) &&
561 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_LASER &&
565 laser = (cvar("g_balance_laser_primary_damage")/cvar("g_balance_laser_primary_refire")*1.0)
566 * bound(0,cvar("g_balance_laser_primary_speed")/distance*maxdelaytime,1);
568 if((self.enemy.flags & FL_ONGROUND)==FALSE){
569 rocket = rocket * (1.5-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius" ),0.9)); //slight bigger change
570 grenade = grenade * (1.5-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
571 electro = electro * (1.5-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius" ),0.95));
572 laser = laser * (1.5-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius" ),0.95));
575 dprint("Floor distance: ",ftos(distancefromfloor),"\n");
576 dprint("Rocket: " , ftos(rocket ), "\n");
577 dprint("Nex: " , ftos(nex ), "\n");
578 dprint("Hagar: " , ftos(hagar ), "\n");
579 dprint("Grenade: ", ftos(grenade ), "\n");
580 dprint("Electro: ", ftos(electro ), "\n");
581 dprint("Crylink: ", ftos(crylink ), "\n");
582 dprint("Uzi: " , ftos(uzi ), "\n");
583 dprint("Shotgun :", ftos(shotgun ), "\n");
584 dprint("Laser :", ftos(laser ), "\n\n");
587 w = WEP_MINSTANEX ;s = minstanex;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
588 w = WEP_ROCKET_LAUNCHER ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
589 w = WEP_NEX ;s = nex ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
590 w = WEP_HAGAR ;s = hagar ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
591 w = WEP_GRENADE_LAUNCHER ;s = grenade ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
592 w = WEP_ELECTRO ;s = electro ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
593 w = WEP_CRYLINK ;s = crylink ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
594 w = WEP_UZI ;s = uzi ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
595 w = WEP_SHOTGUN ;s = shotgun ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
596 w = WEP_LASER ;s = laser ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
598 // switch if the best weapon would provide a significant damage increase
599 if (bestscore > currentscore*1.5){
600 self.switchweapon = bestweapon;
602 // buys time for detonating the rocket. not tested yet
603 if ( cvar("bot_ai_weapon_combo") && bestweapon == WEP_ROCKET_LAUNCHER )
604 self.bot_chooseweapontime += (distance / cvar("g_balance_rocketlauncher_speed"));
611 local vector selfvel, enemyvel;
612 if(self.flags & FL_INWATER)
614 if (time < self.nextaim)
616 self.nextaim = time + 0.1;
617 selfvel = self.velocity;
618 if (!self.waterlevel)
622 enemyvel = self.enemy.velocity;
623 if (!self.enemy.waterlevel)
625 lag_additem(time + self.ping, 0, 0, self.enemy, self.origin, selfvel, self.enemy.origin, enemyvel);
628 lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, self.goalcurrent.origin, '0 0 0');
633 if (bot_strategytoken == self)
634 if (!bot_strategytoken_taken)
636 self.havocbot_role();
637 // token has been used this frame
638 bot_strategytoken_taken = TRUE;
643 havocbot_chooseenemy();
644 if (self.bot_chooseweapontime < time )
646 self.bot_chooseweapontime = time + cvar("bot_ai_chooseweaponinterval");
647 havocbot_chooseweapon();
651 if (self.bot_aimtarg)
653 weapon_action(self.weapon, WR_AIM);
654 if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
656 self.BUTTON_ATCK = FALSE;
657 self.BUTTON_ATCK2 = FALSE;
660 else if (self.goalcurrent)
662 local vector now,v,next;//,heading;
663 local float distance,skillblend,distanceblend,blend;
664 next = now = self.goalcurrent.origin - (self.origin + self.view_ofs);
665 distance = vlen(now);
666 //heading = self.velocity;
667 //dprint(self.goalstack01.classname,etos(self.goalstack01),"\n");
668 if(self.goalstack01 != self && self.goalstack01 != world)
669 next = self.goalstack01.origin - (self.origin + self.view_ofs);
670 skillblend=bound(0,(skill-2.5)*0.5,1); //lower skill player can't preturn
671 distanceblend=bound(0,distance/cvar("bot_ai_keyboard_distance"),1);
672 blend = skillblend * (1-distanceblend);
673 //v = (now * (distanceblend) + next * (1-distanceblend)) * (skillblend) + now * (1-skillblend);
674 //v = now * (distanceblend) * (skillblend) + next * (1-distanceblend) * (skillblend) + now * (1-skillblend);
675 //v = now * ((1-skillblend) + (distanceblend) * (skillblend)) + next * (1-distanceblend) * (skillblend);
676 v = now + blend * (next - now);
677 //dprint(etos(self), " ");
678 //dprint(vtos(now), ":", vtos(next), "=", vtos(v), " (blend ", ftos(blend), ")\n");
679 //v = now * (distanceblend) + next * (1-distanceblend);
680 if (self.waterlevel < 2)
682 //dprint("walk at:", vtos(v), "\n");
683 //te_lightning2(world, self.origin, self.goalcurrent.origin);
686 havocbot_movetogoal();
689 void havocbot_setupbot()
691 self.bot_ai = havocbot_ai;
692 // will be updated by think code
693 //Generate some random skill levels
694 self.havocbot_keyboardskill=random()-0.5;
695 havocbot_chooserole();