Advertisement
Guest User

Untitled

a guest
Aug 30th, 2015
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1.  
  2.  
  3. class CKNGBulletCam extends CR4Player {
  4.  
  5. private var slowMoFactor : float;
  6. private var dodgeRollSlowMoFactor : float;
  7. private var evadeStepSlowMoFactor : float;
  8. private var counterAttackSlowMoFactor : float;
  9. private var criticalHitSlowMoFactor : float;
  10. private var dismemberSlowMoFactor : float;
  11.  
  12. private var criticalHitSlowMoChance : Int32;
  13.  
  14. private var rolling : string;
  15. private var evading : string;
  16. private var counterattack : string;
  17. private var criticalhit : string;
  18. private var dismember : string;
  19.  
  20.  
  21. public function RandomFactor() : Int32 {
  22.  
  23. var i : Int32;
  24. var Min : Int32;
  25. var Max : Int32;
  26. var Value : Int32;
  27.  
  28. i = 0;
  29.  
  30. Min = 0;
  31. Max = 100;
  32.  
  33. for(i = 0; i < 1; i+=1) {
  34.  
  35. Value = RandRange(Max, Min);
  36.  
  37. }
  38.  
  39. return Value;
  40.  
  41. }
  42.  
  43. public function SlowMoCam (isActive : bool, optional actionname : string) {
  44.  
  45.  
  46. rolling = "rolling";
  47. evading = "evading";
  48. counterattack = "counterattack";
  49. criticalhit = "criticalhit";
  50. dismember = "dismember";
  51.  
  52.  
  53. criticalHitSlowMoChance = 25;
  54.  
  55. dodgeRollSlowMoFactor = 1.0f;
  56. evadeStepSlowMoFactor = 1.0f;
  57. counterAttackSlowMoFactor = 0.5f;
  58. criticalHitSlowMoFactor = 0.2f;
  59. dismemberSlowMoFactor = 0.2;
  60.  
  61.  
  62.  
  63.  
  64.  
  65. if (isActive && actionname == rolling) {
  66.  
  67. theGame.SetTimeScale(dodgeRollSlowMoFactor, theGame.GetTimescaleSource(7), theGame.GetTimescalePriority(7), true);
  68. }
  69.  
  70. if (isActive && actionname == evading) {
  71.  
  72. theGame.SetTimeScale(evadeStepSlowMoFactor, theGame.GetTimescaleSource(7), theGame.GetTimescalePriority(7), true);
  73. }
  74.  
  75. if (isActive && actionname == counterattack) {
  76.  
  77. theGame.SetTimeScale(counterAttackSlowMoFactor, theGame.GetTimescaleSource(7), theGame.GetTimescalePriority(7), true);
  78. }
  79.  
  80. if (isActive && actionname == criticalhit && RandomFactor() < criticalHitSlowMoChance) {
  81.  
  82. theGame.SetTimeScale(criticalHitSlowMoFactor, theGame.GetTimescaleSource(7), theGame.GetTimescalePriority(7), true);
  83. }
  84.  
  85. if (isActive && actionname == dismember) {
  86.  
  87. theGame.SetTimeScale(dismemberSlowMoFactor, theGame.GetTimescaleSource(7), theGame.GetTimescalePriority(7), true);
  88. }
  89.  
  90. if (!isActive) {
  91.  
  92. theGame.RemoveTimeScale(theGame.GetTimescaleSource(7));
  93.  
  94. }
  95.  
  96. }
  97.  
  98. public timer function DeactivateSlowMoCam(dt : float, id : int) {
  99.  
  100. SlowMoCam(false);
  101.  
  102.  
  103. }
  104.  
  105. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement