veekun_pokedex/scripts/update-move-changelogs.py

59 lines
2.1 KiB
Python
Raw Normal View History

Add move changelogs for Gen V→VI Made by running a script to compare an old version of moves.csv[1] with the current version. [1]: https://github.com/veekun/pokedex/commit/cb5276773b2248a3ec2e71e34b31ed12fbd38000 Hidden power changed from variable power to 100. We can't represent NULLs in the changelog, so set the power to 1 instead. A few effect chances changed from NULL to 100. We can't represent this either, but i don't think it matters. leer: effect_chance changed from NULL to 100 hidden-power: power changed from 1 to 60 chatter: effect_chance changed from NULL to 100 v-create: effect_chance changed from NULL to 100 Here's the complete list of changes: swords-dance: pp changed from 30 to 20 whirlwind: accuracy changed from 100 to NULL vine-whip: power changed from 35 to 45 vine-whip: pp changed from 15 to 25 pin-missile: power changed from 14 to 25 pin-missile: accuracy changed from 85 to 95 roar: accuracy changed from 100 to NULL flamethrower: power changed from 95 to 90 hydro-pump: power changed from 120 to 110 surf: power changed from 95 to 90 ice-beam: power changed from 95 to 90 blizzard: power changed from 120 to 110 submission: pp changed from 25 to 20 growth: pp changed from 40 to 20 thunderbolt: power changed from 95 to 90 thunder: power changed from 120 to 110 minimize: pp changed from 20 to 10 barrier: pp changed from 30 to 20 lick: power changed from 20 to 30 smog: power changed from 20 to 30 fire-blast: power changed from 120 to 110 skull-bash: power changed from 100 to 130 skull-bash: pp changed from 15 to 10 glare: accuracy changed from 90 to 100 poison-gas: accuracy changed from 80 to 90 bubble: power changed from 20 to 40 psywave: accuracy changed from 80 to 100 acid-armor: pp changed from 40 to 20 crabhammer: power changed from 90 to 100 struggle: target_id changed from 10 to 8 thief: power changed from 40 to 60 thief: pp changed from 10 to 25 snore: power changed from 40 to 50 cotton-spore: target_id changed from 10 to 11 sweet-kiss: type_id changed from 1 to 18 perish-song: target_id changed from 12 to 14 charm: type_id changed from 1 to 18 fury-cutter: power changed from 20 to 40 heal-bell: target_id changed from 4 to 13 moonlight: type_id changed from 1 to 18 hidden-power: power changed from 1 to 60 future-sight: power changed from 100 to 120 heat-wave: power changed from 100 to 95 will-o-wisp: accuracy changed from 75 to 85 smellingsalt: power changed from 60 to 70 follow-me: priority changed from 3 to 2 nature-power: target_id changed from 1 to 10 knock-off: power changed from 20 to 65 poison-fang: effect_chance changed from 30 to 50 meteor-mash: power changed from 100 to 90 meteor-mash: accuracy changed from 85 to 90 aromatherapy: target_id changed from 4 to 13 air-cutter: power changed from 55 to 60 overheat: power changed from 140 to 130 rock-tomb: power changed from 50 to 60 rock-tomb: pp changed from 10 to 15 rock-tomb: accuracy changed from 80 to 95 extrasensory: pp changed from 30 to 20 muddy-water: power changed from 95 to 90 covet: pp changed from 40 to 25 wake-up-slap: power changed from 60 to 70 tailwind: pp changed from 30 to 15 assurance: power changed from 50 to 60 psycho-shift: accuracy changed from 90 to 100 aura-sphere: power changed from 90 to 80 air-slash: pp changed from 20 to 15 dragon-pulse: power changed from 90 to 85 power-gem: power changed from 70 to 80 energy-ball: power changed from 80 to 90 draco-meteor: power changed from 140 to 130 leaf-storm: power changed from 140 to 130 gunk-shot: accuracy changed from 70 to 80 chatter: power changed from 60 to 65 magma-storm: power changed from 120 to 100 wonder-room: priority changed from -7 to 0 rage-powder: priority changed from 3 to 2 magic-room: priority changed from -7 to 0 storm-throw: power changed from 40 to 60 synchronoise: power changed from 70 to 120 synchronoise: pp changed from 15 to 10 low-sweep: power changed from 60 to 65 hex: power changed from 50 to 65 incinerate: power changed from 30 to 60 water-pledge: power changed from 50 to 80 fire-pledge: power changed from 50 to 80 grass-pledge: power changed from 50 to 80 struggle-bug: power changed from 30 to 50 frost-breath: power changed from 40 to 60 sacred-sword: pp changed from 20 to 15 hurricane: power changed from 120 to 110 techno-blast: power changed from 85 to 120 Fixes #127 Fixes #136
2016-09-25 19:04:51 +00:00
from __future__ import print_function
import csv
import sys
fields = ['type_id', 'power', 'pp', 'accuracy', 'priority', 'target_id', 'effect_id', 'effect_chance']
def main():
old = csv.DictReader(open(sys.argv[1], 'rb'))
new = csv.DictReader(open(sys.argv[2], 'rb'))
version_group_id = int(sys.argv[3])
moves = {}
for row in new:
moves[row['id']] = row
for row in old:
if row['id'] not in moves:
print("move %d disappeared!", file=sys.stderr)
continue
oldmove = row
newmove = moves[row['id']]
if int(oldmove['id']) > 10000:
print("skipping shadow moves", file=sys.stderr)
continue
changed_fields = []
for field in fields:
if oldmove[field] == newmove[field]:
continue
if field == 'power' and oldmove['power'] in "01":
if newmove['power'] == "":
# expected
# we used to store variable-power moves as 0 or 1,
# now we store NULL
continue
else:
print("%s: %s changed from %s to %s" % (oldmove['identifier'], field, oldmove[field], newmove[field]), file=sys.stderr)
if oldmove[field] == '':
print("%s: %s changed from NULL to %s" % (oldmove['identifier'], field, newmove[field]), file=sys.stderr)
continue
#print("%s: %s changed from %s to %s" % (oldmove['identifier'], field, oldmove[field], sql_list([newmove[field]])))
changed_fields.append(field)
if changed_fields:
print("INSERT INTO move_changelog (move_id, changed_in_version_group_id, %s) VALUES (%s, %s, %s); -- %s (%s)" %
(sql_list(changed_fields), row['id'], version_group_id,
sql_list(map(oldmove.__getitem__, changed_fields)),
oldmove['identifier'],
sql_list(map(newmove.__getitem__, changed_fields))))
def sql_list(values):
return ", ".join(x if x != "" else "NULL" for x in values)
main()