|
|
|
@ -5,7 +5,6 @@ and hunts for getting an item with specified skills.
|
|
|
|
|
|
|
|
|
|
|
|
from __future__ import print_function
|
|
|
|
from __future__ import print_function
|
|
|
|
|
|
|
|
|
|
|
|
from mhapi.db import MHDB
|
|
|
|
|
|
|
|
from mhapi import stats
|
|
|
|
from mhapi import stats
|
|
|
|
|
|
|
|
|
|
|
|
SKILL_CARVING = "carving"
|
|
|
|
SKILL_CARVING = "carving"
|
|
|
|
@ -206,21 +205,32 @@ class HuntReward(object):
|
|
|
|
out.write("\n")
|
|
|
|
out.write("\n")
|
|
|
|
|
|
|
|
|
|
|
|
def _calculate_evs(self):
|
|
|
|
def _calculate_evs(self):
|
|
|
|
if self.condition == "Body Carve":
|
|
|
|
if self.condition == "Tail Carve":
|
|
|
|
self.skill = SKILL_CARVING
|
|
|
|
self.skill = SKILL_CARVING
|
|
|
|
self.cap = False
|
|
|
|
self.cap = True
|
|
|
|
self.kill = True
|
|
|
|
self.kill = True
|
|
|
|
counts = [
|
|
|
|
counts = [
|
|
|
|
3 + stats.carve_delta_expected_c(skill)
|
|
|
|
1 + stats.carve_delta_expected_c(skill)
|
|
|
|
for skill in xrange(stats.CARVING_SKILL_PRO,
|
|
|
|
for skill in xrange(stats.CARVING_SKILL_PRO,
|
|
|
|
stats.CARVING_SKILL_GOD+1)
|
|
|
|
stats.CARVING_SKILL_GOD+1)
|
|
|
|
]
|
|
|
|
]
|
|
|
|
elif self.condition == "Body Carve (Apparent Death)":
|
|
|
|
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]
|
|
|
|
counts = [1]
|
|
|
|
self.cap = True
|
|
|
|
self.cap = True
|
|
|
|
self.kill = 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.skill = SKILL_CARVING
|
|
|
|
self.cap = True
|
|
|
|
self.cap = True
|
|
|
|
self.kill = True
|
|
|
|
self.kill = True
|
|
|
|
@ -229,6 +239,21 @@ class HuntReward(object):
|
|
|
|
for skill in xrange(stats.CARVING_SKILL_PRO,
|
|
|
|
for skill in xrange(stats.CARVING_SKILL_PRO,
|
|
|
|
stats.CARVING_SKILL_GOD+1)
|
|
|
|
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":
|
|
|
|
elif self.condition == "Capture":
|
|
|
|
self.skill = SKILL_CAP
|
|
|
|
self.skill = SKILL_CAP
|
|
|
|
self.cap = True
|
|
|
|
self.cap = True
|
|
|
|
@ -250,6 +275,12 @@ class HuntReward(object):
|
|
|
|
elif self.condition.startswith("Break"):
|
|
|
|
elif self.condition.startswith("Break"):
|
|
|
|
self.cap = True
|
|
|
|
self.cap = True
|
|
|
|
self.kill = 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:
|
|
|
|
else:
|
|
|
|
raise ValueError("Unknown condition: '%s'"
|
|
|
|
raise ValueError("Unknown condition: '%s'"
|
|
|
|
% self.condition)
|
|
|
|
% self.condition)
|
|
|
|
@ -359,7 +390,6 @@ def print_quests_and_rewards(db, item_row, out):
|
|
|
|
for m in monsters:
|
|
|
|
for m in monsters:
|
|
|
|
mid = m["monster_id"]
|
|
|
|
mid = m["monster_id"]
|
|
|
|
monster = db.get_monster(mid)
|
|
|
|
monster = db.get_monster(mid)
|
|
|
|
has_item = False
|
|
|
|
|
|
|
|
reward_rows = db.get_monster_rewards(mid, q.rank)
|
|
|
|
reward_rows = db.get_monster_rewards(mid, q.rank)
|
|
|
|
hunt_item = HuntItemExpectedValue(item_id, reward_rows)
|
|
|
|
hunt_item = HuntItemExpectedValue(item_id, reward_rows)
|
|
|
|
|
|
|
|
|
|
|
|
|