From 487da7445685662ef89ba03e346c0d6402df4808 Mon Sep 17 00:00:00 2001 From: a_magical_me Date: Sun, 3 Apr 2011 06:34:49 -0700 Subject: [PATCH] Rename terrain => method. #375 They aren't actually terrains, and i need that name for another table. --- ...errain_prose.csv => encounter_method_prose.csv} | 2 +- ...encounter_terrain.csv => encounter_methods.csv} | 0 pokedex/data/csv/encounter_slots.csv | 2 +- pokedex/data/csv/location_area_encounter_rates.csv | 2 +- pokedex/db/tables.py | 52 +++++++++++----------- 5 files changed, 29 insertions(+), 29 deletions(-) rename pokedex/data/csv/{encounter_terrain_prose.csv => encounter_method_prose.csv} (79%) rename pokedex/data/csv/{encounter_terrain.csv => encounter_methods.csv} (100%) diff --git a/pokedex/data/csv/encounter_terrain_prose.csv b/pokedex/data/csv/encounter_method_prose.csv similarity index 79% rename from pokedex/data/csv/encounter_terrain_prose.csv rename to pokedex/data/csv/encounter_method_prose.csv index 789ae19..026db38 100644 --- a/pokedex/data/csv/encounter_terrain_prose.csv +++ b/pokedex/data/csv/encounter_method_prose.csv @@ -1,4 +1,4 @@ -encounter_terrain_id,local_language_id,name +encounter_method_id,local_language_id,name 1,9,Walking in tall grass or a cave 2,9,Fishing with an Old Rod 3,9,Fishing with a Good Rod diff --git a/pokedex/data/csv/encounter_terrain.csv b/pokedex/data/csv/encounter_methods.csv similarity index 100% rename from pokedex/data/csv/encounter_terrain.csv rename to pokedex/data/csv/encounter_methods.csv diff --git a/pokedex/data/csv/encounter_slots.csv b/pokedex/data/csv/encounter_slots.csv index 3444b80..706a79f 100644 --- a/pokedex/data/csv/encounter_slots.csv +++ b/pokedex/data/csv/encounter_slots.csv @@ -1,4 +1,4 @@ -id,version_group_id,encounter_terrain_id,slot,rarity +id,version_group_id,encounter_method_id,slot,rarity 1,8,1,1,20 2,8,1,2,20 3,8,1,3,10 diff --git a/pokedex/data/csv/location_area_encounter_rates.csv b/pokedex/data/csv/location_area_encounter_rates.csv index e75b9b7..abfec03 100644 --- a/pokedex/data/csv/location_area_encounter_rates.csv +++ b/pokedex/data/csv/location_area_encounter_rates.csv @@ -1,4 +1,4 @@ -location_area_id,encounter_terrain_id,version_id,rate +location_area_id,encounter_method_id,version_id,rate 1,2,12,25 1,2,13,25 1,2,14,25 diff --git a/pokedex/db/tables.py b/pokedex/db/tables.py index 8e4ca42..a35a4d6 100644 --- a/pokedex/db/tables.py +++ b/pokedex/db/tables.py @@ -285,10 +285,10 @@ class Encounter(TableBase): "slot" they are in and the state of the game world. What the player is doing to get an encounter, such as surfing or walking - through tall grass, is called terrain. Each terrain has its own set of + through tall grass, is called a method. Each method has its own set of encounter slots. - Within a terrain, slots are defined primarily by rarity. Each slot can + Within a method, slots are defined primarily by rarity. Each slot can also be affected by world conditions; for example, the 20% slot for walking in tall grass is affected by whether a swarm is in effect in that area. "Is there a swarm?" is a condition; "there is a swarm" and "there is not a @@ -308,7 +308,7 @@ class Encounter(TableBase): location_area_id = Column(Integer, ForeignKey('location_areas.id'), nullable=False, autoincrement=False, info=dict(description="The ID of the location of this encounter")) encounter_slot_id = Column(Integer, ForeignKey('encounter_slots.id'), nullable=False, autoincrement=False, - info=dict(description="The ID of the encounter slot, which determines terrain and rarity")) + info=dict(description="The ID of the encounter slot, which determines method and rarity")) pokemon_id = Column(Integer, ForeignKey('pokemon.id'), nullable=False, autoincrement=False, info=dict(description=u"The ID of the encountered Pokémon")) min_level = Column(Integer, nullable=False, autoincrement=False, @@ -361,8 +361,24 @@ class EncounterConditionValueMap(TableBase): encounter_condition_value_id = Column(Integer, ForeignKey('encounter_condition_values.id'), primary_key=True, nullable=False, autoincrement=False, info=dict(description="The ID of the encounter condition value")) +class EncounterMethod(TableBase): + u"""A way the player can enter a wild encounter, e.g., surfing, fishing, or walking through tall grass. + """ + + __tablename__ = 'encounter_methods' + __singlename__ = 'encounter_method' + id = Column(Integer, primary_key=True, nullable=False, + info=dict(description="A unique ID for the method")) + identifier = Column(Unicode(16), nullable=False, unique=True, + info=dict(description="An identifier", format='identifier')) + +create_translation_table('encounter_method_prose', EncounterMethod, 'prose', + name = Column(Unicode(64), nullable=False, index=True, + info=dict(description="The name", format='plaintext', official=False)), +) + class EncounterSlot(TableBase): - u"""An abstract "slot" within a terrain, associated with both some set of conditions and a rarity. + u"""An abstract "slot" within a method, associated with both some set of conditions and a rarity. Note that there are two encounters per slot, so the rarities will only add up to 50. @@ -373,29 +389,13 @@ class EncounterSlot(TableBase): info=dict(description="A unique ID for this slot")) version_group_id = Column(Integer, ForeignKey('version_groups.id'), nullable=False, autoincrement=False, info=dict(description="The ID of the version group this slot is in")) - encounter_terrain_id = Column(Integer, ForeignKey('encounter_terrain.id'), primary_key=False, nullable=False, autoincrement=False, - info=dict(description="The ID of the terrain")) + encounter_method_id = Column(Integer, ForeignKey('encounter_methods.id'), primary_key=False, nullable=False, autoincrement=False, + info=dict(description="The ID of the method")) slot = Column(Integer, nullable=True, - info=dict(description="This slot's order for the location and terrain")) + info=dict(description="This slot's order for the location and method")) rarity = Column(Integer, nullable=False, info=dict(description="The chance of the encounter as a percentage")) -class EncounterTerrain(TableBase): - u"""A way the player can enter a wild encounter, e.g., surfing, fishing, or walking through tall grass. - """ - - __tablename__ = 'encounter_terrain' - __singlename__ = __tablename__ - id = Column(Integer, primary_key=True, nullable=False, - info=dict(description="A unique ID for the terrain")) - identifier = Column(Unicode(64), nullable=False, - info=dict(description="An identifier", format='identifier')) - -create_translation_table('encounter_terrain_prose', EncounterTerrain, 'prose', - name = Column(Unicode(64), nullable=False, index=True, - info=dict(description="The name", format='plaintext', official=False)), -) - class EvolutionChain(TableBase): u"""A family of Pokémon that are linked by evolution """ @@ -653,8 +653,8 @@ class LocationAreaEncounterRate(TableBase): __tablename__ = 'location_area_encounter_rates' location_area_id = Column(Integer, ForeignKey('location_areas.id'), primary_key=True, nullable=False, autoincrement=False, info=dict(description="ID of the area")) - encounter_terrain_id = Column(Integer, ForeignKey('encounter_terrain.id'), primary_key=True, nullable=False, autoincrement=False, - info=dict(description="ID of the terrain")) + encounter_method_id = Column(Integer, ForeignKey('encounter_methods.id'), primary_key=True, nullable=False, autoincrement=False, + info=dict(description="ID of the method")) version_id = Column(Integer, ForeignKey('versions.id'), primary_key=True, autoincrement=False, info=dict(description="ID of the version")) rate = Column(Integer, nullable=True, @@ -1744,7 +1744,7 @@ EncounterConditionValueMap.condition_value = relation(EncounterConditionValue, innerjoin=True, lazy='joined', backref='encounter_map') -EncounterSlot.terrain = relation(EncounterTerrain, +EncounterSlot.method = relation(EncounterMethod, innerjoin=True, lazy='joined', backref='slots') EncounterSlot.version_group = relation(VersionGroup, innerjoin=True) -- 2.7.4