home *** CD-ROM | disk | FTP | other *** search
/ Superpower (Alt) / SUPERPOWER.iso / q / patch / mbq111 / src / bot.qc < prev    next >
Encoding:
Text File  |  1996-09-03  |  2.7 KB  |  97 lines

  1. /*
  2. ==============================================================================
  3.  
  4. BG BOT
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. // Prototypes
  10.  
  11. void    ()        Bot_Precache;
  12. void    ()              BotCreate;
  13.  
  14. void (vector org) spawn_tfog;
  15.  
  16.  
  17. //=============================================================
  18. // Bot_Precache - called by Worldspawn
  19. //=============================================================
  20. void () Bot_Precache =
  21. {
  22. };
  23.  
  24.  
  25. //=============================================================
  26. // BotActivate - Activates the bot
  27. //=============================================================
  28. void () BotCreate =
  29. {
  30. // sounds and models precached in the world.qc file
  31.  
  32.     local entity    newbot;
  33.         local entity    spot;
  34.         local float     r;
  35.  
  36.         r = random ();
  37.     newbot = spawn();
  38.     newbot.solid = SOLID_SLIDEBOX;
  39.         newbot.movetype = MOVETYPE_STEP;
  40.  
  41. // BG Bot - Trying to get it to print Bot kills also in Rankings.
  42.         newbot.cl = "client";
  43.         newbot.netname = "BGBot";
  44.         newbot.classname = "bot";
  45.     newbot.health = 100;
  46.         newbot.max_health = 100;
  47.         if (teamplay)
  48.                 newbot.team = self.team;
  49.         newbot.frags = 0;
  50.         newbot.flags = FL_CLIENT;
  51. // Messing around with different stuff.
  52. //        if (r < 0.33)
  53. //                newbot.colormap = 2;
  54. //        else if (r > 0.66)
  55. //                newbot.colormap = 3;
  56. //        else
  57. //                newbot.colormap = 4;
  58.         newbot.colormap = self.colormap;
  59.     newbot.takedamage = DAMAGE_AIM;
  60.         newbot.goalentity = self;
  61.         newbot.movetarget = self;
  62.         newbot.pausetime = 0;
  63.         newbot.deadflag = DEAD_NO;
  64.     newbot.ideal_yaw = newbot.angles * '0 1 0';
  65.         newbot.yaw_speed = 60;
  66.         newbot.show_hostile = 0;
  67.         newbot.weapon = 1;
  68.         newbot.effects = 0;
  69.         newbot.ammo_shells = 50;
  70.     newbot.view_ofs = '0 0 25';
  71.     newbot.th_stand = bot_stand1;
  72.     newbot.th_walk = bot_walk1;
  73.         newbot.th_stuff = bot_stuff1;
  74.     newbot.th_run = bot_run1;
  75.     newbot.th_pain = bot_pain;
  76.     newbot.th_die = bot_die;
  77.     newbot.th_missile = bot_atk1;
  78.         setmodel (newbot, "progs/player.mdl");
  79.         setsize (newbot, VEC_HULL_MIN, VEC_HULL_MAX);
  80.  
  81. // BG Bot - begin select a spot to spawn bot
  82. // if not deathmatch or coop. starts bot in players starting points
  83.         spot = SelectSpawnPoint ();
  84.  
  85.         newbot.origin = spot.origin + '0 0 1';
  86.         newbot.angles = spot.angles;
  87. // BG Bot - end select a spot to spawn bot
  88.  
  89.     spawn_tfog (newbot.origin);
  90.  
  91.         bprint("bot created\n");
  92.     
  93.     newbot.nextthink = time + 0.1;
  94.     newbot.think = newbot.th_stand;
  95. };
  96.  
  97.