combat_math
Calculate exact damage for a single hit using engine formulas, including crit chance and crit damage from ratings.
Instructions
Explain one hit using the engine's exact formulas (recovered from libgame.so, see docs/GAME_MATH.md). attack_type/armor_type 1..5 (Melee, Pierce, Magic, Siege, Hero); player heroes attack as 5. skill_coeff=1.0 for a normal hit or skill%/100 for a skill. Ratings are raw Hero.data stats. Also returns crit chance and crit-damage that the ratings convert to.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| atk | Yes | ||
| is_crit | No | ||
| armor_type | No | ||
| attack_type | No | ||
| crit_rating | No | ||
| skill_coeff | No | ||
| crit_dmg_rating | No | ||
| target_reduce_rating | No | ||
| target_tenacity_rating | No |