home *** CD-ROM | disk | FTP | other *** search
/ Quake 'em / QUAKEEM.BIN / quake / programs / friend4 / friend.pat next >
Encoding:
Text File  |  1996-08-09  |  19.0 KB  |  773 lines

  1. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/ai.qc friend/ai.qc
  2. --- v101qc/ai.qc    Thu Jul 25 01:51:22 1996
  3. +++ friend/ai.qc    Thu Aug  8 21:27:05 1996
  4. @@ -13,7 +13,7 @@
  5.  The next path spot to walk toward.  If .enemy, ignore .movetarget.
  6.  When an enemy is killed, the monster will try to return to it's path.
  7.  
  8. -.huntt_ime
  9. +.hunt_time
  10.  Set to time + something when the player is in sight, but movement straight for
  11.  him is blocked.  This causes the monster to use wall following code for
  12.  movement direction instead of sighting on the player.
  13. @@ -326,12 +326,23 @@
  14.          sight_entity_time = time;
  15.      }
  16.      
  17. -    self.show_hostile = time + 1;        // wake up other monsters
  18. +    if(self.enemy!=self.friend) 
  19. +        self.show_hostile = time + 1;    // wake up other monsters
  20.  
  21.      SightSound ();
  22.      HuntTarget ();
  23.  };
  24.  
  25. +void() FriendMove = 
  26. +{
  27. +    local float dir;
  28. +
  29. +    if(other != self.friend) return; // We don't want someone else pushing
  30. +    dir = vectoyaw(other.velocity);
  31. +    // dir_z = dir_z+1;
  32. +    walkmove(dir, 7);
  33. +};
  34. +
  35.  /*
  36.  ===========
  37.  FindTarget
  38. @@ -349,9 +360,11 @@
  39.  slower noticing monsters.
  40.  ============
  41.  */
  42. +void(entity newfriend) player_addfriend;
  43. +
  44.  float() FindTarget =
  45.  {
  46. -    local entity    client;
  47. +    local entity    client, oldself;
  48.      local float        r;
  49.  
  50.  // if the first spawnflag bit is set, the monster will only wake up on
  51. @@ -413,6 +426,15 @@
  52.          }
  53.      }
  54.      
  55. +    if(self.flags & FL_FRIENDLY || self.classname == "monster_dog" ) {
  56. +        self.touch=FriendMove;
  57. +        self.friend=self.enemy;
  58. +        oldself=self;
  59. +        self=self.friend;
  60. +        player_addfriend(oldself);
  61. +        self=oldself;
  62. +    }
  63. +
  64.      FoundTarget ();
  65.  
  66.      return TRUE;
  67. @@ -497,16 +519,27 @@
  68.  The monster is staying in one place for a while, with slight angle turns
  69.  =============
  70.  */
  71. +void() FriendMove;
  72.  void() ai_stand =
  73.  {
  74. +    local float r;
  75.      if (FindTarget ())
  76.          return;
  77.      
  78.      if (time > self.pausetime)
  79.      {
  80. -        self.th_walk ();
  81. +        if(self.friend) {
  82. +            self.touch=FriendMove; // Hack
  83. +            r=range(self.friend);
  84. +            if(r==RANGE_MELEE)
  85. +                return;
  86. +            else if(r==RANGE_MID)
  87. +                self.th_walk ();
  88. +            else
  89. +                self.th_run ();
  90. +        } else self.th_walk();
  91.          return;
  92. -    }
  93. +    } 
  94.      
  95.  // change angle slightly
  96.  
  97. @@ -677,12 +710,22 @@
  98.  void(float dist) ai_run =
  99.  {
  100.      local    vector    delta;
  101. +    local    float    test;
  102.      local    float    axis;
  103.      local    float    direct, ang_rint, ang_floor, ang_ceil;
  104.      
  105.      movedist = dist;
  106.  // see if the enemy is dead
  107. -    if (self.enemy.health <= 0)
  108. +    if (self.classname == "monster_dog"
  109. +        || self.classname == "monster_shambler"
  110. +        || self.classname == "monster_demon") 
  111. +        // Those guys are viscious
  112. +            test=1;
  113. +    else {
  114. +        test = (self.enemy.flags & FL_MONSTER) == FL_MONSTER;
  115. +        test = test + (self.enemy.classname == "player");
  116. +    }
  117. +    if (!test || self.enemy.health <= 0)
  118.      {
  119.          self.enemy = world;
  120.      // FIXME: look all around for other targets
  121. @@ -693,7 +736,14 @@
  122.          }
  123.          else
  124.          {
  125. -            if (self.movetarget)
  126. +            if (self.friend)
  127. +                if(self.friend.health > 0) {
  128. +                    self.enemy = self.friend;
  129. +                    HuntTarget();
  130. +                } else {
  131. +                    self.friend=world;
  132. +                }
  133. +            else if (self.movetarget)
  134.                  self.th_walk ();
  135.              else
  136.                  self.th_stand ();
  137. @@ -701,12 +751,24 @@
  138.          }
  139.      }
  140.  
  141. -    self.show_hostile = time + 1;        // wake up other monsters
  142.  
  143.  // check knowledge of enemy
  144.      enemy_vis = visible(self.enemy);
  145.      if (enemy_vis)
  146.          self.search_time = time + 5;
  147. +
  148. +// Okay, just find our friend
  149. +    if(self.enemy == self.friend) {
  150. +        // head straight in
  151. +        if(range(self.friend) == RANGE_MELEE) {
  152. +            self.pausetime=time+1;
  153. +            self.th_stand();
  154. +        } else
  155. +            movetogoal (dist);        // done in C code...
  156. +        return;
  157. +    }
  158. +        
  159. +    self.show_hostile = time + 1;        // wake up other monsters
  160.  
  161.  // look for other coop players
  162.      if (coop && self.search_time < time)
  163. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/client.qc friend/client.qc
  164. --- v101qc/client.qc    Thu Jul 25 01:51:22 1996
  165. +++ friend/client.qc    Fri Aug  9 20:45:23 1996
  166. @@ -2,7 +2,7 @@
  167.  // prototypes
  168.  void () W_WeaponFrame;
  169.  void() W_SetCurrentAmmo;
  170. -void() player_pain;
  171. +void(entity e, float f) player_pain;
  172.  void() player_stand1;
  173.  void (vector org) spawn_tfog;
  174.  void (vector org, entity death_owner) spawn_tdeath;
  175. @@ -57,7 +57,7 @@
  176.  
  177.  void() SetNewParms =
  178.  {
  179. -    parm1 = IT_SHOTGUN | IT_AXE;
  180. +    parm1 = IT_SHOTGUN | IT_AXE | IT_EXTRA_WEAPON;
  181.      parm2 = 100;
  182.      parm3 = 0;
  183.      parm4 = 25;
  184. @@ -466,6 +466,7 @@
  185.      self.invincible_finished = 0;
  186.      self.effects = 0;
  187.      self.invincible_time = 0;
  188. +    self.friendlist=world;
  189.  
  190.      DecodeLevelParms ();
  191.      
  192. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/combat.qc friend/combat.qc
  193. --- v101qc/combat.qc    Thu Jul 25 01:51:22 1996
  194. +++ friend/combat.qc    Thu Aug  1 21:54:38 1996
  195. @@ -149,7 +149,7 @@
  196.  
  197.  // check for godmode or invincibility
  198.      if (targ.flags & FL_GODMODE)
  199. -        return;
  200. +        take=0;
  201.      if (targ.invincible_finished >= time)
  202.      {
  203.          if (self.invincible_sound < time)
  204. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/defs.qc friend/defs.qc
  205. --- v101qc/defs.qc    Thu Jul 25 01:51:22 1996
  206. +++ friend/defs.qc    Thu Aug  1 21:54:38 1996
  207. @@ -240,6 +240,7 @@
  208.  float    FL_PARTIALGROUND        = 1024;    // not all corners are valid
  209.  float    FL_WATERJUMP            = 2048;    // player jumping out of water
  210.  float    FL_JUMPRELEASED            = 4096;    // for jump debouncing
  211. +float    FL_FRIENDLY            = 8192;
  212.  
  213.  // edict.movetype values
  214.  float    MOVETYPE_NONE            = 0;    // never moves
  215. @@ -690,4 +691,6 @@
  216.  
  217.  float(entity targ, entity inflictor) CanDamage;
  218.  
  219. -
  220. +.entity    friend;
  221. +.entity friendlist;
  222. +.entity    listitem;
  223. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/demon.qc friend/demon.qc
  224. --- v101qc/demon.qc    Thu Jul 25 01:51:22 1996
  225. +++ friend/demon.qc    Thu Aug  1 21:54:39 1996
  226. @@ -177,23 +177,8 @@
  227.  /*QUAKED monster_demon1 (1 0 0) (-32 -32 -24) (32 32 64) Ambush
  228.  
  229.  */
  230. -void() monster_demon1 =
  231. +void() _monster_demon1 =
  232.  {
  233. -    if (deathmatch)
  234. -    {
  235. -        remove(self);
  236. -        return;
  237. -    }
  238. -    precache_model ("progs/demon.mdl");
  239. -    precache_model ("progs/h_demon.mdl");
  240. -
  241. -    precache_sound ("demon/ddeath.wav");
  242. -    precache_sound ("demon/dhit2.wav");
  243. -    precache_sound ("demon/djump.wav");
  244. -    precache_sound ("demon/dpain1.wav");
  245. -    precache_sound ("demon/idle1.wav");
  246. -    precache_sound ("demon/sight2.wav");
  247. -
  248.      self.solid = SOLID_SLIDEBOX;
  249.      self.movetype = MOVETYPE_STEP;
  250.  
  251. @@ -213,6 +198,24 @@
  252.      walkmonster_start();
  253.  };
  254.  
  255. +void () monster_demon1 =
  256. +{
  257. +    if (deathmatch)
  258. +    {
  259. +        remove(self);
  260. +        return;
  261. +    }
  262. +    precache_model ("progs/demon.mdl");
  263. +    precache_model ("progs/h_demon.mdl");
  264. +
  265. +    precache_sound ("demon/ddeath.wav");
  266. +    precache_sound ("demon/dhit2.wav");
  267. +    precache_sound ("demon/djump.wav");
  268. +    precache_sound ("demon/dpain1.wav");
  269. +    precache_sound ("demon/idle1.wav");
  270. +    precache_sound ("demon/sight2.wav");
  271. +    _monster_demon1();
  272. +};
  273.  
  274.  /*
  275.  ==============================================================================
  276. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/dog.qc friend/dog.qc
  277. --- v101qc/dog.qc    Thu Jul 25 01:51:22 1996
  278. +++ friend/dog.qc    Thu Aug  1 21:54:39 1996
  279. @@ -327,22 +327,9 @@
  280.  /*QUAKED monster_dog (1 0 0) (-32 -32 -24) (32 32 40) Ambush
  281.  
  282.  */
  283. -void() monster_dog =
  284. -{
  285. -    if (deathmatch)
  286. -    {
  287. -        remove(self);
  288. -        return;
  289. -    }
  290. -    precache_model ("progs/h_dog.mdl");
  291. -    precache_model ("progs/dog.mdl");
  292. -
  293. -    precache_sound ("dog/dattack1.wav");
  294. -    precache_sound ("dog/ddeath.wav");
  295. -    precache_sound ("dog/dpain1.wav");
  296. -    precache_sound ("dog/dsight.wav");
  297. -    precache_sound ("dog/idle.wav");
  298.  
  299. +void() _monster_dog =
  300. +{
  301.      self.solid = SOLID_SLIDEBOX;
  302.      self.movetype = MOVETYPE_STEP;
  303.  
  304. @@ -360,4 +347,22 @@
  305.      self.th_missile = dog_leap1;
  306.  
  307.      walkmonster_start();
  308. +};
  309. +
  310. +void() monster_dog = {
  311. +    if (deathmatch)
  312. +    {
  313. +        remove(self);
  314. +        return;
  315. +    }
  316. +
  317. +    precache_model ("progs/h_dog.mdl");
  318. +    precache_model ("progs/dog.mdl");
  319. +
  320. +    precache_sound ("dog/dattack1.wav");
  321. +    precache_sound ("dog/ddeath.wav");
  322. +    precache_sound ("dog/dpain1.wav");
  323. +    precache_sound ("dog/dsight.wav");
  324. +    precache_sound ("dog/idle.wav");
  325. +    _monster_dog();
  326.  };
  327. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/llsubs.qc friend/llsubs.qc
  328. --- v101qc/llsubs.qc    Wed Dec 31 18:00:00 1969
  329. +++ friend/llsubs.qc    Thu Aug  1 21:54:39 1996
  330. @@ -0,0 +1,40 @@
  331. +entity(float size) SUB_Llinit =
  332. +{
  333. +    local float i=0;
  334. +    local entity head, current;
  335. +    head=world;
  336. +    while(i<size) {
  337. +        current=spawn();
  338. +        current.chain=head;
  339. +        head=current;
  340. +    }
  341. +    return head;
  342. +};
  343. +
  344. +        
  345. +entity(entity list, float index) SUB_Llaccess =
  346. +{
  347. +    local float i=0;
  348. +    local entity here;
  349. +    here=list;
  350. +    while(i<index&&here!=world) {
  351. +        here=here.chain;
  352. +    }
  353. +    return here.ent;
  354. +};
  355. +    
  356. +void(void (entity e) f, entity list) SUB_Lliter =
  357. +{
  358. +    while(list!=world) {
  359. +        f(list.ent);
  360. +        list=list.chain;
  361. +    }
  362. +};
  363. +
  364. +entity(float (entity e) f, entity list) SUB_Llfind =
  365. +{
  366. +    while(list!=world) {
  367. +        if (f(list.ent)) return list.ent;
  368. +        list=list.chain;
  369. +    }
  370. +};
  371. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/monsters.qc friend/monsters.qc
  372. --- v101qc/monsters.qc    Thu Jul 25 01:51:23 1996
  373. +++ friend/monsters.qc    Thu Aug  1 21:54:39 1996
  374. @@ -76,9 +76,15 @@
  375.      
  376.      if (!walkmove(0,0))
  377.      {
  378. -        dprint ("walkmonster in wall at: ");
  379. -        dprint (vtos(self.origin));
  380. -        dprint ("\n");
  381. +//        dprint ("walkmonster in wall at: ");
  382. +//        dprint (vtos(self.origin));
  383. +//        dprint ("\n");
  384. +        sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  385. +        ThrowGib ("progs/gib1.mdl", self.health);
  386. +        ThrowGib ("progs/gib2.mdl", self.health);
  387. +        ThrowGib ("progs/gib3.mdl", self.health);
  388. +        remove(self);
  389. +        return;
  390.      }
  391.      
  392.      self.takedamage = DAMAGE_AIM;
  393. @@ -145,9 +151,15 @@
  394.  
  395.      if (!walkmove(0,0))
  396.      {
  397. -        dprint ("flymonster in wall at: ");
  398. -        dprint (vtos(self.origin));
  399. -        dprint ("\n");
  400. +//        dprint ("flymonster in wall at: ");
  401. +//        dprint (vtos(self.origin));
  402. +//        dprint ("\n");
  403. +        sound (self, CHAN_VOICE, "player/udeath.wav", 1, ATTN_NORM);
  404. +        ThrowGib ("progs/gib1.mdl", self.health);
  405. +        ThrowGib ("progs/gib2.mdl", self.health);
  406. +        ThrowGib ("progs/gib3.mdl", self.health);
  407. +        remove(self);
  408. +        return;
  409.      }
  410.  
  411.      if (self.target)
  412. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/player.qc friend/player.qc
  413. --- v101qc/player.qc    Thu Jul 25 01:51:23 1996
  414. +++ friend/player.qc    Fri Aug  9 21:00:53 1996
  415. @@ -334,8 +334,44 @@
  416.  void()    player_axpain5 =    [    $axpain5,    player_axpain6    ] {};
  417.  void()    player_axpain6 =    [    $axpain6,    player_run    ] {};
  418.  
  419. -void() player_pain =
  420. +void(entity attacker, float take) player_pain =
  421.  {
  422. +    local entity list, previous, onefriend;
  423. +    local entity oldself;
  424. +
  425. +    list=self.friendlist;
  426. +    previous=world;
  427. +    while(list) {
  428. +dprint("a");
  429. +        onefriend=list.listitem;
  430. +        if(onefriend.friend!=self||onefriend.health <=0) {
  431. +            if(previous) {
  432. +dprint("b");
  433. +                previous.chain=list.chain;
  434. +                remove(list);
  435. +                list=previous.chain;
  436. +            } else {
  437. +dprint("c");
  438. +                self.friendlist=list.chain;
  439. +                remove(list);
  440. +                list=self.friendlist;
  441. +            }
  442. +        } else {
  443. +            if(onefriend.enemy==onefriend.friend) {
  444. +dprint("d");
  445. +                onefriend.enemy=attacker;
  446. +                oldself=self;
  447. +                self=onefriend;
  448. +                FoundTarget();
  449. +                self=oldself;
  450. +            }
  451. +dprint("e");
  452. +            previous=list;
  453. +            list=list.chain;
  454. +        }
  455. +    }
  456. +dprint("f\n");
  457. +
  458.      if (self.weaponframe)
  459.          return;
  460.  
  461. @@ -589,6 +625,14 @@
  462.      self.nextthink = -1;
  463.  };
  464.  
  465. +void(entity e) player_addfriend = {
  466. +    local entity newfle;
  467. +    newfle=spawn();
  468. +    newfle.chain=self.friendlist;
  469. +    newfle.listitem=e;
  470. +    e.colormap=self.colormap; // Maybe
  471. +    self.friendlist=newfle;
  472. +};
  473.  
  474.  void()    player_diea1    =    [    $deatha1,    player_diea2    ] {};
  475.  void()    player_diea2    =    [    $deatha2,    player_diea3    ] {};
  476. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/shambler.qc friend/shambler.qc
  477. --- v101qc/shambler.qc    Thu Jul 25 01:51:24 1996
  478. +++ friend/shambler.qc    Thu Aug  1 21:54:40 1996
  479. @@ -326,6 +326,27 @@
  480.  
  481.  /*QUAKED monster_shambler (1 0 0) (-32 -32 -24) (32 32 64) Ambush
  482.  */
  483. +void() _monster_shambler =
  484. +{
  485. +
  486. +    self.solid = SOLID_SLIDEBOX;
  487. +    self.movetype = MOVETYPE_STEP;
  488. +    setmodel (self, "progs/shambler.mdl");
  489. +
  490. +    setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  491. +    self.health = 600;
  492. +
  493. +    self.th_stand = sham_stand1;
  494. +    self.th_walk = sham_walk1;
  495. +    self.th_run = sham_run1;
  496. +    self.th_die = sham_die;
  497. +    self.th_melee = sham_melee;
  498. +    self.th_missile = sham_magic1;
  499. +    self.th_pain = sham_pain;
  500. +    
  501. +    walkmonster_start();
  502. +};
  503. +
  504.  void() monster_shambler =
  505.  {
  506.      if (deathmatch)
  507. @@ -347,21 +368,5 @@
  508.      precache_sound ("shambler/melee1.wav");
  509.      precache_sound ("shambler/melee2.wav");
  510.      precache_sound ("shambler/smack.wav");
  511. -
  512. -    self.solid = SOLID_SLIDEBOX;
  513. -    self.movetype = MOVETYPE_STEP;
  514. -    setmodel (self, "progs/shambler.mdl");
  515. -
  516. -    setsize (self, VEC_HULL2_MIN, VEC_HULL2_MAX);
  517. -    self.health = 600;
  518. -
  519. -    self.th_stand = sham_stand1;
  520. -    self.th_walk = sham_walk1;
  521. -    self.th_run = sham_run1;
  522. -    self.th_die = sham_die;
  523. -    self.th_melee = sham_melee;
  524. -    self.th_missile = sham_magic1;
  525. -    self.th_pain = sham_pain;
  526. -    
  527. -    walkmonster_start();
  528. +    _monster_shambler();
  529.  };
  530. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/soldier.qc friend/soldier.qc
  531. --- v101qc/soldier.qc    Thu Jul 25 01:51:24 1996
  532. +++ friend/soldier.qc    Thu Aug  1 21:54:40 1996
  533. @@ -242,13 +242,34 @@
  534.  
  535.  /*QUAKED monster_army (1 0 0) (-16 -16 -24) (16 16 40) Ambush
  536.  */
  537. -void() monster_army =
  538. +void() _monster_army =
  539.  {    
  540. +
  541. +    self.solid = SOLID_SLIDEBOX;
  542. +    self.movetype = MOVETYPE_STEP;
  543. +
  544. +    setmodel (self, "progs/soldier.mdl");
  545. +
  546. +    setsize (self, '-16 -16 -24', '16 16 40');
  547. +    self.health = 30;
  548. +
  549. +    self.th_stand = army_stand1;
  550. +    self.th_walk = army_walk1;
  551. +    self.th_run = army_run1;
  552. +    self.th_missile = army_atk1;
  553. +    self.th_pain = army_pain;
  554. +    self.th_die = army_die;
  555. +
  556. +    walkmonster_start ();
  557. +};
  558. +
  559. +void() monster_army = {
  560.      if (deathmatch)
  561.      {
  562.          remove(self);
  563.          return;
  564.      }
  565. +
  566.      precache_model ("progs/soldier.mdl");
  567.      precache_model ("progs/h_guard.mdl");
  568.      precache_model ("progs/gib1.mdl");
  569. @@ -263,22 +284,5 @@
  570.      precache_sound ("soldier/sight1.wav");
  571.  
  572.      precache_sound ("player/udeath.wav");        // gib death
  573. -
  574. -
  575. -    self.solid = SOLID_SLIDEBOX;
  576. -    self.movetype = MOVETYPE_STEP;
  577. -
  578. -    setmodel (self, "progs/soldier.mdl");
  579. -
  580. -    setsize (self, '-16 -16 -24', '16 16 40');
  581. -    self.health = 30;
  582. -
  583. -    self.th_stand = army_stand1;
  584. -    self.th_walk = army_walk1;
  585. -    self.th_run = army_run1;
  586. -    self.th_missile = army_atk1;
  587. -    self.th_pain = army_pain;
  588. -    self.th_die = army_die;
  589. -
  590. -    walkmonster_start ();
  591. +    _monster_army();
  592.  };
  593. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/weapons.qc friend/weapons.qc
  594. --- v101qc/weapons.qc    Thu Jul 25 01:51:24 1996
  595. +++ friend/weapons.qc    Thu Aug  8 21:33:52 1996
  596. @@ -1152,6 +1152,99 @@
  597.      dprint ("quad cheat\n");
  598.  };
  599.  
  600. +void() _monster_dog;
  601. +void() _monster_army;
  602. +void() _monster_shambler;
  603. +void() _monster_demon1;
  604. +void(string model, float health) ThrowGib;
  605. +void() walkmonster_start_go;
  606. +void() walkmonster_start;
  607. +void() FriendMove;
  608. +
  609. +void() EggTouch =
  610. +{
  611. +    local entity oldself;
  612. +    oldself=self;
  613. +
  614. +    self=self.owner;
  615. +    player_addfriend(oldself);
  616. +    self=oldself;
  617. +
  618. +    self.touch=FriendMove;
  619. +    self.friend=self.enemy=self.movetarget=self.goalentity=self.owner;
  620. +    self.angles=self.owner.angles;
  621. +    self.owner=world;
  622. +    
  623. +    if(random()>0.3) {
  624. +        self.classname="monster_dog";
  625. +        self.origin = self.origin + '0 0 41';
  626. +        _monster_dog();
  627. +    } else if(random()<0.9) {
  628. +        self.classname="monster_army";
  629. +        self.origin = self.origin + '0 0 41';
  630. +        _monster_army();
  631. +    } else if(random()<0.6) {
  632. +        self.classname="monster_demon1";
  633. +        self.origin = self.origin + '0 0 64';
  634. +        _monster_demon1();
  635. +    } else {
  636. +        self.classname="monster_shambler";
  637. +        self.origin = self.origin + '0 0 64';
  638. +        _monster_shambler();
  639. +    }
  640. +
  641. +//    Testing purposes...
  642. +//    self.classname="monster_demon1";
  643. +//    self.origin = self.origin + '0 0 64';
  644. +//    _monster_demon1();
  645. +
  646. +    walkmonster_start_go();
  647. +    FoundTarget();
  648. +};
  649. +
  650. +void() SpawnFriendEgg =
  651. +{
  652. +    local    entity missile, mpuff;
  653. +    
  654. +    sound (self, CHAN_WEAPON, "player/lburn2.wav", 1, ATTN_NORM);
  655. +
  656. +    if(!(deathmatch || coop || (self.flags & FL_GODMODE)))
  657. +        T_Damage(self,self,self,50);
  658. +    self.punchangle_x = -2;
  659. +
  660. +    missile = spawn ();
  661. +    missile.owner = self;
  662. +    missile.movetype = MOVETYPE_BOUNCE;
  663. +    missile.solid = SOLID_BBOX;
  664. +    missile.classname = "grenade";
  665. +    missile.touch = EggTouch;
  666. +    missile.nextthink = time + 1;
  667. +    missile.think = EggTouch;
  668. +        
  669. +// set missile speed    
  670. +
  671. +    makevectors (self.v_angle);
  672. +
  673. +    if (self.v_angle_x)
  674. +        missile.velocity = v_forward*600 + v_up * 200 + crandom()*v_right*10 + crandom()*v_up*10;
  675. +    else
  676. +    {
  677. +        missile.velocity = aim(self, 10000);
  678. +        missile.velocity = missile.velocity * 600;
  679. +        missile.velocity_z = 200;
  680. +    }
  681. +
  682. +    missile.avelocity = '300 300 300';
  683. +
  684. +    missile.angles = vectoangles(missile.velocity);
  685. +    
  686. +    
  687. +// set missile duration
  688. +
  689. +    setmodel (missile, "progs/zom_gib.mdl");
  690. +    setsize (missile, '0 0 0', '0 0 0');        
  691. +    setorigin (missile, self.origin);
  692. +};
  693.  /*
  694.  ============
  695.  ImpulseCommands
  696. @@ -1170,6 +1263,8 @@
  697.      if (self.impulse == 11)
  698.          ServerflagsCommand ();
  699.  
  700. +    if (self.impulse == 250)
  701. +        SpawnFriendEgg ();
  702.      if (self.impulse == 255)
  703.          QuadCheat ();
  704.          
  705. diff -ur --new-file -x progs.dat -x progdefs.h -x *.bak -x *~ -x *.rej -x *.cfg -x *.sav v101qc/world.qc friend/world.qc
  706. --- v101qc/world.qc    Thu Jul 25 01:51:24 1996
  707. +++ friend/world.qc    Thu Aug  1 21:54:40 1996
  708. @@ -190,6 +190,64 @@
  709.      precache_sound ("misc/h2ohit1.wav");        // landing splash
  710.  
  711.  // setup precaches allways needed
  712. +
  713. +// Dog stuff
  714. +    precache_model ("progs/h_dog.mdl");
  715. +    precache_model ("progs/dog.mdl");
  716. +
  717. +    precache_sound ("dog/dattack1.wav");
  718. +    precache_sound ("dog/ddeath.wav");
  719. +    precache_sound ("dog/dpain1.wav");
  720. +    precache_sound ("dog/dsight.wav");
  721. +    precache_sound ("dog/idle.wav");
  722. +// End dog stuff 
  723. +
  724. +// Soldier stuff
  725. +    precache_model ("progs/soldier.mdl");
  726. +    precache_model ("progs/h_guard.mdl");
  727. +    precache_model ("progs/gib1.mdl");
  728. +    precache_model ("progs/gib2.mdl");
  729. +    precache_model ("progs/gib3.mdl");
  730. +
  731. +    precache_sound ("soldier/death1.wav");
  732. +    precache_sound ("soldier/idle.wav");
  733. +    precache_sound ("soldier/pain1.wav");
  734. +    precache_sound ("soldier/pain2.wav");
  735. +    precache_sound ("soldier/sattck1.wav");
  736. +    precache_sound ("soldier/sight1.wav");
  737. +
  738. +    precache_sound ("player/udeath.wav");        // gib death
  739. +// End of soldier stuff
  740. +
  741. +// Demon stuff
  742. +    precache_model ("progs/demon.mdl");
  743. +    precache_model ("progs/h_demon.mdl");
  744. +
  745. +    precache_sound ("demon/ddeath.wav");
  746. +    precache_sound ("demon/dhit2.wav");
  747. +    precache_sound ("demon/djump.wav");
  748. +    precache_sound ("demon/dpain1.wav");
  749. +    precache_sound ("demon/idle1.wav");
  750. +    precache_sound ("demon/sight2.wav");
  751. +// End of demon
  752. +
  753. +// Shambler
  754. +    precache_model ("progs/shambler.mdl");
  755. +    precache_model ("progs/s_light.mdl");
  756. +    precache_model ("progs/h_shams.mdl");
  757. +    precache_model ("progs/bolt.mdl");
  758. +    
  759. +    precache_sound ("shambler/sattck1.wav");
  760. +    precache_sound ("shambler/sboom.wav");
  761. +    precache_sound ("shambler/sdeath.wav");
  762. +    precache_sound ("shambler/shurt2.wav");
  763. +    precache_sound ("shambler/sidle.wav");
  764. +    precache_sound ("shambler/ssight.wav");
  765. +    precache_sound ("shambler/melee1.wav");
  766. +    precache_sound ("shambler/melee2.wav");
  767. +    precache_sound ("shambler/smack.wav");
  768. +// End of shambler
  769. +
  770.      precache_sound ("items/itembk2.wav");        // item respawn sound
  771.      precache_sound ("player/plyrjmp8.wav");        // player jump
  772.      precache_sound ("player/land.wav");            // player landing
  773.