Exemplo n.º 1
0
 def setup_speed(self, csv_row):
     self.output_data["WSp"] = util.ensure_int(
         csv_row[self.header.index("WSp")])
     self.output_data["Ssp"] = util.ensure_int(
         csv_row[self.header.index("Ssp")])
     self.output_data["Fsp"] = util.ensure_int(
         csv_row[self.header.index("Fsp")])
     self.output_data["Climbing Speed"] = util.ensure_int(
         csv_row[self.header.index("Climbing Speed")])
     self.output_data["Burrowing Speed"] = util.ensure_int(
         csv_row[self.header.index("Burrowing Speed")])
Exemplo n.º 2
0
 def setup_basic_stats(self, csv_row):
     self.output_data["index"] = util.ensure_int(
         csv_row[self.header.index("Index Number")])
     self.output_data["SR"] = util.ensure_float(
         csv_row[self.header.index("SR")])
     self.output_data["Hit Dice"] = util.ensure_int(
         csv_row[self.header.index("Hit Dice")])
     self.output_data["MIN LVL FD"] = util.ensure_int(
         csv_row[self.header.index("MIN LVL FD")])
     self.output_data["HP"] = util.ensure_int(
         csv_row[self.header.index("HP")])
     self.output_data["AC"] = util.ensure_int(
         csv_row[self.header.index("AC")])
     self.output_data["Evolve"] = util.ensure_string(
         csv_row[self.header.index("Evolve")])
Exemplo n.º 3
0
    def add(self, csv_row, poke_data):
        species = poke_data.name

        self.output_data[species] = {}
        self.output_data[species]["into"] = []
        self.output_data[species]["current_stage"] = util.ensure_int(
            csv_row[self.header.index("Evo Stages with Eviolite")])
        self.output_data[species]["total_stages"] = util.ensure_int(
            csv_row[self.header.index("Evo Stages w/o Eviolite")])
        evolve_text = csv_row[self.header.index("Evolution for sheet")]

        # Iterate all Pokemon names and see if they are in the description
        for _, poke in self.pokemon_by_name.items():
            if poke.valid and not poke.name == species and " {} ".format(
                    poke.name) in evolve_text:
                self.output_data[species]["into"].append(poke.name)

        match = self.RE_POINTS.search(evolve_text)
        if match:
            self.output_data[species]["points"] = int(match.group(1))

        match = self.RE_LEVEL.search(evolve_text)
        if match:
            self.output_data[species]["level"] = int(match.group(1))
        else:
            self.output_data[species]["level"] = 0
            match = self.RE_MOVE.search(evolve_text)
            if match:
                self.output_data[species]["move"] = match.group(1)
            # else:
            #     match = self.RE_HOLDING.search(evolve_text)
            #     if match:
            #         self.output_data[species]["holding"] = match.group(1)

        if self.output_data[species]["current_stage"] == 1 and self.output_data[
                species]["total_stages"] == 1 and not self.output_data[
                    species]["level"]:
            del self.output_data[species]

        if species in self.output_data:
            if not self.output_data[species]["level"]:
                del self.output_data[species]["level"]
            if not self.output_data[species]["into"]:
                del self.output_data[species]["into"]

        if species in util.MERGE_EVOLVE_DATA:
            util.merge(self.output_data[species],
                       util.MERGE_EVOLVE_DATA[species])
Exemplo n.º 4
0
    def setup(self, csv_row):
        self.name = csv_row[self.header.index("Name")]
        self.output_data["Type"] = util.ensure_string(
            csv_row[self.header.index("Type")])
        self.output_data["Move Power"] = util.ensure_list(
            csv_row[self.header.index("Move Power")], "/")
        self.output_data["Move Time"] = util.ensure_string(
            csv_row[self.header.index("Move Time")])

        pp = csv_row[self.header.index("PP")]
        if pp == "Unlimited":
            self.output_data["PP"] = pp
        else:
            self.output_data["PP"] = util.ensure_int(pp)
        self.output_data["Duration"] = util.ensure_string(
            csv_row[self.header.index("Duration")])
        self.output_data["Range"] = util.ensure_string(
            csv_row[self.header.index("Range")])
        self.output_data["Description"] = util.ensure_string(
            csv_row[self.header.index("Description")])
        self.setup_extra(csv_row)
        self.setup_damage(csv_row)
        if self.name in util.MERGE_MOVE_DATA:
            util.merge(self.output_data, util.MERGE_MOVE_DATA[self.name])

        util.clean_object(self.output_data["Move Power"])
        if not self.output_data["Move Power"]:
            del self.output_data["Move Power"]

        remove_dice_in_description.remove_dice(self.output_data)
Exemplo n.º 5
0
    def add(self, csv_row):
        value = util.ensure_int(csv_row[self.header.index("Index Number")])
        species = fix_species_name(csv_row[self.header.index(POKEMON)])

        if value not in self.output_data:
            self.output_data[value] = []
        self.output_data[value].append(species)
Exemplo n.º 6
0
    def add(self, csv_row, poke_data):
        value = util.ensure_int(csv_row[self.header.index("Index Number")])
        species = poke_data.name

        if value not in self.output_data:
            self.output_data[value] = []
        self.output_data[value].append(species)
Exemplo n.º 7
0
    def add(self, csv_row):
        species = fix_species_name(csv_row[self.header.index(POKEMON)])
        if species not in self.output_data:
            self.output_data[species] = {}
        self.output_data[species]["index"] = util.ensure_int(
            csv_row[self.header.index("Index Number")])

        self.output_data[species]["Type"] = util.ensure_list(
            csv_row[self.header.index("Type")], "/")
        self.output_data[species]["SR"] = util.ensure_float(
            csv_row[self.header.index("SR")])
        self.output_data[species]["MIN LVL FD"] = util.ensure_int(
            csv_row[self.header.index("MIN LVL FD")])

        if species in util.MERGE_FILTER_DATA:
            util.merge(self.output_data[species],
                       util.MERGE_FILTER_DATA[species])
Exemplo n.º 8
0
 def setup_attributes(self, csv_row):
     self.output_data["attributes"] = {}
     self.output_data["attributes"]["STR"] = util.ensure_int(
         csv_row[self.header.index("STR")])
     self.output_data["attributes"]["DEX"] = util.ensure_int(
         csv_row[self.header.index("DEX")])
     self.output_data["attributes"]["CON"] = util.ensure_int(
         csv_row[self.header.index("CON")])
     self.output_data["attributes"]["INT"] = util.ensure_int(
         csv_row[self.header.index("INT")])
     self.output_data["attributes"]["WIS"] = util.ensure_int(
         csv_row[self.header.index("WIS")])
     self.output_data["attributes"]["CHA"] = util.ensure_int(
         csv_row[self.header.index("CHA")])