SHARE
TWEET

Untitled

a guest Aug 22nd, 2019 98 in 260 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. function dps = dps_formula(ad, atts, critchance, critbonus)
  3.   assasin_bonus = 0.0;
  4.   dps = atts * ad * ((1-critchance)*1 + critchance*(1+critbonus+assasin_bonus));
  5. endfunction
  6.  
  7. function dps = dps_infinity(ad)
  8.   dps = dps_formula(ad+40, 1.0, 0.25, 2.0+1.5);
  9. endfunction
  10.  
  11. function dps = dps_divine(ad,time)
  12.   procchance = 0.07;
  13.   chance_to_notproc = (1-procchance)**time;
  14.   base_dps = dps_formula(ad+20, 1.0+0.2, 0.25, 1.5);
  15.   proc_dps = dps_formula(ad+20, 1.0+0.2, 1.0, 1.5);
  16.   dps = chance_to_notproc * base_dps + (1-chance_to_notproc)*proc_dps;
  17. endfunction
  18.  
  19. ad_range = 0:1:100;
  20. time_range = 0:0.1:60;
  21.  
  22. hold on;
  23. cmap = cool(length(time_range));
  24. plot(ad_range, dps_infinity(ad_range), "color", [0,0,0])
  25. plot(ad_range, dps_divine(ad_range, 10.0), "color", [1.0,0,0])
  26. for t=1:length(time_range)
  27.   plot(ad_range, dps_divine(ad_range,time_range(t)), "color", cmap(t,:))
  28. endfor
  29. %repeating to be on top
  30. plot(ad_range, dps_infinity(ad_range), "color", [0,0,0])
  31. plot(ad_range, dps_divine(ad_range, 10.0), "color", [1.0,0,0])
  32. colormap("cool")
  33. colorbar("south")
  34. caxis([0 60])
  35.  
  36. xlabel('Attack Damage')
  37. ylabel('DPS')
  38. legend('Infinity Edge', 'Divine Sword 10 sec, ~50%')
  39. hold off;
  40.  
  41. %Probability plot
  42. hold on;
  43. plot(0:0.1:60, 1-(1-0.07).^(0:0.1:60), "color", [0.0, 0.0, 0.0])
  44. xlabel('Time')
  45. ylabel('Probability')
  46. n = 150
  47. cmap = cool(n);
  48. probrange = linspace(2.5, 10, n)/100;
  49. for i=1:n
  50.   plot(0:0.1:60, 1-(1-probrange(i)).^(0:0.1:60), "color", cmap(i,:))
  51. endfor
  52.  
  53. plot(0:0.1:60, 1-(1-0.07).^(0:0.1:60), "color", [0.0, 0.0, 0.0])
  54.  
  55. legend('Current 7% chance', 'Chance range 2.5%-10%')
  56. colormap("cool")
  57. caxis([0.025, 0.1])
  58. colorbar("south")
  59. hold off;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top