From 6214335b2c2ce2b4434051d998fd16136e759904 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 29 Nov 2021 01:38:41 +0000 Subject: [PATCH] random script to print drop rates --- tools/print_drop_rates.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 tools/print_drop_rates.py diff --git a/tools/print_drop_rates.py b/tools/print_drop_rates.py new file mode 100644 index 0000000..de352b4 --- /dev/null +++ b/tools/print_drop_rates.py @@ -0,0 +1,36 @@ +#!/usr/bin/env python3 + +import toml, os + +# TODO +# print summary of all drops (all eps/diffs/ids) +# figure out a format for summary +# print specific monster info (ie: all falz drops for all ids, or only a specific id, or only an episode) +# search for specific item drop rate across all eps/diffs/ids +# search for specific item in a specific criteria (ie: only look for vjaya drops in ep1, or only for specific section id, or specific episode + +episodes = ['ep1', 'ep2', 'ep4'] +difficulties = ['normal', 'hard', 'veryhard', 'ultimate'] +sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill'] +base_dir = '../data/drops/' # assumes script is running from /path/to/elseware/tools + +def print_all_drops(): + for episode in episodes: + for difficulty in difficulties: + for sectionid in sectionids: + rare_rates = toml.load('{}/{}/{}/{}/rare_rate.toml'.format(base_dir, episode, difficulty, sectionid)) + dar_rates = toml.load('{}/{}/{}/{}/monster_dar.toml'.format(base_dir, episode, difficulty, sectionid)) + for key in rare_rates.keys(): + monster = key + item = rare_rates[key][0]['item'] + droprate = rare_rates[key][0]['rate'] * (dar_rates[key]['dar']/100) + print('{},{},{},{},{},{:.4f}'.format(episode, difficulty, sectionid, monster, item, droprate * 100)) + + + +def main(): + print_all_drops() + + +if __name__ == '__main__': + main()