explosions.cs 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587
  1. datablock AudioProfile(bloodBurstSound1)
  2. {
  3. filename = "./sounds/headshot_tp_01.wav";
  4. description = AudioDefault3d;
  5. preload = true;
  6. };
  7. datablock AudioProfile(bloodBurstSound2)
  8. {
  9. filename = "./sounds/headshot_tp_02.wav";
  10. description = AudioDefault3d;
  11. preload = true;
  12. };
  13. datablock AudioProfile(bloodBurstSound3)
  14. {
  15. filename = "./sounds/headshot_tp_03.wav";
  16. description = AudioDefault3d;
  17. preload = true;
  18. };
  19. datablock AudioProfile(bloodBurstSound4)
  20. {
  21. filename = "./sounds/headshot_tp_04.wav";
  22. description = AudioDefault3d;
  23. preload = true;
  24. };
  25. datablock AudioProfile(bloodHitSound1)
  26. {
  27. filename = "./sounds/3p_bulletbodyimpact_03.wav";
  28. description = AudioDefault3d;
  29. preload = true;
  30. };
  31. datablock AudioProfile(bloodHitSound2)
  32. {
  33. filename = "./sounds/3p_bulletbodyimpact_04.wav";
  34. description = AudioDefault3d;
  35. preload = true;
  36. };
  37. datablock AudioProfile(bloodHitSound3)
  38. {
  39. filename = "./sounds/3p_bulletbodyimpact_05.wav";
  40. description = AudioDefault3d;
  41. preload = true;
  42. };
  43. datablock AudioProfile(bloodHitSound4)
  44. {
  45. filename = "./sounds/3p_bulletbodyimpact_06.wav";
  46. description = AudioDefault3d;
  47. preload = true;
  48. };
  49. datablock AudioProfile(rbloodDripSound1)
  50. {
  51. filename = "./sounds/rain_drip1.wav";
  52. description = audioClose3d;
  53. preload = true;
  54. };
  55. datablock AudioProfile(rbloodDripSound2)
  56. {
  57. filename = "./sounds/rain_drip2.wav";
  58. description = audioClose3d;
  59. preload = true;
  60. };
  61. datablock AudioProfile(rbloodDripSound3)
  62. {
  63. filename = "./sounds/rain_drip3.wav";
  64. description = audioClose3d;
  65. preload = true;
  66. };
  67. datablock AudioProfile(rbloodDripSound4)
  68. {
  69. filename = "./sounds/rain_drip4.wav";
  70. description = audioClose3d;
  71. preload = true;
  72. };
  73. $RBlood::HeavyHit0 = bloodBurstSound1;
  74. $RBlood::HeavyHit1 = bloodBurstSound2;
  75. $RBlood::HeavyHit2 = bloodBurstSound3;
  76. $RBlood::HeavyHit3 = bloodBurstSound4;
  77. $RBlood::smallHit0 = bloodHitSound1;
  78. $RBlood::smallHit1 = bloodHitSound2;
  79. $RBlood::smallHit2 = bloodHitSound3;
  80. $RBlood::smallHit3 = bloodHitSound4;
  81. $RBlood::smallDrop0 = rbloodDripSound1;
  82. $RBlood::smallDrop1 = rbloodDripSound2;
  83. $RBlood::smallDrop2 = rbloodDripSound3;
  84. $RBlood::smallDrop3 = rbloodDripSound4;
  85. // Ribcage Image
  86. datablock ShapeBaseImageData(RBloodRibcageImage)
  87. {
  88. shapeFile = "./ribcage.dts";
  89. emap = true;
  90. mountPoint = 2;
  91. offset = "0 0 -0.6";
  92. eyeOffset = "0 0 0.4";
  93. rotation = eulerToMatrix("0 0 0");
  94. scale = "1 1 1";
  95. doColorShift = true;
  96. colorShiftColor = "0.500 0.000 0.000 1.000";
  97. stateName[0] = "Ready";
  98. stateName[1] = "FireA";
  99. stateName[2] = "Done";
  100. stateTimeoutValue[0] = 0.01;
  101. stateTimeoutValue[1] = 20;
  102. stateTimeoutValue[2] = 0;
  103. stateTransitionOnTimeout[0] = "FireA";
  104. stateTransitionOnTimeout[1] = "Done";
  105. stateEmitter[1] = largeRBloodEmitter;
  106. stateEmitterTime[1] = 20;
  107. };
  108. // Head stub image
  109. datablock ShapeBaseImageData(RBloodHeadStumpImage)
  110. {
  111. shapeFile = "./stump_head.dts";
  112. emap = true;
  113. mountPoint = 2;
  114. offset = "0 0 0.025";
  115. eyeOffset = "0 0 0";
  116. rotation = eulerToMatrix("0 0 0");
  117. scale = "1 1 1";
  118. doColorShift = true;
  119. colorShiftColor = "0.500 0.000 0.000 1.000";
  120. stateName[0] = "Ready";
  121. stateName[1] = "FireA";
  122. stateName[2] = "Done";
  123. stateTimeoutValue[0] = 0.01;
  124. stateTimeoutValue[1] = 20;
  125. stateTimeoutValue[2] = 0;
  126. stateTransitionOnTimeout[0] = "FireA";
  127. stateTransitionOnTimeout[1] = "Done";
  128. stateEmitter[1] = largeRBloodEmitter;
  129. stateEmitterTime[1] = 20;
  130. stateEmitterNode[1] = "muzzleNode";
  131. };
  132. $RBlood_Stump0 = RBloodHeadStumpImage;
  133. datablock ShapeBaseImageData(RBloodChestStumpImage)
  134. {
  135. shapeFile = "./stump_chest.dts";
  136. emap = true;
  137. mountPoint = 2;
  138. offset = "0 0 0.025";
  139. eyeOffset = "0 0 0";
  140. rotation = eulerToMatrix("0 0 0");
  141. scale = "1 1 1";
  142. doColorShift = true;
  143. colorShiftColor = "0.500 0.000 0.000 1.000";
  144. stateName[0] = "Ready";
  145. stateName[1] = "FireA";
  146. stateName[2] = "Done";
  147. stateTimeoutValue[0] = 0.01;
  148. stateTimeoutValue[1] = 20;
  149. stateTimeoutValue[2] = 0;
  150. stateTransitionOnTimeout[0] = "FireA";
  151. stateTransitionOnTimeout[1] = "Done";
  152. stateEmitter[1] = largeRBloodEmitter;
  153. stateEmitterTime[1] = 20;
  154. stateEmitterNode[1] = "muzzleNode";
  155. };
  156. $RBlood_Stump1 = RBloodChestStumpImage;
  157. datablock ShapeBaseImageData(RBloodRArmStumpImage)
  158. {
  159. shapeFile = "./stump_rarm.dts";
  160. emap = true;
  161. mountPoint = 2;
  162. offset = "0 0 0.025";
  163. eyeOffset = "0 0 0";
  164. rotation = eulerToMatrix("0 0 0");
  165. scale = "1 1 1";
  166. doColorShift = true;
  167. colorShiftColor = "0.500 0.000 0.000 1.000";
  168. stateName[0] = "Ready";
  169. stateName[1] = "FireA";
  170. stateName[2] = "Done";
  171. stateTimeoutValue[0] = 0.01;
  172. stateTimeoutValue[1] = 20;
  173. stateTimeoutValue[2] = 0;
  174. stateTransitionOnTimeout[0] = "FireA";
  175. stateTransitionOnTimeout[1] = "Done";
  176. stateEmitter[1] = largeRBloodEmitter;
  177. stateEmitterTime[1] = 20;
  178. stateEmitterNode[1] = "muzzleNode";
  179. };
  180. $RBlood_Stump2 = RBloodRArmStumpImage;
  181. datablock ShapeBaseImageData(RBloodlarmStumpImage)
  182. {
  183. shapeFile = "./stump_larm.dts";
  184. emap = true;
  185. mountPoint = 2;
  186. offset = "0 0 0.025";
  187. eyeOffset = "0 0 0";
  188. rotation = eulerToMatrix("0 0 0");
  189. scale = "1 1 1";
  190. doColorShift = true;
  191. colorShiftColor = "0.500 0.000 0.000 1.000";
  192. stateName[0] = "Ready";
  193. stateName[1] = "FireA";
  194. stateName[2] = "Done";
  195. stateTimeoutValue[0] = 0.01;
  196. stateTimeoutValue[1] = 20;
  197. stateTimeoutValue[2] = 0;
  198. stateTransitionOnTimeout[0] = "FireA";
  199. stateTransitionOnTimeout[1] = "Done";
  200. stateEmitter[1] = largeRBloodEmitter;
  201. stateEmitterTime[1] = 20;
  202. stateEmitterNode[1] = "muzzleNode";
  203. };
  204. $RBlood_Stump3 = RBloodlarmStumpImage;
  205. datablock ShapeBaseImageData(RBloodllegStumpImage)
  206. {
  207. shapeFile = "./stump_lleg.dts";
  208. emap = true;
  209. mountPoint = 2;
  210. offset = "0 0 0.025";
  211. eyeOffset = "0 0 0";
  212. rotation = eulerToMatrix("0 0 0");
  213. scale = "1 1 1";
  214. doColorShift = true;
  215. colorShiftColor = "0.500 0.000 0.000 1.000";
  216. stateName[0] = "Ready";
  217. stateName[1] = "FireA";
  218. stateName[2] = "Done";
  219. stateTimeoutValue[0] = 0.01;
  220. stateTimeoutValue[1] = 20;
  221. stateTimeoutValue[2] = 0;
  222. stateTransitionOnTimeout[0] = "FireA";
  223. stateTransitionOnTimeout[1] = "Done";
  224. stateEmitter[1] = largeRBloodEmitter;
  225. stateEmitterTime[1] = 20;
  226. stateEmitterNode[1] = "muzzleNode";
  227. };
  228. $RBlood_Stump5 = RBloodllegStumpImage;
  229. datablock ShapeBaseImageData(RBloodrlegStumpImage)
  230. {
  231. shapeFile = "./stump_rleg.dts";
  232. emap = true;
  233. mountPoint = 2;
  234. offset = "0 0 0.025";
  235. eyeOffset = "0 0 0";
  236. rotation = eulerToMatrix("0 0 0");
  237. scale = "1 1 1";
  238. doColorShift = true;
  239. colorShiftColor = "0.500 0.000 0.000 1.000";
  240. stateName[0] = "Ready";
  241. stateName[1] = "FireA";
  242. stateName[2] = "Done";
  243. stateTimeoutValue[0] = 0.01;
  244. stateTimeoutValue[1] = 20;
  245. stateTimeoutValue[2] = 0;
  246. stateTransitionOnTimeout[0] = "FireA";
  247. stateTransitionOnTimeout[1] = "Done";
  248. stateEmitter[1] = largeRBloodEmitter;
  249. stateEmitterTime[1] = 20;
  250. stateEmitterNode[1] = "muzzleNode";
  251. };
  252. $RBlood_Stump4 = RBloodrlegStumpImage;
  253. // Debris
  254. datablock DebrisData(rBloodFootDebris)
  255. {
  256. emitters = smallBloodEmitter;
  257. shapeFile = "./shoe.dts";
  258. lifetime = 5.0;
  259. minSpinSpeed = -500.0;
  260. maxSpinSpeed = 500.0;
  261. elasticity = 0.2;
  262. friction = 0.8;
  263. numBounces = 2;
  264. staticOnMaxBounce = true;
  265. snapOnMaxBounce = false;
  266. fade = true;
  267. gravModifier = 1;
  268. };
  269. datablock DebrisData(rBloodHeadDebris)
  270. {
  271. emitters = largeRBloodEmitter;
  272. shapeFile = "./head.dts";
  273. lifetime = 5.0;
  274. minSpinSpeed = -500.0;
  275. maxSpinSpeed = 500.0;
  276. elasticity = 0.2;
  277. friction = 0.8;
  278. numBounces = 2;
  279. staticOnMaxBounce = true;
  280. snapOnMaxBounce = false;
  281. fade = true;
  282. gravModifier = 1;
  283. };
  284. datablock DebrisData(rBloodHandDebris)
  285. {
  286. emitters = smallBloodEmitter;
  287. shapeFile = "./hand.dts";
  288. lifetime = 5.0;
  289. minSpinSpeed = -500.0;
  290. maxSpinSpeed = 500.0;
  291. elasticity = 0.2;
  292. friction = 0.8;
  293. numBounces = 2;
  294. staticOnMaxBounce = true;
  295. snapOnMaxBounce = false;
  296. fade = true;
  297. gravModifier = 1;
  298. };
  299. datablock DebrisData(bloodBurstDebris)
  300. {
  301. emitters = smallBloodEmitter;
  302. shapeFile = "./cube.dts";
  303. lifetime = 5.0;
  304. minSpinSpeed = -5000.0;
  305. maxSpinSpeed = 5000.0;
  306. elasticity = 0.2;
  307. friction = 0.8;
  308. numBounces = 2;
  309. staticOnMaxBounce = true;
  310. snapOnMaxBounce = false;
  311. fade = true;
  312. gravModifier = 2;
  313. };
  314. datablock DebrisData(bloodChunkDebris)
  315. {
  316. emitters = smallBloodEmitter;
  317. shapeFile = "./chunk.dts";
  318. lifetime = 5.0;
  319. minSpinSpeed = -2000.0;
  320. maxSpinSpeed = 2000.0;
  321. elasticity = 0.2;
  322. friction = 0.8;
  323. numBounces = 2;
  324. staticOnMaxBounce = true;
  325. snapOnMaxBounce = false;
  326. fade = true;
  327. gravModifier = 2;
  328. };
  329. // Explosions
  330. datablock ExplosionData(bloodBurstFinalExplosion)
  331. {
  332. //explosionShape = "";
  333. lifeTimeMS = 1000;
  334. soundProfile = "";
  335. emitter[0] = bloodBurstSprinkleSmallEmitter;
  336. emitter[1] = "";
  337. particleEmitter = bloodBurstSmallEmitter;
  338. particleDensity = 5;
  339. particleRadius = 0.2;
  340. debris = bloodBurstDebris;
  341. debrisNum = 5;
  342. debrisNumVariance = 0;
  343. debrisPhiMin = 0;
  344. debrisPhiMax = 360;
  345. debrisThetaMin = 0;
  346. debrisThetaMax = 180;
  347. debrisVelocity = 5;
  348. debrisVelocityVariance = 3;
  349. faceViewer = true;
  350. explosionScale = "1 1 1";
  351. shakeCamera = false;
  352. camShakeFreq = "7.0 8.0 7.0";
  353. camShakeAmp = "10.0 10.0 10.0";
  354. camShakeDuration = 0.75;
  355. camShakeRadius = 15.0;
  356. // Dynamic light
  357. lightStartRadius = 0;
  358. lightEndRadius = 0;
  359. lightStartColor = "0.45 0.3 0.1";
  360. lightEndColor = "0 0 0";
  361. //impulse
  362. impulseRadius = 0;
  363. impulseForce = 0;
  364. impulseVertical = 0;
  365. //radius damage
  366. radiusDamage = 0;
  367. damageRadius = 0;
  368. //burn the players?
  369. playerBurnTime = 0;
  370. };
  371. datablock ExplosionData(bloodBurstNoDebrisExplosion : bloodBurstFinalExplosion)
  372. {
  373. debris = "";
  374. };
  375. datablock ExplosionData(bloodDismemberExplosion : bloodBurstFinalExplosion)
  376. {
  377. emitter[0] = bloodBurstSprinkleSmallEmitter;
  378. emitter[1] = "";
  379. particleEmitter = bloodBurstLargeEmitter;
  380. particleDensity = 20;
  381. particleRadius = 1.0;
  382. debris = bloodChunkDebris;
  383. debrisNum = 6;
  384. debrisNumVariance = 0;
  385. debrisPhiMin = 0;
  386. debrisPhiMax = 360;
  387. debrisThetaMin = 0;
  388. debrisThetaMax = 180;
  389. debrisVelocity = 10;
  390. debrisVelocityVariance = 3;
  391. };
  392. datablock ExplosionData(bloodFootDebrisExplosion : bloodBurstFinalExplosion)
  393. {
  394. emitter[0] = "";
  395. emitter[1] = "";
  396. particleEmitter = "";
  397. particleDensity = 20;
  398. particleRadius = 1.0;
  399. debris = rBloodFootDebris;
  400. debrisNum = 2;
  401. debrisNumVariance = 0;
  402. debrisPhiMin = 0;
  403. debrisPhiMax = 360;
  404. debrisThetaMin = 0;
  405. debrisThetaMax = 180;
  406. debrisVelocity = 10;
  407. debrisVelocityVariance = 5;
  408. };
  409. datablock ExplosionData(bloodHeadDebrisExplosion : bloodBurstFinalExplosion)
  410. {
  411. emitter[0] = "";
  412. emitter[1] = "";
  413. particleEmitter = "";
  414. particleDensity = 20;
  415. particleRadius = 1.0;
  416. debris = rBloodHeadDebris;
  417. debrisNum = 1;
  418. debrisNumVariance = 0;
  419. debrisPhiMin = 0;
  420. debrisPhiMax = 360;
  421. debrisThetaMin = 0;
  422. debrisThetaMax = 180;
  423. debrisVelocity = 10;
  424. debrisVelocityVariance = 5;
  425. };
  426. datablock ExplosionData(bloodHandDebrisExplosion : bloodBurstFinalExplosion)
  427. {
  428. emitter[0] = "";
  429. emitter[1] = "";
  430. particleEmitter = "";
  431. particleDensity = 20;
  432. particleRadius = 1.0;
  433. debris = rBloodHandDebris;
  434. debrisNum = 2;
  435. debrisNumVariance = 0;
  436. debrisPhiMin = 0;
  437. debrisPhiMax = 360;
  438. debrisThetaMin = 0;
  439. debrisThetaMax = 180;
  440. debrisVelocity = 10;
  441. debrisVelocityVariance = 5;
  442. };
  443. // Projectiles
  444. datablock ProjectileData(bloodBurstFinalExplosionProjectile)
  445. {
  446. directDamage = 0;
  447. radiusDamage = 0;
  448. damageRadius = 0;
  449. explosion = bloodBurstFinalExplosion;
  450. directDamageType = $DamageType::jeepExplosion;
  451. radiusDamageType = $DamageType::jeepExplosion;
  452. explodeOnDeath = 1;
  453. armingDelay = 0;
  454. lifetime = 10;
  455. };
  456. datablock ProjectileData(bloodDismemberProjectile : bloodBurstFinalExplosionProjectile)
  457. {
  458. explosion = bloodDismemberExplosion;
  459. };
  460. datablock ProjectileData(footGibProjectile : bloodBurstFinalExplosionProjectile)
  461. {
  462. explosion = bloodFootDebrisExplosion;
  463. };
  464. datablock ProjectileData(headGibProjectile : bloodBurstFinalExplosionProjectile)
  465. {
  466. explosion = bloodHeadDebrisExplosion;
  467. };
  468. datablock ProjectileData(handGibProjectile : bloodBurstFinalExplosionProjectile)
  469. {
  470. explosion = bloodHandDebrisExplosion;
  471. };
  472. $RBloodGib0 = footGibProjectile;
  473. $RBloodGib1 = headGibProjectile;
  474. $RBloodGib2 = handGibProjectile;
  475. datablock ProjectileData(rbloodDripProjectile)
  476. {
  477. directDamage = 0;
  478. radiusDamage = 0;
  479. damageRadius = 0;
  480. explosion = bloodBurstNoDebrisExplosion;
  481. particleEmitter = smallBloodEmitter; //bulletTrailEmitter;
  482. projectileShapeName = "./cube.dts";
  483. directDamageType = $DamageType::jeepExplosion;
  484. radiusDamageType = $DamageType::jeepExplosion;
  485. explodeOnDeath = 0;
  486. isBallistic = true;
  487. gravityMod = 1.0;
  488. armingDelay = 0;
  489. lifetime = 2000;
  490. };
  491. function rbloodDripProjectile::onCollision(%this, %obj, %col, %vec, %speed)
  492. {
  493. %pos = %obj.getPosition();
  494. if(%col.getClassName() $= "fxDTSBrick")
  495. {
  496. // don't want to always be playing drip sounds because it gets overwhelming very fast
  497. %rareness = 6;
  498. %chance = mCeil(%rareness - %obj.fadeAlpha * %rareness);
  499. if(!getRandom(0, %chance))
  500. serverPlay3D($RBlood::smallDrop[getRandom(0, 3)], %pos);
  501. doBloodSplatter("0 0 -100", setWord(%pos, 2, getWord(%pos, 2) + 0.25), 0);
  502. }
  503. else if(%col.getClassName() $= "AIPlayer" || %col.getClassName() $= "Player")
  504. {
  505. %col.reddenLimb(getRandom(0, getRandom(0, 3)), 1, 5);
  506. }
  507. Parent::onCollision(%this, %obj, %col, %vec, %speed);
  508. }