Skip to content
Merged
48 changes: 11 additions & 37 deletions data/v2/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,32 +128,6 @@ def build_generic(model_classes, file_name, csv_record_to_objects):
model_class.objects.bulk_create(batch)


def scrub_str(string):
"""
The purpose of this function is to scrub the weird template mark-up out of strings
that Veekun is using for their pokedex.
Example:
[]{move:dragon-tail} will effect the opponents [HP]{mechanic:hp}.
Becomes:
dragon tail will effect the opponents HP.

If you find this results in weird strings please take a stab at improving or re-writing.
"""
groups = re.findall(GROUP_RGX, string)
for group in groups:
if group[0]:
sub = group[0]
else:
sub = group[1].split(":")
if len(sub) >= 2:
sub = sub[1]
else:
sub = sub[0]
sub = sub.replace("-", " ")
string = re.sub(SUB_RGX, sub, string, 1)
return string


##############
# LANGUAGE #
##############
Expand Down Expand Up @@ -351,8 +325,8 @@ def csv_record_to_objects(info):
yield AbilityEffectText(
ability_id=int(info[0]),
language_id=int(info[1]),
short_effect=scrub_str(info[2]),
effect=scrub_str(info[3]),
short_effect=info[2],
effect=info[3],
)

build_generic((AbilityEffectText,), "ability_prose.csv", csv_record_to_objects)
Expand All @@ -361,7 +335,7 @@ def csv_record_to_objects(info):
yield AbilityChangeEffectText(
ability_change_id=int(info[0]),
language_id=int(info[1]),
effect=scrub_str(info[2]),
effect=info[2],
)

build_generic(
Expand Down Expand Up @@ -473,7 +447,7 @@ def csv_record_to_objects(info):
yield ItemFlingEffectEffectText(
item_fling_effect_id=int(info[0]),
language_id=int(info[1]),
effect=scrub_str(info[2]),
effect=info[2],
)

build_generic(
Expand Down Expand Up @@ -531,8 +505,8 @@ def csv_record_to_objects(info):
yield ItemEffectText(
item_id=int(info[0]),
language_id=int(info[1]),
short_effect=scrub_str(info[2]),
effect=scrub_str(info[3]),
short_effect=info[2],
effect=info[3],
)

build_generic((ItemEffectText,), "item_prose.csv", csv_record_to_objects)
Expand Down Expand Up @@ -750,8 +724,8 @@ def csv_record_to_objects(info):
yield MoveEffectEffectText(
move_effect_id=int(info[0]),
language_id=int(info[1]),
short_effect=scrub_str(info[2]),
effect=scrub_str(info[3]),
short_effect=info[2],
effect=info[3],
)

build_generic(
Expand All @@ -771,7 +745,7 @@ def csv_record_to_objects(info):
yield MoveEffectChangeEffectText(
move_effect_change_id=int(info[0]),
language_id=int(info[1]),
effect=scrub_str(info[2]),
effect=info[2],
)

build_generic(
Expand Down Expand Up @@ -920,7 +894,7 @@ def csv_record_to_objects(info):
yield MoveAttributeDescription(
move_attribute_id=int(info[0]),
language_id=int(info[1]),
description=scrub_str(info[3]),
description=info[3],
)

build_generic(
Expand Down Expand Up @@ -1391,7 +1365,7 @@ def csv_record_to_objects(info):
yield PokemonSpeciesDescription(
pokemon_species_id=int(info[0]),
language_id=int(info[1]),
description=scrub_str(info[2]),
description=info[2],
)

build_generic(
Expand Down
138 changes: 69 additions & 69 deletions data/v2/csv/ability_changelog_prose.csv
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@ ability_changelog_id,local_language_id,effect
1,5,N'a aucun effet en combat.
1,6,Hat im Kampf keinen Effekt.
1,9,Has no effect in battle.
2,5,N'empêche pas les KO réguliers en ayant tous ses []{mechanic:hp}.
2,6,Verhindert keine regulären K.O. bei vollen []{mechanic:hp}.
2,9,Does not prevent regular KOs from full [HP]{mechanic:hp}.
2,5,N'empêche pas les KO réguliers en ayant tous ses PV.
2,6,Verhindert keine regulären K.O. bei vollen KP.
2,9,Does not prevent regular KOs from full HP.
3,5,N'a pas d'effet en dehors du combat.
3,6,Hat außerhalb vom Kampf keinen Effekt.
3,9,Has no overworld effect.
4,5,"N'absorbe pas les capacités []{type:electric} non-offensives, i.e. []{move:thunder-wave}."
4,6,"[]{type:electric}-Attacken die keinen Schaden anrichten, wie []{move:thunder-wave}, werden nicht absorbiert."
4,9,"Does not absorb non-damaging []{type:electric} moves, i.e. []{move:thunder-wave}."
4,5,"N'absorbe pas les capacités Électrik non-offensives, i.e. Cage Éclair."
4,6,"Elektro-Attacken die keinen Schaden anrichten, wie Donnerwelle, werden nicht absorbiert."
4,9,"Does not absorb non-damaging Electric moves, i.e. Thunder Wave."
5,5,Se déclenche à chaque coup d'une capacité multi-coups.
5,6,Löst bei Attacken die mehrmals Treffen bei jedem Treffer aus.
5,9,Triggers on every hit of multiple-hit moves.
6,5,[]{move:will-o-wisp} ne déclenche pas ce talent pour un Pokémon immunisé à []{mechanic:burn}.
6,6,[]{move:will-o-wisp} triggert die Fähigkeit nicht bei Pokémon die immun gegen []{mechanic:burn} sind.
6,9,[]{move:will-o-wisp} does not trigger this ability for Pokémon immune to [burns]{mechanic:burn}.
6,5,Feu Follet ne déclenche pas ce talent pour un Pokémon immunisé à la brûlure.
6,6,Irrlicht triggert die Fähigkeit nicht bei Pokémon die immun gegen Verbrennung sind.
6,9,Will-O-Wisp does not trigger this ability for Pokémon immune to burns.
7,5,N'a pas d'effet en dehors du combat.
7,6,Hat außerhalb vom Kampf keinen Effekt.
7,9,Has no overworld effect.
Expand All @@ -29,39 +29,39 @@ ability_changelog_id,local_language_id,effect
10,5,Affecte les autres Pokémon avec ce talent.
10,6,Betrifft andere Pokémon mit dieser Fähigkeit.
10,9,Affects other Pokémon with this ability.
11,5,Inflige seulement 1/16 des []{mechanic:hp} maximum du lanceur en dégâts.
11,6,Verursacht nur 1/16 der maximalen []{mechanic:hp} des Angreifers Schaden.
11,9,Inflicts only 1/16 of the attacker's maximum [HP]{mechanic:hp} in damage.
12,5,[]{move:fire-fang} et les capacités qui infligent des []{mechanic:typeless-damage} ignorent ce talent peu importe le type.
12,6,"[]{move:fire-fang} und Attacken die [typenlosen Schaden]{mechanic:typeless-damage} verursachen, ignorieren diese Fähigkeit unabhängig von ihrem Typ."
12,9,[]{move:fire-fang} and moves that inflict [typeless damage]{mechanic:typeless-damage} ignore this ability regardless of type.
11,5,Inflige seulement 1/16 des PV maximum du lanceur en dégâts.
11,6,Verursacht nur 1/16 der maximalen KP des Angreifers Schaden.
11,9,Inflicts only 1/16 of the attacker's maximum HP in damage.
12,5,Crocs Feu et les capacités qui infligent des dommages sans type ignorent ce talent peu importe le type.
12,6,"Feuerzahn und Attacken die typenlosen Schaden verursachen, ignorieren diese Fähigkeit unabhängig von ihrem Typ."
12,9,Fire Fang and moves that inflict typeless damage ignore this ability regardless of type.
13,5,N'a pas d'effet en dehors du combat.
13,6,Hat außerhalb vom Kampf keinen Effekt.
13,9,Has no overworld effect.
14,5,Ne peut pas influencer les natures des Pokémon rencontrés en interagissant avec eux dans le monde extérieur.
14,6,Kann das Wesen von Pokémon mit denen in der Spielwelt interagiert wird nicht verändern.
14,9,Cannot influence the natures of Pokémon encountered by interacting with them on the overworld.
15,5,Ne transmet pas le []{mechanic:poison} grave comme poison régulier.
15,6,Gibt schwere []{mechanic:poison} als normale []{mechanic:poison} zurück.
15,9,Passes back bad [poison]{mechanic:poison} as regular poison.
15,5,Ne transmet pas le poison grave comme poison régulier.
15,6,Gibt schwere Vergiftung als normale Vergiftung zurück.
15,9,Passes back bad poison as regular poison.
16,5,N'a pas d'effet en dehors du combat.
16,6,Hat außerhalb vom Kampf keinen Effekt.
16,9,Has no overworld effect.
17,5,"N'affecte pas les capacités []{type:electric} non-offensives, i.e. []{move:thunder-wave}. Augmente la fréquence des revanches dans le monde extérieur si un Pokémon de l'équipe a ce talent."
17,6,"Betrifft keine []{type:electric}-Attacken die keinen Schaden anrichten, wie []{move:thunder-wave}. Erhöht die Anzahl an Trainer-Anrufen wenn irgendein Pokémon im Team diese Fähigkeit hat."
17,9,"Does not affect non-damaging []{type:electric} moves, i.e. []{move:thunder-wave}. Increases the frequency of Match Call calls on the overworld if any party Pokémon has this ability."
18,5,Redirige les capacités []{type:electric} sans les annuler ou garantir aucun boost d'[]{mechanic:special-attack}. Ne redirige pas []{move:hidden-power}.
18,6,"Leitet []{type:electric}-Attacken um, ohne ihre Effekte zu deaktivieren oder einen []{mechanic:special-attack} Bonus zu gewähren. Leitet []{move:hidden-power} nicht um."
18,9,Redirects []{type:electric} moves without negating them or granting any [Special Attack]{mechanic:special-attack} boost. Does not redirect []{move:hidden-power}.
17,5,"N'affecte pas les capacités Électrik non-offensives, i.e. Cage Éclair. Augmente la fréquence des revanches dans le monde extérieur si un Pokémon de l'équipe a ce talent."
17,6,"Betrifft keine Elektro-Attacken die keinen Schaden anrichten, wie Donnerwelle. Erhöht die Anzahl an Trainer-Anrufen wenn irgendein Pokémon im Team diese Fähigkeit hat."
17,9,"Does not affect non-damaging Electric moves, i.e. Thunder Wave. Increases the frequency of Match Call calls on the overworld if any party Pokémon has this ability."
18,5,Redirige les capacités Électrik sans les annuler ou garantir aucun boost d'Attaque Spéciale. Ne redirige pas Puissance Cachée.
18,6,"Leitet Elektro-Attacken um, ohne ihre Effekte zu deaktivieren oder einen Spezialangriff Bonus zu gewähren. Leitet Kraftreserve nicht um."
18,9,Redirects Electric moves without negating them or granting any Special Attack boost. Does not redirect Hidden Power.
19,5,N'a pas d'effet en dehors du combat.
19,6,Hat außerhalb vom Kampf keinen Effekt.
19,9,Has no overworld effect.
20,5,N'a pas d'effet en dehors du combat.
20,6,Hat außerhalb vom Kampf keinen Effekt.
20,9,Has no overworld effect.
21,5,"Empêche []{move:heal-bell} de soigner le Pokémon, que ce soit en combat ou non."
21,6,"Hindert []{move:heal-bell} daran, das Pokémon zu heilen, auch außerhalb vom Kampf."
21,9,"Prevents []{move:heal-bell} from curing the Pokémon, whether or not it is in battle."
21,5,"Empêche Glas de Soin de soigner le Pokémon, que ce soit en combat ou non."
21,6,"Hindert Vitalglocke daran, das Pokémon zu heilen, auch außerhalb vom Kampf."
21,9,"Prevents Heal Bell from curing the Pokémon, whether or not it is in battle."
22,5,N'a pas d'effet en dehors du combat.
22,6,Hat außerhalb vom Kampf keinen Effekt.
22,9,Has no overworld effect.
Expand All @@ -77,9 +77,9 @@ ability_changelog_id,local_language_id,effect
26,5,N'a pas d'effet en dehors du combat.
26,6,Hat außerhalb vom Kampf keinen Effekt.
26,9,Has no overworld effect.
27,5,Double le rayon d'action de []{move:cut} dans le monde extérieur si un Pokémon de l'équipe a ce talent.
27,6,"Verdoppelt den Radius in dem []{move:cut} Gras entfernt, wenn irgendein Pokémon im Team diese Fähigkeit hat."
27,9,Doubles []{move:cut}'s grass-cutting radius on the overworld if any party Pokémon has this ability.
27,5,Double le rayon d'action de Coupe dans le monde extérieur si un Pokémon de l'équipe a ce talent.
27,6,"Verdoppelt den Radius in dem Zerschneider Gras entfernt, wenn irgendein Pokémon im Team diese Fähigkeit hat."
27,9,Doubles Cut's grass-cutting radius on the overworld if any party Pokémon has this ability.
28,5,N'a aucun effet en combat.
28,6,Hat im Kampf keinen Effekt.
28,9,Has no effect in battle.
Expand All @@ -92,9 +92,9 @@ ability_changelog_id,local_language_id,effect
31,5,N'a pas d'effet en dehors du combat.
31,6,Hat außerhalb vom Kampf keinen Effekt.
31,9,Has no overworld effect.
32,5,Ne prend pas effet pendant le []{mechanic:sleep}.
32,6,Hat keinen Effekt während das Pokémon [schläft]{mechanic:sleep}.
32,9,Does not take effect during [sleep]{mechanic:sleep}.
32,5,Ne prend pas effet pendant le sommeil.
32,6,Hat keinen Effekt während das Pokémon schläft.
32,9,Does not take effect during sleep.
33,5,N'a pas d'effet en dehors du combat.
33,6,Hat außerhalb vom Kampf keinen Effekt.
33,9,Has no overworld effect.
Expand All @@ -110,45 +110,45 @@ ability_changelog_id,local_language_id,effect
37,5,N'a pas d'effet en dehors du combat.
37,6,Hat außerhalb vom Kampf keinen Effekt.
37,9,Has no overworld effect.
38,5,Le []{mechanic:poison} continue d'infliger des dégâts au Pokémon en dehors du combat.
38,6,[]{mechanic:poison} schadet dem Pokémon außerhalb vom Kampf.
38,9,[Poison]{mechanic:poison} still damages the Pokémon outside of battle.
39,5,"La []{mechanic:paralysis} ne peut pas empêcher le Pokémon de bouger, mais le malus de []{mechanic:speed} est appliqué. Le []{mechanic:poison} continue d'infliger des dommages au Pokémon en dehors du combat."
39,6,"[]{mechanic:paralysis} hindert das Pokémon nicht daran sich zu bewegen, aber der []{mechanic:speed} Malus bleibt. []{mechanic:poison} schadet dem Pokémon außerhalb vom Kampf."
39,9,"[Paralysis]{mechanic:paralysis} cannot prevent the Pokémon from moving, though the [Speed]{mechanic:speed} cut is unaffected. [Poison]{mechanic:poison} still damages the Pokémon outside of battle."
40,5,"À cause d'un glitch, les capacités affectées par ce talent ont (100 - accuracy)% de chance de transpercer []{move:detect} ou []{move:protect}."
40,6,Wegen eines Glitches haben Attacken die von dieser Fähigkeit beeinflusst sind eine (100 - Genauigkeit)% Chance durch den []{move:detect} oder []{move:protect} zu treffen.
40,9,"Due to a glitch, moves affected by this ability have a (100 - accuracy)% chance to hit through []{move:detect} or []{move:protect}."
41,5,[]{move:rest} fonctionne de manière habituelle sous le []{mechanic:strong-sunlight}.
41,6,[]{move:rest} funktioniert normal bei [starkem Sonnenlicht]{mechanic:strong-sunlight}.
41,9,[]{move:rest} works as usual during [strong sunlight]{mechanic:strong-sunlight}.
42,5,[]{move:fling} peut être utilisé de manière habituelle.
42,6,[]{move:fling} kann normal benutzt werden.
42,9,[]{move:fling} can be used as usual.
43,5,Redirige les capacités []{type:water} sans les annuler ou garantir aucun boost d'[]{mechanic:special-attack}. Ne redirige pas []{move:hidden-power}.
43,6,Leitet []{type:water}-Attacken um ohne den []{mechanic:special-attack} Bonus zu gewähren. Leitet []{move:hidden-power} nicht um.
43,9,Redirects []{type:water} moves without negating them or granting any [Special Attack]{mechanic:special-attack} boost. Does not redirect []{move:hidden-power}.
44,5,Peut copier []{ability:flower-gift} et []{ability:wonder-guard}.
44,6,Kann []{ability:flower-gift} und []{ability:wonder-guard} kopieren.
44,9,Can copy []{ability:flower-gift} and []{ability:wonder-guard}.
45,5,Peut copier []{ability:forecast} et []{ability:trace}.
45,6,Kann []{ability:forecast} und []{ability:trace} kopieren.
45,9,Can copy []{ability:forecast} and []{ability:trace}.
46,5,Fonctionne uniquement quand associé à []{ability:minus}.
46,6,Funktioniert nur wenn es mit []{ability:minus} kombiniert wird.
46,9,Powers up only when paired with []{ability:minus}.
47,5,Fonctionne uniquement quand associé à []{ability:plus}.
47,6,Funktioniert nur wenn es mit []{ability:plus} kombiniert wird.
47,9,Powers up only when paired with []{ability:plus}.
38,5,Le poison continue d'infliger des dégâts au Pokémon en dehors du combat.
38,6,Vergiftung schadet dem Pokémon außerhalb vom Kampf.
38,9,Poison still damages the Pokémon outside of battle.
39,5,"La paralysie ne peut pas empêcher le Pokémon de bouger, mais le malus de Vitesse est appliqué. Le poison continue d'infliger des dommages au Pokémon en dehors du combat."
39,6,"Paralyse hindert das Pokémon nicht daran sich zu bewegen, aber der Initiative Malus bleibt. Vergiftung schadet dem Pokémon außerhalb vom Kampf."
39,9,"Paralysis cannot prevent the Pokémon from moving, though the Speed cut is unaffected. Poison still damages the Pokémon outside of battle."
40,5,"À cause d'un glitch, les capacités affectées par ce talent ont (100 - accuracy)% de chance de transpercer Détection ou Abri."
40,6,Wegen eines Glitches haben Attacken die von dieser Fähigkeit beeinflusst sind eine (100 - Genauigkeit)% Chance durch den Scanner oder Schutzschild zu treffen.
40,9,"Due to a glitch, moves affected by this ability have a (100 - accuracy)% chance to hit through Detect or Protect."
41,5,Repos fonctionne de manière habituelle sous le soleil intense.
41,6,Erholung funktioniert normal bei starkem Sonnenlicht.
41,9,Rest works as usual during strong sunlight.
42,5,Dégommage peut être utilisé de manière habituelle.
42,6,Schleuder kann normal benutzt werden.
42,9,Fling can be used as usual.
43,5,Redirige les capacités Eau sans les annuler ou garantir aucun boost d'Attaque Spéciale. Ne redirige pas Puissance Cachée.
43,6,Leitet Wasser-Attacken um ohne den Spezialangriff Bonus zu gewähren. Leitet Kraftreserve nicht um.
43,9,Redirects Water moves without negating them or granting any Special Attack boost. Does not redirect Hidden Power.
44,5,Peut copier Don Floral et Garde Mystik.
44,6,Kann Pflanzengabe und Wunderwache kopieren.
44,9,Can copy Flower Gift and Wonder Guard.
45,5,Peut copier Météo et Calque.
45,6,Kann Prognose und Erfassen kopieren.
45,9,Can copy Forecast and Trace.
46,5,Fonctionne uniquement quand associé à Moins.
46,6,Funktioniert nur wenn es mit Minus kombiniert wird.
46,9,Powers up only when paired with Minus.
47,5,Fonctionne uniquement quand associé à Plus.
47,6,Funktioniert nur wenn es mit Plus kombiniert wird.
47,9,Powers up only when paired with Plus.
48,5,Les chances que l'effet s'active sont de 30%.
48,6,"Die Chance, dass der Effekt eintritt, beträgt 30%."
48,9,Chance of taking effect is 30%.
49,5,[]{move:triple-kick} n'est pas affecté.
49,6,[]{move:triple-kick} wird nicht beeinflusst.
49,9,[]{move:triple-kick} is unaffected.
50,5,[]{move:struggle} n'est pas affecté. []{move:helping-hand} et []{move:defense-curl} ne sont pas pris en compte.
50,6,[]{move:struggle} wird nicht beeinflusst. []{move:helping-hand} und []{move:defense-curl} werden nicht beachtet.
50,9,[]{move:struggle} is unaffected. []{move:helping-hand} and []{move:defense-curl} are not taken into account.
49,5,Triple Pied n'est pas affecté.
49,6,Dreifachkick wird nicht beeinflusst.
49,9,Triple Kick is unaffected.
50,5,Lutte n'est pas affecté. Coup d’Main et Boul’Armure ne sont pas pris en compte.
50,6,Verzweifler wird nicht beeinflusst. Rechte Hand und Einigler werden nicht beachtet.
50,9,Struggle is unaffected. Helping Hand and Defense Curl are not taken into account.
51,5,N'a pas d'effet en dehors du combat.
51,6,Hat außerhalb vom Kampf keinen Effekt.
51,9,Has no overworld effect.
Expand Down
Loading
Loading