From 2abdeaa5b7c020707e6c9d9b9cd6967c0d0bead5 Mon Sep 17 00:00:00 2001 From: Bryce Allen Date: Fri, 20 Mar 2015 22:00:07 -0500 Subject: [PATCH] add missing reward types --- mhapi/rewards.py | 44 +++++++++++++++++++++++++++++++++++++------- 1 file changed, 37 insertions(+), 7 deletions(-) diff --git a/mhapi/rewards.py b/mhapi/rewards.py index acc9c00..1038213 100644 --- a/mhapi/rewards.py +++ b/mhapi/rewards.py @@ -5,7 +5,6 @@ and hunts for getting an item with specified skills. from __future__ import print_function -from mhapi.db import MHDB from mhapi import stats SKILL_CARVING = "carving" @@ -206,21 +205,32 @@ class HuntReward(object): out.write("\n") def _calculate_evs(self): - if self.condition == "Body Carve": + if self.condition == "Tail Carve": self.skill = SKILL_CARVING - self.cap = False + self.cap = True self.kill = True counts = [ - 3 + stats.carve_delta_expected_c(skill) + 1 + stats.carve_delta_expected_c(skill) for skill in xrange(stats.CARVING_SKILL_PRO, stats.CARVING_SKILL_GOD+1) ] elif self.condition == "Body Carve (Apparent Death)": - # assume one carve, it's dangerous to try for two + # Gypceros fake death. Assume one carve, it's dangerous to try + # for two. counts = [1] self.cap = True self.kill = True - elif self.condition == "Tail Carve": + elif self.condition == "Body Carve": + self.skill = SKILL_CARVING + self.cap = False + self.kill = True + counts = [ + 3 + stats.carve_delta_expected_c(skill) + for skill in xrange(stats.CARVING_SKILL_PRO, + stats.CARVING_SKILL_GOD+1) + ] + elif self.condition.startswith("Body Carve (KO"): + # Kelbi self.skill = SKILL_CARVING self.cap = True self.kill = True @@ -229,6 +239,21 @@ class HuntReward(object): for skill in xrange(stats.CARVING_SKILL_PRO, stats.CARVING_SKILL_GOD+1) ] + elif "Carve" in self.condition: + # Mouth Carve: Dah'ren Mohran + # Upper Body Carve: Dalamadur + # Lower Body Carve: Dalamadur + # Head Carve: Dalamadur + # TODO: separate these out, some have >3 carves, not sure + # about others + self.skill = SKILL_CARVING + self.cap = False + self.kill = True + counts = [ + 3 + stats.carve_delta_expected_c(skill) + for skill in xrange(stats.CARVING_SKILL_PRO, + stats.CARVING_SKILL_GOD+1) + ] elif self.condition == "Capture": self.skill = SKILL_CAP self.cap = True @@ -250,6 +275,12 @@ class HuntReward(object): elif self.condition.startswith("Break"): self.cap = True self.kill = True + elif self.condition in ("Bug-Catching Back", "Mining Back", + "Mining Ore", "Mining Scale"): + # TODO: it's easy to get more than one here, would be nice + # to separate these out like shinys. + self.cap = True + self.kill = True else: raise ValueError("Unknown condition: '%s'" % self.condition) @@ -359,7 +390,6 @@ def print_quests_and_rewards(db, item_row, out): for m in monsters: mid = m["monster_id"] monster = db.get_monster(mid) - has_item = False reward_rows = db.get_monster_rewards(mid, q.rank) hunt_item = HuntItemExpectedValue(item_id, reward_rows)