Exemplo n.º 1
0
    def assign_location(self, pt):
        if pt.rank == 3:
            self.capital = pt
            loc, scores = location.create_petty_capital(self.race, self.terrain)
            pt.loc = loc
            self.adjust_scores(scores)
        elif pt.rank == 2:
            tp = self.race.suggest_next(self.scores(), 2)
            if tp == "TOWN":
                loc, scores = location.create_town(self.race, self.terrain)
            elif tp == "MILITARY":
                loc, scores = location.create_fort(self.race, self.terrain)
            else:
                loc, scores = location.create_monastery(self.race, self.terrain)
            pt.loc = loc
            self.adjust_scores(scores)
        elif pt.rank == 1:
            tp = self.race.suggest_next(self.scores(), 1)
            if tp == "FARM":
                loc, scores = location.create_farm_town(self.race, self.terrain)
            elif tp == "MINE":
                loc, scores = location.create_mine_town(self.race, self.terrain)
            elif tp == "RELIGIOUS":
                loc, scores = location.create_abbey(self.race, self.terrain)
            pt.loc = loc
            self.adjust_scores(scores)

        else:
            loc, scores = location.create_wilderness(self.race, self.terrain)
            pt.loc = loc
            self.adjust_scores(scores)