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

  1. /*
  2. ==============================================================================
  3.  
  4. 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. // Bot_Precache - called by Worldspawn
  18. //=============================================================
  19. void () Bot_Precache =
  20. {
  21.     precache_model2 ("progs/enforcer.mdl");
  22.     precache_model2 ("progs/h_mega.mdl");
  23.  
  24.     precache_sound2 ("enforcer/death1.wav");
  25.     precache_sound2 ("enforcer/idle1.wav");
  26.     precache_sound2 ("enforcer/pain1.wav");
  27.     precache_sound2 ("enforcer/pain2.wav");
  28.     precache_sound2 ("enforcer/sight1.wav");
  29.     precache_sound2 ("enforcer/sight2.wav");
  30.     precache_sound2 ("enforcer/sight3.wav");
  31.     precache_sound2 ("enforcer/sight4.wav");
  32. };
  33.  
  34. //=============================================================
  35. // BotActivate - Activates the bot
  36. //=============================================================
  37. void () BotCreate =
  38. {
  39. // sounds and models precached in the world.qc file
  40.  
  41.     local entity    newbot;
  42.       local entity    spot;
  43.  
  44.     newbot = spawn();
  45.     newbot.solid = SOLID_SLIDEBOX;
  46.     newbot.movetype = MOVETYPE_STEP;
  47.  
  48.       newbot.netname = "DeathBot";
  49.     newbot.classname = "bot";
  50.     newbot.health = 150;
  51.       newbot.max_health = 300;
  52.       if (teamplay)
  53.         newbot.team = self.team;
  54.       newbot.frags = 0;
  55.       newbot.flags = FL_CLIENT;
  56.     newbot.takedamage = DAMAGE_AIM;
  57.       newbot.goalentity = self;
  58.       newbot.movetarget = self;
  59.       newbot.oldtarg = self;
  60.     newbot.pausetime = time + 1;
  61.     newbot.ideal_yaw = newbot.angles * '0 1 0';
  62.       newbot.yaw_speed = 60;
  63.       newbot.weapon = 1;
  64.       newbot.ammo_shells = 20;
  65.     newbot.view_ofs = '0 0 25';
  66.     newbot.th_stand = bot_stand1;
  67. //***********
  68.     newbot.th_walk = bot_runa1;
  69. //    newbot.th_walk = bot_walk1;
  70. //***********
  71.       newbot.th_stuff = bot_stuff1;
  72.     newbot.th_run = bot_run1;
  73.     newbot.th_pain = bot_pain;
  74.     newbot.th_die = bot_die;
  75.     newbot.th_missile = bot_atk1;
  76.     setmodel(newbot, "progs/enforcer.mdl");
  77.     setsize (newbot, '-16 -16 -24', '16 16 40');
  78.  
  79. //***********
  80.     newbot.fl_lead = FALSE;
  81. //***********
  82.  
  83. // BG Bot - begin select a spot to spawn bot
  84. // if not deathmatch or coop. starts bot in players starting point
  85.       spot = SelectSpawnPoint ();
  86.  
  87.       newbot.origin = spot.origin + '0 0 1';
  88.       newbot.angles = spot.angles;
  89. // BG Bot - end select a spot to spawn bot
  90.  
  91.     spawn_tfog (newbot.origin);
  92.  
  93.       bprint("DeathBot created...\n");
  94.     
  95.     newbot.nextthink = time + 0.1;
  96.     newbot.think = newbot.th_stand;
  97. };
  98.