Beispiel #1
0
class WinotaTester:
    def __init__(self):
        self.hand = Hand("decklists/winota.txt")
        self.trials = 0
        self.castWinotaHits = 0
        self.noWinotaTrigger = 0
        self.castWinotaMiss = 0
        self.iterations = 100000
        self.cardsDrawn = 7
        self.AllHits = 0

    def checkWinotaTrigger(self):
        winotaTrigger = []
        for i in range(6):
            winotaTrigger.append(self.hand.deck[self.hand.draw_card()])
        return 'human' in winotaTrigger

    def run(self):
        for i in range(self.iterations):
            if i % 5000 == 0:
                print(str(i) + " of " + str(self.iterations))
            self.trials += 1
            self.hand.new_hand(self.cardsDrawn)
            numLands = self.hand.count_of('land')
            winotaDrawn = self.hand.contains('winota')
            goblinDrawn = self.hand.contains('goblin')
            
            wouldHit = self.checkWinotaTrigger()
            if numLands < 4 or not winotaDrawn or not goblinDrawn:
                self.noWinotaTrigger += 1
            elif wouldHit:
                self.castWinotaHits += 1
            else:
                self.castWinotaMiss += 1
            
            if wouldHit:
                self.AllHits += 1
        self.printResults()
    
    def printResults(self): 
        print("Trials " + str(self.trials))
        misses = self.trials - self.AllHits
        hitRate = self.AllHits / self.trials
        print ("All Hits: " + str(self.AllHits) + " All Miss: " + str(misses) + " All Hit rate: " + str(hitRate))
        realHitRate = self.castWinotaHits / (self.castWinotaHits + self.castWinotaMiss)
        print ("Real Hits: " + str(self.castWinotaHits) + " Real Miss: " + str(self.castWinotaMiss) + " Real Hit rate: " + str(realHitRate))
Beispiel #2
0
totals = np.zeros((starting_size + 1) - mullto)

land_names = [
    "Cavern of Souls", "Sea Gate Wreckage", "Wastes", "Eldrazi Temple",
    "Urza's Mine", "Urza's Power Plant", "Urza's Tower", "Ghost Quarter"
]

for i in range(iterations):
    flag = False
    early_flag = False
    for j in range(0, (starting_size + 1) - mullto):
        hand.new_hand(starting_size - j)

        tron = hand.has_tron()
        lands = hand.count_of(land_names)
        has_TKS = hand.contains("Thought-Knot Seer")
        has_Reshaper = hand.contains("Matter Reshaper")
        has_Chalice = hand.contains("Chalice of the Void")
        temples = hand.count_of("Eldrazi Temple")
        has_Map = float(hand.count_of("Expedition Map") > 0 and lands >= 2)
        has_Stone = hand.contains("Mind Stone")

        t3_TKS = has_TKS * (((has_Map or (temples > 0)) * (lands >= 2)) or
                            (has_Stone * (lands >= 3)))
        # tron, Chalice + lands, t3 TKS, t2 Reshaper, 2 temples and any spell
        results = np.array([
            tron, has_Chalice * (lands >= 2), t3_TKS,
            has_Reshaper * (temples > 0) * (lands >= 2),
            (temples + has_Map * (lands >= 2) >= 2) * (lands < (7 - j))
        ])
        good_counts[starting_size - j - mullto] += (np.sum(results) > 0)
Beispiel #3
0
                                            B, hand_size)
                                        hand_counts[2] += hand.expect(
                                            U, hand_size)
                                        hand_counts[5] += hand.expect(
                                            "Field of Ruin", hand_size)
                                        hand_counts[6] += hand.expect(
                                            tapped, hand_size)
                                    hand_counts = hand_counts / (
                                        starting_size - mullto + 1)

                                    for i in range(iterations_per):
                                        for hand_size in range(
                                                mullto, (starting_size + 1)):
                                            hand.new_hand(hand_size)

                                            has_island = hand.contains(islands)
                                            has_swamp = hand.contains(swamps)
                                            has_mountain = hand.contains(
                                                mountains)
                                            has_summit = hand.contains(
                                                "Dragonskull Summit")
                                            has_combs = hand.contains(
                                                "Drowned Catacomb")

                                            tapped_summit = min(
                                                has_summit,
                                                max(has_mountain, has_swamp))
                                            tapped_combs = min(
                                                has_combs,
                                                max(has_swamp, has_island))
Beispiel #4
0
zero_others = "Welding Jar"
ones = ["Signal Pest", "Vault Skirge"]
twos = ["Arcbound Ravager", "Cranial Plating", "Steel Overseer"]
threes = ["Etched Champion", "Master of Etherium"]
lands = [
    "Darksteel Citadel", "Spire of Industry", "Glimmervoid", "Inkmoth Nexus",
    "Blinkmoth Nexus", "Island"
]

for i in range(iterations):
    for j in range(0, (starting_size + 1) - mullto):
        hand.new_hand(starting_size - j)

        count_opal = hand.count_of("Mox Opal")
        count_lands = hand.count_of(lands)
        has_drum = hand.contains("Springleaf Drum")
        count_zero_creatures = hand.count_of(zero_creatures)
        count_zeros = count_zero_creatures + hand.count_of(
            zero_others) + hand.contains("Darksteel Citadel")
        count_ones = hand.count_of(ones) + has_drum * 1
        has_two = hand.contains(twos)
        has_three = hand.contains(threes)

        t1_opal = (count_zeros >= 2) or (has_drum and
                                         (count_zero_creatures > 0) and
                                         (count_lands > 0))
        t1_pay_opal = (count_ones > 0) and (count_zeros > 0) and (count_lands >
                                                                  0)
        t1_mana = count_opal * t1_opal + (count_lands > 0) + (
            (not t1_opal) * t1_pay_opal * max((count_opal - 1), 0))
        # t2_accel = t1_accel or (has_drum and (count_zero_creatures > 0)) or ((count_ones > 0) and (count_zeros > 0) and (count_opal > 0)) \
Beispiel #5
0
                            "Drowned Catacomb": combs_ct,
                            "Field of Ruin": field_ct,
                            "Fetid Pools": pool_ct
                        }
                        new_decklist = hand.get_decklist()
                        new_decklist.update(config)
                        hand.set_deck(new_decklist)

                        hand_counts = np.zeros(len(hand_types))
                        totals = np.zeros(len(hand_types))

                        for i in range(iterations_per):
                            for j in range(0, (starting_size + 1) - mullto):
                                hand.new_hand(starting_size - j)

                                has_island = hand.contains(islands)
                                has_swamp = hand.contains(swamps)
                                has_mountain = hand.contains(mountains)
                                tapped_summit = hand.contains(
                                    "Dragonskull Summit") and not (
                                        has_mountain or has_swamp)
                                tapped_combs = hand.contains(
                                    "Drowned Catacomb") and not (has_swamp
                                                                 or has_island)

                                bools = [
                                    hand.contains(R),
                                    hand.contains(B),
                                    hand.contains(U), tapped_summit,
                                    tapped_combs,
                                    hand.contains("Field of Ruin"),