From 05e22763a4280fa88eef54b34020c1c36ca23a57 Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 14 Jan 2022 23:05:53 +0000 Subject: [PATCH] dont push useless tools --- tools/format_drops.py | 184 ------------------------------------- tools/get_area_percents.py | 73 --------------- tools/print_drop_rates.py | 36 -------- 3 files changed, 293 deletions(-) delete mode 100755 tools/format_drops.py delete mode 100755 tools/get_area_percents.py delete mode 100755 tools/print_drop_rates.py diff --git a/tools/format_drops.py b/tools/format_drops.py deleted file mode 100755 index d29fb7d..0000000 --- a/tools/format_drops.py +++ /dev/null @@ -1,184 +0,0 @@ -#!/usr/bin/env python3 - -import sqlite3 - -episodes = ['ep1', 'ep2', 'ep4'] -difficulties = ['normal', 'hard', 'veryhard', 'ultimate'] -sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill'] - -with open('drops','r') as infile: - drops = infile.readlines() -drops = [drop.strip() for drop in drops] - -ep1monsters = [ -'AlRappy', -'BarbarousWolf', -'Booma', -'Bulclaw', -'Canadine', -'Canane', -'ChaosBringer', -'ChaosSorcerer', -'Claw', -'DarkBelra', -'DarkGunner', -'Delsaber', -'Dimenian', -'Dubchic', -'EvilShark', -'Garanz', -'Gigobooma', -'Gillchic', -'Gobooma', -'GrassAssassin', -'GuilShark', -'Hidoom', -'Hildebear', -'Hildeblue', -'LaDimenian', -'Migium', -'Mothmant', -'NanoDragon', -'NarLily', -'PalShark', -'PanArms', -'PofuillySlime', -'PoisonLily', -'PouillySlime', -'RagRappy', -'SavageWolf', -'SinowBeat', -'SinowGold', -'SoDimenian', -'Dragon', -'DeRolLe', -'VolOpt', -'DarkFalz'] - -ep2monsters = [ -'BarbarousWolf', -'ChaosSorcerer', -'DarkBelra', -'Delbiter', -'Deldepth', -'DelLily', -'Delsaber', -'Dimenian', -'Dolmdarl', -'Dolmolm', -'Dubchic', -'EasterRappy', -'Epsilon', -'Garanz', -'Gee', -'Gibbles', -'GiGue', -'Gillchic', -'GrassAssassin', -'HalloRappy', -'Hidoom', -'Hildebear', -'Hildeblue', -'IllGill', -'LaDimenian', -'LoveRappy', -'Mericarol', -'Mericus', -'Merikle', -'Merillia', -'Meriltas', -'Migium', -'Morfos', -'Mothmant', -'NarLily', -'PanArms', -'PoisonLily', -'RagRappy', -'Recon', -'SavageWolf', -'SinowBerill', -'SinowSpigell', -'SinowZele', -'SinowZoa', -'SoDimenian', -'StRappy', -'UlGibbon', -'ZolGibbon', -'BarbaRay', -'GolDragon', -'GalGryphon', -'OlgaFlow'] - -ep4monsters = [ -'Astark', -'BaBoota', -'Boota', -'DelRappyCrater', -'DelRappyDesert', -'Dorphon', -'DorphonEclair', -'Girtablulu', -'Goran', -'GoranDetonator', -'MerissaA', -'MerissaAA', -'PazuzuCrater', -'PazuzuDesert', -'PyroGoran', -'SandRappyCrater', -'SandRappyDesert', -'SatelliteLizardCrater', -'SatelliteLizardDesert', -'YowieCrater', -'YowieDesert', -'ZeBoota', -'ZuCrater', -'ZuDesert', -'SaintMillion', -'Shambertin', -'Kondrieu'] - - -epmonsters = { - 'ep1': ep1monsters, - 'ep2': ep2monsters, - 'ep4': ep4monsters -} - -conn = sqlite3.connect('elsewaredrops.db') -#conn = sqlite3.connect('memory:') -curs = conn.cursor() - -def create_table(): - curs.execute('CREATE TABLE IF NOT EXISTS drops (episode TEXT, difficulty TEXT, sectionid TEXT, monster TEXT, item TEXT, rate REAL)') - #conn.commit() - curs.execute("SELECT COUNT(*) FROM drops") - result = curs.fetchall() - if result[0][0] == 0: - for drop in drops: - line = drop.strip().split(',') - curs.execute("INSERT INTO drops (episode, difficulty, sectionid, monster, item, rate) VALUES (?, ?, ?, ?, ?, ?)", (line[0], line[1], line[2], line[3], line[4], line[5])) - else: - print("already data in the db") - conn.commit() - -print('elseware drops') -for episode in episodes: - for difficulty in difficulties: - print('{} {}'.format(episode, difficulty)) - print('enemy', sep='', end='') - for sectionid in sectionids: - print(',{}'.format(sectionid), sep='', end='') - print() - for monster in epmonsters[episode]: - print('{}'.format(monster), sep='', end='') - curs.execute("SELECT item FROM drops WHERE episode = '{}' AND difficulty = '{}' AND monster = '{}'".format(episode, difficulty, monster)) - rows = curs.fetchall() - for row in rows: - print(',{}'.format(row[0]), sep='', end='') - print() - print() - print() - -curs.close() -conn.close() diff --git a/tools/get_area_percents.py b/tools/get_area_percents.py deleted file mode 100755 index 4d02c91..0000000 --- a/tools/get_area_percents.py +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env python3 - -import toml - -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 get_area_percents(): - for episode in episodes: - print('episode: {}'.format(episode)) - for difficulty in difficulties: - print('difficulty: {}'.format(difficulty)) - for sectionid in sectionids: - #print('sectionid: {}'.format(sectionid)) - area_toml = toml.load('{}/{}/{}/{}/area_percent_pattern.toml'.format(base_dir, episode, difficulty, sectionid)) - keys = list(area_toml.keys()) - attrs1 = [0,0,0,0,0,0,0,0,0,0] - attrs2 = [0,0,0,0,0,0,0,0,0,0] - attrs3 = [0,0,0,0,0,0,0,0,0,0] - for i in range(0, len(keys)): - if 'attribute1' in area_toml[keys[i]]: - attrs1[i] = area_toml[keys[i]]['attribute1'] - if 'attribute2' in area_toml[keys[i]]: - attrs2[i] = area_toml[keys[i]]['attribute2'] - if 'attribute3' in area_toml[keys[i]]: - attrs3[i] = area_toml[keys[i]]['attribute3'] - #print('episode: {}, difficulty: {}, sectionid: {}'.format(episode, difficulty, sectionid)) - print('{}\n{}\n{}'.format(attrs1,attrs2,attrs3)) - print('\n\n') - -# print('episode: {}, difficulty: {}, sectionid: {}, key: {}\ntoml: {}'.format(episode, difficulty, sectionid, key, area_toml[key])) -# if 'attribute1' in area_toml[key]: -# print('attribute1,{}'.format(area_toml[key]['attribute1']), sep=',', end=',') -# if 'attribute2' in area_toml[key]: -# print('attribute2,{}'.format(area_toml[key]['attribute2']), sep=',', end=',') -# if 'attribute3' in area_toml[key]: -# print('attribute3,{}'.format(area_toml[key]['attribute3']), sep=',', end='') -# print() - - -def get_percent_patterns(): - for episode in episodes: -# print('episode: {}'.format(episode)) - for difficulty in difficulties: -# print('difficulty: {}'.format(difficulty)) - for sectionid in sectionids: - print('{}, {}, {}'.format(episode, difficulty, sectionid)) - percent_toml = toml.load('{}/{}/{}/{}/percent_rate.toml'.format(base_dir, episode, difficulty, sectionid)) - keys = list(percent_toml.keys()) - for key in percent_toml.keys(): - print('percent_toml[{}]: '.format(key), sep='', end='') - for p in range(5,95,5): - print(' p{}: {}'.format(p, percent_toml[key]['p' + str(p)] / 100.0), sep=',', end=',') - print() - print() - pattern1 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pattern2 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pattern3 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pattern4 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pattern5 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pattern6 = [[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[],[]] - pass - - -def main(): - #get_area_percents() - get_percent_patterns() - - -if __name__ == '__main__': - main() diff --git a/tools/print_drop_rates.py b/tools/print_drop_rates.py deleted file mode 100755 index 1364e8a..0000000 --- a/tools/print_drop_rates.py +++ /dev/null @@ -1,36 +0,0 @@ -#!/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()