Skip to content

Commit b089dab

Browse files
Merge pull request #480 from andrewbenington/dev
v1.9.0 - Legends Z-A support - Pokémon recovery tools - Enhanced grid views - Fixed move PP bug
2 parents 7df4cbe + ee79ac9 commit b089dab

File tree

256 files changed

+11437
-6176
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

256 files changed

+11437
-6176
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ tester.sh
2222
.env.test.local
2323
.env.production.local
2424
/.erb/dll
25+
src/core/save/__test__/save-files/radicalred_modified.sav
2526

2627
# python
2728
*.pyc

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,7 @@
5353
"editor.tabSize": 2,
5454
"rust-analyzer.cargo.features": ["pkm_rs/wasm"],
5555
"css.completion.completePropertyWithSemicolon": false,
56-
"rust-analyzer.cargo.targetDir": true
56+
"rust-analyzer.cargo.targetDir": true,
57+
"python.defaultInterpreterPath": "generate/.venv/bin/python",
58+
"python.terminal.activateEnvironment": true
5759
}

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
VERSION=1.8.3
1+
VERSION=1.9.0
22

33
.PHONY: help
44
help: # Display this help.
@@ -118,3 +118,7 @@ download-item-sprites:
118118

119119
%:
120120
@pnpm run $@
121+
122+
.PHONY: schema
123+
schema:
124+
@sqlite3 generate/pkm.db .schema > generate/schema.sql

eslint.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ export default [
5959
endOfLine: 'auto',
6060
},
6161
],
62+
'no-restricted-syntax': [
63+
'warn',
64+
{
65+
message:
66+
'useValueChanged should only be used for debugging purposes. Remove this call before committing your code.',
67+
selector: 'CallExpression[callee.name="useValueChanged"]',
68+
},
69+
],
6270
},
6371
},
6472
]

generate/database.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import sqlite3
2+
3+
from models import PokemonForm, SpeciesRow, SpeciesWithForms
4+
5+
def get_species_forms(conn: sqlite3.Connection, natdex: int):
6+
cursor = conn.cursor()
7+
cursor.execute(f"SELECT * FROM form WHERE national_dex = {natdex}")
8+
rows = cursor.fetchall()
9+
return [PokemonForm.model_validate(dict(row)) for row in rows]
10+
11+
def get_species(conn: sqlite3.Connection):
12+
conn.row_factory = sqlite3.Row
13+
cursor = conn.cursor()
14+
cursor.execute("SELECT * FROM species")
15+
rows = cursor.fetchall()
16+
all_species: list[SpeciesWithForms] = []
17+
18+
for row in rows:
19+
species = SpeciesRow.model_validate(dict(row))
20+
forms = get_species_forms(conn, species.national_dex)
21+
all_species.append(SpeciesWithForms(national_dex=species.national_dex, name=species.name, forms=forms))
22+
23+
return all_species
24+
25+
if __name__ == "__main__":
26+
with sqlite3.connect("generate/pkm.db") as conn:
27+
conn.row_factory = sqlite3.Row
28+
all_species = get_species(conn)
29+
print(all_species[900])

0 commit comments

Comments
 (0)