From 3700b78ba215d10036a185492b45097b5f03bfe5 Mon Sep 17 00:00:00 2001 From: "Lynn \"Zhorken\" Vaughan" Date: Thu, 26 Jul 2012 13:38:40 -0400 Subject: [PATCH] Add an ID column to warrior ranks. --- pokedex/data/csv/conquest_warrior_ranks.csv | 486 ++++++++++---------- pokedex/db/tables.py | 25 +- 2 files changed, 265 insertions(+), 246 deletions(-) diff --git a/pokedex/data/csv/conquest_warrior_ranks.csv b/pokedex/data/csv/conquest_warrior_ranks.csv index 44ddee3..e695028 100644 --- a/pokedex/data/csv/conquest_warrior_ranks.csv +++ b/pokedex/data/csv/conquest_warrior_ranks.csv @@ -1,243 +1,243 @@ -warrior_id,rank,skill_id,capacity -1,1,3,4 -1,2,24,6 -1,3,25,8 -2,1,3,4 -2,2,24,6 -2,3,25,8 -3,1,26,5 -3,2,27,8 -4,1,6,4 -4,2,28,5 -5,1,15,6 -5,2,29,7 -5,3,30,8 -6,1,4,6 -6,2,31,7 -7,1,5,5 -7,2,32,6 -8,1,8,7 -8,2,33,8 -9,1,10,5 -9,2,34,6 -10,1,7,6 -10,2,35,7 -11,1,4,5 -11,2,36,6 -12,1,4,7 -12,2,37,8 -13,1,5,7 -13,2,38,8 -14,1,5,7 -14,2,39,8 -15,1,17,5 -15,2,40,6 -16,1,8,7 -16,2,41,8 -17,1,13,5 -17,2,42,6 -18,1,15,5 -18,2,43,6 -19,1,8,8 -19,2,44,8 -20,1,13,5 -20,2,45,6 -21,1,14,5 -21,2,46,6 -22,1,11,6 -22,2,47,7 -23,1,13,5 -23,2,48,5 -24,1,11,5 -24,2,49,6 -25,1,18,5 -25,2,50,5 -26,1,7,6 -26,2,51,7 -27,1,10,6 -27,2,52,7 -28,1,4,7 -28,2,53,7 -29,1,6,5 -29,2,54,5 -30,1,15,5 -30,2,55,6 -31,1,18,3 -31,2,56,4 -32,1,16,4 -32,2,57,5 -33,1,14,6 -33,2,58,6 -34,1,10,5 -34,2,59,6 -35,1,7,6 -35,2,60,7 -36,1,11,5 -36,2,61,5 -37,1,16,5 -37,2,62,6 -38,1,14,5 -38,2,63,6 -39,1,19,7 -40,1,15,6 -41,1,7,6 -42,1,21,7 -43,1,8,7 -44,1,20,7 -45,1,19,2 -46,1,2,4 -47,1,20,4 -48,1,11,6 -49,1,16,5 -50,1,4,6 -51,1,9,2 -52,1,5,5 -53,1,14,6 -54,1,3,6 -55,1,21,5 -56,1,1,5 -57,1,6,2 -58,1,10,2 -59,1,18,5 -60,1,7,4 -61,1,13,6 -62,1,16,6 -63,1,17,6 -64,1,20,5 -65,1,19,3 -66,1,19,3 -67,1,17,5 -68,1,1,5 -69,1,10,2 -70,1,2,3 -71,1,22,4 -72,1,9,2 -73,1,13,3 -74,1,6,4 -75,1,3,3 -76,1,10,5 -77,1,8,6 -78,1,9,5 -79,1,21,4 -80,1,5,4 -81,1,2,5 -82,1,17,3 -83,1,11,7 -84,1,4,7 -85,1,4,6 -86,1,17,6 -87,1,2,4 -88,1,3,5 -89,1,22,3 -90,1,7,7 -91,1,1,7 -92,1,2,5 -93,1,9,5 -94,1,18,2 -95,1,8,6 -96,1,9,5 -97,1,21,5 -98,1,14,5 -99,1,16,3 -100,1,19,3 -101,1,22,3 -102,1,7,6 -103,1,2,6 -104,1,20,5 -105,1,2,5 -106,1,3,5 -107,1,14,7 -108,1,12,5 -109,1,5,4 -110,1,8,3 -111,1,23,4 -112,1,5,3 -113,1,5,3 -114,1,9,3 -115,1,10,5 -116,1,12,3 -117,1,7,6 -118,1,15,5 -119,1,17,6 -120,1,8,5 -121,1,17,5 -122,1,18,7 -123,1,14,6 -124,1,12,3 -125,1,10,4 -126,1,1,5 -127,1,2,6 -128,1,5,5 -129,1,1,4 -130,1,12,3 -131,1,17,5 -132,1,9,5 -133,1,20,4 -134,1,13,4 -135,1,11,6 -136,1,4,6 -137,1,21,5 -138,1,7,5 -139,1,23,5 -140,1,19,5 -141,1,14,4 -142,1,20,4 -143,1,22,5 -144,1,8,4 -145,1,22,7 -146,1,13,1 -147,1,15,6 -148,1,4,5 -149,1,7,6 -150,1,23,3 -151,1,3,4 -152,1,9,2 -153,1,15,7 -154,1,11,7 -155,1,22,5 -156,1,1,7 -157,1,21,7 -158,1,8,6 -159,1,23,4 -160,1,4,4 -161,1,16,3 -162,1,15,8 -163,1,23,5 -164,1,4,5 -165,1,13,6 -166,1,5,4 -167,1,19,5 -168,1,6,3 -169,1,21,3 -170,1,3,3 -171,1,10,3 -172,1,9,3 -173,1,3,3 -174,1,16,6 -175,1,18,6 -176,1,11,6 -177,1,19,3 -178,1,19,5 -179,1,23,5 -180,1,13,2 -181,1,20,2 -182,1,14,3 -183,1,10,4 -184,1,13,4 -185,1,20,4 -186,1,5,4 -187,1,15,4 -188,1,16,4 -189,1,20,4 -190,1,9,4 -191,1,3,4 -192,1,12,4 -193,1,12,4 -194,1,1,4 -195,1,18,6 -196,1,23,3 -197,1,15,6 -198,1,14,5 -199,1,7,5 -200,1,4,4 -201,1,6,3 +id,warrior_id,rank,skill_id,capacity +1,1,1,3,4 +2,1,2,24,6 +3,1,3,25,8 +4,2,1,3,4 +5,2,2,24,6 +6,2,3,25,8 +7,3,1,26,5 +8,3,2,27,8 +9,4,1,6,4 +10,4,2,28,5 +11,5,1,15,6 +12,5,2,29,7 +13,5,3,30,8 +14,6,1,4,6 +15,6,2,31,7 +16,7,1,5,5 +17,7,2,32,6 +18,8,1,8,7 +19,8,2,33,8 +20,9,1,10,5 +21,9,2,34,6 +22,10,1,7,6 +23,10,2,35,7 +24,11,1,4,5 +25,11,2,36,6 +26,12,1,4,7 +27,12,2,37,8 +28,13,1,5,7 +29,13,2,38,8 +30,14,1,5,7 +31,14,2,39,8 +32,15,1,17,5 +33,15,2,40,6 +34,16,1,8,7 +35,16,2,41,8 +36,17,1,13,5 +37,17,2,42,6 +38,18,1,15,5 +39,18,2,43,6 +40,19,1,8,8 +41,19,2,44,8 +42,20,1,13,5 +43,20,2,45,6 +44,21,1,14,5 +45,21,2,46,6 +46,22,1,11,6 +47,22,2,47,7 +48,23,1,13,5 +49,23,2,48,5 +50,24,1,11,5 +51,24,2,49,6 +52,25,1,18,5 +53,25,2,50,5 +54,26,1,7,6 +55,26,2,51,7 +56,27,1,10,6 +57,27,2,52,7 +58,28,1,4,7 +59,28,2,53,7 +60,29,1,6,5 +61,29,2,54,5 +62,30,1,15,5 +63,30,2,55,6 +64,31,1,18,3 +65,31,2,56,4 +66,32,1,16,4 +67,32,2,57,5 +68,33,1,14,6 +69,33,2,58,6 +70,34,1,10,5 +71,34,2,59,6 +72,35,1,7,6 +73,35,2,60,7 +74,36,1,11,5 +75,36,2,61,5 +76,37,1,16,5 +77,37,2,62,6 +78,38,1,14,5 +79,38,2,63,6 +80,39,1,19,7 +81,40,1,15,6 +82,41,1,7,6 +83,42,1,21,7 +84,43,1,8,7 +85,44,1,20,7 +86,45,1,19,2 +87,46,1,2,4 +88,47,1,20,4 +89,48,1,11,6 +90,49,1,16,5 +91,50,1,4,6 +92,51,1,9,2 +93,52,1,5,5 +94,53,1,14,6 +95,54,1,3,6 +96,55,1,21,5 +97,56,1,1,5 +98,57,1,6,2 +99,58,1,10,2 +100,59,1,18,5 +101,60,1,7,4 +102,61,1,13,6 +103,62,1,16,6 +104,63,1,17,6 +105,64,1,20,5 +106,65,1,19,3 +107,66,1,19,3 +108,67,1,17,5 +109,68,1,1,5 +110,69,1,10,2 +111,70,1,2,3 +112,71,1,22,4 +113,72,1,9,2 +114,73,1,13,3 +115,74,1,6,4 +116,75,1,3,3 +117,76,1,10,5 +118,77,1,8,6 +119,78,1,9,5 +120,79,1,21,4 +121,80,1,5,4 +122,81,1,2,5 +123,82,1,17,3 +124,83,1,11,7 +125,84,1,4,7 +126,85,1,4,6 +127,86,1,17,6 +128,87,1,2,4 +129,88,1,3,5 +130,89,1,22,3 +131,90,1,7,7 +132,91,1,1,7 +133,92,1,2,5 +134,93,1,9,5 +135,94,1,18,2 +136,95,1,8,6 +137,96,1,9,5 +138,97,1,21,5 +139,98,1,14,5 +140,99,1,16,3 +141,100,1,19,3 +142,101,1,22,3 +143,102,1,7,6 +144,103,1,2,6 +145,104,1,20,5 +146,105,1,2,5 +147,106,1,3,5 +148,107,1,14,7 +149,108,1,12,5 +150,109,1,5,4 +151,110,1,8,3 +152,111,1,23,4 +153,112,1,5,3 +154,113,1,5,3 +155,114,1,9,3 +156,115,1,10,5 +157,116,1,12,3 +158,117,1,7,6 +159,118,1,15,5 +160,119,1,17,6 +161,120,1,8,5 +162,121,1,17,5 +163,122,1,18,7 +164,123,1,14,6 +165,124,1,12,3 +166,125,1,10,4 +167,126,1,1,5 +168,127,1,2,6 +169,128,1,5,5 +170,129,1,1,4 +171,130,1,12,3 +172,131,1,17,5 +173,132,1,9,5 +174,133,1,20,4 +175,134,1,13,4 +176,135,1,11,6 +177,136,1,4,6 +178,137,1,21,5 +179,138,1,7,5 +180,139,1,23,5 +181,140,1,19,5 +182,141,1,14,4 +183,142,1,20,4 +184,143,1,22,5 +185,144,1,8,4 +186,145,1,22,7 +187,146,1,13,1 +188,147,1,15,6 +189,148,1,4,5 +190,149,1,7,6 +191,150,1,23,3 +192,151,1,3,4 +193,152,1,9,2 +194,153,1,15,7 +195,154,1,11,7 +196,155,1,22,5 +197,156,1,1,7 +198,157,1,21,7 +199,158,1,8,6 +200,159,1,23,4 +201,160,1,4,4 +202,161,1,16,3 +203,162,1,15,8 +204,163,1,23,5 +205,164,1,4,5 +206,165,1,13,6 +207,166,1,5,4 +208,167,1,19,5 +209,168,1,6,3 +210,169,1,21,3 +211,170,1,3,3 +212,171,1,10,3 +213,172,1,9,3 +214,173,1,3,3 +215,174,1,16,6 +216,175,1,18,6 +217,176,1,11,6 +218,177,1,19,3 +219,178,1,19,5 +220,179,1,23,5 +221,180,1,13,2 +222,181,1,20,2 +223,182,1,14,3 +224,183,1,10,4 +225,184,1,13,4 +226,185,1,20,4 +227,186,1,5,4 +228,187,1,15,4 +229,188,1,16,4 +230,189,1,20,4 +231,190,1,9,4 +232,191,1,3,4 +233,192,1,12,4 +234,193,1,12,4 +235,194,1,1,4 +236,195,1,18,6 +237,196,1,23,3 +238,197,1,15,6 +239,198,1,14,5 +240,199,1,7,5 +241,200,1,4,4 +242,201,1,6,3 diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index a2e649c..1b843ef 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -235,6 +235,18 @@ create_translation_table('conquest_kingdom_names', ConquestKingdom, 'names', info=dict(description='The name.', format='plaintext', official=True)) ) +class ConquestMaxLink(TableBase): + u"""The maximum link a warrior rank can reach with a Pokémon in Pokémon + Conquest. + """ + __tablename__ = 'conquest_max_links' + warrior_rank_id = Column(Integer, ForeignKey('conquest_warrior_ranks.id'), primary_key=True, + info=dict(description="The ID of the warrior rank.")) + pokemon_species_id = Column(Integer, ForeignKey('pokemon_species.id'), primary_key=True, + info=dict(description='The ID of the Pokémon species.')) + max_link = Column(Integer, nullable=False, + info=dict(description='The maximum link percentage this warrior rank and Pokémon can reach.')) + class ConquestPokemonEvolution(TableBase): u"""The conditions under which a Pokémon must successfully complete an action to evolve in Pokémon Conquest. @@ -278,7 +290,7 @@ create_translation_table('conquest_warrior_names', ConquestWarrior, 'names', ) class ConquestWarriorRank(TableBase): - u"""A warrior rank in Pokémon Conquest. + u"""A warrior at a particular rank in Pokémon Conquest. These are used for whatever changes between ranks, much like Pokémon forms. Generic warriors who have only one rank are also represented here, with a @@ -290,15 +302,22 @@ class ConquestWarriorRank(TableBase): """ __tablename__ = 'conquest_warrior_ranks' __singlename__ = 'warrior_rank' - warrior_id = Column(Integer, ForeignKey('conquest_warriors.id'), primary_key=True, nullable=False, + id = Column(Integer, primary_key=True, autoincrement=True, + info=dict(description=u'An ID for this warrior rank.')) + warrior_id = Column(Integer, ForeignKey('conquest_warriors.id'), nullable=False, info=dict(description=u'The ID of the warrior.')) - rank = Column(Integer, primary_key=True, nullable=False, + rank = Column(Integer, nullable=False, info=dict(description=u'The rank number.')) skill_id = Column(Integer, ForeignKey('conquest_warrior_skills.id'), nullable=False, info=dict(description=u"The ID of this warrior rank's warrior skill.")) capacity = Column(Integer, nullable=False, info=dict(description=u'The number of Pokémon this warrior rank can be linked with at a time.')) + __table_args__ = ( + UniqueConstraint(warrior_id, rank), + {}, + ) + class ConquestWarriorSkill(TableBase): u"""A warrior skill in Pokémon Conquest. """