Advertisement
Guest User

Untitled

a guest
Apr 12th, 2012
1,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 33.94 KB | None | 0 0
  1. // q3mme - compatible with wolfcam
  2. // edited by jones
  3.  
  4. // wolfcam additional inputs to some scripts are:
  5. // team 0 free, 1 red, 2 blue, 3 spectator
  6. // clientnum
  7. // enemy 1 if enemy of whoever is being specced in demo
  8. // teammate
  9. // ineyes 1 if first person view is with this player
  10. // surfacetype for impact scripts: 0 not specified, 1 metal, 2 wood, 3 dust
  11.  
  12. // wolfcam: the other ql weapons also available as 'nailgun', 'prox', and 'chaingun'
  13. // wolfcam: weapons also have, in addition to impact scripts, impactflesh scripts.
  14.  
  15. // WEAPON EFFECTS:
  16. // flash is a 0.25 second event after a weapon is fired
  17. // fire is a single event when weapon is fired
  18. // impact is for weapons impact on something or explode like grenades
  19. // trail single event for weapons without projectiles or a
  20. // constant event when projectile is in motion projectile is for
  21. // rendering the specific projectile
  22.  
  23. // UNFINISHED EFFECTS = GL/LG/BFG/TELEPORT
  24.  
  25. // ROCKET
  26.  
  27. // input: origin, team, clientnum, enemy, teammate, ineyes
  28. weapon/rocket/flash {
  29.  
  30. color 1 0.75 0
  31. size 300 + rand * 32
  32. Light
  33. }
  34.  
  35. // input: velocity, dir, rotate, origin, angles, axis, size
  36. weapon/rocket/projectile {
  37.  
  38. // world glow
  39.  
  40. color 1 0.5 0.1
  41. size 100
  42. Light
  43.  
  44. // model
  45.  
  46. loopSound sound/weapons/rocket/rockfly.wav
  47. size 1.2
  48. model models/ammo/rocket/rocket.md3
  49. rotate time * 1000 / 4
  50. dirModel
  51.  
  52. // 4x twisting flame
  53.  
  54. t0 180 / pi
  55. t1 cos( t0 * time * pi * 2 )
  56. t2 sin( t0 * time * pi * 2 )
  57.  
  58. normalize dir v2
  59. inverse v2
  60. perpendicular dir v0
  61. cross v2 v0 v1
  62.  
  63. shader flareShader
  64. distance 4 + 1 * rand {
  65.  
  66. scale v2 v2 0.2 + 0.2 * rand
  67.  
  68. repeat 4 {
  69.  
  70. if loopcount = 0 {
  71. scale v0 v3 t2
  72. scale v1 v4 t2
  73. subScale v4 v0 v5 t1
  74. addScale v3 v1 v5 t1
  75. }
  76.  
  77. if loopcount = 1 {
  78. scale v0 v3 -t2
  79. scale v1 v4 -t2
  80. addScale v4 v0 v5 t1
  81. subScale v3 v1 v5 t1
  82. }
  83.  
  84. if loopcount = 2 {
  85. scale v0 v3 t1
  86. scale v1 v4 t1
  87. subScale v4 v0 v5 t2
  88. addScale v3 v1 v5 -t2
  89. }
  90.  
  91. if loopcount = 3 {
  92. scale v0 v3 -t1
  93. scale v1 v4 -t1
  94. subScale v4 v0 v5 -t2
  95. addScale v3 v1 v5 t2
  96. }
  97.  
  98. add v2 v5 v6
  99. addScale parentVelocity v6 velocity 35 + 35 * rand
  100.  
  101. emitter 0.5 * rand * rand {
  102.  
  103. t3 4 + 0.5 * crand
  104. size t3 - t3 * ( 0.5 * lerp )
  105.  
  106. color 1 0.2 0.1
  107.  
  108. colorFade 0
  109. moveGravity 0
  110. moveBounce 0.6 0.2
  111. Sprite cullNear
  112. }
  113. }
  114.  
  115. // random flares
  116.  
  117. random v7
  118. addScale parentVelocity v7 velocity 75 + rand * 50
  119.  
  120. emitter 0.3 * rand * rand {
  121.  
  122. t4 3 + 0.5 * crand
  123. size t4 - t4 * lerp
  124.  
  125. color 1 0.2 0.1
  126.  
  127. colorFade 0
  128. moveGravity 0
  129. moveBounce 0.6 0.2
  130. Sprite cullNear
  131. }
  132. }
  133. }
  134.  
  135. // input: origin, angles, velocity, dir, axis
  136. weapon/rocket/trail {
  137.  
  138. // world glow
  139.  
  140. color 1 0.5 0.1
  141. size 100
  142. Light
  143.  
  144. // flame exhaust
  145.  
  146. shader flareShader
  147. distance 6 + 2 * rand {
  148.  
  149. t2 6 - 2 * rand
  150. normalize dir v0
  151. inverse v0
  152. addScale parentVelocity v0 velocity 75 + rand * 75
  153.  
  154. emitter 0.5 * rand * rand {
  155.  
  156. t0 20 - 2 * rand
  157. size t0 - t0 * ( 0.5 * lerp )
  158. width size - size * lerp
  159.  
  160. color 1 0.2 0.1
  161.  
  162. colorFade 0
  163. moveGravity 0
  164. Spark cullNear
  165. }
  166.  
  167. // exhaust flares
  168.  
  169. normalize dir v1
  170. inverse v1
  171. addScale parentVelocity v1 velocity 100 + rand * 75
  172.  
  173. emitter 0.55 * rand * rand {
  174.  
  175. t1 8 - 2 * rand
  176. size t1 - t1 * ( 0.5 * lerp )
  177. width size - size * lerp
  178.  
  179. color 1 0.2 0.1
  180.  
  181. colorFade 0
  182. moveGravity 0
  183. Spark cullNear
  184. }
  185. }
  186. }
  187.  
  188. // input: origin, dir
  189. weapon/rocket/impact {
  190.  
  191. vibrate 70
  192. sound sound/weapons/rocket/rocklx1a.wav
  193.  
  194. // light
  195.  
  196. color 1 0.5 0.1
  197. emitter 1 {
  198.  
  199. size 200 * clip( 2 - 2 * lerp )
  200. Light
  201. }
  202.  
  203. // beams
  204.  
  205. width 40
  206. shader flareExplosion
  207. repeat 8 + 8 * rand {
  208.  
  209. normalize dir
  210. wobble dir velocity 40 + 30 * rand
  211.  
  212. emitter 0.6 + rand * 0.3 {
  213.  
  214. size 400 - lerp * 200
  215.  
  216. color 1 0.5 0.1
  217.  
  218. colorFade 0
  219. Spark
  220. }
  221. }
  222.  
  223. repeat 4 + 4 * rand {
  224.  
  225. normalize dir
  226. wobble dir velocity 40 + 30 * rand
  227.  
  228. emitter 0.6 + rand * 0.3 {
  229.  
  230. size 400 - lerp * 300
  231.  
  232. color 1 0.1 0.1
  233.  
  234. colorFade 0
  235. Spark
  236. }
  237. }
  238.  
  239. // explosion
  240.  
  241. copy origin parentOrigin
  242. copy velocity parentVelocity
  243.  
  244. t0 180 / pi
  245. t1 pi * 2
  246.  
  247. normalize dir v2
  248. perpendicular dir v0
  249. cross v0 v2 v1
  250.  
  251. shader flareShader
  252. repeat 500 + rand * 100 {
  253.  
  254. random dir
  255. addScale parentVelocity dir velocity 450 * rand
  256. width 2 + 1 * rand
  257.  
  258. emitter 0.5 * rand {
  259.  
  260. size 20 - lerp * 20
  261.  
  262. color 1 0.4 0.1
  263.  
  264. colorFade 0.8
  265. moveBounce 150 0.8
  266. Spark
  267. }
  268. }
  269.  
  270. repeat 900 + 100 * rand {
  271.  
  272. t2 2 * rand - 1
  273. t3 t1 * rand
  274.  
  275. t4 30 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  276. t5 30 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  277. t6 30 * cos( t0 * acos( t2 ) )
  278.  
  279. scale v0 v3 t4
  280. addScale v3 v1 v4 t5
  281. addScale v4 v2 v5 t6
  282.  
  283. add parentOrigin v5 origin
  284.  
  285. t7 10 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  286. t8 10 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  287. t9 10 * cos( t0 * acos( t2 ) )
  288.  
  289. scale v0 v6 t7
  290. addScale v6 v1 v7 t8
  291. addScale v7 v2 v8 t9
  292.  
  293. addScale parentVelocity v8 velocity 10 * rand
  294.  
  295. emitter 1.5 * rand {
  296.  
  297. size ( t3 * 2 ) - ( t3 * 2 ) * lerp
  298.  
  299. color 1 0.2 0.1
  300.  
  301. colorFade 0.8
  302. moveBounce 150 0.8
  303. moveGravity 20
  304. Sprite
  305. }
  306. }
  307.  
  308. repeat 500 + 100 * rand {
  309.  
  310. t2 30 * rand
  311.  
  312. t3 cos( t0 * loop * t1 )
  313. t4 sin( t0 * loop * t1 )
  314.  
  315. scale v0 v3 35 * t3
  316. addScale v3 v1 v4 35 * t4
  317.  
  318. add parentOrigin v4 origin
  319.  
  320. t5 4 * -sin( t0 * loop * t1 )
  321. t6 4 * cos( t0 * loop * t1 )
  322.  
  323. scale v0 v5 t5
  324. addScale v5 v1 v6 t6
  325.  
  326. scale v2 v7 8 * rand
  327. add v6 v7 v8
  328. addScale parentVelocity v8 velocity 15 * rand
  329.  
  330. emitter 1 * rand {
  331.  
  332. size t2 - t2 * lerp
  333. width size - size * lerp
  334.  
  335. color 1 0.2 0.1
  336.  
  337. colorFade 0.8
  338. moveBounce 150 0.8
  339. moveGravity 0
  340. Spark cullNear
  341. }
  342. }
  343.  
  344. repeat 400 + 100 * rand {
  345.  
  346. t2 30 * rand
  347.  
  348. t3 cos( t0 * loop * t1 )
  349. t4 sin( t0 * loop * t1 )
  350.  
  351. scale v0 v3 25 * t3
  352. addScale v3 v1 v4 25 * t4
  353.  
  354. add parentOrigin v4 origin
  355.  
  356. t5 8 * -sin( t0 * loop * t1 )
  357. t6 8 * cos( t0 * loop * t1 )
  358.  
  359. scale v0 v5 t5
  360. addScale v5 v1 v6 t6
  361.  
  362. scale v2 v7 6 * rand
  363. add v6 v7 v8
  364. addScale parentVelocity v8 velocity 15 * rand
  365.  
  366. emitter 1 * rand {
  367.  
  368. size t2 - t2 * lerp
  369. width size - size * lerp
  370.  
  371. color 1 0.2 0.1
  372.  
  373. colorFade 0.8
  374. moveBounce 150 0.8
  375. moveGravity 0
  376. Spark cullNear
  377. }
  378. }
  379.  
  380. repeat 300 + 100 * rand {
  381.  
  382. t2 30 * rand
  383.  
  384. t3 cos( t0 * loop * t1 )
  385. t4 sin( t0 * loop * t1 )
  386.  
  387. scale v0 v3 30 * t3
  388. addScale v3 v1 v4 30 * t4
  389.  
  390. add parentOrigin v4 origin
  391.  
  392. t5 12 * -sin( t0 * loop * t1 )
  393. t6 12 * cos( t0 * loop * t1 )
  394.  
  395. scale v0 v5 t5
  396. addScale v5 v1 v6 t6
  397.  
  398. scale v2 v7 2 * rand
  399. add v6 v7 v8
  400. addScale parentVelocity v8 velocity 15 * rand
  401.  
  402. emitter 1.5 * rand {
  403.  
  404. size t2 - t2 * lerp
  405. width size - size * lerp
  406.  
  407. color 1 0.4 0.1
  408.  
  409. colorFade 0.8
  410. moveBounce 150 0.8
  411. moveGravity 0
  412. Spark cullNear
  413. }
  414. }
  415.  
  416. // decal
  417.  
  418. rotate rand * 360
  419. shader gfx/damage/crack_mrk
  420. size 100
  421. Decal
  422. }
  423.  
  424. }
  425.  
  426. // PLASMA
  427.  
  428. // input: origin, team, clientnum, enemy, teammate, ineyes
  429. weapon/plasma/flash {
  430.  
  431. color 0.35 0.35 1
  432. size 200 + rand * 25
  433. Light
  434. }
  435.  
  436. // input: velocity, dir, rotate, origin, angles, axis, size
  437. weapon/plasma/projectile {
  438.  
  439. loopSound "sound/weapons/plasma/lasfly.wav"
  440.  
  441. // world glow
  442.  
  443. size 125
  444. color 0.35 0.35 1
  445. Light
  446.  
  447. // 4x twisting flame
  448.  
  449. t0 360 / pi
  450. t1 cos( t0 * time * pi * 2 )
  451. t2 sin( t0 * time * pi * 2 )
  452.  
  453. normalize dir v2
  454. inverse v2
  455. perpendicular dir v0
  456. cross v2 v0 v1
  457.  
  458. shader flareShader
  459. distance 6 + 1 * rand {
  460.  
  461. scale v2 v2 0.6 + 0.6 * rand
  462.  
  463. repeat 4 {
  464.  
  465. if loopcount = 0 {
  466. scale v0 v3 t2
  467. scale v1 v4 t2
  468. subScale v4 v0 v5 t1
  469. addScale v3 v1 v5 t1
  470. }
  471.  
  472. if loopcount = 1 {
  473. scale v0 v3 -t2
  474. scale v1 v4 -t2
  475. addScale v4 v0 v5 t1
  476. subScale v3 v1 v5 t1
  477. }
  478.  
  479. if loopcount = 2 {
  480. scale v0 v3 t1
  481. scale v1 v4 t1
  482. subScale v4 v0 v5 t2
  483. addScale v3 v1 v5 -t2
  484. }
  485.  
  486. if loopcount = 3 {
  487. scale v0 v3 -t1
  488. scale v1 v4 -t1
  489. subScale v4 v0 v5 -t2
  490. addScale v3 v1 v5 t2
  491. }
  492.  
  493. add v2 v5 v6
  494. addScale parentVelocity v6 velocity 75 + 50 * rand
  495.  
  496. emitter 0.3 * rand * rand {
  497.  
  498. t3 5 + 0.5 * crand
  499. size t3 - t3 * ( 0.5 * lerp )
  500.  
  501. red 0.2 - lerp * 0.1
  502. green 0.2 - lerp * 0.1
  503. blue 0.9 + lerp * 0.1
  504.  
  505. colorFade 0
  506. moveGravity 0
  507. moveBounce 0.1 0.1
  508. Sprite cullNear
  509. }
  510. }
  511.  
  512. // random flares
  513.  
  514. t4 3 + 0.5 * crand
  515.  
  516. random v7
  517. addScale parentVelocity v7 velocity 75 + rand * 50
  518.  
  519. emitter 0.3 * rand * rand {
  520.  
  521. size t4 - t4 * lerp
  522.  
  523. red 0.2 - lerp * 0.1
  524. green 0.2 + lerp * 0.2
  525. blue 0.9 + lerp * 0.1
  526.  
  527. colorFade 0
  528. moveGravity 0
  529. moveBounce 0.1 0.1
  530. Sprite cullNear
  531. }
  532. }
  533. }
  534.  
  535. // input: origin, angles, velocity, dir, axis
  536. weapon/plasma/trail {
  537.  
  538. // inverse flame
  539.  
  540. shader flareShader
  541. distance 6 + 2 * rand {
  542.  
  543. normalize dir v0
  544. inverse v0
  545. addScale parentVelocity v0 velocity 200 + rand * 75
  546.  
  547. emitter 0.35 * rand * rand {
  548.  
  549. t0 20 - 2 * rand
  550. size t0 - t0 * ( 0.5 * lerp )
  551. width size - size * lerp
  552.  
  553. red 0.2 - lerp * 0.1
  554. green 0.2 - lerp * 0.1
  555. blue 0.9 + lerp * 0.1
  556.  
  557. colorFade 0
  558. moveGravity 0
  559. Spark cullNear
  560. }
  561.  
  562. // inverse flares
  563.  
  564. normalize dir v1
  565. inverse v1
  566. addScale parentVelocity v1 velocity 250 + rand * 75
  567.  
  568. emitter 0.3 * rand * rand {
  569.  
  570. t1 8 - 2 * rand
  571. size t1 - t1 * ( 0.5 * lerp )
  572. width size - size * lerp
  573.  
  574. red 0.2 - lerp * 0.1
  575. green 0.2 + lerp * 0.2
  576. blue 0.9 + lerp * 0.1
  577.  
  578. colorFade 0
  579. moveGravity 0
  580. Spark cullNear
  581. }
  582. }
  583. }
  584.  
  585. // input: origin, dir, surfacetype
  586. weapon/plasma/impact {
  587.  
  588. vibrate 5
  589. sound sound/weapons/plasma/plasmx1a.wav
  590.  
  591. shader plasmaExplosion
  592. model models/weaphits/ring02.md3
  593. rotate rand * 360
  594. emitter 0.5 {
  595. dirModel
  596. }
  597.  
  598. copy origin parentOrigin
  599. copy velocity parentVelocity
  600.  
  601. normalize dir v2
  602. perpendicular dir v0
  603. cross v0 v2 v1
  604.  
  605. t0 180 / pi
  606. t1 pi * 2
  607. t2 25 - 5 * rand
  608.  
  609. shader flareShader
  610. repeat 30 + rand * 40 {
  611.  
  612. random dir
  613. addScale parentVelocity dir velocity 350 * rand
  614. width 2 + 1 * rand
  615.  
  616. emitter 0.7 * rand + rand * 0.4 {
  617.  
  618. size 20 - lerp * 20
  619.  
  620. color 0.1 0.4 1
  621.  
  622. colorFade 0.8
  623. moveBounce 150 0.8
  624. Spark
  625. }
  626. }
  627.  
  628. repeat 20 + 10 * rand {
  629.  
  630. t3 cos( t0 * loop * t1 )
  631. t4 sin( t0 * loop * t1 )
  632.  
  633. scale v0 v3 10 * t3
  634. addScale v3 v1 v4 10 * t4
  635.  
  636. add parentOrigin v4 origin
  637.  
  638. t5 5 * -sin( t0 * loop * t1 )
  639. t6 5 * cos( t0 * loop * t1 )
  640.  
  641. scale v0 v5 t5
  642. addScale v5 v1 v6 t6
  643.  
  644. scale v2 v7 5 * rand
  645. add v6 v7 v8
  646. addScale parentVelocity v8 velocity 25
  647.  
  648. emitter 0.2 + 0.1 * rand {
  649.  
  650. size t2 - t2 * ( 0.5 * lerp * 1.5 )
  651. width size - size * ( 0.5 * lerp * 1.5 )
  652.  
  653. red 0.2 - lerp * 0.1
  654. green 0.2 - lerp * 0.1
  655. blue 0.9 + lerp * 0.1
  656.  
  657. colorFade 0
  658. moveBounce 1 1
  659. moveGravity 0
  660. Spark cullNear
  661. }
  662. }
  663.  
  664. repeat 20 + 10 * rand {
  665.  
  666. t3 cos( t0 * loop * t1 )
  667. t4 sin( t0 * loop * t1 )
  668.  
  669. scale v0 v3 10 * t3
  670. addScale v3 v1 v4 10 * t4
  671.  
  672. add parentOrigin v4 origin
  673.  
  674. t5 5 * -sin( t0 * loop * t1 )
  675. t6 5 * cos( t0 * loop * t1 )
  676.  
  677. scale v0 v5 t5
  678. addScale v5 v1 v6 t6
  679.  
  680. scale v2 v7 5 * rand
  681. add v6 v7 v8
  682. addScale parentVelocity v8 velocity 25
  683.  
  684. emitter 0.2 + 0.2 * rand {
  685.  
  686. size t2 - t2 * ( 0.5 * lerp * 1.5 )
  687. width size - size * ( 0.5 * lerp * 1.5 )
  688.  
  689. red 0.2 - lerp * 0.1
  690. green 0.2 - lerp * 0.1
  691. blue 0.9 + lerp * 0.1
  692.  
  693. colorFade 0
  694. moveBounce 1 1
  695. moveGravity 0
  696. Spark cullNear
  697. }
  698. }
  699. }
  700.  
  701. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  702. weapon/plasma/impactflesh {
  703.  
  704. shader flareShader
  705. repeat 30 + rand * 40 {
  706.  
  707. random dir
  708. addScale parentVelocity dir velocity 350 * rand
  709. width 2 + 1 * rand
  710.  
  711. emitter 0.2 * rand + rand * 0.4 {
  712.  
  713. size 20 - lerp * 20
  714.  
  715. color 0.1 0.4 1
  716.  
  717. colorFade 0.8
  718. moveBounce 150 0.8
  719. Spark
  720. }
  721. }
  722. }
  723.  
  724. // RAILGUN
  725.  
  726. // input: origin, team, clientnum, enemy, teammate, ineyes
  727. weapon/rail/flash {
  728.  
  729. color 0.5 0.5 1
  730. size 300 + rand * 32
  731. Light
  732. }
  733.  
  734. // input: origin, parentOrigin, end, dir, parentDir, color1, color2, team, clientnum, enemy, teammate, ineyes
  735. weapon/rail/trail {
  736.  
  737. copy dir v3
  738.  
  739. t0 v3
  740. t1 360
  741. t2 180 / pi
  742. t3 pi * 2
  743.  
  744. normalize dir v2
  745. perpendicular v2 v0
  746. cross v2 v0 v1
  747.  
  748. // white particles
  749.  
  750. shader flareShader
  751. repeat t0 {
  752.  
  753. t1 t1 + 100
  754. t4 2 + 1 * rand
  755.  
  756. scale v0 v3 crand
  757. scale v1 v4 crand
  758. add v3 v4 v5
  759. addScale v5 v2 v6 loop * t0
  760. add parentOrigin v6 origin
  761.  
  762. scale v5 v7 2 * rand
  763. addScale v7 v2 v8 15 + 15 * rand
  764. add parentVelocity v8 velocity
  765.  
  766. emitter 0.8 + loop * t1 * 0.00001 {
  767.  
  768. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  769.  
  770. color 1 1 1
  771.  
  772. colorFade 0
  773. moveGravity 0
  774. Sprite cullNear
  775. }
  776. }
  777.  
  778. if team = 0 {
  779.  
  780. // blue spiral
  781.  
  782. repeat t0 / 2 {
  783.  
  784. t4 2 + 2 * rand
  785. t5 cos( t2 * loop * t3 * 10 )
  786. t6 sin( t2 * loop * t3 * 10 )
  787.  
  788. scale v0 v3 3 * t5
  789. scale v1 v4 3 * t6
  790. add v3 v4 v5
  791. addScale v5 v2 v6 loop * t0
  792. add parentOrigin v6 origin
  793.  
  794. scale v5 v7 3 * rand
  795. addScale v7 v2 v8 5 + 5 * rand
  796. add parentVelocity v8 velocity
  797.  
  798. emitter 1.2 + 0.2 * rand {
  799.  
  800. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  801.  
  802. color 0.1 0.2 1
  803.  
  804. colorFade 0
  805. moveGravity 0
  806. Sprite cullNear
  807. }
  808. }
  809.  
  810. // teal particles
  811.  
  812. repeat t0 / 3 {
  813.  
  814. t4 1 + 1 * rand
  815.  
  816. scale v0 v3 2 * crand
  817. scale v1 v4 2 * crand
  818. add v3 v4 v5
  819. addScale v5 v2 v6 loop * t0
  820. add parentOrigin v6 origin
  821.  
  822. scale v5 v7 4 * rand
  823. addScale v7 v2 v8 10 + 10 * rand
  824. add parentVelocity v8 velocity
  825.  
  826. emitter 1.2 + 0.2 * rand {
  827.  
  828. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  829.  
  830. color 0.1 0.6 1
  831.  
  832. colorFade 0
  833. moveGravity 0
  834. Sprite cullNear
  835. }
  836. }
  837. }
  838.  
  839. if team = 1 {
  840.  
  841. // red spiral
  842.  
  843. repeat t0 / 2 {
  844.  
  845. t4 2 + 2 * rand
  846. t5 cos( t2 * loop * t3 * 10 )
  847. t6 sin( t2 * loop * t3 * 10 )
  848.  
  849. scale v0 v3 3 * t5
  850. scale v1 v4 3 * t6
  851. add v3 v4 v5
  852. addScale v5 v2 v6 loop * t0
  853. add parentOrigin v6 origin
  854.  
  855. scale v5 v7 3 * rand
  856. addScale v7 v2 v8 5 + 5 * rand
  857. add parentVelocity v8 velocity
  858.  
  859. emitter 1.2 + 0.2 * rand {
  860.  
  861. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  862.  
  863. color 1 0.1 0.1
  864.  
  865. colorFade 0
  866. moveGravity 0
  867. Sprite cullNear
  868. }
  869. }
  870.  
  871. // orange particles
  872.  
  873. repeat t0 / 3 {
  874.  
  875. t4 1 + 1 * rand
  876.  
  877. scale v0 v3 2 * crand
  878. scale v1 v4 2 * crand
  879. add v3 v4 v5
  880. addScale v5 v2 v6 loop * t0
  881. add parentOrigin v6 origin
  882.  
  883. scale v5 v7 4 * rand
  884. addScale v7 v2 v8 10 + 10 * rand
  885. add parentVelocity v8 velocity
  886.  
  887. emitter 1.2 + 0.2 * rand {
  888.  
  889. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  890.  
  891. color 1 0.5 0.1
  892.  
  893. colorFade 0
  894. moveGravity 0
  895. Sprite cullNear
  896. }
  897. }
  898. }
  899.  
  900. if team = 2 {
  901.  
  902. // blue spiral
  903.  
  904. repeat t0 / 2 {
  905.  
  906. t4 2 + 2 * rand
  907. t5 cos( t2 * loop * t3 * 10 )
  908. t6 sin( t2 * loop * t3 * 10 )
  909.  
  910. scale v0 v3 3 * t5
  911. scale v1 v4 3 * t6
  912. add v3 v4 v5
  913. addScale v5 v2 v6 loop * t0
  914. add parentOrigin v6 origin
  915.  
  916. scale v5 v7 3 * rand
  917. addScale v7 v2 v8 5 + 5 * rand
  918. add parentVelocity v8 velocity
  919.  
  920. emitter 1.2 + 0.2 * rand {
  921.  
  922. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  923.  
  924. color 0.1 0.2 1
  925.  
  926. colorFade 0
  927. moveGravity 0
  928. Sprite cullNear
  929. }
  930. }
  931.  
  932. // teal particles
  933.  
  934. repeat t0 / 3 {
  935.  
  936. t4 1 + 1 * rand
  937.  
  938. scale v0 v3 2 * crand
  939. scale v1 v4 2 * crand
  940. add v3 v4 v5
  941. addScale v5 v2 v6 loop * t0
  942. add parentOrigin v6 origin
  943.  
  944. scale v5 v7 4 * rand
  945. addScale v7 v2 v8 10 + 10 * rand
  946. add parentVelocity v8 velocity
  947.  
  948. emitter 1.2 + 0.2 * rand {
  949.  
  950. size t4 - t4 * ( 0.5 * lerp * 1.5 )
  951.  
  952. color 0.1 0.6 1
  953.  
  954. colorFade 0
  955. moveGravity 0
  956. Sprite cullNear
  957. }
  958. }
  959. }
  960. }
  961.  
  962. // input: origin, dir, team, clientnum, enemy, teammate, ineyes, surfacetype
  963. weapon/rail/impact {
  964.  
  965. vibrate 30
  966. sound sound/weapons/plasma/plasmx1a.wav
  967. rotate rand * 360
  968. shader railExplosion
  969. model models/weaphits/ring02.md3
  970. emitter 0.6 {
  971.  
  972. dirModel
  973. size 24
  974. shader gfx/damage/plasma_mrk
  975. Decal energy
  976. }
  977.  
  978. copy origin parentOrigin
  979. copy velocity parentVelocity
  980.  
  981. normalize dir v2
  982. perpendicular dir v0
  983. cross v0 v2 v1
  984.  
  985. t0 180 / pi
  986. t1 pi * 2
  987. t2 25 - 5 * rand
  988.  
  989. shader flareShader
  990. repeat 30 + rand * 40 {
  991.  
  992. random dir
  993. addScale parentVelocity dir velocity 350 * rand
  994. width 2 + 1 * rand
  995.  
  996. emitter 0.7 * rand + rand * 0.4 {
  997.  
  998. size 20 - lerp * 20
  999.  
  1000. color 0.1 0.4 1
  1001.  
  1002. colorFade 0.8
  1003. moveBounce 150 0.8
  1004. Spark
  1005. }
  1006. }
  1007.  
  1008. repeat 20 + 10 * rand {
  1009.  
  1010. t3 cos( t0 * loop * t1 )
  1011. t4 sin( t0 * loop * t1 )
  1012.  
  1013. scale v0 v3 10 * t3
  1014. addScale v3 v1 v4 10 * t4
  1015.  
  1016. add parentOrigin v4 origin
  1017.  
  1018. t5 5 * -sin( t0 * loop * t1 )
  1019. t6 5 * cos( t0 * loop * t1 )
  1020.  
  1021. scale v0 v5 t5
  1022. addScale v5 v1 v6 t6
  1023.  
  1024. scale v2 v7 5 * rand
  1025. add v6 v7 v8
  1026. addScale parentVelocity v8 velocity 25
  1027.  
  1028. emitter 0.2 + 0.1 * rand {
  1029.  
  1030. size t2 - t2 * ( 0.5 * lerp * 1.5 )
  1031. width size - size * ( 0.5 * lerp * 1.5 )
  1032.  
  1033. red 0.2 - lerp * 0.1
  1034. green 0.2 - lerp * 0.1
  1035. blue 0.9 + lerp * 0.1
  1036.  
  1037. colorFade 0.8
  1038. moveBounce 150 0.8
  1039. moveGravity 0
  1040. Spark cullNear
  1041. }
  1042. }
  1043.  
  1044. repeat 20 + 10 * rand {
  1045.  
  1046. t3 cos( t0 * loop * t1 )
  1047. t4 sin( t0 * loop * t1 )
  1048.  
  1049. scale v0 v3 10 * t3
  1050. addScale v3 v1 v4 10 * t4
  1051.  
  1052. add parentOrigin v4 origin
  1053.  
  1054. t5 5 * -sin( t0 * loop * t1 )
  1055. t6 5 * cos( t0 * loop * t1 )
  1056.  
  1057. scale v0 v5 t5
  1058. addScale v5 v1 v6 t6
  1059.  
  1060. scale v2 v7 5 * rand
  1061. add v6 v7 v8
  1062. addScale parentVelocity v8 velocity 25
  1063.  
  1064. emitter 0.2 + 0.2 * rand {
  1065.  
  1066. size t2 - t2 * ( 0.5 * lerp * 1.5 )
  1067. width size - size * ( 0.5 * lerp * 1.5 )
  1068.  
  1069. red 0.2 - lerp * 0.1
  1070. green 0.2 - lerp * 0.1
  1071. blue 0.9 + lerp * 0.1
  1072.  
  1073. colorFade 0.8
  1074. moveBounce 150 0.8
  1075. moveGravity 0
  1076. Spark cullNear
  1077. }
  1078. }
  1079. }
  1080.  
  1081. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  1082. weapon/rail/impactflesh {
  1083.  
  1084. shader flareShader
  1085. repeat 10 + rand * 20 {
  1086.  
  1087. random dir
  1088. addScale parentVelocity dir velocity 350 * rand
  1089. width 2 + 1 * rand
  1090.  
  1091. emitter 0.1 * rand + rand * 0.2 {
  1092.  
  1093. size 20 - lerp * 20
  1094.  
  1095. color 0.1 0.4 1
  1096.  
  1097. colorFade 0.8
  1098. moveBounce 150 0.8
  1099. Spark
  1100. }
  1101. }
  1102. }
  1103.  
  1104. // LIGHTNING
  1105.  
  1106. // input: origin, team, clientnum, enemy, teammate, ineyes
  1107. weapon/lightning/flash {
  1108.  
  1109. color 0.5 0.5 1
  1110. size 200 + rand * 25
  1111. Light
  1112. }
  1113.  
  1114. // input: origin, dir, end, team, clientnum, enemy, teammate, ineyes
  1115. weapon/lightning/trail {
  1116.  
  1117. shader lightningBolt2
  1118. size 16
  1119. angle 45
  1120.  
  1121. if ineyes {
  1122. beam depthhack
  1123. } else {
  1124. beam
  1125. }
  1126.  
  1127. t0 dir
  1128.  
  1129. if ( t0 < 768 ) {
  1130.  
  1131. shaderClear
  1132. model models/weaphits/crackle.md3
  1133. size 1
  1134. addScale origin dir origin ( ( t0 - 16 ) / t0 )
  1135. angles0 rand * 360
  1136. angles1 rand * 360
  1137. angles2 rand * 360
  1138. anglesModel
  1139. }
  1140. }
  1141.  
  1142. // input: origin, dir, team, clientnum, enemy, teammate, ineyes, surfacetype
  1143. weapon/lightning/impact {
  1144.  
  1145. soundList {
  1146.  
  1147. sound/weapons/lightning/lg_hit.wav
  1148. sound/weapons/lightning/lg_hit2.wav
  1149. sound/weapons/lightning/lg_hit3.wav
  1150. }
  1151. }
  1152.  
  1153. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  1154. weapon/lightning/impactflesh {
  1155.  
  1156. soundList {
  1157.  
  1158. sound/weapons/lightning/lg_hit.wav
  1159. sound/weapons/lightning/lg_hit2.wav
  1160. sound/weapons/lightning/lg_hit3.wav
  1161. }
  1162.  
  1163. shader flareShader
  1164. repeat 30 + rand * 40 {
  1165.  
  1166. random dir
  1167. addScale parentVelocity dir velocity 350 * rand
  1168. width 2 + 1 * rand
  1169.  
  1170. emitter 0.1 * rand + rand * 0.2 {
  1171.  
  1172. size 20 - lerp * 20
  1173.  
  1174. color 0.1 0.4 1
  1175.  
  1176. colorFade 0.8
  1177. moveBounce 150 0.8
  1178. Spark
  1179. }
  1180. }
  1181. }
  1182.  
  1183. // GRENADE
  1184.  
  1185. // input: origin, team, clientnum, enemy, teammate, ineyes
  1186. weapon/grenade/flash {
  1187.  
  1188. color 1 0.75 0
  1189. size 300 + rand * 32
  1190. light
  1191. }
  1192.  
  1193. // input: velocity, dir, rotate, origin, angles, axis, size, team, clientnum, enemy, teammate, ineyes
  1194. weapon/grenade/projectile {
  1195.  
  1196. model models/ammo/grenade1.md3
  1197.  
  1198. if velocity {
  1199.  
  1200. rotate time * 1000 / 4
  1201. }
  1202.  
  1203. dirModel
  1204. }
  1205.  
  1206.  
  1207. // input: origin, angles, velocity, dir, axis, team, clientnum, enemy, teammate, ineyes
  1208. weapon/grenade/trail {
  1209.  
  1210. alpha 0.33
  1211. shader smokePuff
  1212. angle 360 * rand
  1213.  
  1214. interval 0.05 {
  1215. emitter 0.700 {
  1216. alphaFade 0
  1217. size 8 + lerp * 32
  1218. sprite cullNear
  1219. }
  1220. }
  1221. }
  1222.  
  1223. // input: origin, dir, surfacetype
  1224. weapon/grenade/impact {
  1225.  
  1226. vibrate 70
  1227. sound sound/weapons/rocket/rocklx1a.wav
  1228.  
  1229. // light
  1230.  
  1231. color 1 0.5 0.1
  1232. emitter 1 {
  1233.  
  1234. size 200 * clip( 2 - 2 * lerp )
  1235. Light
  1236. }
  1237.  
  1238. // beams
  1239.  
  1240. width 40
  1241. shader flareExplosion
  1242. repeat 4 + 4 * rand {
  1243.  
  1244. normalize dir
  1245. wobble dir velocity 40 + 30 * rand
  1246.  
  1247. emitter 0.6 + rand * 0.3 {
  1248.  
  1249. size 400 - lerp * 200
  1250.  
  1251. color 1 0.5 0.1
  1252.  
  1253. colorFade 0
  1254. Spark
  1255. }
  1256. }
  1257.  
  1258. repeat 3 + 3 * rand {
  1259.  
  1260. normalize dir
  1261. wobble dir velocity 40 + 30 * rand
  1262.  
  1263. emitter 0.6 + rand * 0.3 {
  1264.  
  1265. size 400 - lerp * 300
  1266.  
  1267. color 1 0.1 0.1
  1268.  
  1269. colorFade 0
  1270. Spark
  1271. }
  1272. }
  1273.  
  1274. repeat 2 + 2 * rand {
  1275.  
  1276. normalize dir
  1277. wobble dir velocity 40 + 30 * rand
  1278.  
  1279. emitter 0.6 + rand * 0.3 {
  1280.  
  1281. size 400 - lerp * 350
  1282.  
  1283. color 0 0.3 0.6
  1284.  
  1285. colorFade 0
  1286. Spark
  1287. }
  1288. }
  1289.  
  1290.  
  1291. // explosion
  1292.  
  1293. copy origin parentOrigin
  1294. copy velocity parentVelocity
  1295.  
  1296. t0 180 / pi
  1297. t1 pi * 2
  1298.  
  1299. normalize dir v2
  1300. perpendicular dir v0
  1301. cross v0 v2 v1
  1302.  
  1303. shader flareShader
  1304. repeat 50 + rand * 60 {
  1305.  
  1306. random dir
  1307. addScale parentVelocity dir velocity 450 * rand
  1308. width 2 + 1 * rand
  1309.  
  1310. emitter 0.7 * rand + rand * 0.4 {
  1311.  
  1312. size 20 - lerp * 20
  1313.  
  1314. color 1 0.4 0.1
  1315.  
  1316. colorFade 0.8
  1317. moveBounce 150 0.8
  1318. Spark
  1319. }
  1320. }
  1321.  
  1322. repeat 200 + 50 * rand {
  1323.  
  1324. t2 2 * rand - 1
  1325. t3 t1 * rand
  1326.  
  1327. t4 25 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1328. t5 25 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1329. t6 25 * cos( t0 * acos( t2 ) )
  1330.  
  1331. scale v0 v3 t4
  1332. addScale v3 v1 v4 t5
  1333. addScale v4 v2 v5 t6
  1334.  
  1335. add parentOrigin v5 origin
  1336.  
  1337. t7 4 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1338. t8 4 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1339. t9 4 * cos( t0 * acos( t2 ) )
  1340.  
  1341. scale v0 v6 t7
  1342. addScale v6 v1 v7 t8
  1343. addScale v7 v2 v8 t9
  1344.  
  1345. addScale parentVelocity v8 velocity 10 + 10 * rand
  1346.  
  1347. emitter 0.6 + 0.4 * rand {
  1348.  
  1349. size ( t3 * 2 ) - ( t3 * 2 ) * lerp
  1350.  
  1351. color 1 0.2 0.1
  1352.  
  1353. moveBounce 1 1
  1354. moveGravity 0
  1355. Sprite cullNear
  1356. }
  1357. }
  1358.  
  1359. repeat 50 + 50 * rand {
  1360.  
  1361. t2 30 * rand
  1362.  
  1363. t3 cos( t0 * loop * t1 )
  1364. t4 sin( t0 * loop * t1 )
  1365.  
  1366. scale v0 v3 35 * t3
  1367. addScale v3 v1 v4 35 * t4
  1368.  
  1369. add parentOrigin v4 origin
  1370.  
  1371. t5 4 * -sin( t0 * loop * t1 )
  1372. t6 4 * cos( t0 * loop * t1 )
  1373.  
  1374. scale v0 v5 t5
  1375. addScale v5 v1 v6 t6
  1376.  
  1377. scale v2 v7 8 * rand
  1378. add v6 v7 v8
  1379. addScale parentVelocity v8 velocity 15 + 5 * rand
  1380.  
  1381. emitter 0.6 + 0.2 * rand {
  1382.  
  1383. size t2 - t2 * ( 0.5 * lerp )
  1384. width size - size * lerp
  1385.  
  1386. color 1 0.2 0.1
  1387.  
  1388. colorFade 0
  1389. moveBounce 1 1
  1390. moveGravity 0
  1391. Spark cullNear
  1392. }
  1393. }
  1394.  
  1395. repeat 40 + 40 * rand {
  1396.  
  1397. t2 30 * rand
  1398.  
  1399. t3 cos( t0 * loop * t1 )
  1400. t4 sin( t0 * loop * t1 )
  1401.  
  1402. scale v0 v3 25 * t3
  1403. addScale v3 v1 v4 25 * t4
  1404.  
  1405. add parentOrigin v4 origin
  1406.  
  1407. t5 8 * -sin( t0 * loop * t1 )
  1408. t6 8 * cos( t0 * loop * t1 )
  1409.  
  1410. scale v0 v5 t5
  1411. addScale v5 v1 v6 t6
  1412.  
  1413. scale v2 v7 6 * rand
  1414. add v6 v7 v8
  1415. addScale parentVelocity v8 velocity 15 + 5 * rand
  1416.  
  1417. emitter 0.6 + 0.2 * rand {
  1418.  
  1419. size t2 - t2 * ( 0.5 * lerp )
  1420. width size - size * lerp
  1421.  
  1422. color 1 0.2 0.1
  1423.  
  1424. colorFade 0
  1425. moveBounce 1 1
  1426. moveGravity 0
  1427. Spark cullNear
  1428. }
  1429. }
  1430.  
  1431. repeat 30 + 30 * rand {
  1432.  
  1433. t2 5 + 20 * rand
  1434.  
  1435. t3 cos( t0 * loop * t1 )
  1436. t4 sin( t0 * loop * t1 )
  1437.  
  1438. scale v0 v3 15 * t3
  1439. addScale v3 v1 v4 15 * t4
  1440.  
  1441. add parentOrigin v4 origin
  1442.  
  1443. t5 12 * -sin( t0 * loop * t1 )
  1444. t6 12 * cos( t0 * loop * t1 )
  1445.  
  1446. scale v0 v5 t5
  1447. addScale v5 v1 v6 t6
  1448.  
  1449. scale v2 v7 2 * rand
  1450. add v6 v7 v8
  1451. addScale parentVelocity v8 velocity 15 + 5 * rand
  1452.  
  1453. emitter 0.6 + 0.2 * rand {
  1454.  
  1455. size t2 - t2 * ( 0.5 * lerp )
  1456. width size - size * lerp
  1457.  
  1458. color 1 0.4 0.1
  1459.  
  1460. colorFade 0
  1461. moveBounce 1 1
  1462. moveGravity 0
  1463. Spark cullNear
  1464. }
  1465. }
  1466.  
  1467. // decal
  1468.  
  1469. rotate rand * 360
  1470. shader gfx/damage/crack_mrk
  1471. size 100
  1472. Decal
  1473. }
  1474.  
  1475. // SHOTGUN
  1476.  
  1477. // input: origin, team, clientnum, enemy, teammate, ineyes
  1478. weapon/shotgun/flash {
  1479.  
  1480. color 1 0.75 0
  1481. size 300 + rand * 32
  1482. Light
  1483. }
  1484.  
  1485. // input: origin, dir, team, clientnum, enemy, teammate, ineyes, surfacetype
  1486. weapon/shotgun/impact {
  1487.  
  1488. vibrate 1
  1489. shader gfx/damage/bullet_mrk
  1490. size 4
  1491. Decal
  1492.  
  1493. size 1
  1494. shader bulletExplosion
  1495. model models/weaphits/bullet.md3
  1496. rotate rand * 360
  1497. emitter 0.6 {
  1498.  
  1499. dirModel
  1500. }
  1501. }
  1502.  
  1503. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  1504. weapon/shotgun/impactflesh {
  1505.  
  1506. shader flareShader
  1507. repeat 10 + rand * 20 {
  1508.  
  1509. random dir
  1510. addScale parentVelocity dir velocity 350 * rand
  1511. width 2 + 1 * rand
  1512.  
  1513. emitter 0.1 * rand + rand * 0.2 {
  1514.  
  1515. size 20 - lerp * 20
  1516.  
  1517. color 0.1 0.4 1
  1518.  
  1519. colorFade 0.8
  1520. moveBounce 150 0.8
  1521. Spark
  1522. }
  1523. }
  1524. }
  1525.  
  1526. // MACHINEGUN
  1527.  
  1528. // input: origin, dir, team, clientnum, enemy, teammate, ineyes, surfacetype
  1529. weapon/machinegun/impact {
  1530.  
  1531. soundList {
  1532. sound/weapons/machinegun/ric1.wav
  1533. sound/weapons/machinegun/ric2.wav
  1534. sound/weapons/machinegun/ric3.wav
  1535. }
  1536.  
  1537. shader gfx/damage/bullet_mrk
  1538. size 8
  1539. Decal
  1540.  
  1541. size 1
  1542. shader bulletExplosion
  1543. model models/weaphits/bullet.md3
  1544. rotate rand * 360
  1545. emitter 0.6 {
  1546.  
  1547. dirModel
  1548. }
  1549. }
  1550.  
  1551. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  1552. weapon/machinegun/impactflesh {
  1553.  
  1554. shader flareShader
  1555. repeat 10 + rand * 20 {
  1556.  
  1557. random dir
  1558. addScale parentVelocity dir velocity 350 * rand
  1559. width 2 + 1 * rand
  1560.  
  1561. emitter 0.1 * rand + rand * 0.2 {
  1562.  
  1563. size 20 - lerp * 20
  1564.  
  1565. color 0.1 0.4 1
  1566.  
  1567. colorFade 0.8
  1568. moveBounce 150 0.8
  1569. Spark
  1570. }
  1571. }
  1572. }
  1573.  
  1574. // GAUNTLET
  1575.  
  1576. // input: origin, team, clientnum, enemy, teammate, ineyes
  1577. weapon/gauntlet/flash {
  1578.  
  1579. color 0.6 0.6 1
  1580. size 300 + rand * 32
  1581. Light
  1582. }
  1583.  
  1584. // input: origin, dir, team, clientnum, enemy, teammate, ineyes
  1585. weapon/gauntlet/impactflesh {
  1586.  
  1587. shader flareShader
  1588. repeat 30 + rand * 40 {
  1589.  
  1590. random dir
  1591. addScale parentVelocity dir velocity 350 * rand
  1592. width 2 + 1 * rand
  1593.  
  1594. emitter 0.2 * rand + rand * 0.4 {
  1595.  
  1596. size 20 - lerp * 20
  1597.  
  1598. color 0.1 0.4 1
  1599.  
  1600. colorFade 0.8
  1601. moveBounce 150 0.8
  1602. Spark
  1603. }
  1604. }
  1605. }
  1606.  
  1607. // BFG
  1608.  
  1609. // input: origin, team, clientnum, enemy, teammate, ineyes
  1610. weapon/bfg/flash {
  1611.  
  1612. color 0.2 0.2 1
  1613. size 300 + rand * 32
  1614. Light
  1615. }
  1616.  
  1617. // input: velocity, dir, rotate, origin, angles, axis, size
  1618. weapon/bfg/projectile {
  1619.  
  1620. loopSound "sound/weapons/rocket/rockfly.wav"
  1621. model models/weaphits/bfg.md3
  1622. size 1
  1623. dirModel
  1624. }
  1625.  
  1626. // input: origin, angles, velocity, dir (normalized), axis
  1627. weapon/bfg/trail {
  1628.  
  1629. // world glow
  1630.  
  1631. color 0.2 0.2 1
  1632. size 200
  1633. Light
  1634. }
  1635.  
  1636. // input: origin, dir
  1637. weapon/bfg/impact {
  1638.  
  1639. vibrate 100
  1640. sound sound/weapons/rocket/rocklx1a.wav
  1641.  
  1642. // light
  1643.  
  1644. color 0.2 0.2 1
  1645. emitter 1 {
  1646.  
  1647. size 200 * clip( 2 - 2 * lerp )
  1648. Light
  1649. }
  1650.  
  1651. // beams
  1652.  
  1653. width 40
  1654. shader flareExplosion
  1655. repeat 4 + 4 * rand {
  1656.  
  1657. normalize dir
  1658. wobble dir velocity 40 + 30 * rand
  1659.  
  1660. emitter 0.6 + rand * 0.3 {
  1661.  
  1662. size 400 - lerp * 200
  1663.  
  1664. color 0.2 0.2 1
  1665.  
  1666. colorFade 0
  1667. Spark
  1668. }
  1669. }
  1670.  
  1671. repeat 3 + 3 * rand {
  1672.  
  1673. normalize dir
  1674. wobble dir velocity 40 + 30 * rand
  1675.  
  1676. emitter 0.6 + rand * 0.3 {
  1677.  
  1678. size 400 - lerp * 300
  1679.  
  1680. color 0.2 0.4 1
  1681.  
  1682. colorFade 0
  1683. Spark
  1684. }
  1685. }
  1686.  
  1687. repeat 2 + 2 * rand {
  1688.  
  1689. normalize dir
  1690. wobble dir velocity 40 + 30 * rand
  1691.  
  1692. emitter 0.6 + rand * 0.3 {
  1693.  
  1694. size 400 - lerp * 350
  1695.  
  1696. color 0.2 0.6 1
  1697.  
  1698. colorFade 0
  1699. Spark
  1700. }
  1701. }
  1702.  
  1703.  
  1704. // explosion
  1705.  
  1706. copy origin parentOrigin
  1707. copy velocity parentVelocity
  1708.  
  1709. t0 180 / pi
  1710. t1 pi * 2
  1711.  
  1712. normalize dir v2
  1713. perpendicular dir v0
  1714. cross v0 v2 v1
  1715.  
  1716. shader flareShader
  1717. repeat 50 + rand * 60 {
  1718.  
  1719. random dir
  1720. addScale parentVelocity dir velocity 450 * rand
  1721. width 2 + 1 * rand
  1722.  
  1723. emitter 0.7 * rand + rand * 0.4 {
  1724.  
  1725. size 20 - lerp * 20
  1726.  
  1727. color 0.2 0.4 1
  1728.  
  1729. colorFade 0.8
  1730. moveBounce 150 0.8
  1731. Spark
  1732. }
  1733. }
  1734.  
  1735. repeat 200 + 50 * rand {
  1736.  
  1737. t2 2 * rand - 1
  1738. t3 t1 * rand
  1739.  
  1740. t4 25 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1741. t5 25 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1742. t6 25 * cos( t0 * acos( t2 ) )
  1743.  
  1744. scale v0 v3 t4
  1745. addScale v3 v1 v4 t5
  1746. addScale v4 v2 v5 t6
  1747.  
  1748. add parentOrigin v5 origin
  1749.  
  1750. t7 4 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1751. t8 4 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1752. t9 4 * cos( t0 * acos( t2 ) )
  1753.  
  1754. scale v0 v6 t7
  1755. addScale v6 v1 v7 t8
  1756. addScale v7 v2 v8 t9
  1757.  
  1758. addScale parentVelocity v8 velocity 10 + 10 * rand
  1759.  
  1760. emitter 0.6 + 0.4 * rand {
  1761.  
  1762. size ( t3 * 2 ) - ( t3 * 2 ) * lerp
  1763.  
  1764. color 0.2 0.2 1
  1765.  
  1766. moveBounce 1 1
  1767. moveGravity 0
  1768. Sprite cullNear
  1769. }
  1770. }
  1771.  
  1772. repeat 50 + 50 * rand {
  1773.  
  1774. t2 30 * rand
  1775.  
  1776. t3 cos( t0 * loop * t1 )
  1777. t4 sin( t0 * loop * t1 )
  1778.  
  1779. scale v0 v3 35 * t3
  1780. addScale v3 v1 v4 35 * t4
  1781.  
  1782. add parentOrigin v4 origin
  1783.  
  1784. t5 4 * -sin( t0 * loop * t1 )
  1785. t6 4 * cos( t0 * loop * t1 )
  1786.  
  1787. scale v0 v5 t5
  1788. addScale v5 v1 v6 t6
  1789.  
  1790. scale v2 v7 8 * rand
  1791. add v6 v7 v8
  1792. addScale parentVelocity v8 velocity 15 + 5 * rand
  1793.  
  1794. emitter 0.6 + 0.2 * rand {
  1795.  
  1796. size t2 - t2 * ( 0.5 * lerp )
  1797. width size - size * lerp
  1798.  
  1799. color 0.2 0.2 1
  1800.  
  1801. colorFade 0
  1802. moveBounce 1 1
  1803. moveGravity 0
  1804. Spark cullNear
  1805. }
  1806. }
  1807.  
  1808. repeat 40 + 40 * rand {
  1809.  
  1810. t2 30 * rand
  1811.  
  1812. t3 cos( t0 * loop * t1 )
  1813. t4 sin( t0 * loop * t1 )
  1814.  
  1815. scale v0 v3 25 * t3
  1816. addScale v3 v1 v4 25 * t4
  1817.  
  1818. add parentOrigin v4 origin
  1819.  
  1820. t5 8 * -sin( t0 * loop * t1 )
  1821. t6 8 * cos( t0 * loop * t1 )
  1822.  
  1823. scale v0 v5 t5
  1824. addScale v5 v1 v6 t6
  1825.  
  1826. scale v2 v7 6 * rand
  1827. add v6 v7 v8
  1828. addScale parentVelocity v8 velocity 15 + 5 * rand
  1829.  
  1830. emitter 0.6 + 0.2 * rand {
  1831.  
  1832. size t2 - t2 * ( 0.5 * lerp )
  1833. width size - size * lerp
  1834.  
  1835. color 0.2 0.2 1
  1836.  
  1837. colorFade 0
  1838. moveBounce 1 1
  1839. moveGravity 0
  1840. Spark cullNear
  1841. }
  1842. }
  1843.  
  1844. repeat 30 + 30 * rand {
  1845.  
  1846. t2 5 + 20 * rand
  1847.  
  1848. t3 cos( t0 * loop * t1 )
  1849. t4 sin( t0 * loop * t1 )
  1850.  
  1851. scale v0 v3 15 * t3
  1852. addScale v3 v1 v4 15 * t4
  1853.  
  1854. add parentOrigin v4 origin
  1855.  
  1856. t5 12 * -sin( t0 * loop * t1 )
  1857. t6 12 * cos( t0 * loop * t1 )
  1858.  
  1859. scale v0 v5 t5
  1860. addScale v5 v1 v6 t6
  1861.  
  1862. scale v2 v7 2 * rand
  1863. add v6 v7 v8
  1864. addScale parentVelocity v8 velocity 15 + 5 * rand
  1865.  
  1866. emitter 0.6 + 0.2 * rand {
  1867.  
  1868. size t2 - t2 * ( 0.5 * lerp )
  1869. width size - size * lerp
  1870.  
  1871. color 0.2 0.4 1
  1872.  
  1873. colorFade 0
  1874. moveBounce 1 1
  1875. moveGravity 0
  1876. Spark cullNear
  1877. }
  1878. }
  1879.  
  1880. // decal
  1881.  
  1882. rotate rand * 360
  1883. shader gfx/damage/crack_mrk
  1884. size 100
  1885. Decal
  1886. }
  1887.  
  1888. // OTHER EFFECTS
  1889.  
  1890. // input: origin, velocity, team, clientnum, enemy, teammate, ineyes
  1891. player/gibbed {
  1892.  
  1893. shader flareShader
  1894. repeat 20 + rand * 30 {
  1895.  
  1896. random dir
  1897. addScale parentVelocity dir velocity 450 * rand
  1898. width 2 + 1 * rand
  1899.  
  1900. emitter 0.7 * rand + rand * 0.4 {
  1901.  
  1902. size 20 - lerp * 20
  1903.  
  1904. color 0.1 0.3 1
  1905.  
  1906. colorFade 0.8
  1907. moveBounce 150 0.8
  1908. Spark cullNear
  1909. }
  1910. }
  1911.  
  1912. repeat 20 + rand * 30 {
  1913.  
  1914. random dir
  1915. addScale parentVelocity dir velocity 450 * rand
  1916. width 2 + 1 * rand
  1917.  
  1918. emitter 0.7 * rand + rand * 0.4 {
  1919.  
  1920. size 20 - lerp * 20
  1921.  
  1922. color 0.1 0.6 1
  1923.  
  1924. colorFade 0.8
  1925. moveBounce 150 0.8
  1926. Spark cullNear
  1927. }
  1928. }
  1929.  
  1930. repeat 20 + rand * 10 {
  1931.  
  1932. random dir
  1933. addScale parentVelocity dir velocity 350 * rand
  1934.  
  1935. size rand * 3
  1936.  
  1937. emitter rand + rand {
  1938.  
  1939. color 0.1 0.3 1
  1940.  
  1941. colorFade 0
  1942. moveBounce 250 0.8
  1943. Sprite cullNear
  1944. }
  1945. }
  1946.  
  1947. repeat 30 + rand * 20 {
  1948.  
  1949. random dir
  1950. addScale parentVelocity dir velocity 350 * rand
  1951.  
  1952. size rand * 3
  1953.  
  1954. emitter rand + rand {
  1955.  
  1956. color 0.1 0.6 1
  1957.  
  1958. colorFade 0
  1959. moveBounce 250 0.8
  1960. Sprite cullNear
  1961. }
  1962. }
  1963.  
  1964. t0 180 / pi
  1965. t1 pi * 2
  1966.  
  1967. normalize dir v2
  1968. perpendicular dir v0
  1969. cross v0 v2 v1
  1970.  
  1971. clear velocity
  1972.  
  1973. copy origin parentOrigin
  1974. copy velocity parentVelocity
  1975.  
  1976. repeat 150 + 50 * rand {
  1977.  
  1978. t2 2 * rand - 1
  1979. t3 t1 * rand
  1980.  
  1981. t4 8 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1982. t5 8 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1983. t6 8 * cos( t0 * acos( t2 ) )
  1984.  
  1985. scale v0 v3 t4
  1986. addScale v3 v1 v4 t5
  1987. addScale v4 v2 v5 t6
  1988.  
  1989. add parentOrigin v5 origin
  1990.  
  1991. t7 4 * sin( t0 * acos( t2 ) ) * cos( t0 * loop * t3 )
  1992. t8 4 * sin( t0 * acos( t2 ) ) * sin( t0 * loop * t3 )
  1993. t9 4 * cos( t0 * acos( t2 ) )
  1994.  
  1995. scale v0 v6 t7
  1996. addScale v6 v1 v7 t8
  1997. addScale v7 v2 v8 t9
  1998.  
  1999. addScale parentVelocity v8 velocity 20 + 40 * rand
  2000.  
  2001. emitter 0.7 + 0.4 * rand {
  2002.  
  2003. size t3 - t3 * lerp
  2004.  
  2005. color 0.1 0.3 1
  2006.  
  2007. moveBounce 1 1
  2008. moveGravity 0
  2009. Sprite cullNear
  2010. }
  2011. }
  2012. }
  2013.  
  2014. // input: origin
  2015. player/teleportIn {
  2016.  
  2017. sound sound/world/telein.wav
  2018. }
  2019.  
  2020. // input: origin
  2021. player/teleportOut {
  2022.  
  2023. sound sound/world/teleout.wav
  2024. }
  2025.  
  2026. // input: origin
  2027. weapon/common/bubbles {
  2028.  
  2029. shader waterbubble
  2030. distance 5 + rand * 10 {
  2031.  
  2032. size 1 + rand * 2
  2033. random dir
  2034. addScale origin dir origin 10 * rand
  2035.  
  2036. emitter 1 + rand * 0.25 {
  2037.  
  2038. alphaFade 0
  2039. origin2 origin2 + lerp * 8
  2040. Sprite
  2041. }
  2042. }
  2043. }
  2044.  
  2045.  
  2046. // input: origin, angles, velocity, dir, team, clientnum, enemy, teammate, ineyes
  2047. // player/haste {}
  2048.  
  2049. // input: origin, angles, velocity, dir, team, clientnum, enemy, teammate, ineyes
  2050. // player/flight {}
  2051.  
  2052. // input: origin, angles, velocity, dir, team, clientnum, enemy, teammate, ineyes
  2053. // player/head/trail {}
  2054.  
  2055. // input: origin, angles, velocity, dir, team, clientnum, enemy, teammate, ineyes
  2056. // player/torso/trail {}
  2057.  
  2058. // input: origin, angles, velocity, dir, team, clientnum, enemy, teammate, ineyes
  2059. // player/legs/trail {}
  2060.  
  2061. // input: origin, velocity, team, clientnum, enemy, teammate, ineyes
  2062. // player/thawed {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement