From 89d3ac4a46c8021454c2302e34a84818983826a5 Mon Sep 17 00:00:00 2001 From: baiqwerdvd <158065462+baiqwerdvd@users.noreply.github.com> Date: Sun, 28 Apr 2024 11:14:37 +0800 Subject: [PATCH] Fix Mar7th defence clac --- pyproject.toml | 2 +- starrail_damage_cal/damage/AvatarDamage/AvatarDamage.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 81b710f..ec41df0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "starrail_damage_cal" -version = "1.5.4" +version = "1.5.5" description = "For StarRail Role Damage Cal" authors = [ {name = "qwerdvd", email = "105906879+qwerdvd@users.noreply.github.com"}, diff --git a/starrail_damage_cal/damage/AvatarDamage/AvatarDamage.py b/starrail_damage_cal/damage/AvatarDamage/AvatarDamage.py index 37eac0b..7f2ece9 100644 --- a/starrail_damage_cal/damage/AvatarDamage/AvatarDamage.py +++ b/starrail_damage_cal/damage/AvatarDamage/AvatarDamage.py @@ -2291,10 +2291,9 @@ class Mar7th(BaseAvatar): self.avatar_level, ) if self.avatar_rank >= 4: - defence = ( - base_attr["defence"] * (1 + attribute_bonus["DefenceAddedRatio"]) - + attribute_bonus["DefenceDelta"] - ) + defence = base_attr.get("defence", 0) * ( + 1 + attribute_bonus.get("DefenceAddedRatio", 0) + ) + attribute_bonus.get("DefenceDelta", 0) damage_add = defence * 0.3 damagelist4[0] += damage_add damagelist4[1] += damage_add