Advertisement
KishgalYS

Weapon_Package_FortWars\pistola\fnp.cs

Jul 28th, 2015
22
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.71 KB | None | 0 0
  1. //FNP.cs
  2.  
  3. AddDamageType("FNP", '<bitmap:add-ons/Weapon_Package_FortWars/graphics/CI_FNP> %1', '%2 <bitmap:add-ons/Weapon_Package_FortWars/graphics/CI_FNP> %1',0.2,1);
  4. AddDamageType("FNPHeadshot", '<bitmap:add-ons/Weapon_Package_FortWars/graphics/CI_FNP><bitmap:add-ons/Weapon_Package_FortWars/graphics/ci_headshot> %1', '%2 <add-ons/Weapon_Package_FortWars/graphics/CI_FNP><bitmap:add-ons/Weapon_Package_FortWars/graphics/ci_headshot> %1',0.75,1);
  5. datablock ProjectileData(FNPProjectile)
  6. {
  7. projectileShapeName = "./bullet.dts";
  8. directDamage = 25;
  9. directDamageType = $DamageType::FNP;
  10. radiusDamageType = $DamageType::FNP;
  11.  
  12. brickExplosionRadius = 0;
  13. brickExplosionImpact = true; //destroy a brick if we hit it directly?
  14. brickExplosionForce = 10;
  15. brickExplosionMaxVolume = 1; //max volume of bricks that we can destroy
  16. brickExplosionMaxVolumeFloating = 2; //max volume of bricks that we can destroy if they aren't connected to the ground
  17.  
  18. impactImpulse = 400;
  19. verticalImpulse = 400;
  20. explosion = FNPExplosion;
  21. particleEmitter = FNPtrailEmitter;
  22.  
  23. muzzleVelocity = 150;
  24. velInheritFactor = 1;
  25.  
  26. armingDelay = 00;
  27. lifetime = 4000;
  28. fadeDelay = 3500;
  29. bounceElasticity = 0.5;
  30. bounceFriction = 0.20;
  31. isBallistic = false;
  32. gravityMod = 0.0;
  33.  
  34. hasLight = true;
  35. lightRadius = 1.5;
  36. lightColor = "1 0.8 0";
  37.  
  38. uiName = "FNP Bullet";
  39. };
  40.  
  41. //////////
  42. // item //
  43. //////////
  44. datablock ItemData(FNPItem)
  45. {
  46. category = "Weapon"; // Mission editor category
  47. className = "Weapon"; // For inventory system
  48.  
  49. // Basic Item Properties
  50. shapeFile = "./fnp.dts";
  51. rotate = false;
  52. mass = 1;
  53. density = 0.2;
  54. elasticity = 0.2;
  55. friction = 0.6;
  56. emap = true;
  57.  
  58. //gui stuff
  59. uiName = "Pistol A";
  60. iconName = "add-ons/Weapon_Package_FortWars/graphics/icon_FNP";
  61. doColorShift = true;
  62. colorShiftColor = "0.25 0.25 0.25 1.000";
  63.  
  64. // Dynamic properties defined by the scripts
  65. image = FNPImage;
  66. canDrop = true;
  67. };
  68.  
  69. ////////////////
  70. //weapon image//
  71. ////////////////
  72. datablock ShapeBaseImageData(FNPImage)
  73. {
  74. // Basic Item properties
  75. shapeFile = "./fnp.dts";
  76. emap = true;
  77.  
  78. // Specify mount point & offset for 3rd person, and eye offset
  79. // for first person rendering.
  80. mountPoint = 0;
  81. offset = "0 0 0";
  82. eyeOffset = 0; //"0.7 1.2 -0.5";
  83. rotation = eulerToMatrix( "0 0 0" );
  84.  
  85. // When firing from a point offset from the eye, muzzle correction
  86. // will adjust the muzzle vector to point to the eye LOS point.
  87. // Since this weapon doesn't actually fire from the muzzle point,
  88. // we need to turn this off.
  89. correctMuzzleVector = true;
  90.  
  91. // Add the WeaponImage namespace as a parent, WeaponImage namespace
  92. // provides some hooks into the inventory system.
  93. className = "WeaponImage";
  94.  
  95. // Projectile && Ammo.
  96. item = BowItem;
  97. ammo = " ";
  98. projectile = FNPProjectile;
  99. projectileType = Projectile;
  100.  
  101. casing = FNPShellDebris;
  102. shellExitDir = "1.0 1.3 -0.3";
  103. shellExitOffset = "0 0 0";
  104. shellExitVariance = 15.0;
  105. shellVelocity = 7.0;
  106.  
  107. //melee particles shoot from eye node for consistancy
  108. melee = false;
  109. //raise your arm up or not
  110. armReady = true;
  111.  
  112. doColorShift = true;
  113. colorShiftColor = FNPItem.colorShiftColor;//"0.400 0.196 0 1.000";
  114.  
  115. //casing = " ";
  116.  
  117. // Images have a state system which controls how the animations
  118. // are run, which sounds are played, script callbacks, etc. This
  119. // state system is downloaded to the client so that clients can
  120. // predict state changes and animate accordingly. The following
  121. // system supports basic ready->fire->reload transitions as
  122. // well as a no-ammo->dryfire idle state.
  123.  
  124. // Initial start up state
  125. stateName[0] = "ActivateFirst";
  126. stateTimeoutValue[0] = 0.8;
  127. stateTransitionOnTimeout[0] = "Ready";
  128. stateSequence[0] = "firstDraw";
  129. stateSound[0] = FNPFirstDrawSound;
  130.  
  131. stateName[1] = "Ready";
  132. stateTransitionOnTriggerDown[1] = "Fire";
  133. stateSequence[1] = "idle";
  134. stateAllowImageChange[1] = true;
  135. stateSequence[1] = "Ready";
  136.  
  137. stateName[2] = "Fire";
  138. stateTransitionOnTimeout[2] = "Flame";
  139. stateTimeoutValue[2] = 0.01;
  140. stateFire[2] = true;
  141. stateAllowImageChange[2] = false;
  142. stateScript[2] = "onFire";
  143. stateWaitForTimeout[2] = true;
  144. stateEmitter[2] = FNPFireFlameEmitter;
  145. stateEmitterTime[2] = 0.02;
  146. stateEmitterNode[2] = "muzzleNode";
  147. stateEjectShell[2] = true;
  148.  
  149. stateName[3] = "Flame";
  150. stateSequence[3] = "Fire";
  151. stateEmitter[3] = FNPFireGlowEmitter;
  152. stateEmitterTime[3] = 0.05;
  153. stateEmitterNode[3] = "muzzleNode";
  154. stateTimeoutValue[3] = 0.14;
  155. stateTransitionOnTimeout[3] = "Smoke";
  156.  
  157. stateName[4] = "Smoke";
  158. stateEmitter[4] = FNPFireSmokeEmitter;
  159. stateEmitterTime[4] = 3.0;
  160. stateEmitterNode[4] = "muzzleNode";
  161. stateTimeoutValue[4] = 0.01;
  162. stateTransitionOnTimeout[4] = "Reload";
  163.  
  164. stateName[5] = "Reload";
  165. stateSequence[5] = "Reload";
  166. stateTransitionOnTriggerUp[5] = "Ready";
  167. stateSequence[5] = "Ready";
  168.  
  169. };
  170.  
  171. function FNPImage::onFire(%this,%obj,%slot)
  172. {
  173. %obj.spawnExplosion(QuakeLittleRecoilProjectile,"1 1 1");
  174. %obj.playThread(2, plant);
  175. %num = getRandom(1, 3);
  176. serverPlay3D( FNPFireLocal @ %num @ Sound, %obj.getHackPosition() SPC "0 0 1 0");
  177. serverplay2d( FNPFireGlobal @ %num @ Sound );
  178. Parent::onFire(%this,%obj,%slot);
  179. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement