play: add some pokemon

This commit is contained in:
Alessandro Pezzè 2020-08-01 12:00:09 +02:00
parent 47044317e4
commit 047575ff41
9 changed files with 944 additions and 829 deletions

View file

@ -1264,21 +1264,21 @@ def _build_pokemons():
yield PokemonSpecies(
id=int(info[0]),
name=info[1],
generation_id=int(info[2]),
generation_id=int(info[2]) if info[2] != "" else None,
evolves_from_species=None,
evolution_chain_id=int(info[4]),
pokemon_color_id=int(info[5]),
pokemon_shape_id=int(info[6]),
evolution_chain_id=int(info[4]) if info[4] != "" else None,
pokemon_color_id=int(info[5]) if info[5] != "" else None,
pokemon_shape_id=int(info[6]) if info[6] != "" else None,
pokemon_habitat_id=int(info[7]) if info[7] != "" else None,
gender_rate=int(info[8]),
capture_rate=int(info[9]),
base_happiness=int(info[10]),
is_baby=bool(int(info[11])),
hatch_counter=int(info[12]),
has_gender_differences=bool(int(info[13])),
growth_rate_id=int(info[14]),
forms_switchable=bool(int(info[15])),
order=int(info[16]),
gender_rate=int(info[8]) if info[8] != "" else None,
capture_rate=int(info[9]) if info[9] != "" else None,
base_happiness=int(info[10]) if info[10] != "" else None,
is_baby=bool(int(info[11])) if info[11] != "" else None,
hatch_counter=int(info[12]) if info[12] != "" else None,
has_gender_differences=bool(int(info[13])) if info[13] != "" else None,
growth_rate_id=int(info[14]) if info[14] != "" else None,
forms_switchable=bool(int(info[15])) if info[15] != "" else None,
order=int(info[16]) if info[16] != "" else None,
)
build_generic((PokemonSpecies,), "pokemon_species.csv", csv_record_to_objects)
@ -1340,7 +1340,7 @@ def _build_pokemons():
height=int(info[3]) if info[3] != "" else None,
weight=int(info[4]) if info[4] != "" else None,
base_experience=int(info[5]) if info[5] != "" else None,
order=int(info[6]) if info[6] != "" else None,
order=int(info[6]) if info[6] != "" else -1,
is_default=bool(int(info[7])) if info[7] != "" else None,
)

View file

@ -41,3 +41,4 @@ generation_id,local_language_id,name
7,6,Generation VII
7,9,Generation VII
7,11,第七世代
8,9,Generation VIII

1 generation_id local_language_id name
41 7 6 Generation VII
42 7 9 Generation VII
43 7 11 第七世代
44 8 9 Generation VIII

View file

@ -6,3 +6,4 @@ id,main_region_id,identifier
5,5,generation-v
6,6,generation-vi
7,7,generation-vii
8,8,generation-viii

1 id main_region_id identifier
6 5 5 generation-v
7 6 6 generation-vi
8 7 7 generation-vii
9 8 8 generation-viii

View file

@ -887,9 +887,6 @@ id,identifier,species_id,height,weight,base_experience,order,is_default
888,zacian,888,28,1100,335,,1
889,zamazenta,889,29,2100,335,,1
890,eternatus,890,200,9500,345,,1
891,kubfu,891,6,120,,,1
892,urshifu,892,19,1050,,,1
893,zarude,893,18,700,,,1
10001,deoxys-attack,386,17,608,270,497,0
10002,deoxys-defense,386,17,608,270,498,0
10003,deoxys-speed,386,17,608,270,499,0

1 id identifier species_id height weight base_experience order is_default
887 888 zacian 888 28 1100 335 1
888 889 zamazenta 889 29 2100 335 1
889 890 eternatus 890 200 9500 345 1
891 kubfu 891 6 120 1
892 urshifu 892 19 1050 1
893 zarude 893 18 700 1
890 10001 deoxys-attack 386 17 608 270 497 0
891 10002 deoxys-defense 386 17 608 270 498 0
892 10003 deoxys-speed 386 17 608 270 499 0

File diff suppressed because it is too large Load diff

View file

@ -36,3 +36,4 @@ region_id,local_language_id,name
6,8,Kalos
6,9,Kalos
7,9,Alola
8,9,Galar

1 region_id local_language_id name
36 6 8 Kalos
37 6 9 Kalos
38 7 9 Alola
39 8 9 Galar

View file

@ -6,3 +6,4 @@ id,identifier
5,unova
6,kalos
7,alola
8,galar

1 id identifier
6 5 unova
7 6 kalos
8 7 alola
9 8 galar

View file

@ -0,0 +1,33 @@
# Generated by Django 2.1.11 on 2020-07-31 19:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pokemon_v2', '0006_auto_20200725_2205'),
]
operations = [
migrations.AlterField(
model_name='pokemonspecies',
name='base_happiness',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='pokemonspecies',
name='capture_rate',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='pokemonspecies',
name='gender_rate',
field=models.IntegerField(blank=True, null=True),
),
migrations.AlterField(
model_name='pokemonspecies',
name='hatch_counter',
field=models.IntegerField(blank=True, null=True),
),
]

View file

@ -1627,15 +1627,15 @@ class PokemonSpecies(
on_delete=models.CASCADE,
)
gender_rate = models.IntegerField()
gender_rate = models.IntegerField(blank=True, null=True)
capture_rate = models.IntegerField()
capture_rate = models.IntegerField(blank=True, null=True)
base_happiness = models.IntegerField()
base_happiness = models.IntegerField(blank=True, null=True)
is_baby = models.BooleanField(default=False)
hatch_counter = models.IntegerField()
hatch_counter = models.IntegerField(blank=True, null=True)
has_gender_differences = models.BooleanField(default=False)