From c8a60f23a4e42d735845349725fb18326d565948 Mon Sep 17 00:00:00 2001 From: AdoenLunnae Date: Sat, 29 Sep 2018 19:35:42 +0200 Subject: [PATCH] Fixed an error in multiple defenses --- func.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/func.py b/func.py index 2bbb1e7..470908e 100644 --- a/func.py +++ b/func.py @@ -18,7 +18,7 @@ def getdmg(atq, aroll, base, deff, droll, ta, acu, numdef): else: pendef=[0, -30, -50, -70, -90] totalat= atq+aroll - totaldef= deff+droll+pendef[numdef] + totaldef= deff+droll+pendef[numdef-1] diff = 10 * math.trunc((totalat-totaldef) / 10) if diff > 0: abso = 20 + 10 * ta @@ -30,4 +30,4 @@ def getdmg(atq, aroll, base, deff, droll, ta, acu, numdef): return 'A la defensiva' elif diff < 0: contr = -diff // 2 - return 'Contraataque con +{}'.format(contr) \ No newline at end of file + return 'Contraataque con +{}'.format(contr)