2 changed files with 57 additions and 4 deletions
@ -0,0 +1,48 @@ |
|||
import sqlite3 |
|||
from cache_manager import CacheManager |
|||
from DetermineOriginGame import get_locations_from_bulbapedia |
|||
|
|||
def create_encounters_table(): |
|||
conn = sqlite3.connect('pokemon_forms.db') |
|||
#cursor = conn.cursor() |
|||
#cursor.execute(''' |
|||
#CREATE TABLE IF NOT EXISTS encounters ( |
|||
# pfic TEXT, |
|||
# |
|||
#) |
|||
#''') |
|||
#conn.commit() |
|||
return conn |
|||
|
|||
if __name__ == "__main__": |
|||
cache = CacheManager() |
|||
|
|||
conn = create_encounters_table() |
|||
cursor = conn.cursor() |
|||
cursor.execute('SELECT DISTINCT name, form_name FROM pokemon_forms') |
|||
pokemon_forms = cursor.fetchall() |
|||
|
|||
for name, form in pokemon_forms: |
|||
print(f"Processing {name} {form if form else ''}") |
|||
|
|||
if form and name in form: |
|||
form = form.replace(name, "").strip() |
|||
|
|||
gender = None |
|||
if form and "male" in form.lower(): |
|||
gender = form |
|||
form = None |
|||
|
|||
encounters_we_aren_t_interested_in = ["Trade", "Time Capsule", "Unobtainable"] |
|||
|
|||
encounter_data = get_locations_from_bulbapedia(name, form, cache) |
|||
for encounter in encounter_data: |
|||
print(f"Found in {encounter}:") |
|||
for location in encounter_data[encounter]: |
|||
if location in encounters_we_aren_t_interested_in: |
|||
continue |
|||
if "Evolve" in location: |
|||
continue |
|||
if "TradeVersion" in location: |
|||
continue |
|||
print(f" {location}") |
|||
Loading…
Reference in new issue