Guest User

Untitled

a guest
Apr 26th, 2018
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.86 KB | None | 0 0
  1. //
  2. //FGP - BULLET IMPACT EFFECTS
  3. //
  4.  
  5. //FGP - Client side bullet crap cvars
  6. extern cvar_t *cl_bt_impactefx;//disable/enable ALL impact effects
  7. extern cvar_t *cl_bt_texturesnd;//impact texture-type sound
  8. extern cvar_t *cl_bt_ricochetsnd;//impact ricochet sound
  9. extern cvar_t *cl_bt_nearmisssnd;//nearmiss (flyby) sound
  10. extern cvar_t *cl_bt_decals;//impact decals
  11. extern cvar_t *cl_bt_particles;//impact particles
  12. extern cvar_t *cl_bt_streaks;//impact streaks
  13. //FGP - Client side bullet crap cvars
  14.  
  15. void EV_HLDM_ImpactEFX(int iBulletType, int isplayer, int iscrowbar, cl_entity_t *pEntity, vec3_t position, vec3_t normal)
  16. {
  17. //Do nothing more, if bullet impact EFX are disabled
  18. if(cl_bt_impactefx == 0)
  19. {
  20. return;
  21. }
  22.  
  23. int entity = pEntity->index;
  24.  
  25. pmtrace_t tr;
  26. pmtrace_t *pTrace = &tr;
  27. // physent_t *pe;
  28.  
  29. VectorCopy( position, pTrace->endpos );
  30. //pTrace->ent = idx;//pEntity->index;
  31. //pe = gEngfuncs.pEventAPI->EV_GetPhysent( pTrace->ent );
  32.  
  33. //Position fix. Corrects particles sometimes not appearing on (angled) surfaces
  34. if ( pTrace->fraction != 1.0 )
  35. {
  36. position = position + (normal * 1.5);
  37. }
  38.  
  39. // hit the world, try to play sound based on texture material type
  40. char chTextureType = CHAR_TEX_CONCRETE;
  41. // float fvol;
  42. // float fvolbar;
  43. // char *rgsz[4];
  44. // int cnt;
  45. float fattn = ATTN_NORM;
  46. // int entity;
  47. char *pTextureName;
  48. char texname[ 64 ];
  49. char szbuffer[ 64 ];
  50.  
  51. // FIXME check if playtexture sounds movevar is set
  52. //
  53. chTextureType = 0;
  54.  
  55. // Player
  56. if ( entity >= 1 && entity <= gEngfuncs.GetMaxClients() )
  57. {
  58. // hit body
  59. chTextureType = CHAR_TEX_FLESH;
  60. }
  61. else if ( entity == 0 )
  62. {
  63. // get texture from entity or world (world is ent(0))
  64. pTextureName = (char *)gEngfuncs.pEventAPI->EV_TraceTexture( entity, position+normal, position-normal );//pTrace->plane.normal );//vecSrc, vecEnd );
  65.  
  66. if ( pTextureName )
  67. {
  68. strcpy( texname, pTextureName );
  69. pTextureName = texname;
  70.  
  71. // strip leading '-0' or '+0~' or '{' or '!'
  72. if (*pTextureName == '-' || *pTextureName == '+')
  73. {
  74. pTextureName += 2;
  75. }
  76.  
  77. if (*pTextureName == '{' || *pTextureName == '!' || *pTextureName == '~' || *pTextureName == ' ')
  78. {
  79. pTextureName++;
  80. }
  81.  
  82. // '}}'
  83. strcpy( szbuffer, pTextureName );
  84. szbuffer[ CBTEXTURENAMEMAX - 1 ] = 0;
  85.  
  86. // get texture type
  87. chTextureType = PM_FindTextureType( szbuffer );
  88. }
  89. }
  90.  
  91.  
  92. switch (chTextureType)
  93. {
  94. default:
  95. //CONCRETE
  96. case CHAR_TEX_CONCRETE:
  97. if(cl_bt_decals->value != 0)
  98. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  99. if(cl_bt_particles->value != 0)
  100. gParticleEngine.CreateCluster("concrete_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  101. if(cl_bt_streaks->value != 0)
  102. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 5, gEngfuncs.pfnRandomLong(8,12), 100, -150, 150 );
  103.  
  104. //if(iscrowbar)
  105. if(cl_bt_texturesnd->value != 0)
  106. {
  107. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  108. {
  109. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  110. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  111. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  112. }
  113. }
  114. break;
  115. //METAL
  116. case CHAR_TEX_METAL:
  117. case CHAR_TEX_GRATE://ass
  118. if(cl_bt_decals->value != 0)
  119. gBSPRenderer.CreateDecal( position, normal, "shot_metal", FALSE );
  120. if(cl_bt_particles->value != 0)
  121. gParticleEngine.CreateCluster("metal_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  122. if(cl_bt_streaks->value != 0)
  123. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 0, gEngfuncs.pfnRandomLong(25,35), 100, -200, 200 );
  124.  
  125. if(cl_bt_texturesnd->value != 0)
  126. {
  127. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  128. {
  129. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  130. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  131. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  132. }
  133. }
  134. break;
  135. //DIRT
  136. case CHAR_TEX_DIRT:
  137. if(cl_bt_decals->value != 0)
  138. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  139. if(cl_bt_particles->value != 0)
  140. gParticleEngine.CreateCluster("dirt_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  141.  
  142. if(cl_bt_texturesnd->value != 0)
  143. {
  144. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  145. {
  146. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_dirt1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  147. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_dirt2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  148. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_dirt3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  149. }
  150. }
  151. break;
  152. //VENT
  153. case CHAR_TEX_VENT:
  154. if(cl_bt_decals->value != 0)
  155. gBSPRenderer.CreateDecal( position, normal, "shot_metal", FALSE );
  156. if(cl_bt_particles->value != 0)
  157. gParticleEngine.CreateCluster("metal_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  158. if(cl_bt_streaks->value != 0)
  159. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 0, gEngfuncs.pfnRandomLong(20,30), 100, -200, 200 );
  160.  
  161. if(cl_bt_texturesnd->value != 0)
  162. {
  163. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  164. {
  165. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_vent1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  166. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_vent2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  167. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_vent3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  168. }
  169. }
  170. break;
  171. //GRATE
  172. /* case CHAR_TEX_GRATE:
  173. if(cl_bt_decals->value != 0)
  174. gBSPRenderer.CreateDecal( position, normal, "shot_metal", FALSE );
  175. if(cl_bt_particles->value != 0)
  176. gParticleEngine.CreateCluster("metal_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  177. if(cl_bt_streaks->value != 0)
  178. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 0, gEngfuncs.pfnRandomLong(30,40), 100, -200, 200 );
  179.  
  180. if(cl_bt_texturesnd->value != 0)
  181. {
  182. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  183. {
  184. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  185. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  186. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  187. }
  188. }
  189. break;*/
  190. //TILE
  191. case CHAR_TEX_TILE:
  192. if(cl_bt_decals->value != 0)
  193. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  194. if(cl_bt_particles->value != 0)
  195. gParticleEngine.CreateCluster("concrete_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  196. if(cl_bt_streaks->value != 0)
  197. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 5, gEngfuncs.pfnRandomLong(8,16), 60, -200, 200 );
  198.  
  199. if(cl_bt_texturesnd->value != 0)
  200. {
  201. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  202. {
  203. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_tile1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  204. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_tile2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  205. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_tile3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  206. }
  207. }
  208. break;
  209. //SLOSH
  210. case CHAR_TEX_SLOSH:
  211. if(cl_bt_particles->value != 0)
  212. gParticleEngine.CreateCluster("water_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  213.  
  214. if(cl_bt_texturesnd->value != 0)
  215. {
  216. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  217. {
  218. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_water1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  219. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_water2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  220. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_water3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  221. }
  222. }
  223. break;
  224. //WOOD
  225. case CHAR_TEX_WOOD:
  226. if(cl_bt_decals->value != 0)
  227. gBSPRenderer.CreateDecal( position, normal, "shot_wood", FALSE );
  228. if(cl_bt_particles->value != 0)
  229. gParticleEngine.CreateCluster("concrete_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  230. // if(cl_bt_streaks->value != 0)
  231. // gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 5, gEngfuncs.pfnRandomLong(2,4), 50, -80, 80 );
  232.  
  233. if(cl_bt_texturesnd->value != 0)
  234. {
  235. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  236. {
  237. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  238. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  239. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_conc3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  240. }
  241. }
  242. break;
  243. //COMPUTER
  244. case CHAR_TEX_COMPUTER:
  245. if(cl_bt_decals->value != 0)
  246. gBSPRenderer.CreateDecal( position, normal, "shot_metal", FALSE );
  247. if(cl_bt_particles->value != 0)
  248. gParticleEngine.CreateCluster("metal_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  249. if(cl_bt_streaks->value != 0)
  250. {
  251. gEngfuncs.pEfxAPI->R_SparkShower( position );//sparks
  252. gEngfuncs.pEfxAPI->R_StreakSplash( position, normal, 0, gEngfuncs.pfnRandomLong(40,60), 100, -200, 200 );
  253. }
  254.  
  255. if(cl_bt_texturesnd->value != 0)
  256. {
  257. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  258. {
  259. case 0:
  260. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110));
  261. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "buttons/spark3.wav", gEngfuncs.pfnRandomFloat(0.25, 0.45), ATTN_NORM, 0, 98);
  262. break;
  263. case 1:
  264. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110));
  265. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "buttons/spark4.wav", gEngfuncs.pfnRandomFloat(0.25, 0.45), ATTN_NORM, 0, 98);
  266. break;
  267. case 2:
  268. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_metal3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110));
  269. gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "buttons/spark6.wav", gEngfuncs.pfnRandomFloat(0.25, 0.45), ATTN_NORM, 0, 98);
  270. break;
  271. }
  272. }
  273. break;
  274. //GLASS
  275. case CHAR_TEX_GLASS:
  276. if(cl_bt_decals->value != 0)
  277. gBSPRenderer.CreateDecal( position, normal, "shot_glass", FALSE );
  278. if(cl_bt_particles->value != 0)
  279. gParticleEngine.CreateCluster("glass_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  280.  
  281. if(cl_bt_texturesnd->value != 0)
  282. {
  283. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  284. {
  285. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_glass1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  286. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_glass2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  287. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_glass3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  288. }
  289. }
  290. break;
  291. //FLESH
  292. case CHAR_TEX_FLESH:
  293. //Do nothing..?
  294. //(TODO: handle flesh/blood impacts here)
  295. break;
  296. //SNOW
  297. case CHAR_TEX_SNOW:
  298. if(cl_bt_decals->value != 0)
  299. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  300. if(cl_bt_particles->value != 0)
  301. gParticleEngine.CreateCluster("snow_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  302.  
  303. if(cl_bt_texturesnd->value != 0)
  304. {
  305. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  306. {
  307. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_snow1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  308. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_snow2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  309. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_snow3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  310. }
  311. }
  312. break;
  313. //CARPET
  314. case CHAR_TEX_CARPET:
  315. if(cl_bt_decals->value != 0)
  316. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  317. if(cl_bt_particles->value != 0)
  318. gParticleEngine.CreateCluster("carpet_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  319.  
  320. if(cl_bt_texturesnd->value != 0)
  321. {
  322. switch ( gEngfuncs.pfnRandomLong ( 0 , 2 ) )
  323. {
  324. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_carpet1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  325. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_carpet2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  326. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "bullets/impact_carpet3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  327. }
  328. }
  329. break;
  330. //ORGANIC
  331. case CHAR_TEX_ORGANIC:
  332. if(cl_bt_decals->value != 0)
  333. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  334. // if(cl_bt_particles->value != 0)
  335. // gParticleEngine.CreateCluster("organic_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  336.  
  337. if(cl_bt_texturesnd->value != 0)
  338. {
  339. switch ( gEngfuncs.pfnRandomLong ( 0 , 3 ) )
  340. {
  341. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_organic1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  342. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_organic2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  343. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_organic3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  344. case 3: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_organic4.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  345. }
  346. }
  347. break;
  348. //GRAVEL
  349. case CHAR_TEX_GRAVEL:
  350. if(cl_bt_decals->value != 0)
  351. gBSPRenderer.CreateDecal( position, normal, "shot", FALSE );
  352. if(cl_bt_particles->value != 0)
  353. gParticleEngine.CreateCluster("dirt_impact_cluster.txt", position, normal, 0);//works awesome with position fix!
  354.  
  355. if(cl_bt_texturesnd->value != 0)
  356. {
  357. switch ( gEngfuncs.pfnRandomLong ( 0 , 3 ) )
  358. {
  359. case 0: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_gravel1.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  360. case 1: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_gravel2.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  361. case 2: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_gravel3.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  362. case 3: gSoundEngine.EV_PlaySound( entity, position, CHAN_STATIC, "player/pl_gravel4.wav", gEngfuncs.pfnRandomFloat(0.3, 0.6), ATTN_NORM, 0, gEngfuncs.pfnRandomFloat(90, 110)); break;
  363. }
  364. }
  365. break;
  366. }
  367. }
Add Comment
Please, Sign In to add comment