コード例 #1
0
    def start_new_game(self, player_name: str, enemy_name: str,
                       conflictTheater: ConflictTheater, midgame: bool,
                       multiplier: float, period: datetime,
                       settings: Settings):

        # Reset name generator
        namegen.reset()
        start_generator.prepare_theater(conflictTheater, settings, midgame)

        print("-- Starting New Game Generator")
        print("Enemy name : " + enemy_name)
        print("Player name : " + player_name)
        print("Midgame : " + str(midgame))
        start_generator.generate_inital_units(conflictTheater, enemy_name,
                                              True, multiplier)

        print("-- Initial units generated")
        game = Game(player_name=player_name,
                    enemy_name=enemy_name,
                    theater=conflictTheater,
                    start_date=period,
                    settings=settings)

        print("-- Game Object generated")
        start_generator.generate_groundobjects(conflictTheater, game)
        game.budget = int(game.budget * multiplier)
        game.settings.multiplier = multiplier
        game.settings.sams = True
        game.settings.version = CONST.VERSION_STRING

        if midgame:
            game.budget = game.budget * 4 * len(
                list(conflictTheater.conflicts()))

        return game
コード例 #2
0
    def generate(self) -> Game:
        # Reset name generator
        namegen.reset()
        self.prepare_theater()
        game = Game(player_name=self.player,
                    enemy_name=self.enemy,
                    theater=self.theater,
                    start_date=self.generator_settings.start_date,
                    settings=self.settings,
                    player_budget=self.generator_settings.player_budget,
                    enemy_budget=self.generator_settings.enemy_budget)

        GroundObjectGenerator(game, self.generator_settings).generate()
        game.settings.version = VERSION
        return game
コード例 #3
0
    def generate(self) -> Game:
        # Reset name generator
        namegen.reset()
        self.prepare_theater()
        self.populate_red_airbases()

        game = Game(player_name=self.player,
                    enemy_name=self.enemy,
                    theater=self.theater,
                    start_date=self.start_date,
                    settings=self.settings)

        GroundObjectGenerator(game).generate()
        game.budget = self.starting_budget
        game.settings.multiplier = self.multiplier
        game.settings.sams = True
        game.settings.version = VERSION
        return game
コード例 #4
0
    def generate(self) -> Game:
        with logged_duration("TGO population"):
            # Reset name generator
            namegen.reset()
            self.prepare_theater()
            game = Game(
                player_faction=self.player.apply_mod_settings(
                    self.mod_settings),
                enemy_faction=self.enemy.apply_mod_settings(self.mod_settings),
                theater=self.theater,
                start_date=self.generator_settings.start_date,
                settings=self.settings,
                player_budget=self.generator_settings.player_budget,
                enemy_budget=self.generator_settings.enemy_budget,
            )

            GroundObjectGenerator(game, self.generator_settings).generate()
        game.settings.version = VERSION
        game.begin_turn_0()
        return game
コード例 #5
0
    def start_new_game(self, player_name: str, enemy_name: str,
                       conflicttheater: ConflictTheater, midgame: bool,
                       multiplier: float, period: datetime):

        if midgame:
            for i in range(0, int(len(conflicttheater.controlpoints) / 2)):
                conflicttheater.controlpoints[i].captured = True

        # Reset name generator
        namegen.reset()

        print("-- Starting New Game Generator")
        print("Enemy name : " + enemy_name)
        print("Player name : " + player_name)
        print("Midgame : " + str(midgame))
        start_generator.generate_inital_units(conflicttheater, enemy_name,
                                              True, multiplier)

        print("-- Initial units generated")
        game = Game(player_name=player_name,
                    enemy_name=enemy_name,
                    theater=conflicttheater,
                    start_date=period)

        print("-- Game Object generated")
        start_generator.generate_groundobjects(conflicttheater, game)
        game.budget = int(game.budget * multiplier)
        game.settings.multiplier = multiplier
        game.settings.sams = True
        game.settings.version = "2.0RC7"

        if midgame:
            game.budget = game.budget * 4 * len(
                list(conflicttheater.conflicts()))

        return game