Ejemplo n.º 1
0
        'cost': 2,
    }
    ext.add_dh_bonus_data(data, [2])

    def run(self, target, **kwargs):
        return [
            std_events.Damage(self.game,
                              self,
                              target=self.game.get_hero(1 - self.player_id),
                              value=self.dh_values[0])
        ]


# 森林狼 (20000) *
Enc_森林狼 = ext.create_enchantment({'id': 20000},
                                 *enc_common.apply_fn_add_attack(1),
                                 base=AuraEnchantment)


class 森林狼(Minion):
    data = {
        'id': 20000,
        'klass': 2,
        'cost': 1,
        'attack': 1,
        'health': 1,
        'race': [Race.Beast],
    }

    class Aura_森林狼(Aura):
        def check_entity(self, entity, **kwargs):
Ejemplo n.º 2
0
__author__ = 'fyabc'


###############
# Neutral (0) #
###############

# 精灵弓箭手 (0)
ext.create_damage_minion({
    'id': 0,
    'cost': 1, 'attack': 1, 'health': 1,
    'battlecry': True, 'po_tree': '$HaveTarget',
}, 1)

# 暗鳞先知 (1) *
Enc_暗鳞先知 = ext.create_enchantment({'id': 0}, *enc_common.apply_fn_add_attack(1), base=AuraEnchantment)


class 暗鳞先知(Minion):
    data = {
        'id': 1,
        'cost': 1, 'attack': 1, 'health': 1,
        'race': [Race.Murloc],
    }

    class Aura_暗鳞先知(Aura):
        def check_entity(self, entity, **kwargs):
            return entity.zone == Zone.Play and entity.type == Type.Minion and \
                   entity.player_id == self.owner.player_id and Race.Murloc in entity.race and entity is not self.owner

        def grant_enchantment(self, entity, **kwargs):
Ejemplo n.º 3
0
#! /usr/bin/python
# -*- coding: utf-8 -*-

from MyHearthStone import ext
from MyHearthStone.ext import Spell
from MyHearthStone.ext import enc_common

__author__ = 'fyabc'


###############
# Paladin (4) #
###############

Enc_受祝福的勇士 = ext.create_enchantment(
    {'id': 1040010}, apply_fn=enc_common.modify_aura_tmp('attack', lambda a: a * 2))


class 受祝福的勇士(Spell):
    """<https://hearthstone.gamepedia.com/Blessed_Champion>"""
    data = {
        'id': 1040010,
        'type': 1, 'rarity': 2, 'klass': 4, 'cost': 5,
        'po_tree': '$HaveTarget',
    }

    check_target = ext.checker_minion

    def run(self, target, **kwargs):
        Enc_受祝福的勇士.from_card(self, self.game, target)
        return []
Ejemplo n.º 4
0
        'id': 8,
        'klass': 9,
        'is_basic': True,
        'cost': 2,
    }

    def run(self, target, **kwargs):
        return [
            std_events.GainArmor(self.game, self,
                                 self.game.get_hero(self.player_id), 2)
        ]


# 战歌指挥官 (90000) *
Enc_战歌指挥官 = ext.create_enchantment({'id': 90000},
                                   *enc_common.apply_fn_add_attack(1),
                                   base=AuraEnchantment)


class 战歌指挥官(Minion):
    data = {
        'id': 90000,
        'klass': 9,
        'cost': 3,
        'attack': 2,
        'health': 3,
    }

    class Aura_战歌指挥官(Aura):
        def check_entity(self, entity, **kwargs):
            return entity.zone == Zone.Play and entity.type == Type.Minion and \
Ejemplo n.º 5
0
            return self.Inactive
        if not self._candidates():
            if msg_fn:
                msg_fn('I have already own all 4 basic totems!')
            return self.Inactive
        return super_result

    def run(self, target, **kwargs):
        return std_events.pure_summon_events(self.game,
                                             choice(self._candidates()),
                                             self.player_id, 'last')


# 火舌图腾 (70000) *
Enc_火舌图腾 = ext.create_enchantment({'id': 70000},
                                  *enc_common.apply_fn_add_attack(2),
                                  base=AuraEnchantment)


class 火舌图腾(Minion):
    data = {
        'id': 70000,
        'klass': 7,
        'cost': 2,
        'attack': 0,
        'health': 3,
        'race': [Race.Totem],
    }

    class Aura_火舌图腾(Aura):
        def __init__(self, game, owner):
Ejemplo n.º 6
0
    }

    def __init__(self, game, player_id):
        super().__init__(game, player_id)
        self.dr_trigger = std_triggers.DrTrigger.create(
            self.game,
            owner=self,
            dr_fn=lambda trigger, event:
            [std_events.DrawCard(self.game, self, self.player_id)],
            reg_fn=None,
            data=None)


# 恐狼前锋 (1000009)
Enc_恐狼前锋 = ext.create_enchantment({'id': 1000002},
                                  *enc_common.apply_fn_add_attack(1),
                                  base=AuraEnchantment)


class 恐狼前锋(Minion):
    """[NOTE]: This is a classic card of adjacent aura."""
    data = {
        'id': 1000009,
        'rarity': 1,
        'cost': 2,
        'attack': 2,
        'health': 2,
        'race': [Race.Beast],
    }

    class Aura_恐狼前锋(Aura):
Ejemplo n.º 7
0
from MyHearthStone import ext
from MyHearthStone.ext import Weapon, Minion
from MyHearthStone.ext import std_events, std_triggers
from MyHearthStone.utils.game import Type

__author__ = 'fyabc'


###############
# Warrior (8) #
###############


# 暴乱狂战士 (1090007)
Enc_暴乱狂战士 = ext.create_enchantment({'id': 1090003}, *ext.enc_common.apply_fn_add_attack(1))


class 暴乱狂战士(Minion):
    data = {
        'id': 1090007,
        'rarity': 2, 'klass': 9, 'cost': 3, 'attack': 2, 'health': 4,
    }

    class Trig_暴乱狂战士(std_triggers.AttachedTrigger):
        respond = [std_events.Damage]

        def process(self, event: respond[0]):
            if event.target.type == Type.Minion:
                # TODO: Now create new enchantment for every damage, change it into accumulate a single enchantment?
                Enc_暴乱狂战士.from_card(self.owner, self.game, self.owner)
Ejemplo n.º 8
0
    """[NOTE]: This is a classic card of (permanent) copy effect."""
    data = {
        'id': 50002,
        'type': 1, 'klass': 5, 'cost': 1,
    }

    def run(self, target, **kwargs):
        opp_hand = self.game.get_zone(Zone.Hand, 1 - self.player_id)
        if not opp_hand:
            return []
        copy_target = random.choice(opp_hand)
        return std_events.copy_events(self.game, copy_target, self.player_id, Zone.Hand, 'last')


# 真言术:盾 (50003) *
Enc_真言术_盾 = ext.create_enchantment({'id': 50000}, *enc_common.apply_fn_add_health(2))


class 真言术_盾(Spell):
    data = {
        'id': 50003,
        'type': 1, 'klass': 5, 'cost': 1,
        'po_tree': '$HaveTarget',
    }

    can_do_action = ext.require_minion
    check_target = ext.checker_minion

    def run(self, target, **kwargs):
        Enc_真言术_盾.from_card(self, self.game, target)
        return [std_events.DrawCard(self.game, self, self.player_id)]
Ejemplo n.º 9
0
#! /usr/bin/python
# -*- coding: utf-8 -*-

from MyHearthStone import ext
from MyHearthStone.ext import Weapon, Minion
from MyHearthStone.ext import std_events, std_triggers
from MyHearthStone.utils.game import Type

__author__ = 'fyabc'

###############
# Warrior (8) #
###############

# 暴乱狂战士 (1090007)
Enc_暴乱狂战士 = ext.create_enchantment({'id': 1090003},
                                   *ext.enc_common.apply_fn_add_attack(1))


class 暴乱狂战士(Minion):
    data = {
        'id': 1090007,
        'rarity': 2,
        'klass': 9,
        'cost': 3,
        'attack': 2,
        'health': 4,
    }

    class Trig_暴乱狂战士(std_triggers.AttachedTrigger):
        respond = [std_events.Damage]
Ejemplo n.º 10
0
#! /usr/bin/python
# -*- coding: utf-8 -*-

from MyHearthStone import ext
from MyHearthStone.ext import Spell
from MyHearthStone.ext import enc_common

__author__ = 'fyabc'

###############
# Paladin (4) #
###############

Enc_受祝福的勇士 = ext.create_enchantment({'id': 1040010},
                                    apply_fn=enc_common.modify_aura_tmp(
                                        'attack', lambda a: a * 2))


class 受祝福的勇士(Spell):
    """<https://hearthstone.gamepedia.com/Blessed_Champion>"""
    data = {
        'id': 1040010,
        'type': 1,
        'rarity': 2,
        'klass': 4,
        'cost': 5,
        'po_tree': '$HaveTarget',
    }

    check_target = ext.checker_minion
Ejemplo n.º 11
0
        'type': 1,
        'klass': 6,
        'cost': 1,
        'po_tree': '$HaveTarget',
    }
    ext.add_dh_bonus_data(data, 2)

    can_do_action, check_target = ext.action_target_checker_factory_cond_minion(
        lambda target: not target.damaged)

    def run(self, target, **kwargs):
        return [std_events.Damage(self.game, self, target, self.dh_values[0])]


# 致命药膏 (60001) *
Enc_致命药膏 = ext.create_enchantment({'id': 60000},
                                  *enc_common.apply_fn_add_attack(2))


class 致命药膏(Spell):
    data = {
        'id': 60001,
        'type': 1,
        'klass': 6,
        'cost': 1,
    }

    def can_do_action(self, msg_fn=None):
        super_result = super().can_do_action(msg_fn)
        if super_result == self.Inactive:
            return super_result
        if self.game.get_weapon(self.player_id) is None:
Ejemplo n.º 12
0
        'klass': 4,
        'cost': 7,
        'attack': 5,
        'health': 6,
        'battlecry': True,
    }

    def run_battlecry(self, target, **kwargs):
        return [
            std_events.Healing(self.game, self,
                               self.game.get_hero(self.player_id), 6)
        ]


# 力量祝福 (40001)
Enc_力量祝福 = ext.create_enchantment({'id': 40000},
                                  *enc_common.apply_fn_add_attack(3))


class 力量祝福(Spell):
    data = {
        'id': 40001,
        'type': 1,
        'klass': 4,
        'cost': 1,
        'po_tree': '$HaveTarget',
    }

    can_do_action = ext.require_minion
    check_target = ext.checker_minion

    def run(self, target, **kwargs):
Ejemplo n.º 13
0
        'klass': 9, 'hero_power': 8,
    }


class 全副武装(HeroPower):
    data = {
        'id': 8,
        'klass': 9, 'is_basic': True, 'cost': 2,
    }

    def run(self, target, **kwargs):
        return [std_events.GainArmor(self.game, self, self.game.get_hero(self.player_id), 2)]


# 战歌指挥官 (90000) *
Enc_战歌指挥官 = ext.create_enchantment({'id': 90000}, *enc_common.apply_fn_add_attack(1), base=AuraEnchantment)


class 战歌指挥官(Minion):
    data = {
        'id': 90000,
        'klass': 9, 'cost': 3, 'attack': 2, 'health': 3,
    }

    class Aura_战歌指挥官(Aura):
        def check_entity(self, entity, **kwargs):
            return entity.zone == Zone.Play and entity.type == Type.Minion and \
                   entity.player_id == self.owner.player_id and entity.charge

        def grant_enchantment(self, entity, **kwargs):
            Enc_战歌指挥官.from_card(self.owner, self.game, entity, self)
Ejemplo n.º 14
0
        'id': 1000008,
        'rarity': 1, 'cost': 2, 'attack': 2, 'health': 1,
        'deathrattle': True,
    }

    def __init__(self, game, player_id):
        super().__init__(game, player_id)
        self.dr_trigger = std_triggers.DrTrigger.create(
            self.game, owner=self,
            dr_fn=lambda trigger, event: [std_events.DrawCard(self.game, self, self.player_id)],
            reg_fn=None, data=None
        )


# 恐狼前锋 (1000009)
Enc_恐狼前锋 = ext.create_enchantment({'id': 1000002}, *enc_common.apply_fn_add_attack(1), base=AuraEnchantment)


class 恐狼前锋(Minion):
    """[NOTE]: This is a classic card of adjacent aura."""
    data = {
        'id': 1000009,
        'rarity': 1, 'cost': 2, 'attack': 2, 'health': 2,
        'race': [Race.Beast],
    }

    class Aura_恐狼前锋(Aura):
        def __init__(self, game, owner):
            super().__init__(game, owner)
            self.location = None
Ejemplo n.º 15
0
###############

# 精灵弓箭手 (0)
ext.create_damage_minion(
    {
        'id': 0,
        'cost': 1,
        'attack': 1,
        'health': 1,
        'battlecry': True,
        'po_tree': '$HaveTarget',
    }, 1)

# 暗鳞先知 (1) *
Enc_暗鳞先知 = ext.create_enchantment({'id': 0},
                                  *enc_common.apply_fn_add_attack(1),
                                  base=AuraEnchantment)


class 暗鳞先知(Minion):
    data = {
        'id': 1,
        'cost': 1,
        'attack': 1,
        'health': 1,
        'race': [Race.Murloc],
    }

    class Aura_暗鳞先知(Aura):
        def check_entity(self, entity, **kwargs):
            return entity.zone == Zone.Play and entity.type == Type.Minion and \
Ejemplo n.º 16
0
        'type': 1,
        'klass': 5,
        'cost': 1,
    }

    def run(self, target, **kwargs):
        opp_hand = self.game.get_zone(Zone.Hand, 1 - self.player_id)
        if not opp_hand:
            return []
        copy_target = random.choice(opp_hand)
        return std_events.copy_events(self.game, copy_target, self.player_id,
                                      Zone.Hand, 'last')


# 真言术:盾 (50003) *
Enc_真言术_盾 = ext.create_enchantment({'id': 50000},
                                   *enc_common.apply_fn_add_health(2))


class 真言术_盾(Spell):
    data = {
        'id': 50003,
        'type': 1,
        'klass': 5,
        'cost': 1,
        'po_tree': '$HaveTarget',
    }

    can_do_action = ext.require_minion
    check_target = ext.checker_minion

    def run(self, target, **kwargs):
Ejemplo n.º 17
0

class 爪击(Spell):
    data = {
        'id': 10003,
        'type': 1, 'klass': 1, 'cost': 1,
    }

    def run(self, target, **kwargs):
        hero = self.game.get_hero(self.player_id)
        Enc_爪击.from_card(self, self.game, hero)
        return [std_events.GainArmor(self.game, self, hero, 2)]


# 野性印记 (10004) *
Enc_野性印记 = ext.create_enchantment(
    {'id': 10002}, *enc_common.apply_fn_add_a_h(2, 2, apply_other=enc_common.set_target_attr_temp('taunt', True)))


class 野性印记(Spell):
    data = {
        'id': 10004,
        'type': 1, 'klass': 1, 'cost': 2,
        'po_tree': '$HaveTarget',
    }

    check_target = ext.checker_minion

    def run(self, target, **kwargs):
        Enc_野性印记.from_card(self, self.game, target)
        return []
Ejemplo n.º 18
0
            value=self.dh_values[0])]


# 森林狼 (20000)
class 森林狼(Minion):
    data = {
        'id': 20000,
        'klass': 2, 'cost': 1, 'attack': 1, 'health': 1,
        'race': [Race.Beast],
    }

    # TODO


# 驯兽师 (20001)
Enc_驯兽师 = ext.create_enchantment(
    {'id': 20001}, *enc_common.apply_fn_add_a_h(2, 2, apply_imm_other=enc_common.set_target_attr('taunt', True)))


class 驯兽师(Minion):
    data = {
        'id': 20001,
        'klass': 2, 'cost': 4, 'attack': 4, 'health': 3,
        'battlecry': True,
    }

    player_operation_tree = ext.make_conditional_targeted_po_tree(ext.make_have_friendly_race(Race.Beast))

    def check_target(self, target, **kwargs):
        if not ext.checker_friendly_minion(self, target, **kwargs):
            return False
        assert isinstance(target, Minion)
Ejemplo n.º 19
0
        if self.game.full(Zone.Play, self.player_id):
            if msg_fn:
                msg_fn('I have too many minions, and I can\'t use it!')
            return self.Inactive
        if not self._candidates():
            if msg_fn:
                msg_fn('I have already own all 4 basic totems!')
            return self.Inactive
        return super_result

    def run(self, target, **kwargs):
        return std_events.pure_summon_events(self.game, choice(self._candidates()), self.player_id, 'last')


# 火舌图腾 (70000) *
Enc_火舌图腾 = ext.create_enchantment({'id': 70000}, *enc_common.apply_fn_add_attack(2), base=AuraEnchantment)


class 火舌图腾(Minion):
    data = {
        'id': 70000,
        'klass': 7, 'cost': 2, 'attack': 0, 'health': 3,
        'race': [Race.Totem],
    }

    class Aura_火舌图腾(Aura):
        def __init__(self, game, owner):
            super().__init__(game, owner)
            self.location = None

        def prepare_update(self):
Ejemplo n.º 20
0

# 列王守卫 (40000)
class 列王守卫(Minion):
    data = {
        'id': 40000,
        'klass': 4, 'cost': 7, 'attack': 5, 'health': 6,
        'battlecry': True,
    }

    def run_battlecry(self, target, **kwargs):
        return [std_events.Healing(self.game, self, self.game.get_hero(self.player_id), 6)]


# 力量祝福 (40001) *
Enc_力量祝福 = ext.create_enchantment({'id': 40000}, *enc_common.apply_fn_add_attack(3))


class 力量祝福(Spell):
    data = {
        'id': 40001,
        'type': 1, 'klass': 4, 'cost': 1,
        'po_tree': '$HaveTarget',
    }

    can_do_action = ext.require_minion
    check_target = ext.checker_minion

    def run(self, target, **kwargs):
        Enc_力量祝福.from_card(self, self.game, target)
        return []