Advertisement
Guest User

Untitled

a guest
Dec 16th, 2015
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.97 KB | None | 0 0
  1. datablock ParticleData(smallBloodParticle)
  2. {
  3. dragCoefficient = 3;
  4. gravityCoefficient = 0.5;
  5. inheritedVelFactor = 0.3;
  6. constantAcceleration = 0;
  7. lifetimeMS = 1000;
  8. lifetimeVarianceMS = 250;
  9. textureName = "base/data/particles/dot";
  10. spinSpeed = 0;
  11. spinRandomMin = -20;
  12. spinRandomMax = 20;
  13. colors[0] = "0.6 0 0 1";
  14. colors[1] = "0.5 0 0 0.9 ";
  15. colors[2] = "0.4 0 0 0";
  16. sizes[0] = 0.06;
  17. sizes[1] = 0.09;
  18. sizes[2] = 0.04;
  19. times[1] = 0.5;
  20. times[2] = 1;
  21. useInvAlpha = true;
  22. };
  23.  
  24. datablock ParticleEmitterData(smallBloodEmitter)
  25. {
  26. ejectionPeriodMS = 2;
  27. periodVarianceMS = 0;
  28. ejectionVelocity = 2;
  29. velocityVariance = 1.2;
  30. ejectionOffset = 0;
  31. thetaMin = 0;
  32. thetaMax = 180;
  33. phiReferenceVel = 0;
  34. phiVariance = 360;
  35. overrideAdvance = false;
  36. lifetimeMS = 3500;
  37. particles = "smallBloodParticle";
  38.  
  39. uiName = "Bleed";
  40. };
  41.  
  42. datablock DebrisData(CubeDebris)
  43. {
  44. shapeFile = "./cube.dts";
  45. lifetime = 3;
  46. minSpinSpeed = -200;
  47. maxSpinSpeed = 200;
  48. useRadiusMass = true;
  49. baseRadius = 0.1;
  50. elasticity = 0.5;
  51. friction = 0.2;
  52. numBounces = 1;
  53. staticOnMaxBounce = true;
  54. fade = true;
  55. gravModifier = 2;
  56. emitters[0] = smallBloodEmitter;
  57. };
  58.  
  59. datablock ExplosionData(CubeLowExplosion)
  60. {
  61. uiName = "";
  62. lifetimeMS = 25;
  63. particleEmitter = smallBloodEmitter;
  64. particleDensity = 25;
  65. faceViewer = true;
  66. explosionScale = "1 1 1";
  67. //soundProfile = GoreExplosionSound;
  68. debris = CubeDebris;
  69. debrisNum = 1;
  70. debrisNumVariance = 1;
  71. debrisPhiMin = 0;
  72. debrisPhiMax = 360;
  73. debrisThetaMin = 0;
  74. debrisThetaMax = 360;
  75. debrisVelocity = 6;
  76. debrisVelocityVariance = 2;
  77. };
  78.  
  79. datablock explosionData(CubeMediumExplosion : CubeLowExplosion)
  80. {
  81. debrisNum = 2;
  82. };
  83.  
  84. datablock explosionData(CubeHighExplosion : CubeLowExplosion)
  85. {
  86. debrisNum = 2;
  87. };
  88.  
  89. datablock ProjectileData(CubeLowExplosionProjectile)
  90. {
  91. projectileShapeName = "base/data/shapes/empty.dts";
  92. directDamage = 0;
  93. directDamageType = $DamageType::Default;
  94. radiusDamageType = $DamageType::Default;
  95. impactImpulse = 0;
  96. verticalImpulse = 0;
  97. explosion = cubeLowExplosion;
  98.  
  99. brickExplosionRadius = 0;
  100. brickExplosionImpact = false;
  101. brickExplosionForce = 0;
  102. brickExplosionMaxVolume = 0;
  103. brickExplosionMaxVolumeFloating = 0;
  104.  
  105. muzzleVelocity = 1;
  106. velInheritFactor = 1;
  107.  
  108. lifetime = 10;
  109. bounceElasticity = 0;
  110. bounceFriction = 0;
  111. isBallistic = false;
  112. explodeOnDeath = true;
  113. hasLight = false;
  114.  
  115. uiName = "Cube Low Explosion";
  116. };
  117.  
  118. datablock projectileData(cubeMediumExplosionProjectile : cubeLowExplosionProjectile)
  119. {
  120. explosion = cubeMediumExplosion;
  121. uiName = "Cube Medium Explosion";
  122. };
  123.  
  124. datablock projectileData(cubeHighExplosionProjectile : cubeLowExplosionProjectile)
  125. {
  126. explosion = cubeHighExplosion;
  127. uiName = "Cube High Explosion";
  128. };
  129.  
  130. package CubeGore
  131. {
  132. function Player::Emote(%this,%image)
  133. {
  134. if(getSubStr(%image,0,7) $= "painLow")
  135. {
  136. %image = cubeLowExplosionProjectile;
  137. }
  138. if(getSubStr(%image,0,7) $= "painMid")
  139. {
  140. %image = cubeMediumExplosionProjectile;
  141. }
  142. if(getSubStr(%image,0,7) $= "painHig")
  143. {
  144. %image = cubeHighExplosionProjectile;
  145. }
  146. parent::Emote(%this,%image);
  147. }
  148. };
  149. activatePackage(cubeGore);
  150.  
  151.  
  152. package DamageStuff
  153. {
  154. function ProjectileData::Damage(%this, %obj, %col, %fade, %pos, %normal)
  155. {
  156. if(%col.gettype() & $TypeMasks::PlayerObjectType && fileName(%col.dataBlock.shapeFile) $= "m.dts")
  157. {
  158. //%damLoc = %col.getDamageLocation(%pos);
  159. %fvec = %col.getForwardVector();
  160. %vec1 = -getWord(%fvec,1) SPC getWord(%fvec,0) SPC 0;
  161. %vec2 = vectorNormalize(%obj.initialVelocity);
  162.  
  163. %damloc = (vectorDot(%vec1,%vec2) > 0);
  164.  
  165. %scale = getWord(%col.getScale(),2);
  166. if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 3.3*%scale)
  167. {
  168. %hidestr = "headskin";
  169. for(%i=0;$hat[%i] !$= "";%i++) %hidestr = %hidestr SPC $hat[%i];
  170. for(%i=0;$accent[%i] !$= "";%i++) %hidestr = %hidestr SPC $accent[%i];
  171. }
  172. else if(getword(%pos, 2) > getword(%col.getWorldBoxCenter(), 2) - 4.5*%scale)
  173. {
  174. //Torso shot
  175. if(%damLoc == 0)
  176. {
  177. %hidestr = "lhand lhook larm larmslim";
  178. }
  179. else
  180. {
  181. %hidestr = "rhand rhook rarm rarmslim";
  182. }
  183. }
  184. else
  185. {
  186. //Leg shot
  187. if(%damLoc == 0)
  188. {
  189. %hidestr = "lshoe lpeg";
  190. }
  191. else
  192. {
  193. %hidestr = "rshoe rpeg";
  194. }
  195. }
  196.  
  197. for(%i=0;%i<getWordCount(%hidestr);%i++)
  198. {
  199. %node = getWord(%hidestr,%i);
  200. if(%col.isNodeVisible(%node) && strStr(%col.chainsawUnhideStr," " @ %node) == -1)
  201. %col.chainsawUnhideStr = %col.chainsawUnhideStr SPC %node;
  202.  
  203. %col.hideNode(%node);
  204. }
  205.  
  206. cancel(%col.chainsawResetSched);
  207. %col.chainsawResetSched = %col.schedule(5000,chainsawReset);
  208. }
  209.  
  210. Parent::Damage(%this, %obj, %col, %fade, %pos, %normal);
  211. }
  212. };
  213. activatePackage("DamageStuff");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement