Guest User

Untitled

a guest
Nov 14th, 2021
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. function ppsAny(Gcd, Job, level) {
  2. Job = Job.toUpperCase();
  3. sps = getSps(Gcd,level);
  4. let filler = Filler(Job, level); //potencies of filler spells per job
  5. let dot = Dot(Job, level); //[initial hit,potency, duration]
  6. dot[1]*= (1000+SPD(sps,level))/1000; // sps boosts dots
  7.  
  8. let cps = Cps(Gcd,dot[2],Job); // [gcds cast between dot refreshes, total time spent casting those gcds]
  9. let casts = cps[0];
  10. let refreshtime = cps[1];
  11. let P = filler * (casts - 1) + dot[0]; // filler casts plus hit potency of dot
  12. P += dot[1] * Math.min(dot[2],refreshtime)/3; // tick potency * average ticks between refreshes
  13. P /= refreshtime; // potency/time of gcds
  14.  
  15. //Job specific actions
  16. if(Job === "WHM"){
  17. P += filler * POM(Gcd,20)/120; //extra glares granted by POM divided by 120s
  18. P += 400/45; //assize
  19. }
  20.  
  21. if(Job === "SCH"){
  22. P += 300/60 + 300/180; //Energy drain from AF and dissipation
  23. }
  24.  
  25. if(Job === "AST"){
  26. let dyne = Astrodyne(Gcd,sps); // average net malefics gained by an astrodyne window [2 seal casts, 3 seal bonus]
  27. let dynegain = dyne[0]; //extra malefics granted by astrodyne
  28. dynegain+= dyne[1] * 140/225; //chance-weighting 3 seal buff
  29. let dynecd = 254/255 * 90 + 1/255 * 120; //"cooldown" of astrodyne, weighted averaged of delayed uses to fish for seals
  30. P += filler * dynegain/dynecd;
  31. P += 310/60; //earthly star
  32. P += 250/60 * 1/2; //Minor arcana average potency
  33. }
  34.  
  35. if(Job === "SGE"){
  36. P += (510-filler)/GcdCalc(45000, sps, level); //phlegma
  37. }
  38. return P;
  39. }
  40.  
  41. function Cps(Gcd,dottimer,Job) {
  42. let dotrecast = (Job === "SGE") ? 2.5 : Gcd; // Eukrasian dosis has an effective recast time of 2.5s regardless of sps
  43. let x = (dottimer - dotrecast) % Gcd > 1.5; // Decide wether or not to cast an extra gcd before refreshing dot
  44. let casts = Math.floor(dottimer / Gcd) + (x ? 1 : 0); // number of gcd casts between dot refreshes, including dot
  45. let refreshtime = Gcd * (casts-1) + dotrecast; // total time spent between dot refreshes
  46. return [casts,refreshtime];
  47. }
  48.  
  49. //returns number of extra gcds granted on average by a 15s long sps buff
  50. function spsbuffgain(Gcd,buff) {
  51. let weave = Math.round(Gcd*60)/100 + 0.1;
  52. let buffgcd = Math.floor(Gcd * (100-buff))/100;
  53. let timer = 15 - (Gcd - weave); //effective buff time available after weaving it.
  54. return casts = timer/buffgcd - timer/Gcd;
  55. }
Advertisement
Add Comment
Please, Sign In to add comment