Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def mainmethod(deckname, default_hand_size, michions_in_deck, sandaions_in_deck, maids_in_deck, other_timelords_in_deck, cts_in_deck,
- switchyards_in_deck, pegasii_in_deck, bullets_in_deck, cranes_in_deck, railcars_in_deck, boosters_in_deck, other_earth_machines_in_deck, knights_in_deck, schedules_in_deck,
- jizukiru_in_deck, burial_in_deck, reborn_in_deck, pots_desires_in_deck, goblin_in_deck, pinpoints_in_deck,
- added_card=None, removed_card=None, extra_cards_in_deck=0):
- trains_in_deck = bullets_in_deck + cranes_in_deck
- pots_indulgences_in_deck = 0
- print("-----Deck: " + deckname)
- if added_card:
- print("-----Added Card: %s" % added_card)
- if removed_card:
- print("-----Removed Card: %s" % removed_card)
- deck = []
- if extra_cards_in_deck:
- for i in range(0, extra_cards_in_deck):
- deck.append('ExtraCard')
- for i in range(0, michions_in_deck):
- deck.append('TimelordMich')
- for i in range(0, maids_in_deck):
- deck.append('TimelordMaid')
- for i in range(0, sandaions_in_deck):
- deck.append('TimelordSand')
- for i in range(0, other_timelords_in_deck):
- deck.append('TimelordGeneric')
- for i in range(0, cts_in_deck):
- deck.append('CT')
- for i in range(0, schedules_in_deck):
- deck.append('Schedule')
- for i in range(0, pegasii_in_deck):
- deck.append('Pegasus')
- for i in range(0, railcars_in_deck):
- deck.append('Railcar')
- for i in range(0, boosters_in_deck):
- deck.append('Booster')
- for i in range(0, other_earth_machines_in_deck):
- deck.append('OtherEarthMachine')
- if bullets_in_deck:
- for i in range(0, cranes_in_deck):
- deck.append('Lv10Crane')
- for i in range(0, bullets_in_deck):
- deck.append('Lv10Train')
- for i in range(0, knights_in_deck):
- deck.append('KnightTrain')
- for i in range(0, switchyards_in_deck):
- deck.append('Switchyard')
- for i in range(0, pinpoints_in_deck):
- deck.append('Pinpoint')
- if jizukiru_in_deck:
- deck.append('Slumber')
- deck.append('Kaiju1')
- deck.append('Kaiju2')
- for i in range(jizukiru_in_deck):
- deck.append('KaijuJizukiru')
- for i in range(0, pots_indulgences_in_deck):
- deck.append('PotOfIndulgence')
- for i in range(0, pots_desires_in_deck):
- deck.append('PotOfDesires')
- if burial_in_deck:
- deck.append('FoolishBurial')
- if reborn_in_deck:
- deck.append('MonsterReborn')
- if added_card:
- deck.append(added_card)
- if removed_card:
- deck.remove(removed_card)
- print("Misc cards in deck: %s" % (40 - len(deck) - goblin_in_deck))
- if len(deck) < 40:
- for i in range(0, 40 - len(deck)):
- deck.append('MiscCard')
- for i in range(goblin_in_deck):
- deck.remove('MiscCard')
- wincount = 0
- bls_win_count = 0
- totalcount = 1000000
- timelord_otk_count = 0
- bonus_cards_count = 0
- for iteration in range(0, totalcount):
- if default_hand_size:
- hand_size = default_hand_size
- else:
- hand_size = 5 + iteration % 2
- turn_one = hand_size == 5
- extra_deck_broke = False
- hand = random.sample(deck, hand_size)
- if "Pinpoint" in hand or "PotOfDesires" in hand:
- special_deck = deck.copy()
- goblin_drawn = False
- if "Pinpoint" in hand:
- special_deck.remove("Pinpoint")
- hand = random.sample(special_deck, hand_size)
- goblin_drawn = True
- if "PotOfDesires" in hand:
- special_deck.remove("PotOfDesires")
- removed_cards = random.sample(special_deck, hand_size + 11)
- hand = removed_cards[10:]
- if "Schedule" in hand[-2:]:
- if removed_cards.count("Pegasus") == pegasii_in_deck or\
- removed_cards.count("Lv10Train") + removed_cards.count("Lv10Crane") == bullets_in_deck + cranes_in_deck:
- hand.remove("Schedule")
- if "Switchyard" in hand[-2:]:
- if removed_cards.count("Lv10Train") + removed_cards.count("Lv10Crane") == bullets_in_deck + cranes_in_deck:
- hand.remove("Switchyard") # Not fully accurate, missing knight trains
- if "Pinpoint" in hand[-2:] and not goblin_drawn:
- special_deck.remove("Pinpoint")
- hand = random.sample(removed_cards, hand_size + 1)
- elif "PotOfIndulgence" in hand: # simulate using a pot
- special_deck = deck.copy()
- special_deck.remove("PotOfIndulgence")
- hand = random.sample(special_deck, hand_size + 1)
- if random.random() < 0.0442:
- # extra deck broke
- extra_deck_broke = True
- timelords = 0
- cts = 0
- schedules = 0
- pegasii = 0
- lv10_trains = 0
- bullets = 0
- cranes = 0
- railcars = 0
- boosters = 0
- lv4s = 0
- knight_trains = 0
- winner = False
- bls_winner = False
- jizukirus = 0
- kaijus = 0
- kaiju1 = False
- kaiju2 = False
- slumber = False
- misc_cards = 0
- pot_indulgences = 0
- pot_desires = 0
- switchyards = 0
- burials = 0
- reborns = 0
- extra_cards = 0
- timelord_sand_count = 0
- timelord_mich_maid_count = 0
- timelord_maid_count = 0
- timelord_winner = False
- for h in hand:
- if h.startswith("Time"):
- timelords += 1
- if h == "TimelordMich":
- timelord_mich_maid_count += 1
- if h == "TimelordMaid":
- timelord_mich_maid_count += 1
- timelord_maid_count += 1
- elif h == "TimelordSand":
- timelord_sand_count += 1
- elif h == "CT":
- cts += 1
- elif h == "Schedule":
- schedules += 1
- elif h == "Pegasus":
- pegasii += 1
- elif h == "Lv10Train":
- lv10_trains += 1
- bullets += 1
- elif h == "Lv10Crane":
- lv10_trains += 1
- cranes += 1
- elif h == "Railcar":
- railcars += 1
- lv4s += 1
- elif h == "Booster":
- boosters += 1
- lv4s += 1
- elif h == "OtherEarthMachine":
- railcars += 1
- lv4s += 1
- elif h == "KnightTrain":
- knight_trains += 1
- elif h.startswith("Slumber"):
- slumber = True
- elif h.startswith("Kaiju"):
- kaijus += 1
- if h == "KaijuJizukiru":
- jizukirus += 1
- elif h == "Kaiju1":
- kaiju1 = True
- elif h == "Kaiju2":
- kaiju2 = True
- elif h == "MiscCard":
- misc_cards += 1
- elif h == "PotOfIndulgence":
- pot_indulgences += 1
- elif h == "PotOfDesires":
- pot_desires += 1
- elif h == "Switchyard":
- switchyards += 1
- elif h == 'FoolishBurial':
- burials += 1
- elif h == 'MonsterReborn':
- reborns += 1
- elif h == "ExtraCard":
- extra_cards += 1
- if extra_cards_in_deck and extra_cards == 0:
- totalcount -= 1
- continue
- # Common combos
- burial_reborn_combo = burials and reborns
- switchyard_reborn_combo = switchyards and reborns
- jizukiru_summoned = False
- slumber_played = False
- schedule_played = False
- # Remove T1 options
- if turn_one:
- jizukirus = 0
- kaijus = 0
- slumber = 0
- schedules = 0
- if jizukirus >= 1 and kaijus >= 2:
- jizukiru_summoned = True
- elif slumber and not (kaiju1 and kaiju2):
- jizukiru_summoned = True
- slumber_played = True
- if schedules and (lv10_trains < trains_in_deck):
- schedule_played = True
- # Normal Summon Timelord
- if timelords:
- if timelord_mich_maid_count >= 2 or (timelord_mich_maid_count and timelord_sand_count):
- if cts or switchyard_reborn_combo:
- timelord_winner = True
- if (timelord_mich_maid_count or timelord_sand_count) and burial_reborn_combo:
- timelord_winner = True
- # if timelords >= 1:
- if burial_reborn_combo:
- winner = True
- if lv10_trains:
- bls_winner = True
- if jizukiru_summoned:
- winner = True
- if jizukiru_summoned and burial_reborn_combo:
- bls_winner = True
- if schedule_played:
- bls_winner = True
- # ignoring jizukiru_and_schedule_played
- if timelords >= 2:
- if cts:
- winner = True
- if switchyard_reborn_combo:
- winner = True
- # Normal Summon Knight/Pegasus
- if knight_trains or pegasii or lv4s or switchyards or burial_reborn_combo:
- if bullets and cranes:
- bls_winner = True
- if schedule_played:
- bls_winner = True
- if switchyard_reborn_combo and knight_trains >= 2: # Remember, Switchyard gets a card
- bls_winner = True
- if switchyards and (pegasii or burial_reborn_combo) and (knight_trains or lv10_trains):
- bls_winner = True
- if burial_reborn_combo and pegasii:
- bls_winner = True
- extra_summons = 0
- if pegasii and burials and not burial_reborn_combo:
- extra_summons += 1
- if bullets and not slumber_played:
- extra_summons += 1
- if cranes:
- extra_summons += 1
- if switchyards and (knight_trains or pegasii or lv4s or burial_reborn_combo):
- # Make sure the switchyard wasn't used getting us here
- extra_summons += 1
- if timelord_maid_count and not slumber_played and not (timelords == 1 and cts):
- if not lv10_trains:
- extra_summons += 1
- if timelords and cts:
- extra_summons += 1
- if timelords >= 2 and cts >= 2:
- bls_winner = True
- if jizukiru_summoned:
- extra_summons += 1
- if burial_reborn_combo and (switchyards or knight_trains):
- extra_summons += 1
- if switchyards and burial_reborn_combo and not (knight_trains or pegasii or lv4s):
- extra_summons -= 1 # Switchyard and burial_reborn don't make a BLS
- if extra_summons:
- if knight_trains or pegasii or switchyards or burial_reborn_combo:
- # Railcars alone can't win
- winner = True
- if boosters:
- bls_winner = True
- if extra_summons >= 2:
- bls_winner = True
- # No Normal Summon
- if schedule_played:
- if jizukiru_summoned and not slumber_played:
- bls_winner = True
- if lv10_trains:
- bls_winner = True
- # Last chance Kaiju summoning
- if winner and not jizukiru_summoned and kaijus >= 2:
- bls_win_count += 1
- #######
- # Set winner tags/count
- if not extra_deck_broke:
- if timelord_winner:
- timelord_otk_count += 1
- winner = True
- if bls_winner:
- bls_win_count += 1
- winner = True
- if winner:
- wincount += 1
- if winner and lv10_trains:
- bonus_cards_count += 1
- if bls_winner and railcars:
- bonus_cards_count += 1
- print("XYZ Summon Chance: %s%%" % (wincount * 100 / totalcount))
- print("Knuckle+XYZ Summon Chance: %s%%" % (bls_win_count * 100 / totalcount))
- if timelord_otk_count:
- print("Timelords OTK Chance: %s%%" % (timelord_otk_count * 100 / totalcount))
- print("Bonus cards: %s%%" % (bonus_cards_count / totalcount))
- #for card in [None, 'TimelordGeneric', 'TimelordSand', 'Schedule', 'Switchyard', 'PotOfDesires', 'Pegasus', 'Lv10Train', 'KnightTrain', 'KaijuJizukiru', 'Reborn', 'CTS']:
- default_hand_size = 0
- mainmethod("Pure Trains", default_hand_size=default_hand_size, michions_in_deck=0, sandaions_in_deck=0, maids_in_deck=0, other_timelords_in_deck=0, cts_in_deck=0,
- switchyards_in_deck=5, pegasii_in_deck=3, bullets_in_deck=3, cranes_in_deck=3, railcars_in_deck=3, boosters_in_deck=3, other_earth_machines_in_deck=3, knights_in_deck=3, schedules_in_deck=3,
- jizukiru_in_deck=0, burial_in_deck=1, reborn_in_deck=1, pots_desires_in_deck=3, goblin_in_deck=1, pinpoints_in_deck=2,
- added_card=None, removed_card=None)
- mainmethod("Trainlords", default_hand_size=default_hand_size, michions_in_deck=3, sandaions_in_deck=4, maids_in_deck=3, other_timelords_in_deck=1, cts_in_deck=3,
- switchyards_in_deck=5, pegasii_in_deck=3, bullets_in_deck=3, cranes_in_deck=3, railcars_in_deck=0, boosters_in_deck=0, other_earth_machines_in_deck=0, knights_in_deck=3, schedules_in_deck=3,
- jizukiru_in_deck=0, burial_in_deck=0, reborn_in_deck=1, pots_desires_in_deck=3, goblin_in_deck=0, pinpoints_in_deck=0,
- added_card=None, removed_card=None)
- mainmethod("Full Timelords", default_hand_size=default_hand_size, michions_in_deck=3, sandaions_in_deck=4, maids_in_deck=3, other_timelords_in_deck=2, cts_in_deck=3,
- switchyards_in_deck=5, pegasii_in_deck=3, bullets_in_deck=1, cranes_in_deck=1, railcars_in_deck=0, boosters_in_deck=0, other_earth_machines_in_deck=0, knights_in_deck=1, schedules_in_deck=3,
- jizukiru_in_deck=3, burial_in_deck=1, reborn_in_deck=1, pots_desires_in_deck=3, goblin_in_deck=0, pinpoints_in_deck=0,
- added_card=None, removed_card=None)
- mainmethod("Kaiju Trains", default_hand_size=default_hand_size, michions_in_deck=0, sandaions_in_deck=0, maids_in_deck=0, other_timelords_in_deck=0, cts_in_deck=0,
- switchyards_in_deck=5, pegasii_in_deck=3, bullets_in_deck=3, cranes_in_deck=3, railcars_in_deck=3, boosters_in_deck=0, other_earth_machines_in_deck=0, knights_in_deck=3, schedules_in_deck=3,
- jizukiru_in_deck=3, burial_in_deck=1, reborn_in_deck=1, pots_desires_in_deck=3, goblin_in_deck=1, pinpoints_in_deck=0,
- added_card=None, removed_card=None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement