Exemplo n.º 1
0
    def __get_dispel_result(self, wizard_level) -> int:
        dispel_result = 0
        for dice in range(self.get_dispel_dice()):
            dispel_result += get_d6_roll()

        if dispel_result <= 2:
            # see WHFB rule book 8th ed, p.35
            return 0

        dispel_result += wizard_level
        return dispel_result
Exemplo n.º 2
0
    def __get_cast_result(self, wizard_level) -> int:
        casting_result = 0
        for dice in range(self.get_dice()):
            casting_result += get_d6_roll()

        if casting_result <= 2:
            # see WHFB Rule Book 8th ed, p.32
            return 0

        casting_result += wizard_level
        return casting_result
    def roll_for_winds_of_magic(self):
        logger.info("Roll for winds of magic")
        # player
        roll1 = get_d6_roll()
        roll2 = get_d6_roll()
        self.__player_power_pool = roll1 + roll2
        self.__player_dispel_pool = max(roll1, roll2)

        # computer
        roll1 = get_d6_roll()
        roll2 = get_d6_roll()
        self.__computer_power_pool = roll1 + roll2
        self.__computer_dispel_pool = max(roll1, roll2)

        self.__channeling_power_dice()
        self.__channeling_dispel_dice()

        logger.info("Player Power Pool: {}".format(self.__player_power_pool))
        logger.info("Player Dispel Pool: {}".format(self.__player_dispel_pool))
        logger.info("Computer Power Pool: {}".format(self.__computer_power_pool))
        logger.info("Computer Dispel Pool: {}".format(self.__computer_dispel_pool))
    def __channeling_dispel_dice(self):
        mm = self.get_models_manager()
        for wizard in mm.get_wizards_list():
            if get_d6_roll() == 6:
                if wizard.is_player_model():
                    self.__player_dispel_pool += 1
                else:
                    self.__computer_dispel_pool += 1

        # Power Limit WHFB p.30, number of dice can never exceed 12
        if self.__player_dispel_pool >= 12:
            self.__player_dispel_pool = 12
        if self.__computer_dispel_pool >= 12:
            self.__computer_dispel_pool = 12