Started logic for adding creatures, ramp, board wipes, interaction, and other cards based on the chosen themes

Fixed logical error in tagger causing it to look for 'Artifact' in a lowercase 'type' column

Need to refine logic for adding by tags and weighted theme values.
This commit is contained in:
mwisnowski 2024-12-25 19:56:35 -08:00
parent 279d81ed3c
commit c81a5fb64e
3 changed files with 544 additions and 263 deletions

File diff suppressed because it is too large Load diff

View file

@ -23,10 +23,15 @@ banned_cards = [# in commander
'Jihad', 'Imprison', 'Crusade' 'Jihad', 'Imprison', 'Crusade'
] ]
basic_lands = ['Plains', 'Island', 'Swamp', 'Mountain', 'Forest']
board_wipe_tags = ['destroy all', 'destroy each', 'return all', 'return each', 'deals damage to each', board_wipe_tags = ['destroy all', 'destroy each', 'return all', 'return each', 'deals damage to each',
'exile all', 'exile each', 'creatures get -X/-X', 'sacrifices all', 'sacrifices each', 'exile all', 'exile each', 'creatures get -X/-X', 'sacrifices all', 'sacrifices each',
'sacrifices the rest'] 'sacrifices the rest']
card_types = ['Artifact','Creature', 'Enchantment', 'Instant', 'Land', 'Planeswalker', 'Sorcery',
'Kindred', 'Dungeon', 'Battle']
csv_directory = 'csv_files' csv_directory = 'csv_files'
colors = ['colorless', 'white', 'blue', 'black', 'red', 'green', colors = ['colorless', 'white', 'blue', 'black', 'red', 'green',
@ -108,6 +113,10 @@ creature_types = ['Advisor', 'Aetherborn', 'Alien', 'Ally', 'Angel', 'Antelope',
enchantment_tokens = ['Cursed Role', 'Monster Role', 'Royal Role', 'Sorcerer Role', enchantment_tokens = ['Cursed Role', 'Monster Role', 'Royal Role', 'Sorcerer Role',
'Virtuous Role', 'Wicked Role', 'Young Hero Role', 'Shard'] 'Virtuous Role', 'Wicked Role', 'Young Hero Role', 'Shard']
multiple_copy_cards = ['Dragon\'s Approach', 'Hare Apparent', 'Nazgûl', 'Persistent Petitioners',
'Rat Colony','Relentless Rars', 'Seven Dwarves', 'Shadowborn Apostle',
'Slime Against Humanity', 'Templar Knights']
non_creature_types = ['Legendary', 'Creature', 'Enchantment', 'Artifact', non_creature_types = ['Legendary', 'Creature', 'Enchantment', 'Artifact',
'Battle', 'Sorcery', 'Instant', 'Land', '-', '', 'Battle', 'Sorcery', 'Instant', 'Land', '-', '',
'Blood', 'Clue', 'Food', 'Gold', 'Incubator', 'Blood', 'Clue', 'Food', 'Gold', 'Incubator',

View file

@ -2941,7 +2941,7 @@ def mana_dorks(df, color):
for index, row in df.iterrows(): for index, row in df.iterrows():
theme_tags = row['themeTags'] theme_tags = row['themeTags']
if pd.notna(row['text']): if pd.notna(row['text']):
if ('Creature' in row['type'].lower() if ('Creature' in row['type']
): ):
# Tap itself for mana # Tap itself for mana
if ('{T}: Add' in row['text']): if ('{T}: Add' in row['text']):
@ -3003,7 +3003,7 @@ def mana_rocks(df, color):
for index, row in df.iterrows(): for index, row in df.iterrows():
theme_tags = row['themeTags'] theme_tags = row['themeTags']
if pd.notna(row['text']): if pd.notna(row['text']):
if ('Artifact' in row['type'].lower() if ('Artifact' in row['type']
): ):
# Tap itself for mana # Tap itself for mana
if ('{T}: Add' in row['text']): if ('{T}: Add' in row['text']):