# Path: MTG/mana.py
# class Mana(Enum):
# class ManaPool():
#     WHITE = 0
#     BLUE = 1
#     BLACK = 2
#     RED = 3
#     GREEN = 4
#     COLORLESS = 5
#     GENERIC = 6
# def str_to_mana_dict(manacost):
# def chr_to_mana(c):
#     def __init__(self, controller=None):
#     def add(self, mana, amount=1):
#     def add_str(self, mana_str):
#     def pay(self, manacost):
#     def is_empty(self):
#     def determine_costs(self, manacost):
#     def canPay(self, manacost, convoke=False):
#     def clear(self):
#     def __repr__(self):
# 
# Path: MTG/play.py
# class Play(gameobject.GameObject):
#     def __init__(self, apply_func, apply_condition=lambda: True, 
#                  card=None, source=None, name=None,
#                  targets_chosen=None, target_criterias=None, is_mana_ability=False):
#     def __repr__(self):
#     def can_be_countered(self, source=None):
#     def counter(self, source):
#     def apply(self):
# 
# Path: MTG/gameobject.py
# class Characteristics():
# class GameObject():
#     def __init__(self,
#                  name='',
#                  mana_cost='',
#                  color=[],
#                  types=[],
#                  subtype=[],
#                  supertype=[],
#                  text='',
#                  abilities=[],
#                  power=None,
#                  toughness=None,
#                  loyalty=None):
#     def __repr__(self):
#     def satisfy(self, criteria):
#     def __init__(self, characteristics=None,
#                  controller=None, owner=None, zone=None, 
#                  previousState=None):
#     def __repr__(self):
#     def __str__(self):
#     def __eq__(x, y):
#     def __hash__(self):
#     def owner(self):
#     def game(self):
#     def is_permanent(self):
#     def is_spell(self):
#     def name(self):
#     def raw_manacost(self):
#     def manacost(self):
#     def is_land(self):
#     def is_basic_land(self):
#     def is_creature(self):
#     def is_instant(self):
#     def is_sorcery(self):
#     def is_artifact(self):
#     def is_enchantment(self):
#     def is_aura(self):
#     def is_equipment(self):
#     def power(self):
#     def toughness(self):
#     def has_ability(self, ability):
#     def share_color(self, other):
#     def has_color(self, color):
#     def is_color(self, color):
#     def is_monocolored(self):
#     def is_multicolored(self):
#     def is_colorless(self):
#     def has_subtype(self, subtype):
#     def exile(self):
#     def targets(self):
#     def target_legality(self):
#     def has_valid_target(self):
#     def choose_targets(self):
#     def change_zone(self, target_zone, from_top=0, shuffle=True,
#                     status_mod=None, modi_func=None):


from enum import Enum
from MTG import mana
from MTG import play
from MTG import gameobject
    def can_activate(self):
        """ choose targets, pays ability's costs, attempt to activate """
        cost = self.cost
        _card = self.card

        targets_chosen = self.choose_targets()

        return targets_chosen and (lambda self: eval(cost))(_card)


class TriggeredAbility(Ability):
    def __init__(self, card, effect, requirements, target_criterias=None,
                 prompts=None, intervening_if=None):
        super(TriggeredAbility, self).__init__(card, effect, target_criterias, prompts)
        
        self.requirements = requirements
        
        if not intervening_if:
            self.intervening_if = lambda self: True
        else:
            self.intervening_if = intervening_if

        self.trigger_amount = 1
        self.trigger_source = None

    def condition_satisfied(self):
        return self.requirements(self) and self.intervening_if(self)

    def put_on_stack(self):
        if self.choose_targets():

# Path: MTG/mana.py
# class Mana(Enum):
# class ManaPool():
#     WHITE = 0
#     BLUE = 1
#     BLACK = 2
#     RED = 3
#     GREEN = 4
#     COLORLESS = 5
#     GENERIC = 6
# def str_to_mana_dict(manacost):
# def chr_to_mana(c):
#     def __init__(self, controller=None):
#     def add(self, mana, amount=1):
#     def add_str(self, mana_str):
#     def pay(self, manacost):
#     def is_empty(self):
#     def determine_costs(self, manacost):
#     def canPay(self, manacost, convoke=False):
#     def clear(self):
#     def __repr__(self):
# 
# Path: MTG/play.py
# class Play(gameobject.GameObject):
#     def __init__(self, apply_func, apply_condition=lambda: True, 
#                  card=None, source=None, name=None,
#                  targets_chosen=None, target_criterias=None, is_mana_ability=False):
#     def __repr__(self):
#     def can_be_countered(self, source=None):
#     def counter(self, source):
#     def apply(self):
# 
# Path: MTG/gameobject.py
# class Characteristics():
# class GameObject():
#     def __init__(self,
#                  name='',
#                  mana_cost='',
#                  color=[],
#                  types=[],
#                  subtype=[],
#                  supertype=[],
#                  text='',
#                  abilities=[],
#                  power=None,
#                  toughness=None,
#                  loyalty=None):
#     def __repr__(self):
#     def satisfy(self, criteria):
#     def __init__(self, characteristics=None,
#                  controller=None, owner=None, zone=None, 
#                  previousState=None):
#     def __repr__(self):
#     def __str__(self):
#     def __eq__(x, y):
#     def __hash__(self):
#     def owner(self):
#     def game(self):
#     def is_permanent(self):
#     def is_spell(self):
#     def name(self):
#     def raw_manacost(self):
#     def manacost(self):
#     def is_land(self):
#     def is_basic_land(self):
#     def is_creature(self):
#     def is_instant(self):
#     def is_sorcery(self):
#     def is_artifact(self):
#     def is_enchantment(self):
#     def is_aura(self):
#     def is_equipment(self):
#     def power(self):
#     def toughness(self):
#     def has_ability(self, ability):
#     def share_color(self, other):
#     def has_color(self, color):
#     def is_color(self, color):
#     def is_monocolored(self):
#     def is_multicolored(self):
#     def is_colorless(self):
#     def has_subtype(self, subtype):
#     def exile(self):
#     def targets(self):
#     def target_legality(self):
#     def has_valid_target(self):
#     def choose_targets(self):
#     def change_zone(self, target_zone, from_top=0, shuffle=True,
#                     status_mod=None, modi_func=None):


# Path: MTG/abilities.py
from enum import Enum
from MTG import mana
from MTG import play
from MTG import gameobject

    def can_activate(self):
        """ choose targets, pays ability's costs, attempt to activate """
        cost = self.cost
        _card = self.card

        targets_chosen = self.choose_targets()

        return targets_chosen and (lambda self: eval(cost))(_card)


class TriggeredAbility(Ability):
    def __init__(self, card, effect, requirements, target_criterias=None,
                 prompts=None, intervening_if=None):
        super(TriggeredAbility, self).__init__(card, effect, target_criterias, prompts)
        
        self.requirements = requirements
        
        if not intervening_if:
            self.intervening_if = lambda self: True
        else:
            self.intervening_if = intervening_if

        self.trigger_amount = 1
        self.trigger_source = None

    def condition_satisfied(self):
        return self.requirements(self) and self.intervening_if(self)

    def put_on_stack(self):
        if self.choose_targets():

            return play.Play(lambda: self.resolve(),