Advertisement
biu

Untitled

biu
Nov 26th, 2012
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 KB | None | 0 0
  1. function bool checkhaveamp(optional bool eatcharge,optional float eatchargep)
  2. { // Find ANY amp, that the player owns, and use its charge to increase weapons output..
  3. // Basicly let any arbritary object become a usable amplifier.
  4. local pickup p;
  5. local bool useitup;
  6.  
  7. // Make sure we acully have a value higher then 0.0
  8. //if (eatcharge < 0.1) { eatcharge = 0.1;}
  9. // could have just check float for zero isstead of using a bool...
  10.  
  11. foreach AllActors(class'pickup',p) // Find stuff
  12. { if (p.owner == playerpawn(owner)) // Stuff this current owner has
  13. { if (p.IsA('amplifier') || p.IsA('enhAmp')||p.IsA('dzamplifier'))
  14. { // various amplifiers or any object can be used.
  15. if (p.charge > 0) // It really dont matter if we are not subtracting
  16. {
  17. if (useitup && p.IsInState('activated')) // Only Consume if the player has it active.
  18. { // it may subtract from all the amp(s) you have ,
  19. // but the players not expeced to have more then one.
  20. p.charge=p.charge - eatchargep;
  21. return true;
  22. }else{
  23. return true;
  24. }
  25.  
  26. }
  27. }
  28.  
  29. }
  30. }
  31. return false;
  32. }
  33.  
  34.  
  35. function Fire( float Value )
  36. {
  37. GotoState('NormalFire');
  38. if ( PlayerPawn(Owner) != None )
  39. PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert);
  40. bPointing=True;
  41. PlayFiring();
  42. // if ( !bRapidFire && (FiringSpeed > 0) )
  43. // {
  44. // Pawn(Owner).PlayRecoil(FiringSpeed);
  45.  
  46.  
  47. if ( PowerLevel > 0 && powerlevel < 2 )
  48. {
  49. pjt = ProjectileFire(class'DispersionAmmo', ProjectileSpeed, bWarnTarget);
  50. if (pjt != none && checkhaveamp())
  51. {
  52. pjt.damage = pjt.Damage + 5;
  53. pjt.drawscale= 1.8;
  54. }
  55.  
  56. }
  57. if ( PowerLevel > 1 && powerlevel < 3 )
  58. {
  59. pjt= ProjectileFire(class'dammo2', ProjectileSpeed, bWarnTarget);
  60. if (pjt != none && checkhaveamp())
  61. {
  62. pjt.damage = pjt.Damage + 5;
  63. pjt.drawscale= 1.8;
  64. }
  65. }
  66. if ( PowerLevel > 2 && powerlevel < 4 )
  67. {
  68. pjt = ProjectileFire(class'dammo3', ProjectileSpeed, bWarnTarget);
  69. if (pjt != none && checkhaveamp())
  70. {
  71. pjt.damage = pjt.Damage + 5;
  72. pjt.drawscale= 1.8;
  73. }
  74. }
  75. if ( PowerLevel > 3 && powerlevel < 5 )
  76. {
  77. pjt =ProjectileFire(class'dammo4', ProjectileSpeed, bWarnTarget);
  78. if (pjt != none && checkhaveamp())
  79. {
  80. pjt.damage = pjt.Damage + 5;
  81. pjt.drawscale= 1.8;
  82. }
  83. }
  84. if ( PowerLevel > 4 && powerlevel < 6 )
  85. {
  86. pjt = ProjectileFire(class'dammo5', ProjectileSpeed, bWarnTarget);
  87. if (pjt != none && checkhaveamp())
  88. {
  89. pjt.damage = pjt.Damage + 5;
  90. pjt.drawscale= 1.8;
  91. }
  92. }
  93. //}
  94. if ( Owner.bHidden )
  95. CheckVisibility();
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement