Guest User

tarbaby SMC-5.4

a guest
Jan 28th, 2017
136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2. ==============================================================================
  3.  
  4. BLOB
  5.  
  6. ==============================================================================
  7. */
  8.  
  9. $cd /raid/quake/id1/models/tarbaby
  10. $origin 0 0 24
  11. $base base
  12.  
  13. //$skin skin
  14. $skin base
  15. $skin skin2
  16. $skin skin
  17.  
  18. $frame walk1 walk2 walk3 walk4 walk5 walk6 walk7 walk8 walk9 walk10
  19. $frame walk11 walk12 walk13 walk14 walk15 walk16 walk17 walk18 walk19
  20. $frame walk20 walk21 walk22 walk23 walk24 walk25
  21.  
  22. $frame run1 run2 run3 run4 run5 run6 run7 run8 run9 run10 run11 run12 run13
  23. $frame run14 run15 run16 run17 run18 run19 run20 run21 run22 run23
  24. $frame run24 run25
  25.  
  26. $frame jump1 jump2 jump3 jump4 jump5 jump6
  27.  
  28. $frame fly1 fly2 fly3 fly4
  29.  
  30. $frame exp
  31.  
  32. void() tbaby_stand1 =[ $walk1, tbaby_stand1 ] {ai_stand();};
  33.  
  34. void() tbaby_hang1 =[ $walk1, tbaby_hang1 ] {ai_stand();};
  35.  
  36. void() tbaby_walk1 =[ $walk1, tbaby_walk2 ] {ai_turn();};
  37. void() tbaby_walk2 =[ $walk2, tbaby_walk3 ] {ai_turn();};
  38. void() tbaby_walk3 =[ $walk3, tbaby_walk4 ] {ai_turn();};
  39. void() tbaby_walk4 =[ $walk4, tbaby_walk5 ] {ai_turn();};
  40. void() tbaby_walk5 =[ $walk5, tbaby_walk6 ] {ai_turn();};
  41. void() tbaby_walk6 =[ $walk6, tbaby_walk7 ] {ai_turn();};
  42. void() tbaby_walk7 =[ $walk7, tbaby_walk8 ] {ai_turn();};
  43. void() tbaby_walk8 =[ $walk8, tbaby_walk9 ] {ai_turn();};
  44. void() tbaby_walk9 =[ $walk9, tbaby_walk10 ] {ai_turn();};
  45. void() tbaby_walk10 =[ $walk10, tbaby_walk11 ] {ai_turn();};
  46. void() tbaby_walk11 =[ $walk11, tbaby_walk12 ] {ai_walk(2);};
  47. void() tbaby_walk12 =[ $walk12, tbaby_walk13 ] {ai_walk(2);};
  48. void() tbaby_walk13 =[ $walk13, tbaby_walk14 ] {ai_walk(2);};
  49. void() tbaby_walk14 =[ $walk14, tbaby_walk15 ] {ai_walk(2);};
  50. void() tbaby_walk15 =[ $walk15, tbaby_walk16 ] {ai_walk(2);};
  51. void() tbaby_walk16 =[ $walk16, tbaby_walk17 ] {ai_walk(2);};
  52. void() tbaby_walk17 =[ $walk17, tbaby_walk18 ] {ai_walk(2);};
  53. void() tbaby_walk18 =[ $walk18, tbaby_walk19 ] {ai_walk(2);};
  54. void() tbaby_walk19 =[ $walk19, tbaby_walk20 ] {ai_walk(2);};
  55. void() tbaby_walk20 =[ $walk20, tbaby_walk21 ] {ai_walk(2);};
  56. void() tbaby_walk21 =[ $walk21, tbaby_walk22 ] {ai_walk(2);};
  57. void() tbaby_walk22 =[ $walk22, tbaby_walk23 ] {ai_walk(2);};
  58. void() tbaby_walk23 =[ $walk23, tbaby_walk24 ] {ai_walk(2);};
  59. void() tbaby_walk24 =[ $walk24, tbaby_walk25 ] {ai_walk(2);};
  60. void() tbaby_walk25 =[ $walk25, tbaby_walk1 ] {ai_walk(2);};
  61.  
  62. void() tbaby_run1 =[ $run1, tbaby_run2 ] {ai_face();};
  63. void() tbaby_run2 =[ $run2, tbaby_run3 ] {ai_face();};
  64. void() tbaby_run3 =[ $run3, tbaby_run4 ] {ai_face();};
  65. void() tbaby_run4 =[ $run4, tbaby_run5 ] {ai_face();};
  66. void() tbaby_run5 =[ $run5, tbaby_run6 ] {ai_face();};
  67. void() tbaby_run6 =[ $run6, tbaby_run7 ] {ai_face();};
  68. void() tbaby_run7 =[ $run7, tbaby_run8 ] {ai_face();};
  69. void() tbaby_run8 =[ $run8, tbaby_run9 ] {ai_face();};
  70. void() tbaby_run9 =[ $run9, tbaby_run10 ] {ai_face();};
  71. void() tbaby_run10 =[ $run10, tbaby_run11 ] {ai_face();};
  72. void() tbaby_run11 =[ $run11, tbaby_run12 ] {ai_run(2);};
  73. void() tbaby_run12 =[ $run12, tbaby_run13 ] {ai_run(2);};
  74. void() tbaby_run13 =[ $run13, tbaby_run14 ] {ai_run(2);};
  75. void() tbaby_run14 =[ $run14, tbaby_run15 ] {ai_run(2);};
  76. void() tbaby_run15 =[ $run15, tbaby_run16 ] {ai_run(2);};
  77. void() tbaby_run16 =[ $run16, tbaby_run17 ] {ai_run(2);};
  78. void() tbaby_run17 =[ $run17, tbaby_run18 ] {ai_run(2);};
  79. void() tbaby_run18 =[ $run18, tbaby_run19 ] {ai_run(2);};
  80. void() tbaby_run19 =[ $run19, tbaby_run20 ] {ai_run(2);};
  81. void() tbaby_run20 =[ $run20, tbaby_run21 ] {ai_run(2);};
  82. void() tbaby_run21 =[ $run21, tbaby_run22 ] {ai_run(2);};
  83. void() tbaby_run22 =[ $run22, tbaby_run23 ] {ai_run(2);};
  84. void() tbaby_run23 =[ $run23, tbaby_run24 ] {ai_run(2);};
  85. void() tbaby_run24 =[ $run24, tbaby_run25 ] {ai_run(2);};
  86. void() tbaby_run25 =[ $run25, tbaby_run1 ] {ai_run(2);};
  87.  
  88.  
  89. //============================================================================
  90.  
  91.  
  92. void() tbaby_jump1;
  93.  
  94. void() Tar_JumpTouch =
  95. {
  96. local float ldmg;
  97.  
  98. if (other.takedamage && other.classname != self.classname)
  99. {
  100. if ( vlen(self.velocity) > 400 )
  101. {
  102. var float autocvar_tarbaby_size_influenced_attack = 0; // set cvar 'tarbaby_size_influenced_attack' default to 0
  103. if (autocvar_tarbaby_size_influenced_attack == 1) // if 'tarbaby_size_influenced_attack' is set via autoexec.cfg to '1' raise monster´s attack values according to its size
  104. ldmg = (autocvar_tarbaby_jump * self.scale) + 10*random(); // default 10
  105. else
  106. ldmg = autocvar_tarbaby_jump + 10*random(); // default 10
  107. T_Damage (other, self, self, ldmg);
  108. sound (self, CHAN_WEAPON, "blob/hit1.wav", 1, ATTN_NORM);
  109. }
  110. }
  111. else
  112. sound (self, CHAN_WEAPON, "blob/land1.wav", 1, ATTN_NORM);
  113.  
  114.  
  115. if (!checkbottom(self))
  116. {
  117. if (self.flags & FL_ONGROUND)
  118. { // jump randomly to not get hung up
  119. //dprint ("popjump\n");
  120. self.touch = SUB_Null;
  121. self.think = tbaby_run1;
  122. self.movetype = MOVETYPE_STEP;
  123. self.nextthink = time + 0.1;
  124.  
  125. // self.velocity_x = (random() - 0.5) * 600;
  126. // self.velocity_y = (random() - 0.5) * 600;
  127. // self.velocity_z = 200;
  128. // self.flags = self.flags - FL_ONGROUND;
  129. }
  130. if (self.origin == self.old_origin)
  131. {
  132. self.touch = SUB_Null;
  133. self.flags = self.flags & FL_ONGROUND;
  134. makevectors (self.angles);
  135. self.velocity = (v_forward * (random() - 0.5) * 500) + '0 0 200';
  136. self.think = tbaby_jump1;
  137. self.nextthink = time + 0.2;
  138. }
  139. self.old_origin = self.origin;
  140. return; // not on ground yet
  141. }
  142.  
  143. self.touch = SUB_Null;
  144. self.think = tbaby_jump1;
  145. self.nextthink = time + 0.1;
  146. };
  147.  
  148. void() tbaby_jump5;
  149.  
  150. void() tbaby_fly1 =[ $fly1, tbaby_fly2 ] {};
  151. void() tbaby_fly2 =[ $fly2, tbaby_fly3 ] {};
  152. void() tbaby_fly3 =[ $fly3, tbaby_fly4 ] {};
  153. void() tbaby_fly4 =[ $fly4, tbaby_fly1 ] {
  154. self.cnt = self.cnt + 1;
  155. if (self.cnt == 4)
  156. {
  157. //dprint ("spawn hop\n");
  158. tbaby_jump5 ();
  159. }
  160. };
  161.  
  162. void() tbaby_jump1 =[ $jump1, tbaby_jump2 ] {ai_face();self.colormod = '1 1 1.3';};
  163. void() tbaby_jump2 =[ $jump2, tbaby_jump3 ] {ai_face();self.colormod = '1 1 1.6';};
  164. void() tbaby_jump3 =[ $jump3, tbaby_jump4 ] {ai_face();self.colormod = '1 1 1.9';};
  165. void() tbaby_jump4 =[ $jump4, tbaby_jump5 ] {ai_face();self.colormod = '1 1 2.1';};
  166. void() tbaby_jump5 =[ $jump5, tbaby_jump6 ]
  167. {
  168. self.movetype = MOVETYPE_BOUNCE;
  169. self.touch = Tar_JumpTouch;
  170. makevectors (self.angles);
  171. self.origin_z = self.origin_z + 1;
  172. self.velocity = v_forward * 600 + '0 0 200';
  173. self.velocity_z = self.velocity_z + random()*150;
  174. if (self.flags & FL_ONGROUND)
  175. self.flags = self.flags - FL_ONGROUND;
  176. self.cnt = 0;
  177. };
  178. void() tbaby_jump6 =[ $jump6,tbaby_fly1 ] {self.colormod = '1 1 2.5';};
  179.  
  180.  
  181.  
  182. //=============================================================================
  183.  
  184. void() tbaby_die1 =[ $exp, tbaby_die2 ] {
  185. gibbed_monsters = gibbed_monsters + 1;
  186. self.takedamage = DAMAGE_NO;
  187. };
  188. void() tbaby_die2 =[ $exp, tbaby_run1 ]
  189. {
  190. var float autocvar_tarbaby_size_influenced_attack = 0; // set cvar 'tarbaby_size_influenced_attack' default to 0
  191. if (autocvar_tarbaby_size_influenced_attack == 1) // if 'tarbaby_size_influenced_attack' is set via autoexec.cfg to '1' raise monster´s attack values according to its size
  192. T_RadiusDamage (self, self, autocvar_tarbaby_explode * self.scale, world); // default 120
  193. else
  194. T_RadiusDamage (self, self, autocvar_tarbaby_explode, world); // default 120
  195.  
  196. sound (self, CHAN_VOICE, "blob/death1.wav", 1, ATTN_NORM);
  197. self.origin = self.origin - 8*normalize(self.velocity);
  198.  
  199. WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
  200. WriteByte (MSG_BROADCAST, TE_TAREXPLOSION);
  201. WriteCoord (MSG_BROADCAST, self.origin_x);
  202. WriteCoord (MSG_BROADCAST, self.origin_y);
  203. WriteCoord (MSG_BROADCAST, self.origin_z);
  204.  
  205. BecomeExplosion ();
  206. };
  207.  
  208. //=============================================================================
  209. void() tbaby_mitosis;
  210.  
  211. void() tbaby_checknew =
  212. {
  213. if (!walkmove(0,0))
  214. {
  215. remove(self);
  216. return;
  217. }
  218.  
  219. self.enemy = self.enemy;
  220. self.th_stand = tbaby_stand1;
  221. self.th_walk = tbaby_walk1;
  222. self.th_run = tbaby_run1;
  223. self.th_missile = tbaby_jump1;
  224. self.th_melee = tbaby_jump1;
  225. self.th_die = tbaby_die1;
  226. self.origin_z = self.origin_z + 1; // raise off floor a bit
  227. droptofloor();
  228.  
  229. if (!walkmove(0,0))
  230. {
  231. self.owner.th_pain = tbaby_mitosis;
  232. remove(self);
  233. return;
  234. }
  235.  
  236. self.takedamage = DAMAGE_AIM;
  237. self.ideal_yaw = self.angles * '0 1 0';
  238. if (!self.yaw_speed)
  239. self.yaw_speed = 20;
  240. self.view_ofs = '0 0 25';
  241. self.use = monster_use;
  242. self.flags = self.flags | FL_MONSTER;
  243. self.pausetime = 99999999;
  244. self.th_stand ();
  245. self.nextthink = self.nextthink + random()*0.5;
  246.  
  247. total_monsters = total_monsters + 1;
  248.  
  249.  
  250. WriteByte (MSG_BROADCAST, SVC_UPDATESTAT);
  251. WriteByte (MSG_BROADCAST, STAT_TOTALMONSTERS);
  252. WriteLong (MSG_BROADCAST, total_monsters);
  253. };
  254.  
  255. void() tbaby_mitosis =
  256. {
  257. local entity newSpawn;
  258.  
  259. if ( random() < 0.35 )
  260. {
  261. newSpawn = spawn();
  262. newSpawn.classname = self.classname;
  263. newSpawn.movetype = MOVETYPE_STEP;
  264. setsize (newSpawn, '-16 -16 -24', '16 16 40');
  265. newSpawn.health = 80;
  266. if (self.skin == 1)
  267. newSpawn.health = 60;
  268. else if (self.skin == 2)
  269. newSpawn.health = 100;
  270.  
  271. newSpawn.owner = self;
  272. self.th_pain = SUB_Null;
  273.  
  274. setmodel (newSpawn, "progs/tarbaby.mdl");
  275. newSpawn.solid = SOLID_SLIDEBOX;
  276. newSpawn.skin = self.skin;
  277.  
  278. setorigin (newSpawn, self.origin);
  279. newSpawn.think = tbaby_checknew;
  280. newSpawn.nextthink = time + 0.5;
  281.  
  282. sound (newSpawn, CHAN_VOICE, "blob/mytosis.wav", 1, ATTN_NORM);
  283. }
  284. };
  285.  
  286. /*QUAKED monster_tarbaby (1 0 0) (-16 -16 -24) (16 16 24) Ambush Blue Green Spots
  287. The Spawn (and hellspawn)
  288.  
  289. The spawn type is random by default.
  290. If you want a specific type, select "Blue", "Green", or "Spots".
  291. */
  292. void() monster_tarbaby =
  293. {
  294. local float myRand;
  295. local float skillLevel;
  296.  
  297. if (deathmatch)
  298. {
  299. remove(self);
  300. return;
  301. }
  302. precache_model2 ("progs/tarbaby.mdl");
  303.  
  304. precache_sound2 ("blob/death1.wav");
  305. precache_sound2 ("blob/hit1.wav");
  306. precache_sound2 ("blob/land1.wav");
  307. precache_sound2 ("blob/sight1.wav");
  308. precache_sound2 ("blob/mytosis.wav");
  309.  
  310. self.solid = SOLID_SLIDEBOX;
  311. self.movetype = MOVETYPE_STEP;
  312.  
  313. var float autocvar_tarbabymultiskin = 0; // set cvar 'tarbabymultiskin' default to 0
  314. local float zufall;
  315. if (autocvar_tarbabymultiskin == 1) // if 'tarbabymultiskin' is set via autoexec.cfg to '1' use 2 different skins for ID1 model
  316. {
  317. self.multiskin = 1;
  318. setmodel (self, "progs/tarbaby.mdl");
  319. zufall = random();
  320. if (zufall >= 0.5)
  321. {
  322. self.skin = 0;
  323. self.monsterskin = 0;
  324. self.monstermodel = 0;
  325. }
  326. else
  327. {
  328. self.skin = 1;
  329. self.monsterskin = 1;
  330. self.monstermodel = 0;
  331. }
  332. }
  333. else if (autocvar_tarbabymultiskin == 2) // if 'tarbabymultiskin' is set via autoexec.cfg to '2' use 1 Id1 model skin AND external model
  334. {
  335. self.multiskin = 2;
  336. precache_model ("progs/tarbaby1.mdl");
  337. zufall = random();
  338. if (zufall >= 0.5)
  339. {
  340. setmodel (self, "progs/tarbaby.mdl");
  341. self.skin = 0;
  342. self.monsterskin = 0;
  343. self.monstermodel = 0;
  344. }
  345. else
  346. {
  347. setmodel (self, "progs/tarbaby1.mdl");
  348. self.skin = 0;
  349. self.monsterskin = 0;
  350. self.monstermodel = 1;
  351. }
  352. }
  353. else if (autocvar_tarbabymultiskin == 3) // if 'tarbabymultiskin' is set via autoexec.cfg to '3' use 2 Id1 model skins AND external model
  354. {
  355. self.multiskin = 3;
  356. precache_model ("progs/tarbaby1.mdl");
  357. zufall = random();
  358. if (zufall > 0.66)
  359. {
  360. setmodel (self, "progs/tarbaby.mdl");
  361. self.skin = 0;
  362. self.monsterskin = 0;
  363. self.monstermodel = 0;
  364. }
  365. else if (zufall < 0.34)
  366. {
  367. setmodel (self, "progs/tarbaby.mdl");
  368. self.skin = 1;
  369. self.monsterskin = 1;
  370. self.monstermodel = 0;
  371. }
  372. else
  373. {
  374. setmodel (self, "progs/tarbaby1.mdl");
  375. self.skin = 0;
  376. self.monsterskin = 0;
  377. self.monstermodel = 1;
  378. }
  379. }
  380. else if (autocvar_tarbabymultiskin == 4) // if 'tarbabymultiskin' is set via autoexec.cfg to '4' use 2 Id1 model skins AND 2 external model skins
  381. {
  382. self.multiskin = 4;
  383. precache_model ("progs/tarbaby1.mdl");
  384. zufall = random();
  385. if (zufall > 0.75)
  386. {
  387. setmodel (self, "progs/tarbaby.mdl");
  388. self.skin = 0;
  389. self.monsterskin = 0;
  390. self.monstermodel = 0;
  391. }
  392. else if (zufall > 0.5 && zufall <= 0.75)
  393. {
  394. setmodel (self, "progs/tarbaby.mdl");
  395. self.skin = 1;
  396. self.monsterskin = 1;
  397. self.monstermodel = 0;
  398. }
  399. else if (zufall > 0.25 && zufall <= 0.5)
  400. {
  401. setmodel (self, "progs/tarbaby1.mdl");
  402. self.skin = 0;
  403. self.monsterskin = 0;
  404. self.monstermodel = 1;
  405. }
  406. else
  407. {
  408. setmodel (self, "progs/tarbaby1.mdl");
  409. self.skin = 1;
  410. self.monsterskin = 1;
  411. self.monstermodel = 1;
  412. }
  413. }
  414. else // standard Quake
  415. {
  416. setmodel (self, "progs/tarbaby.mdl");
  417. self.skin = 0;
  418. self.monsterskin = 0;
  419. self.monstermodel = 0;
  420. }
  421.  
  422. var float autocvar_tarbaby_size = 3; // set cvar 'tarbaby_size' default to 3
  423. local float zuffa;
  424. if (autocvar_tarbaby_size == 1) // if 'tarbaby_size' is set via autoexec.cfg to '1' give monster random size between 100% and 114% (7% steps due to DP´s .scale restrictions)
  425. {
  426. zuffa = random(); // je 7% um ca. 1.7 größer (bei 24er Ausgangs bbox Mitte)
  427. if (zuffa <= 0.33) // 1.07 ==> -25.7 1.14 ==> -27.4
  428. { // 1.07 ==> -25 1.14 ==> -27
  429. self.scale = 1.14;
  430. setsize (self, '-16 -16 -24' - '0 0 3', '16 16 40' - '0 0 3');
  431. }
  432. else if (zuffa <= 0.66)
  433. {
  434. self.scale = 1.07;
  435. setsize (self, '-16 -16 -24' - '0 0 1', '16 16 40' - '0 0 1');
  436. }
  437. else
  438. {
  439. self.scale = 1;
  440. setsize (self, '-16 -16 -24', '16 16 40');
  441. }
  442. }
  443. else if (autocvar_tarbaby_size == 2) // if 'tarbaby_size' is set via autoexec.cfg to '2' give monster random size between 100% and 121% (7% steps due to DP´s .scale restrictions)
  444. {
  445. zuffa = random(); // je 7% um ca. 1.7 größer (bei 24er Ausgangs bbox Mitte)
  446. if (zuffa <= 0.25) // 1.07 ==> -25.7 1.14 ==> -27.4 1.21 ==> 29
  447. { // 1.07 ==> -25 1.14 ==> -27 1.21 ==> 29
  448. self.scale = 1.21;
  449. setsize (self, '-16 -16 -24' - '0 0 5', '16 16 40' - '0 0 5');
  450. }
  451. else if (zuffa <= 0.5)
  452. {
  453. self.scale = 1.14;
  454. setsize (self, '-16 -16 -24' - '0 0 3', '16 16 40' - '0 0 3');
  455. }
  456. else if (zuffa <= 0.75)
  457. {
  458. self.scale = 1.07;
  459. setsize (self, '-16 -16 -24' - '0 0 1', '16 16 40' - '0 0 1');
  460. }
  461. else
  462. {
  463. self.scale = 1;
  464. setsize (self, '-16 -16 -24', '16 16 40');
  465. }
  466. }
  467. else if (autocvar_tarbaby_size == 3) // if 'tarbaby_size' is set via autoexec.cfg to '3' give monster random size between 100% and 128% (7% steps due to DP´s .scale restrictions)
  468. {
  469. zuffa = random(); // je 7% um ca. 1.7 größer (bei 24er Ausgangs bbox Mitte)
  470. if (zuffa <= 0.2) // 1.07 ==> -25.7 1.14 ==> -27.4 1.21 ==> 29 1.28 ==> 31
  471. { // 1.07 ==> -25 1.14 ==> -27 1.21 ==> 29 1.28 ==> 31
  472. self.scale = 1.28;
  473. setsize (self, '-16 -16 -24' - '0 0 7', '16 16 40' - '0 0 7');
  474. }
  475. else if (zuffa <= 0.4)
  476. {
  477. self.scale = 1.21;
  478. setsize (self, '-16 -16 -24' - '0 0 5', '16 16 40' - '0 0 5');
  479. }
  480. else if (zuffa <= 0.6)
  481. {
  482. self.scale = 1.14;
  483. setsize (self, '-16 -16 -24' - '0 0 3', '16 16 40' - '0 0 3');
  484. }
  485. else if (zuffa <= 0.8)
  486. {
  487. self.scale = 1.07;
  488. setsize (self, '-16 -16 -24' - '0 0 1', '16 16 40' - '0 0 1');
  489. }
  490. else
  491. {
  492. self.scale = 1;
  493. setsize (self, '-16 -16 -24', '16 16 40');
  494. }
  495. }
  496. else if (autocvar_tarbaby_size == 4) // if 'tarbaby_size' is set via autoexec.cfg to '4' give monster random size between 100% and 135% (7% steps due to DP´s .scale restrictions)
  497. {
  498. zuffa = random(); // je 7% um ca. 1.7 größer (bei 24er Ausgangs bbox Mitte)
  499. if (zuffa <= 0.17) // 1.07 ==> -25.7 1.14 ==> -27.4 1.21 ==> 29.1 1.28 ==> 30.8 1.35 ==> 32.5
  500. { // 1.07 ==> -25 1.14 ==> -27 1.21 ==> 29 1.28 ==> 31 1.35 ==> 33
  501. self.scale = 1.35;
  502. setsize (self, '-16 -16 -24' - '0 0 9', '16 16 40' - '0 0 9');
  503. }
  504. else if (zuffa <= 0.34)
  505. {
  506. self.scale = 1.28;
  507. setsize (self, '-16 -16 -24' - '0 0 7', '16 16 40' - '0 0 7');
  508. }
  509. else if (zuffa <= 0.5)
  510. {
  511. self.scale = 1.21;
  512. setsize (self, '-16 -16 -24' - '0 0 5', '16 16 40' - '0 0 5');
  513. }
  514. else if (zuffa <= 0.67)
  515. {
  516. self.scale = 1.14;
  517. setsize (self, '-16 -16 -24' - '0 0 3', '16 16 40' - '0 0 3');
  518. }
  519. else if (zuffa <= 0.84)
  520. {
  521. self.scale = 1.07;
  522. setsize (self, '-16 -16 -24' - '0 0 1', '16 16 40' - '0 0 1');
  523. }
  524. else
  525. {
  526. self.scale = 1;
  527. setsize (self, '-16 -16 -24', '16 16 40');
  528. }
  529. }
  530. else if (autocvar_tarbaby_size > 4) // if 'tarbaby_size' is set via autoexec.cfg to a value bigger than '4' give monster the selected fixed size ==> 100% + [value]% (7% steps due to DP´s .scale restrictions)
  531. {
  532. if (autocvar_tarbaby_size > 40)
  533. self.origin = self.origin + '0 0 10'; // might get stuck in floor otherwise. --> drop him to floor from higher position !
  534. self.scale = 1 + (autocvar_tarbaby_size * 0.01);
  535. self.sizefactor_x = 0;
  536. self.sizefactor_y = 0;
  537. self.sizefactor_z = autocvar_tarbaby_size * 0.25;
  538. setsize (self, '-16 -16 -24' - self.sizefactor, '16 16 40' - self.sizefactor);
  539. }
  540. else
  541. {
  542. self.scale = 1;
  543. setsize (self, '-16 -16 -24', '16 16 40');
  544. }
  545.  
  546. self.th_stand = tbaby_stand1;
  547. self.th_walk = tbaby_walk1;
  548. self.th_run = tbaby_run1;
  549. self.th_missile = tbaby_jump1;
  550. self.th_melee = tbaby_jump1;
  551. self.th_die = tbaby_die1;
  552.  
  553. if (self.spawnflags & 8)
  554. {
  555. self.th_pain = tbaby_mitosis;
  556. self.skin = 2;
  557. self.health = 100;
  558. }
  559. else if (self.spawnflags & 4)
  560. {
  561. self.th_pain = tbaby_mitosis;
  562. self.skin = 1;
  563. self.health = 60;
  564. }
  565. else if (self.spawnflags & 2)
  566. {
  567. self.skin = 0;
  568. }
  569. else
  570. {
  571. skillLevel = cvar ( "skill" );
  572. myRand = skillLevel * 0.2;
  573. myRand = myRand + random();
  574.  
  575. if (myRand > 0.8 && skillLevel > 1)
  576. {
  577. self.th_pain = tbaby_mitosis;
  578. self.skin = 2;
  579. self.health = 100;
  580. }
  581. else if (myRand > 0.5)
  582. {
  583. self.th_pain = tbaby_mitosis;
  584. self.skin = 1;
  585. self.health = 60;
  586. }
  587. else
  588. {
  589. self.skin = 0;
  590. }
  591. }
  592.  
  593. var float autocvar_tarbaby_size_influenced_health = 0; // set cvar 'tarbaby_size_influenced_health' default to 0
  594. if (autocvar_tarbaby_size_influenced_health == 1) // if 'tarbaby_size_influenced_health' is set via autoexec.cfg to '1' raise monster´s health according to its size (use different formular for monsters with default health <100 and health >100 to be realistic/noticable)
  595. self.health = autocvar_tarbaby_health + ((self.scale - 1) * 100); // default: 80
  596. else
  597. self.health = autocvar_tarbaby_health; // default 80
  598. self.health_initial = self.health;
  599.  
  600. if (autocvar_monster_random_skin_color_alteration && autocvar_tarbaby_random_skin_colors) // modify/edit this monster types skin textures randomly (for higher variation in-game)
  601. { // limit values to avoid extreme colors
  602. self.colormod_x = random ();
  603. if (self.colormod_x < 0.5)
  604. self.colormod_x = self.colormod_x + 0.5;
  605. if (autocvar_monster_random_skin_color_alteration == 1) // only slight changes allowed
  606. {
  607. if (self.colormod_x < 0.75)
  608. self.colormod_x = self.colormod_x + 0.25;
  609. }
  610. else if (autocvar_monster_random_skin_color_alteration == 2) // moderate changes allowed
  611. {
  612. if (self.colormod_x < 0.65)
  613. self.colormod_x = self.colormod_x + 0.25;
  614. }
  615. else // stronger changes allowed
  616. {
  617. if (self.colormod_x < 0.55)
  618. self.colormod_x = self.colormod_x + 0.25;
  619. }
  620. self.colormod_y = random ();
  621. if (self.colormod_y < 0.5)
  622. self.colormod_y = self.colormod_y + 0.5;
  623. if (autocvar_monster_random_skin_color_alteration == 1) // only slight changes allowed
  624. {
  625. if (self.colormod_y < 0.75)
  626. self.colormod_y = self.colormod_y + 0.25;
  627. }
  628. else if (autocvar_monster_random_skin_color_alteration == 2) // moderate changes allowed
  629. {
  630. if (self.colormod_y < 0.65)
  631. self.colormod_y = self.colormod_y + 0.25;
  632. }
  633. else // stronger changes allowed
  634. {
  635. if (self.colormod_y < 0.55)
  636. self.colormod_y = self.colormod_y + 0.25;
  637. }
  638. self.colormod_z = random ();
  639. if (self.colormod_z < 0.5)
  640. self.colormod_z = self.colormod_z + 0.5;
  641. if (autocvar_monster_random_skin_color_alteration == 1) // only slight changes allowed
  642. {
  643. if (self.colormod_z < 0.75)
  644. self.colormod_z = self.colormod_z + 0.25;
  645. }
  646. else if (autocvar_monster_random_skin_color_alteration == 2) // moderate changes allowed
  647. {
  648. if (self.colormod_z < 0.65)
  649. self.colormod_z = self.colormod_z + 0.25;
  650. }
  651. else // stronger changes allowed
  652. {
  653. if (self.colormod_z < 0.55)
  654. self.colormod_z = self.colormod_z + 0.25;
  655. }
  656. }
  657.  
  658. self.alpha = autocvar_monstertransparency * 0.01;
  659.  
  660. if (autocvar_spider_replace_tarbaby) // if tarbaby shall be replaced by spider. Check the chance and do it !!)
  661. {
  662. local float replacer;
  663. replacer = autocvar_spider_replace_tarbaby * 0.01;
  664. if (random () <= replacer)
  665. {
  666. local vector check;
  667. check = (self.origin - ((VEC_HULL2_MIN + VEC_HULL2_MAX) * 0.5)) + '0 0 1';
  668. if (((pointcontents(check) == CONTENT_WATER) && (autocvar_spider_can_spawn_in_water)) || (pointcontents(check) != CONTENT_WATER)) // checks if monster is spawned in water. Spider is too small to be visible in shallow (not transparent) water, so better not change to spider.
  669. {
  670. self.skin = 3;
  671. self.health = autocvar_tarbaby_health; // default 80
  672. self.scale = 1;
  673. setsize (self, '-16 -16 -24', '16 16 40');
  674. self.nextthink = time + 0.3;
  675. self.think = SUB_Remove;
  676. monster_spider_start();
  677. return;
  678. }
  679. }
  680. }
  681.  
  682. if (autocvar_reiver_replace_tarbaby) // if tarbaby shall be replaced by reiver. Check the chance and do it !!)
  683. {
  684. local float replacez;
  685. replacez = autocvar_reiver_replace_tarbaby * 0.01;
  686. if (random () <= replacez)
  687. {
  688. self.health = autocvar_tarbaby_health; // default 80
  689. self.scale = 1;
  690. setsize (self, '-16 -16 -24', '16 16 40');
  691. self.nextthink = time + 0.3;
  692. self.think = SUB_Remove;
  693. monster_reiver_liftorigin_start();
  694. return;
  695. }
  696. }
  697.  
  698. if (autocvar_afrit_replace_tarbaby) // if tarbaby shall be replaced by afrit. Check the chance and do it !!)
  699. {
  700. local float replac;
  701. replac = autocvar_afrit_replace_tarbaby * 0.01;
  702. if (random () <= replac)
  703. {
  704. self.health = autocvar_tarbaby_health; // default 80
  705. self.scale = 1;
  706. setsize (self, '-16 -16 -24', '16 16 40');
  707. self.nextthink = time + 0.3;
  708. self.think = SUB_Remove;
  709. monster_afrit_liftorigin_start();
  710. return;
  711. }
  712. }
  713.  
  714. walkmonster_start ();
  715.  
  716. do_the_cloning();
  717.  
  718. if (autocvar_reiver_supports_tarbaby) // if reiver shall be spawned in ADDITION to an existing tarbaby. Check the chance and do it !!)
  719. {
  720. local float replacce;
  721. replacce = autocvar_reiver_supports_tarbaby * 0.01;
  722. if (random () <= replacce)
  723. add_reiver_support_walk ();
  724. }
  725.  
  726. if (autocvar_afrit_supports_tarbaby) // if afrit shall be spawned in ADDITION to an existing tarbaby. Check the chance and do it !!)
  727. {
  728. local float replace;
  729. replace = autocvar_afrit_supports_tarbaby * 0.01;
  730. if (random () <= replace)
  731. add_afrit_support_walk ();
  732. }
  733.  
  734. var float autocvar_tarbabymass = 2500;
  735. MonsterPhysics (self, autocvar_tarbabymass);
  736. };
RAW Paste Data