diff options
| author | Supremist <sergkarv@gmail.com> | 2025-10-30 01:16:56 +0200 |
|---|---|---|
| committer | Supremist <sergkarv@gmail.com> | 2025-10-30 01:16:56 +0200 |
| commit | 9cc423f1e3b0a1d9e498c522cb550709e348eed7 (patch) | |
| tree | 9cf54a7b7d77cc6f905f091c7bff972430dfdc40 /game.py | |
| parent | 9fa4cfbe2f948f4067ca1572bbc5dbfab678e7da (diff) | |
| download | pf2e_calc-9cc423f1e3b0a1d9e498c522cb550709e348eed7.tar.xz pf2e_calc-9cc423f1e3b0a1d9e498c522cb550709e348eed7.zip | |
Add weapon damage comparison graph
Diffstat (limited to 'game.py')
| -rw-r--r-- | game.py | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -48,6 +48,26 @@ class Roll: def clamp(value): return max(Roll.Fumble, min(Roll.Crit, value)) + @staticmethod + def icon(check_res): + if check_res == Roll.Crit: + return "🎯" + if check_res == Roll.Success: + return "✅" + if check_res == Roll.Fail: + return "💢" + if check_res == Roll.Fumble: + return "💀" + return "?" + + @staticmethod + def short_str(dist: Distribution): + res = list() + for roll in range(2, -2, -1): + number = int(round(dist.probabilities[roll] * 20)) + res.append(Roll.icon(roll) + str(number)) + return " ".join(res) + class Difficulty(Enum): Terrible = -2 |
