Overview¶
Path | PyPoE/poe/sim/formula.py |
Version | 1.0.0a0 |
Revision | $Id: db9df107ffbe3149f2652c1059fae216594b2782 $ |
Author | Omega_K2 |
Description¶
Formulas for calculating certain things.
Documentation¶
-
class
PyPoE.poe.sim.formula.
GemTypes
[source]¶ Bases:
enum.Enum
Variables: - support – Support Skill Gem
- active – Active Skill Gem
-
PyPoE.poe.sim.formula.
armour_damage_reduction
(armour, damage)[source]¶ Calculates the damage reduction from armour.
Note
The final damage reduction may differ; there are other stats that can grant damage reduction and damage reduction is capped.
Parameters: Returns: damage reduction factor
Return type:
-
PyPoE.poe.sim.formula.
chance_to_hit
(accuracy, evasion)[source]¶ Calculates the chance to hit for the given accuracy and evasion.
Parameters: Returns: chance to hit
Return type:
-
PyPoE.poe.sim.formula.
chance_to_evade
(accuracy, evasion)[source]¶ Calculates the chance to evade for the given accuracy and evasion.
Parameters: Returns: chance to evade
Return type:
-
PyPoE.poe.sim.formula.
gem_stat_requirement
(level, gtype=<GemTypes.support: 1>, multi=100)[source]¶ Calculates and returns the stat requirement for the specified level requirement.
The calculations vary depending on the gem type (i.e. active or support gem) and on the multiplier.
Currently only multipliers of 100, 60 and 40 are supported.
Warning
These functions are primarily reverse engineered and may break with updates.
Generally, the gem stat requirements seem to be based on a linear function (i.e. f(x) = ax+b), however values are rounded.
For the values a & b were calculated with linear regression, then sightly adjusted to produce the correct results for existing gems, but it may not be entirely accurate. In particular it seems strange that the formula changes depending on the multiplier; I haven’t been able to figure out a single formula that works for all, so for the time being each multiplier comes with their own formula.
Parameters: Returns: calculated stat requirement
Return type: Raises: ValueError
– if multi is unsupported if gtype is invalid