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) < 1.5)
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 + cvar("bot_ai_facingwall_timeout");
258 if(!self.ignoregoaltime)
259 self.facingwalltime = 0;
261 if(time > self.ignoregoaltime)
263 self.ignoregoal = world;
264 self.ignoregoaltime = 0;
268 // Check for water/slime/lava and edges
269 if(trace_fraction == 1){
270 traceline(dst_ahead , dst_down, TRUE, world);
271 // te_lightning2(world, self.origin, dst_ahead); // Draw "ahead" look
272 s = pointcontents(trace_endpos + '0 0 1');
273 if (s != CONTENT_SOLID)
274 if (s == CONTENT_LAVA || s == CONTENT_SLIME)
275 evadelava = normalize(self.velocity) * -1;
276 else if (s == CONTENT_SKY)
277 evadeobstacle = normalize(self.velocity) * -1;
278 else if (tracebox_hits_trigger_hurt(dst_ahead, self.mins, self.maxs, trace_endpos))
280 // te_lightning2(world, dst_ahead, dst_down); // Draw "downwards" look
281 // if ain't a safe goal with "holes" (like the soylent jumpad)
282 if(!boxesoverlap(dst_ahead - self.view_ofs + self.mins, dst_ahead - self.view_ofs + self.maxs,
283 self.goalcurrent.absmin, self.goalcurrent.absmax))
285 // Remove dangerous dynamic goals from stack
286 if (self.goalcurrent.classname == "player" || self.goalcurrent.classname == "droppedweapon")
287 navigation_poproute();
290 evadeobstacle = normalize(self.velocity) * -1;
299 makevectors(self.v_angle_y * '0 1 0');
302 dodge = havocbot_dodge();
303 dodge = dodge * bound(0,3+skill*0.1,1);
304 evadelava = evadelava * bound(1,3-skill,3); //Noobs fear lava a lot and take more distance from it
305 traceline(self.origin, self.enemy.origin, TRUE, world);
306 if(trace_ent.classname == "player")
307 dir = dir * bound(0,skill/7,1);
309 dir = normalize(dir + dodge + evadeobstacle + evadelava);
310 // self.bot_dodgevector = dir;
311 // self.bot_dodgevector_jumpbutton = self.BUTTON_JUMP;
314 //dir = self.bot_dodgevector;
315 //if (self.bot_dodgevector_jumpbutton)
316 // self.BUTTON_JUMP = 1;
318 self.movement_x = dir * v_forward * maxspeed;
319 self.movement_y = dir * v_right * maxspeed;
320 self.movement_z = dir * v_up * maxspeed;
322 // Emulate keyboard interface
324 havocbot_keyboard_movement(destorg);
326 if ((dir * v_up) >= cvar("sv_jumpvelocity")*0.5 && (self.flags & FL_ONGROUND)) self.BUTTON_JUMP=1;
327 if (((dodge * v_up) > 0) && random()*frametime >= 0.2*bound(0,(10-skill)*0.1,1)) self.BUTTON_JUMP=TRUE;
328 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);
331 .float havocbot_chooseenemy_finished;
332 .float havocbot_stickenemy;
333 void havocbot_chooseenemy()
335 local entity head, best;
336 local float rating, bestrating;
338 if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
345 if (!bot_shouldattack(self.enemy))
347 // enemy died or something, find a new target
349 self.havocbot_chooseenemy_finished = time;
351 else if (self.havocbot_stickenemy)
353 // tracking last chosen enemy
354 // if enemy is visible
355 // and not really really far away
356 // and we're not severely injured
357 // then keep tracking for a half second into the future
358 traceline(self.origin+self.view_ofs, self.enemy.origin+self.enemy.view_ofs*0.5,FALSE,world);
359 if (trace_ent == self.enemy || trace_fraction == 1)
360 if (vlen(self.enemy.origin - self.origin) < 1000)
361 if (self.health > 30)
363 // remain tracking him for a shot while (case he went after a small corner or pilar
364 self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
367 // enemy isn't visible, or is far away, or we're injured severely
368 // so stop preferring this enemy
369 // (it will still take a half second until a new one is chosen)
370 self.havocbot_stickenemy = 0;
373 if (time < self.havocbot_chooseenemy_finished)
375 self.havocbot_chooseenemy_finished = time + cvar("bot_ai_enemydetectioninterval");
376 eye = (self.origin + self.view_ofs);
378 bestrating = 100000000;
379 head = findchainfloat(bot_attack, TRUE);
382 v = (head.absmin + head.absmax) * 0.5;
383 rating = vlen(v - eye);
384 if (bestrating > rating)
385 if (bot_shouldattack(head))
387 traceline(eye, v, TRUE, self);
388 if (trace_ent == head || trace_fraction >= 1)
397 self.havocbot_stickenemy = TRUE;
400 .float bot_chooseweapontime;
401 float(entity e) w_getbestweapon;
402 void havocbot_chooseweapon()
404 // TODO: clean this up by moving it to weapon code
405 if(self.enemy.classname!="player")
407 self.switchweapon = w_getbestweapon(self);
412 local float rocket ; rocket =-1000;
413 local float nex ; nex =-1000;
414 local float hagar ; hagar =-1000;
415 local float grenade ; grenade =-1000;
416 local float electro ; electro =-1000;
417 local float crylink ; crylink =-1000;
418 local float uzi ; uzi =-1000;
419 local float shotgun ; shotgun =-1000;
420 local float campingrifle ; campingrifle =-1000;
421 local float laser ; laser =-1000;
422 local float minstanex ; minstanex =-1000;
423 local float currentscore;
424 local float bestscore; bestscore = 0;
425 local float bestweapon; bestweapon=self.switchweapon;
426 local float distance; distance=bound(10,vlen(self.origin-self.enemy.origin)-200,10000);
427 local float maxdelaytime=0.5;
428 local float spreadpenalty=10;
429 local float distancefromfloor;
431 local float af, ct, combo_time;
433 traceline(self.enemy.origin,self.enemy.origin-'0 0 1000',TRUE,world);
434 distancefromfloor = self.enemy.origin_z - trace_endpos_z;
436 af = ATTACK_FINISHED(self);
437 ct = cvar("bot_ai_weapon_combo_threshold");
439 // Bots with no skill will be 4 times more slower than "godlike" bots when doing weapon combos
440 // Ideally this 4 should be calculated as longest_weapon_refire / bot_ai_weapon_combo_threshold
441 combo_time = time + ct + (ct * ((-0.3*skill)+3));
443 // Custom weapon list based on distance to the enemy
444 local float i; i = 0;
445 if(bot_custom_weapon){
447 // Choose weapons for far distance
448 if ( distance > bot_distance_far ) {
449 for(i=0; i < WEP_LAST && bot_weapons_far[i] != -1 ; ++i){
450 w = bot_weapons_far[i];
451 if ( client_hasweapon(self, w, TRUE, FALSE) ){
452 if ( self.weapon == w){
453 if( cvar("bot_ai_weapon_combo") && af > combo_time)
456 self.switchweapon = w;
463 // Choose weapons for mid distance
464 if ( distance > bot_distance_close ) {
465 for(i=0; i < WEP_LAST && bot_weapons_mid[i] != -1 ; ++i){
466 w = bot_weapons_mid[i];
467 if ( client_hasweapon(self, w, TRUE, FALSE) ){
468 if ( self.weapon == w){
469 if( cvar("bot_ai_weapon_combo") && af > combo_time)
472 self.switchweapon = w;
479 // Choose weapons for close distance
480 for(i=0; i < WEP_LAST && bot_weapons_close[i] != -1 ; ++i){
481 w = bot_weapons_close[i];
482 if ( client_hasweapon(self, w, TRUE, FALSE) ){
483 if ( self.weapon == w){
484 if( cvar("bot_ai_weapon_combo") && af > combo_time)
487 self.switchweapon = w;
492 // If now weapon was chosen by this system fall back to the previous one
496 // (Damage/Sec * Weapon spefic change to get that damage)
497 // *(Time to get to target * weapon specfic hitchange bonus) / (in a time of maxdelaytime)
498 // *(Spread change of hit) // if it applies
499 // *(Penality for target beeing in air)
501 if (client_hasweapon(self, WEP_MINSTANEX, TRUE, FALSE))
502 minstanex = (1000/cvar("g_balance_minstanex_refire")*1.0)
505 if (client_hasweapon(self, WEP_ROCKET_LAUNCHER, TRUE, FALSE) &&
506 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ROCKET_LAUNCHER &&
510 rocket = (cvar("g_balance_rocketlauncher_damage")/cvar("g_balance_rocketlauncher_refire")*0.75)
511 * bound(0,(cvar("g_balance_rocketlauncher_speed")/distance*maxdelaytime),1)*1.5;
513 if (client_hasweapon(self, WEP_NEX, TRUE, FALSE) &&
514 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_NEX &&
518 nex = (cvar("g_balance_nex_damage")/cvar("g_balance_nex_refire")*1.0)
521 if (client_hasweapon(self, WEP_HAGAR, TRUE, FALSE) ) // &&
522 // !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_HAGAR && time < self.bot_lastshot + cvar("g_balance_hagar_primary_refire") ))
523 hagar = (cvar("g_balance_hagar_primary_damage")/cvar("g_balance_hagar_primary_refire")*1.0)
524 * bound(0,(cvar("g_balance_hagar_primary_speed")/distance*maxdelaytime),1)*0.2;
526 if (client_hasweapon(self, WEP_GRENADE_LAUNCHER, TRUE, FALSE) &&
528 cvar("bot_ai_weapon_combo") && self.weapon == WEP_GRENADE_LAUNCHER &&
532 grenade = (cvar("g_balance_grenadelauncher_primary_damage")/cvar("g_balance_grenadelauncher_primary_refire")*1.0)
533 * bound(0,(cvar("g_balance_grenadelauncher_primary_speed")/distance*maxdelaytime),1)*1.1;
535 if (client_hasweapon(self, WEP_ELECTRO, TRUE, FALSE) &&
536 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_ELECTRO &&
540 electro = (cvar("g_balance_electro_primary_damage")/cvar("g_balance_electro_primary_refire")*0.75)
541 * bound(0,(cvar("g_balance_electro_primary_speed")/distance*maxdelaytime),1)*1.0;
543 if (client_hasweapon(self, WEP_CRYLINK, TRUE, FALSE) ) // &&
544 // !( self.weapon == WEP_CRYLINK && time < self.bot_lastshot + cvar("g_balance_crylink_primary_refire") ))
545 crylink = (cvar("g_balance_crylink_primary_damage")/cvar("g_balance_crylink_primary_refire")*1.0)
546 * bound(0,(cvar("g_balance_crylink_primary_speed")/distance*maxdelaytime),1)*(64/(32+cvar("g_balance_crylink_primary_spread")*distance))*1.0;
548 if (client_hasweapon(self, WEP_UZI, TRUE, FALSE) ) // &&
549 // !( self.weapon == WEP_UZI && time < self.bot_lastshot + cvar("g_balance_uzi_sustained_refire") ))
550 uzi = (cvar("g_balance_uzi_sustained_damage")/cvar("g_balance_uzi_sustained_refire")*1.0)
551 * bound(0,32/(32+cvar("g_balance_uzi_sustained_spread")*distance),1);
553 if (client_hasweapon(self, WEP_SHOTGUN, TRUE, FALSE) &&
554 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_SHOTGUN &&
558 shotgun = (cvar("g_balance_shotgun_primary_damage")*cvar("g_balance_shotgun_primary_bullets")/cvar("g_balance_shotgun_primary_refire")*1.0)
559 * bound(0,32/(32+cvar("g_balance_shotgun_primary_spread")*distance),1);
561 if (client_hasweapon(self, WEP_LASER, FALSE, FALSE) &&
562 !( cvar("bot_ai_weapon_combo") && self.weapon == WEP_LASER &&
566 laser = (cvar("g_balance_laser_primary_damage")/cvar("g_balance_laser_primary_refire")*1.0)
567 * bound(0,cvar("g_balance_laser_primary_speed")/distance*maxdelaytime,1);
569 if((self.enemy.flags & FL_ONGROUND)==FALSE){
570 rocket = rocket * (1.5-bound(0, distancefromfloor/cvar("g_balance_rocketlauncher_radius" ),0.9)); //slight bigger change
571 grenade = grenade * (1.5-bound(0,distancefromfloor/cvar("g_balance_grenadelauncher_primary_radius"),0.95));
572 electro = electro * (1.5-bound(0,distancefromfloor/cvar("g_balance_electro_primary_radius" ),0.95));
573 laser = laser * (1.5-bound(0,distancefromfloor/cvar("g_balance_laser_primary_radius" ),0.95));
576 dprint("Floor distance: ",ftos(distancefromfloor),"\n");
577 dprint("Rocket: " , ftos(rocket ), "\n");
578 dprint("Nex: " , ftos(nex ), "\n");
579 dprint("Hagar: " , ftos(hagar ), "\n");
580 dprint("Grenade: ", ftos(grenade ), "\n");
581 dprint("Electro: ", ftos(electro ), "\n");
582 dprint("Crylink: ", ftos(crylink ), "\n");
583 dprint("Uzi: " , ftos(uzi ), "\n");
584 dprint("Shotgun :", ftos(shotgun ), "\n");
585 dprint("Laser :", ftos(laser ), "\n\n");
588 w = WEP_MINSTANEX ;s = minstanex;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
589 w = WEP_ROCKET_LAUNCHER ;s = rocket ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
590 w = WEP_NEX ;s = nex ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
591 w = WEP_HAGAR ;s = hagar ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
592 w = WEP_GRENADE_LAUNCHER ;s = grenade ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
593 w = WEP_ELECTRO ;s = electro ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
594 w = WEP_CRYLINK ;s = crylink ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
595 w = WEP_UZI ;s = uzi ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
596 w = WEP_SHOTGUN ;s = shotgun ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
597 w = WEP_LASER ;s = laser ;if (s > bestscore){bestscore = s;bestweapon = w;} if (self.switchweapon == w) currentscore = s;
599 // switch if the best weapon would provide a significant damage increase
600 if (bestscore > currentscore*1.5){
601 self.switchweapon = bestweapon;
603 // buys time for detonating the rocket. not tested yet
604 if ( cvar("bot_ai_weapon_combo") && bestweapon == WEP_ROCKET_LAUNCHER )
605 self.bot_chooseweapontime += (distance / cvar("g_balance_rocketlauncher_speed"));
612 local vector selfvel, enemyvel;
613 if(self.flags & FL_INWATER)
615 if (time < self.nextaim)
617 self.nextaim = time + 0.1;
618 selfvel = self.velocity;
619 if (!self.waterlevel)
623 enemyvel = self.enemy.velocity;
624 if (!self.enemy.waterlevel)
626 lag_additem(time + self.ping, 0, 0, self.enemy, self.origin, selfvel, self.enemy.origin, enemyvel);
629 lag_additem(time + self.ping, 0, 0, world, self.origin, selfvel, self.goalcurrent.origin, '0 0 0');
634 if (bot_strategytoken == self)
635 if (!bot_strategytoken_taken)
637 self.havocbot_role();
638 // token has been used this frame
639 bot_strategytoken_taken = TRUE;
644 havocbot_chooseenemy();
645 if (self.bot_chooseweapontime < time )
647 self.bot_chooseweapontime = time + cvar("bot_ai_chooseweaponinterval");
648 havocbot_chooseweapon();
652 if (self.bot_aimtarg)
654 weapon_action(self.weapon, WR_AIM);
655 if (cvar("bot_nofire") || IS_INDEPENDENT_PLAYER(self))
657 self.BUTTON_ATCK = FALSE;
658 self.BUTTON_ATCK2 = FALSE;
661 else if (self.goalcurrent)
663 local vector now,v,next;//,heading;
664 local float distance,skillblend,distanceblend,blend;
665 next = now = self.goalcurrent.origin - (self.origin + self.view_ofs);
666 distance = vlen(now);
667 //heading = self.velocity;
668 //dprint(self.goalstack01.classname,etos(self.goalstack01),"\n");
669 if(self.goalstack01 != self && self.goalstack01 != world)
670 next = self.goalstack01.origin - (self.origin + self.view_ofs);
671 skillblend=bound(0,(skill-2.5)*0.5,1); //lower skill player can't preturn
672 distanceblend=bound(0,distance/cvar("bot_ai_keyboard_distance"),1);
673 blend = skillblend * (1-distanceblend);
674 //v = (now * (distanceblend) + next * (1-distanceblend)) * (skillblend) + now * (1-skillblend);
675 //v = now * (distanceblend) * (skillblend) + next * (1-distanceblend) * (skillblend) + now * (1-skillblend);
676 //v = now * ((1-skillblend) + (distanceblend) * (skillblend)) + next * (1-distanceblend) * (skillblend);
677 v = now + blend * (next - now);
678 //dprint(etos(self), " ");
679 //dprint(vtos(now), ":", vtos(next), "=", vtos(v), " (blend ", ftos(blend), ")\n");
680 //v = now * (distanceblend) + next * (1-distanceblend);
681 if (self.waterlevel < 2)
683 //dprint("walk at:", vtos(v), "\n");
684 //te_lightning2(world, self.origin, self.goalcurrent.origin);
687 havocbot_movetogoal();
690 void havocbot_setupbot()
692 self.bot_ai = havocbot_ai;
693 // will be updated by think code
694 //Generate some random skill levels
695 self.havocbot_keyboardskill=random()-0.5;
696 havocbot_chooserole();