ep4_charts v1 (probably) #91

Merged
jake merged 25 commits from ep4_charts into master 2022-02-14 20:20:59 -05:00
Showing only changes of commit d8dee4bede - Show all commits

View File

@ -1,198 +1,184 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import sqlite3
episodes = ['ep1', 'ep2', 'ep4'] episodes = ['ep1', 'ep2', 'ep4']
difficulties = ['normal', 'hard', 'veryhard', 'ultimate'] difficulties = ['normal', 'hard', 'veryhard', 'ultimate']
sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill'] sectionids = ['viridia', 'greenill', 'skyly', 'bluefull', 'purplenum', 'pinkal', 'redria', 'oran', 'yellowboze', 'whitill']
with open('drops','r') as infile: with open('drops','r') as infile:
drops = infile.readlines() drops = infile.readlines()
drops = [drop.strip() for drop in drops]
ep1drops = list(filter(lambda d: d.split(',')[0] == 'ep1', drops)) ep1monsters = [
ep2drops = list(filter(lambda d: d.split(',')[0] == 'ep2', drops)) 'AlRappy',
ep4drops = list(filter(lambda d: d.split(',')[0] == 'ep4', drops)) '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']
ep1monsters = list(set(line.split(',')[3] for line in ep1drops)) ep2monsters = [
ep2monsters = list(set(line.split(',')[3] for line in ep2drops)) 'BarbarousWolf',
ep4monsters = list(set(line.split(',')[3] for line in ep4drops)) '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']
ep1monsters.sort() ep4monsters = [
ep2monsters.sort() 'Astark',
ep4monsters.sort() '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']
ep1normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep1drops))
ep1hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep1drops))
ep1veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep1drops))
ep1ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep1drops))
print('ep1 normal drops') epmonsters = {
for monster in ep1monsters: 'ep1': ep1monsters,
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1normal)) # all drops for specific monster (list of strings) 'ep2': ep2monsters,
print('{},'.format(monster), sep='', end='') '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: for sectionid in sectionids:
for md in monster_drops: print(',{}'.format(sectionid), sep='', end='')
if sectionid in md: print()
print('{}'.format(md.split(',')[4]),sep='', end='') for monster in epmonsters[episode]:
print(',', sep='', end='') print('{}'.format(monster), sep='', end='')
print() curs.execute("SELECT item FROM drops WHERE episode = '{}' AND difficulty = '{}' AND monster = '{}'".format(episode, difficulty, monster))
rows = curs.fetchall()
print('\n\n') for row in rows:
print(',{}'.format(row[0]), sep='', end='')
print('ep1 hard drops') print()
for monster in ep1monsters: print()
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1hard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep1 veryhard drops')
for monster in ep1monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1veryhard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep1 ultimate drops')
for monster in ep1monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep1ultimate)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('\n\n\n\n\n\n')
# print drops per difficulty
ep2normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep2drops))
ep2hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep2drops))
ep2veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep2drops))
ep2ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep2drops))
print('ep2 normal drops')
for monster in ep2monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2normal)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep2 hard drops')
for monster in ep2monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2hard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep2 veryhard drops')
for monster in ep2monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2veryhard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep2 ultimate drops')
for monster in ep2monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep2ultimate)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('\n\n\n\n\n\n')
# print drops per difficulty
ep4normal = list(filter(lambda d: d.split(',')[1] == 'normal', ep4drops))
ep4hard = list(filter(lambda d: d.split(',')[1] == 'hard', ep4drops))
ep4veryhard = list(filter(lambda d: d.split(',')[1] == 'veryhard', ep4drops))
ep4ultimate = list(filter(lambda d: d.split(',')[1] == 'ultimate', ep4drops))
print('ep4 normal drops')
for monster in ep4monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4normal)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep4 hard drops')
for monster in ep4monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4hard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep4 veryhard drops')
for monster in ep4monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4veryhard)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print()
print('\n\n')
print('ep4 ultimate drops')
for monster in ep4monsters:
monster_drops = list(filter(lambda d: d.split(',')[3] == monster, ep4ultimate)) # all drops for specific monster (list of strings)
print('{},'.format(monster), sep='', end='')
for sectionid in sectionids:
for md in monster_drops:
if sectionid in md:
print('{}'.format(md.split(',')[4]),sep='', end='')
print(',', sep='', end='')
print() print()
curs.close()
conn.close()