当前位置: 首页>>代码示例>>Python>>正文


Python game_objects.Minion类代码示例

本文整理汇总了Python中hearthbreaker.game_objects.Minion的典型用法代码示例。如果您正苦于以下问题:Python Minion类的具体用法?Python Minion怎么用?Python Minion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Minion类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: create_minion

    def create_minion(self, player):
        def did_damage(amount, target):
            target.freeze()

        minion = Minion(3, 6)
        minion.bind("did_damage", did_damage)
        return minion
开发者ID:tokkot,项目名称:hearthbreaker,代码行数:7,代码来源:mage.py

示例2: create_minion

    def create_minion(self, player):
        minion = Minion(2, 2)
        for combo in range(0, player.cards_played):
            minion.increase_health(2)
            minion.change_attack(2)

        return minion
开发者ID:nilrogen,项目名称:CGS-AI-UML,代码行数:7,代码来源:rogue.py

示例3: create_minion

    def create_minion(self, player):

        class Moonfire(Card):
            def __init__(self):
                super().__init__("Moonfire", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL)

        class Dispel(Card):
            def __init__(self):
                super().__init__("Dispel", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL)

        moonfire = Moonfire()
        dispell = Dispel()
        option = player.agent.choose_option(moonfire, dispell)
        minion = Minion(2, 4)
        if option == moonfire:
            action = deal_two_damage
            targets = hearthbreaker.targeting.find_battlecry_target(player.game, lambda m: not m.stealth)
        else:
            action = silence
            targets = hearthbreaker.targeting.find_minion_battlecry_target(player.game, lambda m: not m.stealth)

        if targets is not None:
            self.target = player.agent.choose_target(targets)

        # here we have to set these things up to mimic a battlecry, although it is not a battlecry
        minion.card = self
        action(minion)

        return minion
开发者ID:nilrogen,项目名称:CGS-AI-UML,代码行数:29,代码来源:druid.py

示例4: create_minion

            def create_minion(self, player):
                def add_effect(m, index):
                    m.add_aura(1, 0, [player], lambda mini: mini is not minion)

                minion = Minion(2, 4, MINION_TYPE.BEAST)
                minion.bind("added_to_board", add_effect)
                return minion
开发者ID:WabiWasabi,项目名称:hearthbreaker,代码行数:7,代码来源:hunter.py

示例5: create_minion

    def create_minion(self, player):
        def draw_card():
            player.draw()

        minion = Minion(1, 3)
        player.game.bind("minion_healed", draw_card)
        minion.bind_once("silenced", lambda: player.game.unbind("minion_healed", draw_card))
        return minion
开发者ID:anuragpapineni,项目名称:Hearthbreaker-evolved-agent,代码行数:8,代码来源:priest.py

示例6: create_minion

    def create_minion(self, player):
        def draw_card():
            player.draw()

        minion = Minion(0, 3)
        player.bind("turn_ended", draw_card)
        minion.bind_once("silenced", lambda: player.unbind("turn_ended", draw_card))
        return minion
开发者ID:mharris717,项目名称:hearthbreaker,代码行数:8,代码来源:shaman.py

示例7: create_minion

    def create_minion(self, player):
        def gain_one_attack(m):
            minion.change_attack(1)

        minion = Minion(2, 4)
        player.game.bind("minion_damaged", gain_one_attack)
        minion.bind_once("silenced", lambda: player.game.unbind("minion_damaged", gain_one_attack))
        return minion
开发者ID:hertzg,项目名称:hearthstone-simulator,代码行数:8,代码来源:warrior.py

示例8: create_minion

    def create_minion(self, player):
        class Filter:
            def __init__(self):
                self.amount = 2
                self.filter = lambda c: isinstance(c, MinionCard)
                self.min = 1

        mana_filter = Filter()
        minion = Minion(0, 4)
        minion.bind_once("silenced", lambda: player.mana_filters.remove(mana_filter))
        player.mana_filters.append(mana_filter)
        return minion
开发者ID:tokkot,项目名称:hearthbreaker,代码行数:12,代码来源:warlock.py

示例9: create_minion

    def create_minion(self, player):
        def silence():
            player.heal_does_damage = False

            # If another Auchenai Soulpriest is alive and not silenced, keep
            # heal_does_damage as True
            for m in player.minions:
                if m.card.name == "Auchenai Soulpriest" and not m.silenced and m is not minion:
                    player.heal_does_damage = True

        minion = Minion(3, 5)
        minion.bind_once("silenced", silence)
        player.heal_does_damage = True
        return minion
开发者ID:tokkot,项目名称:hearthbreaker,代码行数:14,代码来源:priest.py

示例10: __from_json__

    def __from_json__(cls, pd, game, agent):
        deck = Deck.__from__to_json__(pd["deck"], hero_from_name(pd["hero"]["name"]))
        player = Player("whatever", deck, agent, game)
        hero = Hero.__from_json__(pd["hero"], player)
        player.hero = hero
        hero.player = player
        if pd["weapon"]:
            player.weapon = Weapon.__from_json__(pd["weapon"], player)
            player.weapon.player = player
        player.mana = pd["mana"]
        player.max_mana = pd["max_mana"]
        player.upcoming_overload = pd["upcoming_overload"]
        player.current_overload = pd["current_overload"]
        player.name = pd["name"]
        player.hand = []
        for card_def in pd["hand"]:
            card = card_lookup(card_def["name"])
            card.__from_json__(card, **card_def)
            card.attach(card, player)
            player.hand.append(card)
        player.graveyard = pd["graveyard"]

        player.secrets = []
        for secret_name in pd["secrets"]:
            secret = card_lookup(secret_name)
            secret.player = player
            player.secrets.append(secret)
        i = 0
        player.minions = []
        for md in pd["minions"]:
            minion = Minion.__from_json__(md, player, game)
            minion.index = i
            player.minions.append(minion)
            i += 1
        return player
开发者ID:AlexSafatli,项目名称:hearthbreaker,代码行数:35,代码来源:engine.py

示例11: __from_json__

    def __from_json__(cls, pd, game, agent):
        deck = Deck.__from__to_json__(pd["deck"],
                                      hearthbreaker.constants.CHARACTER_CLASS.from_str(pd["hero"]["character"]))
        player = Player("whatever", deck, agent, game)
        hero = Hero.__from_json__(pd["hero"], player)
        player.hero = hero
        hero.player = player
        if hero.weapon:
            hero.weapon.player = player
        player.mana = pd["mana"]
        player.max_mana = pd["max_mana"]
        player.name = pd['name']
        player.hand = [card_lookup(name) for name in pd["hand"]]
        player.graveyard = set()
        for card_name in pd["graveyard"]:
            player.graveyard.add(card_name)

        player.secrets = []
        for secret_name in pd["secrets"]:
            secret = card_lookup(secret_name)
            secret.player = player
            player.secrets.append(secret)
        i = 0
        player.minions = []
        for md in pd["minions"]:
            minion = Minion.__from_json__(md, player, game)
            minion.index = i
            player.minions.append(minion)
            i += 1
        return player
开发者ID:jademcgough,项目名称:hearthstone-simulator,代码行数:30,代码来源:engine.py

示例12: create_minion

    def create_minion(self, player):

        # These are basically placeholders to give the agent something to
        # choose
        class Health(Card):
            def __init__(self):
                super().__init__("+5 Health and Taunt", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL)

        class Attack(Card):
            def __init__(self):
                super().__init__("+5 Attack", 0, CHARACTER_CLASS.DRUID, CARD_RARITY.SPECIAL)

        health = Health()
        attack = Attack()
        option = player.agent.choose_option(health, attack)
        minion = Minion(5, 5)
        if option is health:
            minion.increase_health(5)
            minion._effects_to_add.append(Taunt())
        else:
            minion.change_attack(5)

        return minion
开发者ID:miannelli,项目名称:hearthbreaker,代码行数:23,代码来源:druid.py

示例13: create_minion

    def create_minion(self, player):
        def poisonous(amount, target):
            if type(target) is Minion:
                target.die(self)

        minion = Minion(1, 1, stealth=True)
        minion.bind("did_damage", poisonous)
        minion.bind_once("silenced", lambda: minion.unbind("did_damage", poisonous))
        return minion
开发者ID:tokkot,项目名称:hearthbreaker,代码行数:9,代码来源:rogue.py

示例14: create_minion

 def create_minion(self, player):
     res = Minion(self.base_attack, self.health, taunt=self.taunt)
     res.name = self.name
     return res
开发者ID:miannelli,项目名称:hearthbreaker,代码行数:4,代码来源:test_helpers.py


注:本文中的hearthbreaker.game_objects.Minion类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。