fix fixed rewards

Fixed rewards for the matching item will be listed on a separate
output line from non-fixed rewards for the same item in the same
quest reward slot.
main
Bryce Allen 11 years ago
parent 805a2a3362
commit 33493b67b1

@ -136,15 +136,14 @@ def print_quests_and_rewards(db, item_row, out):
quest_ev = 0 quest_ev = 0
sub_used = False sub_used = False
fixed_other_rewards = dict(A=0, B=0, Sub=0) fixed_rewards = dict(A=0, B=0, Sub=0)
total_reward_p = dict(A=0, B=0, Sub=0) total_reward_p = dict(A=0, B=0, Sub=0)
for reward in q._rewards: for reward in q._rewards:
slot = reward["reward_slot"] slot = reward["reward_slot"]
#reward_item_row = db.get_item(reward["item_id"]) #reward_item_row = db.get_item(reward["item_id"])
#print slot, reward_item_row["name"], reward["percentage"] #print slot, reward_item_row["name"], reward["percentage"]
if reward["percentage"] == 100: if reward["percentage"] == 100:
if reward["item_id"] != item_id: fixed_rewards[slot] += 1
fixed_other_rewards[slot] += 1
else: else:
total_reward_p[slot] += reward["percentage"] total_reward_p[slot] += reward["percentage"]
@ -159,12 +158,16 @@ def print_quests_and_rewards(db, item_row, out):
#reward_item_row = db.get_item(reward["item_id"]) #reward_item_row = db.get_item(reward["item_id"])
#print slot, reward_item_row["name"], reward["percentage"] #print slot, reward_item_row["name"], reward["percentage"]
if reward["item_id"] == item_id: if reward["item_id"] == item_id:
if reward["percentage"] == 100:
totals = [100]
evs = [100 * reward["stack_size"]]
else:
totals = [mhprob.quest_reward_expected_c(slot, skill) totals = [mhprob.quest_reward_expected_c(slot, skill)
for skill in xrange(mhprob.LUCK_SKILL_NONE, for skill in xrange(mhprob.LUCK_SKILL_NONE,
mhprob.LUCK_SKILL_GREAT+1)] mhprob.LUCK_SKILL_GREAT+1)]
evs = [((i - fixed_other_rewards[slot]) evs = [((i - fixed_rewards[slot])
* reward["stack_size"] * reward["percentage"]) * reward["stack_size"] * reward["percentage"])
for i in totals] for i in totals]

Loading…
Cancel
Save