Advertisement
kolpastebin

ninja assassins.ash

Dec 11th, 2013
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. //x^p
  2. float powf(float x, float p)
  3. {
  4. return x ** p;
  5. }
  6.  
  7. float calculateCurrentNinjaAssassinMaxDamage()
  8. {
  9. float assassin_ml = 155.0 + monster_level_adjustment();
  10. float damage_absorption = raw_damage_absorption();
  11. float damage_reduction = damage_reduction();
  12. float moxie = my_buffedstat($stat[moxie]);
  13. float cold_resistance = numeric_modifier("cold resistance");
  14. float v = 0.0;
  15.  
  16. //spaded by yojimboS_LAW
  17.  
  18. if (false)
  19. {
  20. print("-----------------");
  21. print("assassin_ml = " + assassin_ml);
  22. print("damage_absorption = " + damage_absorption);
  23. print("damage_reduction = " + damage_reduction);
  24. print("moxie = " + moxie);
  25. print("cold_resistance = " + cold_resistance);
  26. }
  27.  
  28. float myst_class_extra_cold_resistance = 0.0;
  29. if (my_class() == $class[pastamancer] || my_class() == $class[sauceror] || my_class() == $class[avatar of jarlsberg])
  30. myst_class_extra_cold_resistance = 0.05;
  31.  
  32. if (cold_resistance < 9)
  33. v = ((((MAX((assassin_ml - moxie), 0.0) - damage_reduction) + 120.0) * MAX(0.1, MIN((1.1 - square_root((damage_absorption/1000.0))), 1.0))) * ((1.0 - myst_class_extra_cold_resistance) - ((0.1) * MAX((cold_resistance - 5.0), 0.0))));
  34. else
  35. v = ((((MAX((assassin_ml - moxie), 0.0) - damage_reduction) + 120.0) * MAX(0.1, MIN((1.1 - square_root((damage_absorption/1000.0))), 1.0))) * (0.1 - myst_class_extra_cold_resistance + (0.5 * (powf((5.0/6.0), (cold_resistance - 9.0))))));
  36.  
  37. return v;
  38. }
  39.  
  40. void main()
  41. {
  42. boolean can_survive = false;
  43. float init_needed = monster_initiative($monster[Ninja snowman assassin]);
  44.  
  45. float damage_taken = calculateCurrentNinjaAssassinMaxDamage();
  46.  
  47. string result;
  48. if (initiative_modifier() >= init_needed)
  49. {
  50. can_survive = true;
  51. result += "Keep";
  52. }
  53. else
  54. result += "Need";
  55. result += " +" + ceil(init_needed) + "% init to survive ninja, or ";
  56.  
  57. if (my_hp() >= damage_taken)
  58. {
  59. result += "keep";
  60. can_survive = true;
  61. }
  62. else
  63. result += "need";
  64. int min_safe_damage = (ceil(damage_taken) + 2);
  65. result += " HP above " + min_safe_damage + ".";// + " (or maybe " + ceil(min_safe_damage * 1.1 + 1) + ")";
  66.  
  67. if (!can_survive)
  68. print(result, "red");
  69. else
  70. print(result);
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement