Esempio n. 1
0
    def _setup_mission_coalitions(cls):
        cls.current_mission.coalition["blue"] = Coalition("blue")
        cls.current_mission.coalition["red"] = Coalition("red")

        p_country = cls.game.player_country
        e_country = cls.game.enemy_country
        cls.current_mission.coalition["blue"].add_country(
            country_dict[db.country_id_from_name(p_country)]())
        cls.current_mission.coalition["red"].add_country(
            country_dict[db.country_id_from_name(e_country)]())
Esempio n. 2
0
    def _setup_mission_coalitions(cls) -> None:
        cls.current_mission.coalition["blue"] = Coalition(
            "blue", bullseye=cls.game.blue_bullseye.to_pydcs())
        cls.current_mission.coalition["red"] = Coalition(
            "red", bullseye=cls.game.red_bullseye.to_pydcs())

        p_country = cls.game.player_country
        e_country = cls.game.enemy_country
        cls.current_mission.coalition["blue"].add_country(
            country_dict[db.country_id_from_name(p_country)]())
        cls.current_mission.coalition["red"].add_country(
            country_dict[db.country_id_from_name(e_country)]())
Esempio n. 3
0
    def prepare(self, terrain: Terrain, is_quick: bool):
        with open("resources/default_options.lua", "r") as f:
            options_dict = loads(f.read())["options"]

        self.current_mission = Mission(terrain)

        print(self.game.player_country)
        print(country_dict[db.country_id_from_name(self.game.player_country)])
        print(country_dict[db.country_id_from_name(
            self.game.player_country)]())

        # Setup coalition :
        self.current_mission.coalition["blue"] = Coalition("blue")
        self.current_mission.coalition["red"] = Coalition("red")

        p_country = self.game.player_country
        e_country = self.game.enemy_country
        self.current_mission.coalition["blue"].add_country(
            country_dict[db.country_id_from_name(p_country)]())
        self.current_mission.coalition["red"].add_country(
            country_dict[db.country_id_from_name(e_country)]())

        print([
            c for c in self.current_mission.coalition["blue"].countries.keys()
        ])
        print([
            c for c in self.current_mission.coalition["red"].countries.keys()
        ])

        if is_quick:
            self.quick_mission = self.current_mission
        else:
            self.regular_mission = self.current_mission

        self.current_mission.options.load_from_dict(options_dict)
        self.is_quick = is_quick

        if is_quick:
            self.attackers_starting_position = None
            self.defenders_starting_position = None
        else:
            self.attackers_starting_position = self.departure_cp.at
            # TODO: Is this possible?
            if self.to_cp is not None:
                self.defenders_starting_position = self.to_cp.at
            else:
                self.defenders_starting_position = None
    def setup_mission_coalitions(self) -> None:
        self.mission.coalition["blue"] = Coalition(
            "blue", bullseye=self.game.blue.bullseye.to_pydcs())
        self.mission.coalition["red"] = Coalition(
            "red", bullseye=self.game.red.bullseye.to_pydcs())
        self.mission.coalition["neutrals"] = Coalition(
            "neutrals",
            bullseye=Bullseye(Point(0, 0, self.mission.terrain)).to_pydcs())

        p_country = self.game.blue.country_name
        e_country = self.game.red.country_name
        self.mission.coalition["blue"].add_country(
            country_dict[country_id_from_name(p_country)]())
        self.mission.coalition["red"].add_country(
            country_dict[country_id_from_name(e_country)]())

        belligerents = [
            country_id_from_name(p_country),
            country_id_from_name(e_country),
        ]
        for country in country_dict.keys():
            if country not in belligerents:
                self.mission.coalition["neutrals"].add_country(
                    country_dict[country]())