Esempio n. 1
0
 def update_health_by(self, change_integer):
     if self.has_instance_of_card(WereOnlyMakingItStronger()) and change_integer <= -2:
         WereOnlyMakingItStronger().special_effect(self, None)
     if self.has_instance_of_card(Regeneration()):
         change_integer = Regeneration().special_effect(self, change_integer)
     if self.has_instance_of_card(ArmorPlating()):
         change_integer = ArmorPlating().special_effect(self, change_integer)
     self.current_health += change_integer
     if self.current_health > self.maximum_health:
         self.current_health = self.maximum_health
     if self.current_health <= 0:
         if self.has_instance_of_card(ItHasAChild()):
             ItHasAChild().special_effect(self, None)
         else:
             self.is_alive = False
             self.newly_dead = True
Esempio n. 2
0
def test_it_has_a_child_costs_7_energy():
    assert ItHasAChild().cost == 7
Esempio n. 3
0
def test_it_has_a_child_discards_all_cards_when_health_is_0(player):
    player.current_health = 0
    ItHasAChild().immediate_effect(player, None)
    ItHasAChild().special_effect(player, None)
    assert len(player.cards) == 0
Esempio n. 4
0
def test_it_has_a_child_no_affect_when_health_above_zero(player):
    player.current_health = 2
    ItHasAChild().immediate_effect(player, None)
    ItHasAChild().special_effect(player, None)
    assert len(player.cards) > 0
Esempio n. 5
0
def test_it_has_a_child_moves_outside_tokyo_when_played(player):
    player.move_to_tokyo()
    player.current_health = 0
    ItHasAChild().immediate_effect(player, None)
    ItHasAChild().special_effect(player, None)
    assert player.location == Locations.OUTSIDE
Esempio n. 6
0
def test_it_has_a_child_gains_10_health_when_health_is_0(player):
    player.current_health = 0
    ItHasAChild().immediate_effect(player, None)
    ItHasAChild().special_effect(player, None)
    assert player.current_health == 10
Esempio n. 7
0
def test_it_has_a_child_loses_all_stars_when_health_is_0(player):
    player.victory_points = 5
    ItHasAChild().immediate_effect(player, None)
    player.current_health = 0
    ItHasAChild().special_effect(player, None)
    assert player.victory_points == 0
Esempio n. 8
0
def get_all_cards():
    """
    Serves as the master list of all cards to add to the deck.

    Create lists to reflect package structure and add individual cards to each list.
    If a new list is created extend it onto the full_list_of_cards
    """
    energy_manipulation_cards = [Energize()]

    health_manipulation_cards = [FireBlast(), HighAltitudeBombing()]

    multi_manipulation_cards = [
        GasRefinery(),
        JetFighters(),
        NationalGuard(),
        NuclearPowerPlant(),
        Tanks(),
        VastStorm()
    ]

    victory_point_manipulation_cards = [
        ApartmentBuilding(),
        CommuterTrain(),
        CornerStore(),
        DropFromHighAltitude(),
        EvacuationOrders(),
        Skyscraper()
    ]

    turn_manipulation_cards = [Frenzy()]

    discard_cards = []
    discard_cards.extend(health_manipulation_cards)
    discard_cards.extend(energy_manipulation_cards)
    discard_cards.extend(multi_manipulation_cards)
    discard_cards.extend(victory_point_manipulation_cards)
    discard_cards.extend(turn_manipulation_cards)

    keep_cards = []

    keep_attack_manipulation_cards = [NovaBreath(), SpikedTail()]

    keep_energy_manipulation_cards = [
        EnergyHoarder(),
        FriendOfChildren(),
        SolarPowered(),
        WereOnlyMakingItStronger(),
        AlienMetabolism()
    ]

    keep_health_manipulation_cards = [
        ItHasAChild(),
        EvenBigger(),
        Regeneration(),
        ArmorPlating()
    ]

    keep_victory_point_manipulation_cards = [
        AlphaMonster(),
        CompleteDestruction(),
        DedicatedNewsTeam(),
        Gourmet(),
        Omnivore(),
        EaterOfTheDead()
    ]

    keep_turn_manipulation_cards = [GiantBrain()]

    keep_cards = []
    keep_cards.extend(keep_attack_manipulation_cards)
    keep_cards.extend(keep_energy_manipulation_cards)
    keep_cards.extend(keep_health_manipulation_cards)
    keep_cards.extend(keep_victory_point_manipulation_cards)
    keep_cards.extend(keep_turn_manipulation_cards)

    full_list_of_cards = []
    full_list_of_cards.extend(discard_cards)
    full_list_of_cards.extend(keep_cards)

    return full_list_of_cards