Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //x^p
- float powf(float x, float p)
- {
- return x ** p;
- }
- float calculateCurrentNinjaAssassinMaxDamage()
- {
- float assassin_ml = 155.0 + monster_level_adjustment();
- float damage_absorption = raw_damage_absorption();
- float damage_reduction = damage_reduction();
- float moxie = my_buffedstat($stat[moxie]);
- float cold_resistance = numeric_modifier("cold resistance");
- float v = 0.0;
- //spaded by yojimboS_LAW
- if (false)
- {
- print("-----------------");
- print("assassin_ml = " + assassin_ml);
- print("damage_absorption = " + damage_absorption);
- print("damage_reduction = " + damage_reduction);
- print("moxie = " + moxie);
- print("cold_resistance = " + cold_resistance);
- }
- float myst_class_extra_cold_resistance = 0.0;
- if (my_class() == $class[pastamancer] || my_class() == $class[sauceror] || my_class() == $class[avatar of jarlsberg])
- myst_class_extra_cold_resistance = 0.05;
- if (cold_resistance < 9)
- 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))));
- else
- 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))))));
- return v;
- }
- void main()
- {
- boolean can_survive = false;
- float init_needed = monster_initiative($monster[Ninja snowman assassin]);
- float damage_taken = calculateCurrentNinjaAssassinMaxDamage();
- string result;
- if (initiative_modifier() >= init_needed)
- {
- can_survive = true;
- result += "Keep";
- }
- else
- result += "Need";
- result += " +" + ceil(init_needed) + "% init to survive ninja, or ";
- if (my_hp() >= damage_taken)
- {
- result += "keep";
- can_survive = true;
- }
- else
- result += "need";
- int min_safe_damage = (ceil(damage_taken) + 2);
- result += " HP above " + min_safe_damage + ".";// + " (or maybe " + ceil(min_safe_damage * 1.1 + 1) + ")";
- if (!can_survive)
- print(result, "red");
- else
- print(result);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement