From 2b9e8435d5721e3b15b44dd867a6bd43efdce03a Mon Sep 17 00:00:00 2001 From: Bryce Allen Date: Sun, 28 Feb 2016 20:57:16 -0600 Subject: [PATCH] add sharpness +2 support for mhx --- bin/mhdamage.py | 9 +++++---- mhapi/damage.py | 4 +++- mhapi/model.py | 3 +++ 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/bin/mhdamage.py b/bin/mhdamage.py index 1f45c9d..e4d091d 100755 --- a/bin/mhdamage.py +++ b/bin/mhdamage.py @@ -113,7 +113,8 @@ def parse_weapon_arg(arg, base_args): def get_skill_names(args): - return ["Sharpness +1" if args.sharpness_plus_one else "", + return ["Sharpness +%d" % args.sharpness_plus + if args.sharpness_plus else "", "Awaken" if args.awaken else "", skills.AttackUp.name(args.attack_up), skills.CriticalEye.name(args.critical_eye), @@ -128,9 +129,9 @@ def percent_change(a, b): def _add_skill_args(parser): - parser.add_argument("-s", "--sharpness-plus-one", action="store_true", + parser.add_argument("-s", "--sharpness-plus", type=int, default=False, - help="add Sharpness +1 skill, default off") + help="add Sharpness +1 or +2 skill, default off") parser.add_argument("-f", "--awaken", action="store_true", default=False, help="add Awaken (FreeElemnt), default off") @@ -400,7 +401,7 @@ if __name__ == '__main__': skill_args = skill_args_map.get(name, args) wd = WeaponMonsterDamage(row, monster, monster_damage, - motion, skill_args.sharpness_plus_one, + motion, skill_args.sharpness_plus, monster_breaks, attack_skill=skill_args.attack_up, critical_eye_skill=skill_args.critical_eye, diff --git a/mhapi/damage.py b/mhapi/damage.py index 560e387..9fb27c5 100644 --- a/mhapi/damage.py +++ b/mhapi/damage.py @@ -206,8 +206,10 @@ class WeaponMonsterDamage(object): else: self.true_raw = (self.weapon["attack"] / WeaponType.multiplier(self.weapon_type)) - if sharp_plus: + if sharp_plus == 1: self.sharpness = self.weapon.sharpness_plus.max + elif sharp_plus == 2: + self.sharpness = self.weapon.sharpness_plus2.max else: self.sharpness = self.weapon.sharpness.max #print "sharpness=", self.sharpness diff --git a/mhapi/model.py b/mhapi/model.py index a4c7da5..8ce53c4 100644 --- a/mhapi/model.py +++ b/mhapi/model.py @@ -383,6 +383,8 @@ class Weapon(ItemCraftable): self.sharpness = WeaponSharpness(self._row["sharpness"] + [0]) self.sharpness_plus = WeaponSharpness( self._row["sharpness_plus"] + [0]) + self.sharpness_plus2 = WeaponSharpness( + self._row["sharpness_plus2"] + [0]) else: # 4U data from db parts = self._row["sharpness"].split(" ") @@ -392,6 +394,7 @@ class Weapon(ItemCraftable): normal, plus = parts self._data["sharpness"] = WeaponSharpness(normal) self._data["sharpness_plus"] = WeaponSharpness(plus) + self._data["sharpness_plus2"] = WeaponSharpness(plus) def is_not_localized(self): return (self.name == self.name_jp)