Rename Mt. Coronet areas
From the PR:
> Mt. Coronet's floors were misnumbered: a small room on 4F was labelled as 5F, causing the subsequent floors to all be off-by-one. This pull request corrects that numbering, aligning the floor numbering with the official guidebook.
>
> Additionally, a number of the areas within Mt. Coronet had vague or otherwise unclear names (especially "cave"). This pull request renames those areas for clarity. It also ensures that all areas on 1F include "1F" in their name, for consistency.
They were cyclically off by one, so e.g. machine 0 mapped to tm01,
machine 99 wrapped around to tm00, machine 100 mapped to tr01, and
machine 199 mapped to tr00.
The moves seem to be right though.
update machines m set item_id = (select item_id from machines m2 where m2.machine_number = (m.machine_number+99) % 100 + case when m.machine_number >= 100 then 100 else 0 end and version_group_id = 20) where version_group_id = 20;
Python 3.6 deprecated using regex flag syntax (?x) to set flags in the
middle of a pattern. Now you can only use it at the start of a pattern.
Fortunately that same release added a new scoped-flag syntax, (?x:).
(Wait, you say, it looks like our code *does* set flags at the start of
the pattern? That's true, but the markdown module includes our regex in the
middle of a larger one, so it's not actually at the start.)
Fixes this warning (and a couple similar ones):
DeprecationWarning: Flags not at the start of the expression '^(.?)(?x) \[ ([^]]' (truncated)
self.compiled_re = re.compile(r"^(.?)%s(.)$" % pattern
Fixes the following warnings when run with Markdown 2.6.11:
DeprecationWarning: "safe_mode" is deprecated in Python-Markdown. Use an HTML sanitizer (like Bleach https://bleach.readthedocs.io/) if you are parsing untrusted markdown text. See the 2.6 release notes for more info
DeprecationWarning: Using short names for Markdown's builtin extensions is deprecated. Use the full path to the extension with Python's dot notation (eg: "markdown.extensions.extra" instead of "extra"). The current behavior will raise an error in version 2.7. See the Release Notes for Python-Markdown version 2.6 for more info.
Also get rid of some compatability code for Markdown 2.0, which we no longer support.
Updates #257
Add Let's Go Pikachu/Eevee and Sword/Shield data
Here is a summary of the extracted data:
- Moves (names, flavor text, changelogs, flags, effects)
- Abilities (names, flavor text)
- Items (names, game indices, machines)
- Pokemon (names, species, formes, learnsets, egg groups, dex numbers, dex entries, evolutions, categories (genus))
Locations and encounters are not included.
The Let's Go data excludes unobtainable pokemon; i.e., everything except
the first 151 and their forms, plus Meltan and Melmetal. While the game
has data for the rest of the pokemon, they are explicitly unobtainable
even by trading, and the data is mostly (or entirely?) copied from Sun &
Moon.
TMs and TRs are numbered from 00 to 99 in Sword/Shield. We use machine
numbers 0-99 for the TMs, and 100-199 for the TRs. For example TM05 is ID
5, and TR99 is ID 199. Note that TRs overlap with HMs in previous games.
Friendship-based evolutions now trigger at 160 friendship instead of 220.
Pokemon shapes are left blank (it's unclear if they are in Sw/Sh at all).
We can grab them from HOME later. Other blank columns: pokemon_name (in
pokemon_form_names), is_battle_only, has_gender_differences, and form_switchable.
Parnassius's python scripts for extracting the game data are available
here: <https://github.com/Parnassius/i-pokemoni>.
They are heavily based on the pknx project:
<https://github.com/kwsch/pkNX>.
Closes#311Closes#284Closes#262Closes#210Closes#231
The Mt. Coronet area names were not sufficiently clear as to which
areas they were referring to (especially the one simply named "cave").
I have renamed all of the areas that I think were unclear,
as well as ensured that all 1F areas in Mt. Coronet
include "1F" in their name for consistency.
"Quick tempered" and "A little quick tempered" erroneously had the same
Spanish translation, "Tiene mal genio". The latter should actually be
"A veces se enfada".
Verified against a text dump.
Fixes#309
Legendary and Mythical are official terms which, while generally not
present in the game data, are more or less consistently applied in
promotional material. They're also useful categorizations to fans,
so it seems reasonable to include them here.
The legendary Pokémon are:
Articuno, Zapdos, Moltres, Mewtwo,
Raikou, Entei, Suicune, Lugia, Ho-Oh,
Regirock, Regice, Registeel,
Latias, Latios, Kyogre, Groudon, Rayquaza,
Uxie, Mesprit, Azelf, Dialga, Palkia, Giratina,
Heatran, Regigigas, Cresselia,
Cobalion, Terrakion, Virizion,
Tornadus, Thundurus, Landorus,
Reshiram, Zekrom, Kyurem,
Xerneas, Yveltal, Zygarde,
Tapu Koko, Tapu Lele, Tapu Bulu, Tapu Fini,
Cosmog, Cosmoem, Solgaleo, Lunala, Necrozma.
The mythical Pokémon are: Mew, Celebi, Jirachi, Deoxys, Phione, Manaphy,
Darkrai, Shaymin, Arceus, Victini, Keldeo, Meloetta, Genesect,
Diancie, Hoopa, Volcanion, Magearna, Marshadow, Zeraora.
A bug in the text dumper caused み to be replaced with a narrow
non-breaking space and the actual nbsp character in the unicode private
use area to go untranslated.
Only affected OR/AS.
Fix with a simple text replace on the affected entries.
import csv
in_ = open("../pokedex/data/csv/pokemon_species_flavor_text.csv", "r")
out = open("fixed.csv", "w")
r = csv.reader(in_, lineterminator='\n')
w = csv.writer(out, lineterminator='\n')
for row in r:
text = row[3]
if row[1] in {'25', '26'}:
text = text.replace("\u202f", "\u307f") # nbsp => mi
text = text.replace("\ue07f", "\u202f") # e07f => nbsp
w.writerow((row[0], row[1], row[2], text))
out.close()
Fixes#308
The initial import of data from S/M and US/UM only included held items for Moon
and Ultra Sun. (Presumably those were the only games eevee had access to?)
I now have all four games and I've verified that the data file which
contains held items is completely identical between Sun and Moon, and between
Ultra Sun and Ultra Moon.
So we can just copy the held items from the other two games.
pokedex=> insert into pokemon_items (select pokemon_id, 27, item_id, rarity from pokemon_items where version_id=28);
INSERT 0 356
Time: 220.560 ms
pokedex=> insert into pokemon_items (select pokemon_id, 30, item_id, rarity from pokemon_items where version_id=29);
INSERT 0 362
Time: 102.063 ms
- Add exception handling for SQLite, PostgreSQL, and MySQL.
Sqlalchemy gives different exceptions for each database engine so I have
seperated each exception for each engine.
The error message passed by each engine is also different so that is
checked as well.
- Once the function gets one of those exceptions the following message
is outputed and the program ends: `ERROR: Table 'TABLENAME' already
exists in the database. Did you mean to use 'pokedex load -D'`
- If the error is not that a table already exists, then the output will
just be the full error from sqlalchemy. That way if someone runs into
that error it can be reported as an issue and whoever can help would see
the full error.
---
Resolves part of issue #16
Filtering on pokemon name was broken. Not sure why, since the search CLI
was added way after the i18n stuff was added. The error is related to
AssociationProxy, which figures because nothing about association
proxies ever seems to work right. I don't know enough about SQLAlchemy
internals to know if what it was trying to do was supposed to
work, or how to fix it if so. So, fix it by using the same boring
join-based filtering that spline-pokedex uses.
Running `pokedex search --name=gloom` caused the following error with
PostgreSQL and SQLAlchemy 1.3.5:
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) can't adapt type 'ColumnAssociationProxyInstance'
...and this error with SQLite.
sqlalchemy.exc.InterfaceError: (sqlite3.InterfaceError) Error binding parameter 4 - probably unsupported type.
[parameters: (9, 9, 9, 9, ColumnAssociationProxyInstance(AssociationProxy('names_local', 'name')), 'gloom')]
Additionaly, the following error would happen with PostgreSQL and SQLAlchemy 0.9.7,
but that's probably unrelated:
sqlalchemy.exc.ProgrammingError: (ProgrammingError) subquery in FROM must have an alias
LINE 4: FROM pokemon_species, (SELECT pokemon_species_names.name AS ...
^
Fixes#296
Gen III contest effects were part of the initial data import from brown
veekun and so have probably never gotten a proper rip.
This commit re-rips contest effect stats, types, combos, and the mapping
between contest effects and moves.
None of the stats changed (jam & appeal); a few moves got assigned
different contest effects (specifically: smokescreen, flash, spite, and
shadow ball); and several combos changed.
For example, Hail was listed as comboing into the following moves
(this is also what Bulbapedia says):
Ice Beam, Blizzard, Aurora Beam, Haze, Powder Snow, Icy Wind,
Ice Ball, Weather Ball, Sheer Cold, Icicle Spear
However, the actual list is much shorter:
Blizzard, Powder Snow, Weather Ball
I verified on my Ruby cart that Hail->Ice Beam and Hail->Icy Wind are
not real combos, and that Hail->Blizzard is.
n.b. There are a bunch of unused contest effects in the game: out of 48
effects, 15 are not used by any move. The pokedex doesn't currently
include these. I elected not to add them, partly because i didn't want
to have to rip flavor text for them, but mostly because if i were going
to go that route i would probably reassign contest_effects.id to match
their internal ids, which would have made for uglier diffs.
Fixes#280
- link to nonexistant `[]{move:shield}` in Color Change (changed to protect)
- invalid syntax `[move:sandstorm]` in Primordial Sea
- invalid syntax `[move:sandstorm]` in Desolate Land
- invalid syntax `[move:sandstorm]` in Delta Stream
Found by test_markdown_values, which is not run by default because it is
slow. It can be run manually with
py.test pokedex/tests/test_strings.py --all
Pikachu's Cap forms and Cosplay forms had overlapping orders because i
forgot about Cosplay Pikachu when i set the form_order for the cap
forms.
??? Arceus had form_order=3 so it would go after all the other forms,
which had form_order=2. These were assigned distinct form_orders 2
through 17 at some point during a recent dump, but ??? Arceus was
missed.
Fixes#282
This commit adds Korean translations for egg groups, generations, languages, regions, stats, and version names. Also the ??? and shadow types.
It also fills in some missing foreign version names for S/M and US/UM (from Bulbapedia).
Roserade and Roselia were mistakenly sharing dex number 72. Presumably
an error from the original X/Y spreadsheet. I guess we never reripped
these after 3DS rom dumping became possible.
Regardless of how it happened, add a test and some database constraints
to ensure that it doesn't happen again.
- Add a test for gaps in pokedex numbers
- Add uniqueness constraints to pokemon_dex_numbers. A species can
only appear once per pokedex, and a number cannot be used more than
once per pokedex.
Cosplay Pikachu was listed as being encountered in contest-hall, but
that's a Sinnoh location. In OR/AS, the contest halls are not a
first-class location but rather just treated as part of the town or city
they are in. Cosplay Pikachu is given to the player after they
participate in their first contest, so its location can be any of the
four cities with a contest hall.
The Sinnoh starter that the player obtains in OR/AS is on Hoenn Route
101, not Sinnoh Route 201 (probably a copy/paste error).
Add a test to make sure that encounter regions always match the
region(s) that their game takes place in.