Added contest combos.
authorEevee <git@veekun.com>
Wed, 16 Sep 2009 03:04:22 +0000 (20:04 -0700)
committerEevee <git@veekun.com>
Wed, 16 Sep 2009 03:04:22 +0000 (20:04 -0700)
pokedex/data/csv/contest_combos.csv [new file with mode: 0644]
pokedex/data/csv/super_contest_combos.csv [new file with mode: 0644]
pokedex/db/tables.py

diff --git a/pokedex/data/csv/contest_combos.csv b/pokedex/data/csv/contest_combos.csv
new file mode 100644 (file)
index 0000000..6af426a
--- /dev/null
@@ -0,0 +1,247 @@
+first_move_id,second_move_id
+1,3
+1,29
+1,185
+7,8
+7,9
+8,7
+8,9
+9,7
+9,8
+10,154
+10,163
+11,12
+11,20
+14,15
+14,152
+14,163
+14,206
+14,210
+14,306
+28,189
+30,31
+30,32
+43,10
+43,23
+43,30
+43,33
+43,44
+43,137
+43,184
+43,185
+47,195
+47,287
+57,291
+64,31
+64,65
+74,22
+74,71
+74,72
+74,73
+74,75
+74,76
+74,80
+74,202
+74,331
+74,338
+74,345
+82,225
+82,337
+82,349
+88,157
+88,317
+89,90
+89,284
+93,94
+93,100
+93,134
+93,248
+94,93
+94,100
+94,134
+94,248
+95,138
+95,171
+99,37
+99,43
+99,184
+104,97
+104,98
+104,100
+106,33
+106,36
+106,38
+106,182
+106,205
+111,33
+111,205
+116,2
+116,5
+116,21
+116,25
+116,36
+116,38
+116,167
+116,198
+116,223
+116,238
+116,264
+116,280
+116,292
+116,327
+123,108
+124,188
+125,155
+125,198
+134,93
+134,94
+134,100
+134,248
+135,121
+155,125
+155,198
+156,173
+156,214
+170,5
+170,25
+170,26
+170,66
+170,136
+170,223
+170,276
+170,329
+174,180
+174,194
+174,212
+174,288
+181,59
+184,43
+184,44
+184,162
+184,242
+187,156
+188,124
+189,28
+189,300
+198,125
+198,155
+199,87
+199,161
+199,190
+199,192
+199,276
+201,28
+201,189
+201,300
+201,311
+201,328
+201,341
+203,175
+203,179
+203,194
+203,220
+203,283
+203,284
+204,39
+204,45
+204,156
+204,186
+204,260
+212,194
+212,195
+225,82
+225,337
+225,349
+230,77
+230,78
+230,79
+240,3
+240,55
+240,56
+240,57
+240,61
+240,87
+240,127
+240,128
+240,145
+240,152
+240,190
+240,291
+240,308
+240,311
+240,323
+240,330
+240,346
+240,352
+241,7
+241,27
+241,52
+241,53
+241,76
+241,83
+241,126
+241,172
+241,221
+241,234
+241,235
+241,236
+241,257
+241,284
+241,299
+241,307
+241,311
+241,315
+252,69
+252,185
+252,233
+252,282
+252,292
+254,255
+254,256
+258,58
+258,59
+258,62
+258,114
+258,181
+258,196
+258,301
+258,311
+258,329
+258,333
+268,9
+268,84
+268,85
+268,86
+268,87
+268,192
+268,209
+268,344
+268,351
+269,68
+269,197
+269,243
+281,156
+281,303
+291,57
+300,55
+300,189
+300,346
+319,232
+346,55
+346,287
+346,300
+347,60
+347,93
+347,94
+347,96
+347,113
+347,115
+347,138
+347,149
+347,248
+347,295
+347,296
+347,354
+349,82
+349,225
+349,337
diff --git a/pokedex/data/csv/super_contest_combos.csv b/pokedex/data/csv/super_contest_combos.csv
new file mode 100644 (file)
index 0000000..5d08742
--- /dev/null
@@ -0,0 +1,7 @@
+first_move_id,second_move_id
+74,345
+96,136
+111,205
+116,400
+244,56
+268,422
index 3e8f988..9348800 100644 (file)
@@ -20,6 +20,11 @@ class Ability(TableBase):
     flavor_text = Column(Unicode(64), nullable=False)
     effect = Column(Unicode(255), nullable=False)
 
+class ContestCombo(TableBase):
+    __tablename__ = 'contest_combos'
+    first_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False)
+    second_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False)
+
 class ContestEffect(TableBase):
     __tablename__ = 'contest_effects'
     id = Column(Integer, primary_key=True, nullable=False)
@@ -387,6 +392,11 @@ class Stat(TableBase):
     id = Column(Integer, primary_key=True, nullable=False)
     name = Column(Unicode(16), nullable=False)
 
+class SuperContestCombo(TableBase):
+    __tablename__ = 'super_contest_combos'
+    first_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False)
+    second_move_id = Column(Integer, ForeignKey('moves.id'), primary_key=True, nullable=False, autoincrement=False)
+
 class SuperContestEffect(TableBase):
     __tablename__ = 'super_contest_effects'
     id = Column(Integer, primary_key=True, nullable=False)
@@ -419,6 +429,11 @@ class Version(TableBase):
 
 
 ### Relations down here, to avoid ordering problems
+ContestCombo.first = relation(Move, primaryjoin=ContestCombo.first_move_id==Move.id,
+                                    backref='contest_combo_first')
+ContestCombo.second = relation(Move, primaryjoin=ContestCombo.second_move_id==Move.id,
+                                     backref='contest_combo_second')
+
 Encounter.pokemon = relation(Pokemon, backref='encounters')
 Encounter.version = relation(Version, backref='encounters')
 Encounter.location_area = relation(LocationArea, backref='encounters')
@@ -439,6 +454,8 @@ LocationArea.location = relation(Location, backref='areas')
 Machine.generation = relation(Generation)
 
 Move.contest_effect = relation(ContestEffect, backref='moves')
+Move.contest_combo_next = association_proxy('contest_combo_first', 'second')
+Move.contest_combo_prev = association_proxy('contest_combo_second', 'first')
 Move.damage_class = relation(MoveDamageClass, backref='moves')
 Move.flags = association_proxy('move_flags', 'flag')
 Move.flavor_text = relation(MoveFlavorText, order_by=MoveFlavorText.generation_id, backref='move')
@@ -448,6 +465,8 @@ Move.machines = relation(Machine, backref='move')
 Move.move_effect = relation(MoveEffect, backref='moves')
 Move.move_flags = relation(MoveFlag, backref='move')
 Move.super_contest_effect = relation(SuperContestEffect, backref='moves')
+Move.super_contest_combo_next = association_proxy('super_contest_combo_first', 'second')
+Move.super_contest_combo_prev = association_proxy('super_contest_combo_second', 'first')
 Move.target = relation(MoveTarget, backref='moves')
 Move.type = relation(Type, backref='moves')
 
@@ -505,6 +524,11 @@ PokemonName.language = relation(Language)
 
 PokemonStat.stat = relation(Stat)
 
+SuperContestCombo.first = relation(Move, primaryjoin=SuperContestCombo.first_move_id==Move.id,
+                                        backref='super_contest_combo_first')
+SuperContestCombo.second = relation(Move, primaryjoin=SuperContestCombo.second_move_id==Move.id,
+                                         backref='super_contest_combo_second')
+
 Type.damage_efficacies = relation(TypeEfficacy,
                                   primaryjoin=Type.id
                                       ==TypeEfficacy.damage_type_id,